Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Feb 2023 21:21:08 GMT
From:      Doug Ambrisko <ambrisko@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: bbd354cb2382 - main - enic: convert to IfAPI
Message-ID:  <202302062121.316LL8vS074334@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by ambrisko:

URL: https://cgit.FreeBSD.org/src/commit/?id=bbd354cb2382917a2cfbbc3e918ccfe342b645b4

commit bbd354cb2382917a2cfbbc3e918ccfe342b645b4
Author:     Doug Ambrisko <ambrisko@FreeBSD.org>
AuthorDate: 2023-02-06 21:17:15 +0000
Commit:     Doug Ambrisko <ambrisko@FreeBSD.org>
CommitDate: 2023-02-06 21:19:48 +0000

    enic: convert to IfAPI
    
    Prompted by:    jhibbits
---
 sys/dev/enic/enic.h    |  2 +-
 sys/dev/enic/if_enic.c | 20 ++++++++++----------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/sys/dev/enic/enic.h b/sys/dev/enic/enic.h
index 9d84ca6ecaf6..a2a40334986f 100644
--- a/sys/dev/enic/enic.h
+++ b/sys/dev/enic/enic.h
@@ -278,7 +278,7 @@ struct enic_softc {
 	if_softc_ctx_t		scctx;
 	if_shared_ctx_t		sctx;
 	struct ifmedia		*media;
-	struct ifnet		*ifp;
+	if_t			ifp;
 
 	struct mtx		enic_lock;
 
diff --git a/sys/dev/enic/if_enic.c b/sys/dev/enic/if_enic.c
index d3ac5bb902c6..537e613efa2d 100644
--- a/sys/dev/enic/if_enic.c
+++ b/sys/dev/enic/if_enic.c
@@ -754,12 +754,12 @@ static int
 enic_rxq_intr(void *rxq)
 {
 	struct vnic_rq *rq;
-	struct ifnet *ifp;
+	if_t ifp;
 
 	rq = (struct vnic_rq *)rxq;
 	ifp = iflib_get_ifp(rq->vdev->softc->ctx);
-	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
-                return (FILTER_HANDLED);
+	if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)
+		return (FILTER_HANDLED);
 
 	return (FILTER_SCHEDULE_THREAD);
 }
@@ -852,7 +852,7 @@ enic_init(if_ctx_t ctx)
 		enic_start_rq(enic, index);
 
 	/* Use the current MAC address. */
-	bcopy(IF_LLADDR(softc->ifp), softc->lladdr, ETHER_ADDR_LEN);
+	bcopy(if_getlladdr(softc->ifp), softc->lladdr, ETHER_ADDR_LEN);
 	enic_set_lladdr(softc);
 
 	ENIC_LOCK(softc);
@@ -902,7 +902,7 @@ enic_copy_maddr(void *arg, struct sockaddr_dl *sdl, u_int idx)
 static void
 enic_multi_set(if_ctx_t ctx)
 {
-	struct ifnet *ifp;
+	if_t ifp;
 	struct enic_softc *softc;
 	u_int count;
 
@@ -916,12 +916,12 @@ enic_multi_set(if_ctx_t ctx)
 	enic_add_mcast(softc);
 	ENIC_UNLOCK(softc);
 
-	if (ifp->if_flags & IFF_PROMISC) {
+	if (if_getflags(ifp) & IFF_PROMISC) {
 		softc->promisc = 1;
 	} else {
 		softc->promisc = 0;
 	}
-	if (ifp->if_flags & IFF_ALLMULTI) {
+	if (if_getflags(ifp) & IFF_ALLMULTI) {
 		softc->allmulti = 1;
 	} else {
 		softc->allmulti = 0;
@@ -988,18 +988,18 @@ enic_media_change(if_ctx_t ctx)
 static int
 enic_promisc_set(if_ctx_t ctx, int flags)
 {
-	struct ifnet *ifp;
+	if_t ifp;
 	struct enic_softc *softc;
 
 	softc = iflib_get_softc(ctx);
 	ifp = iflib_get_ifp(ctx);
 
-	if (ifp->if_flags & IFF_PROMISC) {
+	if (if_getflags(ifp) & IFF_PROMISC) {
 		softc->promisc = 1;
 	} else {
 		softc->promisc = 0;
 	}
-	if (ifp->if_flags & IFF_ALLMULTI) {
+	if (if_getflags(ifp) & IFF_ALLMULTI) {
 		softc->allmulti = 1;
 	} else {
 		softc->allmulti = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202302062121.316LL8vS074334>