git: 068f2c0e10d5 - main - Mechanically convert dwc(4) to IfAPI

From: Justin Hibbits <jhibbits_at_FreeBSD.org>
Date: Tue, 07 Mar 2023 14:46:58 UTC
The branch main has been updated by jhibbits:

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

commit 068f2c0e10d59919b6a5fb0703742a6560289b30
Author:     Justin Hibbits <jhibbits@FreeBSD.org>
AuthorDate: 2022-08-20 02:04:32 +0000
Commit:     Justin Hibbits <jhibbits@FreeBSD.org>
CommitDate: 2023-03-07 14:49:11 +0000

    Mechanically convert dwc(4) to IfAPI
    
    Reviewed by:    manu (older)
    Sponsored by:   Juniper Networks, Inc.
    Differential Revision: https://reviews.freebsd.org/D37846
---
 sys/arm/allwinner/aw_if_dwc.c | 3 +++
 sys/dev/dwc/if_dwc.c          | 2 +-
 sys/dev/dwc/if_dwcvar.h       | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/sys/arm/allwinner/aw_if_dwc.c b/sys/arm/allwinner/aw_if_dwc.c
index 067afbdbd9c4..c448e9ecf51d 100644
--- a/sys/arm/allwinner/aw_if_dwc.c
+++ b/sys/arm/allwinner/aw_if_dwc.c
@@ -31,8 +31,11 @@ __FBSDID("$FreeBSD$");
 #include <sys/systm.h>
 #include <sys/bus.h>
 #include <sys/kernel.h>
+#include <sys/socket.h>
 #include <sys/module.h>
 
+#include <net/if.h>
+
 #include <machine/bus.h>
 
 #include <dev/dwc/if_dwc.h>
diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c
index 5fc735fdd5f1..9165a860bf78 100644
--- a/sys/dev/dwc/if_dwc.c
+++ b/sys/dev/dwc/if_dwc.c
@@ -475,7 +475,7 @@ dwc_setup_rxfilter(struct dwc_softc *sc)
 	/*
 	 * Set the primary address.
 	 */
-	eaddr = IF_LLADDR(ifp);
+	eaddr = if_getlladdr(ifp);
 	lo = eaddr[0] | (eaddr[1] << 8) | (eaddr[2] << 16) |
 	    (eaddr[3] << 24);
 	hi = eaddr[4] | (eaddr[5] << 8);
diff --git a/sys/dev/dwc/if_dwcvar.h b/sys/dev/dwc/if_dwcvar.h
index 97ae0ea681c8..f4193b8222c9 100644
--- a/sys/dev/dwc/if_dwcvar.h
+++ b/sys/dev/dwc/if_dwcvar.h
@@ -65,7 +65,7 @@ struct dwc_softc {
 	int			mii_clk;
 	device_t		miibus;
 	struct mii_data *	mii_softc;
-	struct ifnet		*ifp;
+	if_t			ifp;
 	int			if_flags;
 	struct mtx		mtx;
 	void *			intr_cookie;