git: 0f10a33fc1b3 - main - ar40xx: fix to compile/run under the new ifnet rules
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 15 Feb 2025 20:44:06 UTC
The branch main has been updated by adrian:
URL: https://cgit.FreeBSD.org/src/commit/?id=0f10a33fc1b30b2eefd7f0278380875b2982e9a9
commit 0f10a33fc1b30b2eefd7f0278380875b2982e9a9
Author: Adrian Chadd <adrian@FreeBSD.org>
AuthorDate: 2025-02-02 22:17:03 +0000
Commit: Adrian Chadd <adrian@FreeBSD.org>
CommitDate: 2025-02-15 20:43:42 +0000
ar40xx: fix to compile/run under the new ifnet rules
Locally tested:
* IPQ4018, Asus router, w/ ethernet driver
Differential Revision: https://reviews.freebsd.org/D49025
Reviewed by: imp, zlei
---
sys/dev/etherswitch/ar40xx/ar40xx_phy.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sys/dev/etherswitch/ar40xx/ar40xx_phy.c b/sys/dev/etherswitch/ar40xx/ar40xx_phy.c
index f27e7503eb28..aa02ef25ac7b 100644
--- a/sys/dev/etherswitch/ar40xx/ar40xx_phy.c
+++ b/sys/dev/etherswitch/ar40xx/ar40xx_phy.c
@@ -200,9 +200,9 @@ ar40xx_attach_phys(struct ar40xx_softc *sc)
snprintf(name, IFNAMSIZ, "%sport", device_get_nameunit(sc->sc_dev));
for (phy = 0; phy < AR40XX_NUM_PHYS; phy++) {
sc->sc_phys.ifp[phy] = if_alloc(IFT_ETHER);
- sc->sc_phys.ifp[phy]->if_softc = sc;
- sc->sc_phys.ifp[phy]->if_flags |= IFF_UP | IFF_BROADCAST |
- IFF_DRV_RUNNING | IFF_SIMPLEX;
+ if_setsoftc(sc->sc_phys.ifp[phy], sc);
+ if_setflagbits(sc->sc_phys.ifp[phy], IFF_UP | IFF_BROADCAST |
+ IFF_DRV_RUNNING | IFF_SIMPLEX, 0);
sc->sc_phys.ifname[phy] = malloc(strlen(name)+1, M_DEVBUF,
M_WAITOK);
bcopy(name, sc->sc_phys.ifname[phy], strlen(name)+1);
@@ -215,7 +215,7 @@ ar40xx_attach_phys(struct ar40xx_softc *sc)
device_printf(sc->sc_dev,
"%s attached to pseudo interface %s\n",
device_get_nameunit(sc->sc_phys.miibus[phy]),
- sc->sc_phys.ifp[phy]->if_xname);
+ if_name(sc->sc_phys.ifp[phy]));
if (err != 0) {
device_printf(sc->sc_dev,
"attaching PHY %d failed\n",