diff --git a/sys/arch/arm/at91/at91emac.c b/sys/arch/arm/at91/at91emac.c index 1852c922856b..43e06d469373 100644 --- a/sys/arch/arm/at91/at91emac.c +++ b/sys/arch/arm/at91/at91emac.c @@ -1,5 +1,5 @@ -/* $Id: at91emac.c,v 1.10 2011/07/01 19:31:17 dyoung Exp $ */ -/* $NetBSD: at91emac.c,v 1.10 2011/07/01 19:31:17 dyoung Exp $ */ +/* $Id: at91emac.c,v 1.11 2012/07/22 14:32:49 matt Exp $ */ +/* $NetBSD: at91emac.c,v 1.11 2012/07/22 14:32:49 matt Exp $ */ /* * Copyright (c) 2007 Embedtronics Oy @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.10 2011/07/01 19:31:17 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.11 2012/07/22 14:32:49 matt Exp $"); #include #include @@ -109,7 +109,7 @@ static int emac_mediachange(struct ifnet *); static void emac_mediastatus(struct ifnet *, struct ifmediareq *); int emac_mii_readreg (device_t, int, int); void emac_mii_writereg (device_t, int, int, int); -void emac_statchg (device_t ); +void emac_statchg (struct ifnet *); void emac_tick (void *); static int emac_ifioctl (struct ifnet *, u_long, void *); static void emac_ifstart (struct ifnet *); @@ -118,7 +118,7 @@ static int emac_ifinit (struct ifnet *); static void emac_ifstop (struct ifnet *, int); static void emac_setaddr (struct ifnet *); -CFATTACH_DECL(at91emac, sizeof(struct emac_softc), +CFATTACH_DECL_NEW(at91emac, sizeof(struct emac_softc), emac_match, emac_attach, NULL, NULL); #ifdef EMAC_DEBUG @@ -526,7 +526,8 @@ emac_mii_readreg(device_t self, int phy, int reg) { struct emac_softc *sc; - sc = (struct emac_softc *)self; + sc = device_private(self); + EMAC_WRITE(ETH_MAN, (ETH_MAN_HIGH | ETH_MAN_RW_RD | ((phy << ETH_MAN_PHYA_SHIFT) & ETH_MAN_PHYA) | ((reg << ETH_MAN_REGA_SHIFT) & ETH_MAN_REGA) @@ -539,7 +540,9 @@ void emac_mii_writereg(device_t self, int phy, int reg, int val) { struct emac_softc *sc; - sc = (struct emac_softc *)self; + + sc = device_private(self); + EMAC_WRITE(ETH_MAN, (ETH_MAN_HIGH | ETH_MAN_RW_WR | ((phy << ETH_MAN_PHYA_SHIFT) & ETH_MAN_PHYA) | ((reg << ETH_MAN_REGA_SHIFT) & ETH_MAN_REGA) @@ -550,9 +553,9 @@ emac_mii_writereg(device_t self, int phy, int reg, int val) void -emac_statchg(device_t self) +emac_statchg(struct ifnet *ifp) { - struct emac_softc *sc = (struct emac_softc *)self; + struct emac_softc *sc = ifp->if_softc; u_int32_t reg; /* diff --git a/sys/arch/arm/ep93xx/epe.c b/sys/arch/arm/ep93xx/epe.c index 8866c5125e10..7911fc31e469 100644 --- a/sys/arch/arm/ep93xx/epe.c +++ b/sys/arch/arm/ep93xx/epe.c @@ -1,4 +1,4 @@ -/* $NetBSD: epe.c,v 1.26 2011/07/01 19:31:17 dyoung Exp $ */ +/* $NetBSD: epe.c,v 1.27 2012/07/22 14:32:50 matt Exp $ */ /* * Copyright (c) 2004 Jesse Off @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.26 2011/07/01 19:31:17 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.27 2012/07/22 14:32:50 matt Exp $"); #include #include @@ -98,15 +98,15 @@ __KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.26 2011/07/01 19:31:17 dyoung Exp $"); #define CTRLPAGE_DMASYNC(x, y, z) #endif /* ! EPE_FAST */ -static int epe_match(struct device *, struct cfdata *, void *); -static void epe_attach(struct device *, struct device *, void *); +static int epe_match(device_t , cfdata_t, void *); +static void epe_attach(device_t, device_t, void *); static void epe_init(struct epe_softc *); static int epe_intr(void* arg); static int epe_gctx(struct epe_softc *); static int epe_mediachange(struct ifnet *); -int epe_mii_readreg (struct device *, int, int); -void epe_mii_writereg (struct device *, int, int, int); -void epe_statchg (struct device *); +int epe_mii_readreg (device_t, int, int); +void epe_mii_writereg (device_t, int, int, int); +void epe_statchg (struct ifnet *); void epe_tick (void *); static int epe_ifioctl (struct ifnet *, u_long, void *); static void epe_ifstart (struct ifnet *); @@ -119,21 +119,21 @@ CFATTACH_DECL(epe, sizeof(struct epe_softc), epe_match, epe_attach, NULL, NULL); static int -epe_match(struct device *parent, struct cfdata *match, void *aux) +epe_match(device_t parent, cfdata_t match, void *aux) { return 2; } static void -epe_attach(struct device *parent, struct device *self, void *aux) +epe_attach(device_t parent, device_t self, void *aux) { - struct epe_softc *sc; + struct epe_softc *sc = device_private(self); struct epsoc_attach_args *sa; prop_data_t enaddr; - printf("\n"); - sc = (struct epe_softc*) self; + aprint_normal("\n"); sa = aux; + sc->sc_dev = self; sc->sc_iot = sa->sa_iot; sc->sc_intr = sa->sa_intr; sc->sc_dmat = sa->sa_dmat; @@ -303,7 +303,7 @@ epe_init(struct epe_softc *sc) /* Read ethernet MAC, should already be set by bootrom */ bus_space_read_region_1(sc->sc_iot, sc->sc_ioh, EPE_IndAd, sc->sc_enaddr, ETHER_ADDR_LEN); - printf("%s: MAC address %s\n", sc->sc_dev.dv_xname, + aprint_normal_dev(sc->sc_dev, "MAC address %s\n", ether_sprintf(sc->sc_enaddr)); /* Soft Reset the MAC */ @@ -334,7 +334,7 @@ epe_init(struct epe_softc *sc) sc->ctrlpage, PAGE_SIZE, NULL, BUS_DMA_WAITOK); } if (err != 0) { - panic("%s: Cannot get DMA memory", sc->sc_dev.dv_xname); + panic("%s: Cannot get DMA memory", device_xname(sc->sc_dev)); } sc->ctrlpage_dsaddr = sc->ctrlpage_dmamap->dm_segs[0].ds_addr; memset(sc->ctrlpage, 0, PAGE_SIZE); @@ -402,8 +402,8 @@ epe_init(struct epe_softc *sc) } /* Divide HCLK by 32 for MDC clock */ - if (device_cfdata(&sc->sc_dev)->cf_flags) - mdcdiv = device_cfdata(&sc->sc_dev)->cf_flags; + if (device_cfdata(sc->sc_dev)->cf_flags) + mdcdiv = device_cfdata(sc->sc_dev)->cf_flags; EPE_WRITE(SelfCtl, (SelfCtl_MDCDIV(mdcdiv)|SelfCtl_PSPRS)); sc->sc_mii.mii_ifp = ifp; @@ -413,7 +413,7 @@ epe_init(struct epe_softc *sc) sc->sc_ec.ec_mii = &sc->sc_mii; ifmedia_init(&sc->sc_mii.mii_media, IFM_IMASK, epe_mediachange, ether_mediastatus); - mii_attach((struct device *)sc, &sc->sc_mii, 0xffffffff, MII_PHY_ANY, + mii_attach(sc->sc_dev, &sc->sc_mii, 0xffffffff, MII_PHY_ANY, MII_OFFSET_ANY, 0); ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_AUTO); @@ -434,7 +434,7 @@ epe_init(struct epe_softc *sc) */ sc->sc_ec.ec_capabilities |= ETHERCAP_VLAN_MTU; - strcpy(ifp->if_xname, sc->sc_dev.dv_xname); + strcpy(ifp->if_xname, device_xname(sc->sc_dev)); ifp->if_flags = IFF_BROADCAST|IFF_SIMPLEX|IFF_NOTRAILERS|IFF_MULTICAST; ifp->if_ioctl = epe_ifioctl; ifp->if_start = epe_ifstart; @@ -457,12 +457,13 @@ epe_mediachange(struct ifnet *ifp) } int -epe_mii_readreg(struct device *self, int phy, int reg) +epe_mii_readreg(device_t self, int phy, int reg) { - u_int32_t d, v; struct epe_softc *sc; + u_int32_t d, v; + + sc = device_private(self); - sc = (struct epe_softc *)self; d = EPE_READ(SelfCtl); EPE_WRITE(SelfCtl, d & ~SelfCtl_PSPRS); /* no preamble suppress */ EPE_WRITE(MIICmd, (MIICmd_READ | (phy << 5) | reg)); @@ -473,12 +474,13 @@ epe_mii_readreg(struct device *self, int phy, int reg) } void -epe_mii_writereg(struct device *self, int phy, int reg, int val) +epe_mii_writereg(device_t self, int phy, int reg, int val) { struct epe_softc *sc; u_int32_t d; - sc = (struct epe_softc *)self; + sc = device_private(self); + d = EPE_READ(SelfCtl); EPE_WRITE(SelfCtl, d & ~SelfCtl_PSPRS); /* no preamble suppress */ EPE_WRITE(MIIData, val); @@ -489,9 +491,9 @@ epe_mii_writereg(struct device *self, int phy, int reg, int val) void -epe_statchg(struct device *self) +epe_statchg(struct ifnet *ifp) { - struct epe_softc *sc = (struct epe_softc *)self; + struct epe_softc *sc = ifp->if_softc; u_int32_t reg; /* @@ -518,7 +520,7 @@ epe_tick(void *arg) /* These misses are ok, they will happen if the RAM/CPU can't keep up */ misses = EPE_READ(RXMissCnt); if (misses > 0) - printf("%s: %d rx misses\n", sc->sc_dev.dv_xname, misses); + printf("%s: %d rx misses\n", device_xname(sc->sc_dev), misses); s = splnet(); if (epe_gctx(sc) > 0 && IFQ_IS_EMPTY(&ifp->if_snd) == 0) { @@ -666,7 +668,7 @@ epe_ifwatchdog(struct ifnet *ifp) if ((ifp->if_flags & IFF_RUNNING) == 0) return; printf("%s: device timeout, BMCtl = 0x%08x, BMSts = 0x%08x\n", - sc->sc_dev.dv_xname, EPE_READ(BMCtl), EPE_READ(BMSts)); + device_xname(sc->sc_dev), EPE_READ(BMCtl), EPE_READ(BMSts)); } static int diff --git a/sys/arch/arm/ep93xx/epevar.h b/sys/arch/arm/ep93xx/epevar.h index b1507d188426..de4f7898f0dd 100644 --- a/sys/arch/arm/ep93xx/epevar.h +++ b/sys/arch/arm/ep93xx/epevar.h @@ -1,4 +1,4 @@ -/* $NetBSD: epevar.h,v 1.5 2009/10/23 00:39:30 snj Exp $ */ +/* $NetBSD: epevar.h,v 1.6 2012/07/22 14:32:50 matt Exp $ */ /*- * Copyright (c) 2004 Jesse Off * All rights reserved @@ -38,7 +38,7 @@ struct epe_qmeta { }; struct epe_softc { - struct device sc_dev; + device_t sc_dev; bus_space_tag_t sc_iot; bus_space_handle_t sc_ioh; bus_dma_tag_t sc_dmat; diff --git a/sys/arch/arm/gemini/if_gmc.c b/sys/arch/arm/gemini/if_gmc.c index 7d0255c4a7fe..5f0b6d1287ee 100644 --- a/sys/arch/arm/gemini/if_gmc.c +++ b/sys/arch/arm/gemini/if_gmc.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_gmc.c,v 1.4 2011/07/01 19:32:28 dyoung Exp $ */ +/* $NetBSD: if_gmc.c,v 1.5 2012/07/22 14:32:50 matt Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. * All rights reserved. @@ -47,7 +47,7 @@ #include #include -__KERNEL_RCSID(0, "$NetBSD: if_gmc.c,v 1.4 2011/07/01 19:32:28 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_gmc.c,v 1.5 2012/07/22 14:32:50 matt Exp $"); #define MAX_TXSEG 32 @@ -307,9 +307,9 @@ gmc_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr) } static void -gmc_mii_statchg(device_t self) +gmc_mii_statchg(struct ifnet *ifp) { - struct gmc_softc * const sc = device_private(self); + struct gmc_softc * const sc = ifp->if_softc; uint32_t gmac_status; gmac_status = sc->sc_gmac_status; diff --git a/sys/arch/arm/xscale/ixp425_if_npe.c b/sys/arch/arm/xscale/ixp425_if_npe.c index 44708f7c054f..6faeaae8bcca 100644 --- a/sys/arch/arm/xscale/ixp425_if_npe.c +++ b/sys/arch/arm/xscale/ixp425_if_npe.c @@ -1,4 +1,4 @@ -/* $NetBSD: ixp425_if_npe.c,v 1.22 2012/02/02 19:42:58 tls Exp $ */ +/* $NetBSD: ixp425_if_npe.c,v 1.23 2012/07/22 14:32:50 matt Exp $ */ /*- * Copyright (c) 2006 Sam Leffler. All rights reserved. @@ -28,7 +28,7 @@ #if 0 __FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/if_npe.c,v 1.1 2006/11/19 23:55:23 sam Exp $"); #endif -__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.22 2012/02/02 19:42:58 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.23 2012/07/22 14:32:50 matt Exp $"); /* * Intel XScale NPE Ethernet driver. @@ -99,7 +99,7 @@ struct npedma { }; struct npe_softc { - struct device sc_dev; + device_t sc_dev; struct ethercom sc_ethercom; uint8_t sc_enaddr[ETHER_ADDR_LEN]; struct mii_data sc_mii; @@ -220,9 +220,9 @@ static uint32_t npe_getimageid(struct npe_softc *); static int npe_setloopback(struct npe_softc *, int ena); #endif -static int npe_miibus_readreg(struct device *, int, int); -static void npe_miibus_writereg(struct device *, int, int, int); -static void npe_miibus_statchg(struct device *); +static int npe_miibus_readreg(device_t, int, int); +static void npe_miibus_writereg(device_t, int, int, int); +static void npe_miibus_statchg(struct ifnet *); static int npe_debug; #define DPRINTF(sc, fmt, ...) do { \ @@ -251,14 +251,14 @@ static int tx_doneqid = -1; void (*npe_getmac_md)(int, uint8_t *); -static int npe_match(struct device *, struct cfdata *, void *); -static void npe_attach(struct device *, struct device *, void *); +static int npe_match(device_t, cfdata_t, void *); +static void npe_attach(device_t, device_t, void *); -CFATTACH_DECL(npe, sizeof(struct npe_softc), +CFATTACH_DECL_NEW(npe, sizeof(struct npe_softc), npe_match, npe_attach, NULL, NULL); static int -npe_match(struct device *parent, struct cfdata *cf, void *arg) +npe_match(device_t parent, cfdata_t cf, void *arg) { struct ixpnpe_attach_args *na = arg; @@ -266,16 +266,17 @@ npe_match(struct device *parent, struct cfdata *cf, void *arg) } static void -npe_attach(struct device *parent, struct device *self, void *arg) +npe_attach(device_t parent, device_t self, void *arg) { - struct npe_softc *sc = (void *)self; + struct npe_softc *sc = device_private(self); + struct ixpnpe_softc *isc = device_private(parent); struct ixpnpe_attach_args *na = arg; - struct ixpnpe_softc *isc = (struct ixpnpe_softc *)parent; struct ifnet *ifp; aprint_naive("\n"); aprint_normal(": Ethernet co-processor\n"); + sc->sc_dev = self; sc->sc_iot = na->na_iot; sc->sc_dt = na->na_dt; sc->sc_npe = na->na_npe; @@ -288,15 +289,15 @@ npe_attach(struct device *parent, struct device *self, void *arg) callout_init(&sc->sc_tick_ch, 0); if (npe_activate(sc)) { - aprint_error("%s: Failed to activate NPE (missing " - "microcode?)\n", sc->sc_dev.dv_xname); + aprint_error_dev(sc->sc_dev, + "Failed to activate NPE (missing microcode?)\n"); return; } npe_getmac(sc); npeinit_macreg(sc); - aprint_normal("%s: Ethernet address %s\n", sc->sc_dev.dv_xname, + aprint_normal_dev(sc->sc_dev, "Ethernet address %s\n", ether_sprintf(sc->sc_enaddr)); ifp = &sc->sc_ethercom.ec_if; @@ -309,7 +310,7 @@ npe_attach(struct device *parent, struct device *self, void *arg) ifmedia_init(&sc->sc_mii.mii_media, IFM_IMASK, ether_mediachange, npe_ifmedia_status); - mii_attach(&sc->sc_dev, &sc->sc_mii, 0xffffffff, MII_PHY_ANY, + mii_attach(sc->sc_dev, &sc->sc_mii, 0xffffffff, MII_PHY_ANY, MII_OFFSET_ANY, MIIF_DOPAUSE); if (LIST_FIRST(&sc->sc_mii.mii_phys) == NULL) { ifmedia_add(&sc->sc_mii.mii_media, IFM_ETHER|IFM_NONE, 0, NULL); @@ -318,7 +319,7 @@ npe_attach(struct device *parent, struct device *self, void *arg) ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_AUTO); ifp->if_softc = sc; - strcpy(ifp->if_xname, sc->sc_dev.dv_xname); + strcpy(ifp->if_xname, device_xname(sc->sc_dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_start = npestart; ifp->if_ioctl = npeioctl; @@ -332,7 +333,7 @@ npe_attach(struct device *parent, struct device *self, void *arg) if_attach(ifp); ether_ifattach(ifp, sc->sc_enaddr); - rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname, + rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev), RND_TYPE_NET, 0); /* callback function to reset MAC */ @@ -430,15 +431,17 @@ npe_dma_setup(struct npe_softc *sc, struct npedma *dma, error = bus_dmamem_alloc(sc->sc_dt, size, sizeof(uint32_t), 0, &seg, 1, &rseg, BUS_DMA_NOWAIT); if (error) { - printf("%s: unable to allocate memory for %s h/w buffers, " - "error %u\n", sc->sc_dev.dv_xname, dma->name, error); + aprint_error_dev(sc->sc_dev, + "unable to %s for %s %s buffers, error %u\n", + "allocate memory", dma->name, "h/w", error); } error = bus_dmamem_map(sc->sc_dt, &seg, 1, size, &hwbuf, BUS_DMA_NOWAIT | BUS_DMA_COHERENT | BUS_DMA_NOCACHE); if (error) { - printf("%s: unable to map memory for %s h/w buffers, " - "error %u\n", sc->sc_dev.dv_xname, dma->name, error); + aprint_error_dev(sc->sc_dev, + "unable to %s for %s %s buffers, error %u\n", + "map memory", dma->name, "h/w", error); free_dmamem: bus_dmamem_free(sc->sc_dt, &seg, rseg); return error; @@ -448,8 +451,9 @@ npe_dma_setup(struct npe_softc *sc, struct npedma *dma, error = bus_dmamap_create(sc->sc_dt, size, 1, size, 0, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, &dma->buf_map); if (error) { - printf("%s: unable to create map for %s h/w buffers, " - "error %u\n", sc->sc_dev.dv_xname, dma->name, error); + aprint_error_dev(sc->sc_dev, + "unable to %s for %s %s buffers, error %u\n", + "create map", dma->name, "h/w", error); unmap_dmamem: dma->hwbuf = NULL; bus_dmamem_unmap(sc->sc_dt, hwbuf, size); @@ -459,8 +463,9 @@ npe_dma_setup(struct npe_softc *sc, struct npedma *dma, error = bus_dmamap_load(sc->sc_dt, dma->buf_map, hwbuf, size, NULL, BUS_DMA_NOWAIT); if (error) { - printf("%s: unable to load map for %s h/w buffers, " - "error %u\n", sc->sc_dev.dv_xname, dma->name, error); + aprint_error_dev(sc->sc_dev, + "unable to %s for %s %s buffers, error %u\n", + "load map", dma->name, "h/w", error); destroy_dmamap: bus_dmamap_destroy(sc->sc_dt, dma->buf_map); goto unmap_dmamem; @@ -469,8 +474,9 @@ npe_dma_setup(struct npe_softc *sc, struct npedma *dma, /* XXX M_TEMP */ dma->buf = malloc(nbuf * sizeof(struct npebuf), M_TEMP, M_NOWAIT | M_ZERO); if (dma->buf == NULL) { - printf("%s: unable to allocate memory for %s s/w buffers\n", - sc->sc_dev.dv_xname, dma->name); + aprint_error_dev(sc->sc_dev, + "unable to %s for %s %s buffers, error %u\n", + "allocate memory", dma->name, "h/w", error); bus_dmamap_unload(sc->sc_dt, dma->buf_map); error = ENOMEM; goto destroy_dmamap; @@ -488,9 +494,9 @@ npe_dma_setup(struct npe_softc *sc, struct npedma *dma, error = bus_dmamap_create(sc->sc_dt, MCLBYTES, maxseg, MCLBYTES, 0, 0, &npe->ix_map); if (error != 0) { - printf("%s: unable to create dmamap for %s buffer %u, " - "error %u\n", sc->sc_dev.dv_xname, dma->name, i, - error); + aprint_error_dev(sc->sc_dev, + "unable to %s for %s buffer %u, error %u\n", + "create dmamap", dma->name, i, error); /* XXXSCW: Free up maps... */ return error; } @@ -539,9 +545,8 @@ npe_activate(struct npe_softc *sc) if (bus_space_map(sc->sc_iot, npeconfig[unit].regbase, npeconfig[unit].regsize, 0, &sc->sc_ioh)) { - printf("%s: Cannot map registers 0x%x:0x%x\n", - sc->sc_dev.dv_xname, npeconfig[unit].regbase, - npeconfig[unit].regsize); + aprint_error_dev(sc->sc_dev, "Cannot map registers 0x%x:0x%x\n", + npeconfig[unit].regbase, npeconfig[unit].regsize); return ENOMEM; } @@ -553,9 +558,9 @@ npe_activate(struct npe_softc *sc) */ if (bus_space_map(sc->sc_iot, npeconfig[unit].miibase, npeconfig[unit].miisize, 0, &sc->sc_miih)) { - printf("%s: Cannot map MII registers 0x%x:0x%x\n", - sc->sc_dev.dv_xname, npeconfig[unit].miibase, - npeconfig[unit].miisize); + aprint_error_dev(sc->sc_dev, + "Cannot map MII registers 0x%x:0x%x\n", + npeconfig[unit].miibase, npeconfig[unit].miisize); return ENOMEM; } } else @@ -571,16 +576,18 @@ npe_activate(struct npe_softc *sc) error = bus_dmamem_alloc(sc->sc_dt, sizeof(struct npestats), sizeof(uint32_t), 0, &seg, 1, &rseg, BUS_DMA_NOWAIT); if (error) { - printf("%s: unable to allocate memory for stats block, " - "error %u\n", sc->sc_dev.dv_xname, error); + aprint_error_dev(sc->sc_dev, + "unable to %s for %s, error %u\n", + "allocate memory", "stats block", error); return error; } error = bus_dmamem_map(sc->sc_dt, &seg, 1, sizeof(struct npestats), &statbuf, BUS_DMA_NOWAIT); if (error) { - printf("%s: unable to map memory for stats block, " - "error %u\n", sc->sc_dev.dv_xname, error); + aprint_error_dev(sc->sc_dev, + "unable to %s for %s, error %u\n", + "map memory", "stats block", error); return error; } sc->sc_stats = (void *)statbuf; @@ -589,15 +596,17 @@ npe_activate(struct npe_softc *sc) sizeof(struct npestats), 0, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, &sc->sc_stats_map); if (error) { - printf("%s: unable to create map for stats block, " - "error %u\n", sc->sc_dev.dv_xname, error); + aprint_error_dev(sc->sc_dev, + "unable to %s for %s, error %u\n", + "create map", "stats block", error); return error; } if (bus_dmamap_load(sc->sc_dt, sc->sc_stats_map, sc->sc_stats, sizeof(struct npestats), NULL, BUS_DMA_NOWAIT) != 0) { - printf("%s: unable to load memory for stats block, error %u\n", - sc->sc_dev.dv_xname, error); + aprint_error_dev(sc->sc_dev, + "unable to %s for %s, error %u\n", + "load map", "stats block", error); return error; } sc->sc_stats_phys = sc->sc_stats_map->dm_segs[0].ds_addr; @@ -629,7 +638,7 @@ npe_activate(struct npe_softc *sc) #if 0 for (i = 0; i < 8; i++) #else -printf("%s: remember to fix rx q setup\n", sc->sc_dev.dv_xname); +printf("%s: remember to fix rx q setup\n", device_xname(sc->sc_dev)); for (i = 0; i < 4; i++) #endif npe_setrxqosentry(sc, i, 0, sc->rx_qid); @@ -766,7 +775,7 @@ npe_getmac(struct npe_softc *sc) uint8_t *eaddr = sc->sc_enaddr; if (npe_getmac_md != NULL) { - (*npe_getmac_md)(sc->sc_dev.dv_unit, eaddr); + (*npe_getmac_md)(device_unit(sc->sc_dev), eaddr); } else { /* * Some system's unicast address appears to be loaded from @@ -949,7 +958,7 @@ npe_rxdone(int qid, void *arg) #if 1 if (mrx->m_pkthdr.len < sizeof(struct ether_header)) { log(LOG_INFO, "%s: too short frame (len=%d)\n", - sc->sc_dev.dv_xname, mrx->m_pkthdr.len); + device_xname(sc->sc_dev), mrx->m_pkthdr.len); /* Back out "newly allocated" mbuf. */ m_freem(m); ifp->if_ierrors++; @@ -1025,7 +1034,7 @@ npe_rxdone(int qid, void *arg) } if (mrx->m_pkthdr.len > NPE_FRAME_SIZE_DEFAULT) { log(LOG_INFO, "%s: oversized frame (len=%d)\n", - sc->sc_dev.dv_xname, mrx->m_pkthdr.len); + device_xname(sc->sc_dev), mrx->m_pkthdr.len); /* Back out "newly allocated" mbuf. */ m_freem(m); ifp->if_ierrors++; @@ -1073,7 +1082,7 @@ npe_startxmit(struct npe_softc *sc) if (npe->ix_m != NULL) { /* NB: should not happen */ printf("%s: %s: free mbuf at entry %u\n", - sc->sc_dev.dv_xname, __func__, i); + device_xname(sc->sc_dev), __func__, i); m_freem(npe->ix_m); } npe->ix_m = NULL; @@ -1266,7 +1275,7 @@ npestart(struct ifnet *ifp) n = npe_defrag(m); if (n == NULL) { printf("%s: %s: too many fragments\n", - sc->sc_dev.dv_xname, __func__); + device_xname(sc->sc_dev), __func__); m_freem(m); return; /* XXX? */ } @@ -1276,7 +1285,7 @@ npestart(struct ifnet *ifp) } if (error != 0) { printf("%s: %s: error %u\n", - sc->sc_dev.dv_xname, __func__, error); + device_xname(sc->sc_dev), __func__, error); m_freem(m); return; /* XXX? */ } @@ -1397,7 +1406,7 @@ npewatchdog(struct ifnet *ifp) struct npe_softc *sc = ifp->if_softc; int s; - printf("%s: device timeout\n", sc->sc_dev.dv_xname); + aprint_error_dev(sc->sc_dev, "device timeout\n"); s = splnet(); ifp->if_oerrors++; npeinit_locked(sc); @@ -1609,9 +1618,9 @@ npe_mii_mdio_wait(struct npe_softc *sc) } static int -npe_miibus_readreg(struct device *self, int phy, int reg) +npe_miibus_readreg(device_t self, int phy, int reg) { - struct npe_softc *sc = (void *)self; + struct npe_softc *sc = device_private(self); uint32_t v; if (sc->sc_phy > IXPNPECF_PHY_DEFAULT && phy != sc->sc_phy) @@ -1628,9 +1637,9 @@ npe_miibus_readreg(struct device *self, int phy, int reg) } static void -npe_miibus_writereg(struct device *self, int phy, int reg, int data) +npe_miibus_writereg(device_t self, int phy, int reg, int data) { - struct npe_softc *sc = (void *)self; + struct npe_softc *sc = device_private(self); uint32_t v; if (sc->sc_phy > IXPNPECF_PHY_DEFAULT && phy != sc->sc_phy) @@ -1644,9 +1653,9 @@ npe_miibus_writereg(struct device *self, int phy, int reg, int data) } static void -npe_miibus_statchg(struct device *self) +npe_miibus_statchg(struct ifnet *ifp) { - struct npe_softc *sc = (void *)self; + struct npe_softc *sc = ifp->if_softc; uint32_t tx1, rx1; uint32_t randoff; diff --git a/sys/arch/evbppc/virtex/dev/if_temac.c b/sys/arch/evbppc/virtex/dev/if_temac.c index 8510683b85a4..7f65ce3180e5 100644 --- a/sys/arch/evbppc/virtex/dev/if_temac.c +++ b/sys/arch/evbppc/virtex/dev/if_temac.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_temac.c,v 1.8 2011/06/18 06:44:27 matt Exp $ */ +/* $NetBSD: if_temac.c,v 1.9 2012/07/22 14:32:51 matt Exp $ */ /* * Copyright (c) 2006 Jachym Holecek @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_temac.c,v 1.8 2011/06/18 06:44:27 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_temac.c,v 1.9 2012/07/22 14:32:51 matt Exp $"); #include @@ -205,7 +205,7 @@ static void temac_stop(struct ifnet *, int); /* Media management. */ static int temac_mii_readreg(device_t, int, int); -static void temac_mii_statchg(device_t); +static void temac_mii_statchg(struct ifnet *); static void temac_mii_tick(void *); static void temac_mii_writereg(device_t, int, int, int); @@ -841,9 +841,9 @@ temac_mii_writereg(device_t self, int phy, int reg, int val) } static void -temac_mii_statchg(device_t self) +temac_mii_statchg(struct ifnet *ifp) { - struct temac_softc *sc = device_private(self); + struct temac_softc *sc = ifp->if_softc; uint32_t rcf, tcf, mmc; /* Full/half duplex link. */ diff --git a/sys/arch/macppc/dev/if_bm.c b/sys/arch/macppc/dev/if_bm.c index 4d4fd0dccc60..897326045165 100644 --- a/sys/arch/macppc/dev/if_bm.c +++ b/sys/arch/macppc/dev/if_bm.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_bm.c,v 1.45 2011/06/30 00:52:57 matt Exp $ */ +/* $NetBSD: if_bm.c,v 1.46 2012/07/22 14:32:51 matt Exp $ */ /*- * Copyright (C) 1998, 1999, 2000 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_bm.c,v 1.45 2011/06/30 00:52:57 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bm.c,v 1.46 2012/07/22 14:32:51 matt Exp $"); #include "opt_inet.h" @@ -116,7 +116,7 @@ void bmac_setladrf(struct bmac_softc *); int bmac_mii_readreg(device_t, int, int); void bmac_mii_writereg(device_t, int, int, int); -void bmac_mii_statchg(device_t); +void bmac_mii_statchg(struct ifnet *); void bmac_mii_tick(void *); u_int32_t bmac_mbo_read(device_t); void bmac_mbo_write(device_t, u_int32_t); @@ -880,9 +880,9 @@ bmac_mbo_write(device_t self, u_int32_t val) } void -bmac_mii_statchg(device_t self) +bmac_mii_statchg(struct ifnet *ifp) { - struct bmac_softc *sc = device_private(self); + struct bmac_softc *sc = ifp->if_softc; int x; /* Update duplex mode in TX configuration */ diff --git a/sys/arch/macppc/dev/if_gm.c b/sys/arch/macppc/dev/if_gm.c index cc6e5706e827..82e909c7bedb 100644 --- a/sys/arch/macppc/dev/if_gm.c +++ b/sys/arch/macppc/dev/if_gm.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_gm.c,v 1.41 2012/02/02 19:42:59 tls Exp $ */ +/* $NetBSD: if_gm.c,v 1.42 2012/07/22 14:32:51 matt Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_gm.c,v 1.41 2012/02/02 19:42:59 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_gm.c,v 1.42 2012/07/22 14:32:51 matt Exp $"); #include "opt_inet.h" @@ -117,7 +117,7 @@ void gmac_watchdog(struct ifnet *); int gmac_mii_readreg(device_t, int, int); void gmac_mii_writereg(device_t, int, int, int); -void gmac_mii_statchg(device_t); +void gmac_mii_statchg(struct ifnet *); void gmac_mii_tick(void *); CFATTACH_DECL_NEW(gm, sizeof(struct gmac_softc), @@ -883,9 +883,9 @@ gmac_mii_writereg(device_t self, int phy, int reg, int val) } void -gmac_mii_statchg(device_t self) +gmac_mii_statchg(struct ifnet *ifp) { - struct gmac_softc *sc = device_private(self); + struct gmac_softc *sc = ifp->if_softc; gmac_stop_txdma(sc); gmac_stop_rxdma(sc); diff --git a/sys/arch/mips/alchemy/dev/if_aumac.c b/sys/arch/mips/alchemy/dev/if_aumac.c index ba7907a2207b..e73b802e2a7e 100644 --- a/sys/arch/mips/alchemy/dev/if_aumac.c +++ b/sys/arch/mips/alchemy/dev/if_aumac.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_aumac.c,v 1.36 2012/06/07 00:19:29 kiyohara Exp $ */ +/* $NetBSD: if_aumac.c,v 1.37 2012/07/22 14:32:51 matt Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -46,7 +46,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_aumac.c,v 1.36 2012/06/07 00:19:29 kiyohara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_aumac.c,v 1.37 2012/07/22 14:32:51 matt Exp $"); @@ -190,7 +190,7 @@ static int aumac_rxintr(struct aumac_softc *); static int aumac_mii_readreg(device_t, int, int); static void aumac_mii_writereg(device_t, int, int, int); -static void aumac_mii_statchg(device_t); +static void aumac_mii_statchg(struct ifnet *); static int aumac_mii_wait(struct aumac_softc *, const char *); static int aumac_match(device_t, struct cfdata *, void *); @@ -1038,9 +1038,9 @@ aumac_mii_writereg(device_t self, int phy, int reg, int val) * Callback from MII layer when media changes. */ static void -aumac_mii_statchg(device_t self) +aumac_mii_statchg(struct ifnet *ifp) { - struct aumac_softc *sc = device_private(self); + struct aumac_softc *sc = ifp->if_softc; if ((sc->sc_mii.mii_media_active & IFM_FDX) != 0) sc->sc_control |= CONTROL_F; diff --git a/sys/arch/mips/atheros/dev/if_ae.c b/sys/arch/mips/atheros/dev/if_ae.c index c51a1083b160..cbebf00045f7 100644 --- a/sys/arch/mips/atheros/dev/if_ae.c +++ b/sys/arch/mips/atheros/dev/if_ae.c @@ -1,4 +1,4 @@ -/* $Id: if_ae.c,v 1.22 2012/02/02 19:43:00 tls Exp $ */ +/* $Id: if_ae.c,v 1.23 2012/07/22 14:32:52 matt Exp $ */ /*- * Copyright (c) 2006 Urbana-Champaign Independent Media Center. * Copyright (c) 2006 Garrett D'Amore. @@ -98,7 +98,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ae.c,v 1.22 2012/02/02 19:43:00 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ae.c,v 1.23 2012/07/22 14:32:52 matt Exp $"); #include @@ -174,7 +174,7 @@ static void ae_rxintr(struct ae_softc *); static void ae_txintr(struct ae_softc *); static void ae_mii_tick(void *); -static void ae_mii_statchg(device_t); +static void ae_mii_statchg(struct ifnet *); static int ae_mii_readreg(device_t, int, int); static void ae_mii_writereg(device_t, int, int, int); @@ -1838,9 +1838,9 @@ ae_mii_tick(void *arg) * Callback from PHY when media changes. */ static void -ae_mii_statchg(device_t self) +ae_mii_statchg(struct ifnet *ifp) { - struct ae_softc *sc = device_private(self); + struct ae_softc *sc = ifp->if_softc; uint32_t macctl, flowc; //opmode = AE_READ(sc, CSR_OPMODE); diff --git a/sys/arch/mips/ralink/ralink_eth.c b/sys/arch/mips/ralink/ralink_eth.c index 272b48125fbd..d328e8af6f12 100644 --- a/sys/arch/mips/ralink/ralink_eth.c +++ b/sys/arch/mips/ralink/ralink_eth.c @@ -1,4 +1,4 @@ -/* $NetBSD: ralink_eth.c,v 1.5 2011/08/23 08:10:08 oki Exp $ */ +/* $NetBSD: ralink_eth.c,v 1.6 2012/07/22 14:32:52 matt Exp $ */ /*- * Copyright (c) 2011 CradlePoint Technology, Inc. * All rights reserved. @@ -29,7 +29,7 @@ /* ralink_eth.c -- Ralink Ethernet Driver */ #include -__KERNEL_RCSID(0, "$NetBSD: ralink_eth.c,v 1.5 2011/08/23 08:10:08 oki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ralink_eth.c,v 1.6 2012/07/22 14:32:52 matt Exp $"); #include #include @@ -249,7 +249,7 @@ static int ralink_eth_ioctl(struct ifnet *, u_long, void *); #if defined(RT3050) || defined(RT3052) static void ralink_eth_mdio_enable(ralink_eth_softc_t *, bool); #endif -static void ralink_eth_mii_statchg(device_t); +static void ralink_eth_mii_statchg(struct ifnet *); static void ralink_eth_mii_tick(void *); static int ralink_eth_mii_read(device_t, int, int); static void ralink_eth_mii_write(device_t, int, int, int); @@ -1581,10 +1581,10 @@ ralink_eth_mdio_enable(ralink_eth_softc_t *sc, bool enable) * ralink_eth_mii_statchg */ static void -ralink_eth_mii_statchg(device_t self) +ralink_eth_mii_statchg(struct ifnet *ifp) { #if 0 - ralink_eth_softc_t * const sc = device_private(self); + ralink_eth_softc_t * const sc = ifp->if_softc; #endif } diff --git a/sys/arch/mips/sibyte/dev/sbmac.c b/sys/arch/mips/sibyte/dev/sbmac.c index 2f679648527d..1797a22b5ac5 100644 --- a/sys/arch/mips/sibyte/dev/sbmac.c +++ b/sys/arch/mips/sibyte/dev/sbmac.c @@ -1,4 +1,4 @@ -/* $NetBSD: sbmac.c,v 1.41 2011/07/10 23:32:03 matt Exp $ */ +/* $NetBSD: sbmac.c,v 1.42 2012/07/22 14:32:52 matt Exp $ */ /* * Copyright 2000, 2001, 2004 @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sbmac.c,v 1.41 2011/07/10 23:32:03 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sbmac.c,v 1.42 2012/07/22 14:32:52 matt Exp $"); #include "opt_inet.h" #include "opt_ns.h" @@ -319,9 +319,9 @@ sbmac_mii_writereg(device_t self, int phy, int reg, int val) } static void -sbmac_mii_statchg(device_t self) +sbmac_mii_statchg(struct ifnet *ifp) { - struct sbmac_softc *sc = device_private(self); + struct sbmac_softc *sc = ifp->if_softc; sbmac_state_t oldstate; /* Stop the MAC in preparation for changing all of the parameters. */ @@ -1468,7 +1468,7 @@ sbmac_init_and_start(struct sbmac_softc *sc) s = splnet(); mii_pollstat(&sc->sc_mii); /* poll phy for current speed */ - sbmac_mii_statchg(sc->sc_dev); /* set state to new speed */ + sbmac_mii_statchg(&sc->sc_ethercom.ec_if); /* set state to new speed */ sbmac_set_channel_state(sc, sbmac_state_on); splx(s); diff --git a/sys/arch/powerpc/ibm4xx/dev/if_emac.c b/sys/arch/powerpc/ibm4xx/dev/if_emac.c index f5bb99327c28..ef480179c6bf 100644 --- a/sys/arch/powerpc/ibm4xx/dev/if_emac.c +++ b/sys/arch/powerpc/ibm4xx/dev/if_emac.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_emac.c,v 1.40 2012/06/24 08:39:39 kiyohara Exp $ */ +/* $NetBSD: if_emac.c,v 1.41 2012/07/22 14:32:52 matt Exp $ */ /* * Copyright 2001, 2002 Wasabi Systems, Inc. @@ -52,7 +52,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_emac.c,v 1.40 2012/06/24 08:39:39 kiyohara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_emac.c,v 1.41 2012/07/22 14:32:52 matt Exp $"); #include "opt_emac.h" @@ -306,7 +306,7 @@ static void emac_smart_reset(struct emac_softc *); static int emac_mii_readreg(device_t, int, int); static void emac_mii_writereg(device_t, int, int, int); -static void emac_mii_statchg(device_t); +static void emac_mii_statchg(struct ifnet *); static uint32_t emac_mii_wait(struct emac_softc *); static void emac_mii_tick(void *); @@ -1463,10 +1463,9 @@ out: } static void -emac_mii_statchg(device_t self) +emac_mii_statchg(struct ifnet *ifp) { - struct emac_softc *sc = device_private(self); - struct ifnet *ifp = &sc->sc_ethercom.ec_if; + struct emac_softc *sc = ifp->if_softc; struct mii_data *mii = &sc->sc_mii; /* @@ -1498,12 +1497,12 @@ emac_mii_statchg(device_t self) break; default: - aprint_error_dev(self, "unknown sub-type %d\n", + aprint_error_dev(sc->sc_dev, "unknown sub-type %d\n", IFM_SUBTYPE(mii->mii_media_active)); break; } if (sc->sc_rmii_speed) - sc->sc_rmii_speed(device_parent(self), sc->sc_instance, + sc->sc_rmii_speed(device_parent(sc->sc_dev), sc->sc_instance, IFM_SUBTYPE(mii->mii_media_active)); EMAC_WRITE(sc, EMAC_MR1, sc->sc_mr1); diff --git a/sys/arch/sgimips/mace/if_mec.c b/sys/arch/sgimips/mace/if_mec.c index 3e5da39588f4..22e19abdd623 100644 --- a/sys/arch/sgimips/mace/if_mec.c +++ b/sys/arch/sgimips/mace/if_mec.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_mec.c,v 1.48 2012/02/02 19:43:00 tls Exp $ */ +/* $NetBSD: if_mec.c,v 1.49 2012/07/22 14:32:53 matt Exp $ */ /*- * Copyright (c) 2004, 2008 Izumi Tsutsui. All rights reserved. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_mec.c,v 1.48 2012/02/02 19:43:00 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_mec.c,v 1.49 2012/07/22 14:32:53 matt Exp $"); #include "opt_ddb.h" @@ -390,7 +390,7 @@ static void mec_attach(device_t, device_t, void *); static int mec_mii_readreg(device_t, int, int); static void mec_mii_writereg(device_t, int, int, int); static int mec_mii_wait(struct mec_softc *); -static void mec_statchg(device_t); +static void mec_statchg(struct ifnet *); static int mec_init(struct ifnet * ifp); static void mec_start(struct ifnet *); @@ -823,9 +823,9 @@ mec_mii_wait(struct mec_softc *sc) } static void -mec_statchg(device_t self) +mec_statchg(struct ifnet *ifp) { - struct mec_softc *sc = device_private(self); + struct mec_softc *sc = ifp->if_softc; bus_space_tag_t st = sc->sc_st; bus_space_handle_t sh = sc->sc_sh; uint32_t control; diff --git a/sys/dev/ic/aic6915.c b/sys/dev/ic/aic6915.c index ccacba7b73b1..d16506ed9938 100644 --- a/sys/dev/ic/aic6915.c +++ b/sys/dev/ic/aic6915.c @@ -1,4 +1,4 @@ -/* $NetBSD: aic6915.c,v 1.28 2010/11/13 13:52:00 uebayasi Exp $ */ +/* $NetBSD: aic6915.c,v 1.29 2012/07/22 14:32:55 matt Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.28 2010/11/13 13:52:00 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.29 2012/07/22 14:32:55 matt Exp $"); #include @@ -85,7 +85,7 @@ static void sf_set_filter(struct sf_softc *); static int sf_mii_read(device_t, int, int); static void sf_mii_write(device_t, int, int, int); -static void sf_mii_statchg(device_t); +static void sf_mii_statchg(struct ifnet *); static void sf_tick(void *); @@ -1349,7 +1349,7 @@ sf_set_filter(struct sf_softc *sc) static int sf_mii_read(device_t self, int phy, int reg) { - struct sf_softc *sc = (void *) self; + struct sf_softc *sc = device_private(self); uint32_t v; int i; @@ -1377,7 +1377,7 @@ sf_mii_read(device_t self, int phy, int reg) static void sf_mii_write(device_t self, int phy, int reg, int val) { - struct sf_softc *sc = (void *) self; + struct sf_softc *sc = device_private(self); int i; sf_genreg_write(sc, SF_MII_PHY_REG(phy, reg), val); @@ -1398,9 +1398,9 @@ sf_mii_write(device_t self, int phy, int reg, int val) * Callback from the PHY when the media changes. */ static void -sf_mii_statchg(device_t self) +sf_mii_statchg(struct ifnet *ifp) { - struct sf_softc *sc = (void *) self; + struct sf_softc *sc = ifp->if_softc; uint32_t ipg; if (sc->sc_mii.mii_media_active & IFM_FDX) { diff --git a/sys/dev/ic/ax88190.c b/sys/dev/ic/ax88190.c index 19b45947f832..7378d873d95f 100644 --- a/sys/dev/ic/ax88190.c +++ b/sys/dev/ic/ax88190.c @@ -1,4 +1,4 @@ -/* $NetBSD: ax88190.c,v 1.11 2008/04/28 20:23:49 martin Exp $ */ +/* $NetBSD: ax88190.c,v 1.12 2012/07/22 14:32:56 matt Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ax88190.c,v 1.11 2008/04/28 20:23:49 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ax88190.c,v 1.12 2012/07/22 14:32:56 matt Exp $"); #include #include @@ -60,7 +60,7 @@ __KERNEL_RCSID(0, "$NetBSD: ax88190.c,v 1.11 2008/04/28 20:23:49 martin Exp $"); static int ax88190_mii_readreg(device_t, int, int); static void ax88190_mii_writereg(device_t, int, int, int); -static void ax88190_mii_statchg(device_t); +static void ax88190_mii_statchg(struct ifnet *); /* * MII bit-bang glue. @@ -174,7 +174,7 @@ ax88190_mii_writereg(device_t self, int phy, int reg, int val) } static void -ax88190_mii_statchg(device_t self) +ax88190_mii_statchg(struct ifnet *ifp) { /* XXX */ diff --git a/sys/dev/ic/dl10019.c b/sys/dev/ic/dl10019.c index 47bf5a52be00..cd34ea9ddf1b 100644 --- a/sys/dev/ic/dl10019.c +++ b/sys/dev/ic/dl10019.c @@ -1,4 +1,4 @@ -/* $NetBSD: dl10019.c,v 1.11 2008/04/28 20:23:49 martin Exp $ */ +/* $NetBSD: dl10019.c,v 1.12 2012/07/22 14:32:56 matt Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dl10019.c,v 1.11 2008/04/28 20:23:49 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dl10019.c,v 1.12 2012/07/22 14:32:56 matt Exp $"); #include #include @@ -61,7 +61,7 @@ __KERNEL_RCSID(0, "$NetBSD: dl10019.c,v 1.11 2008/04/28 20:23:49 martin Exp $"); int dl10019_mii_readreg(device_t, int, int); void dl10019_mii_writereg(device_t, int, int, int); -void dl10019_mii_statchg(device_t); +void dl10019_mii_statchg(struct ifnet *); /* * MII bit-bang glue. @@ -228,10 +228,10 @@ dl10019_mii_writereg(device_t self, int phy, int reg, int val) } void -dl10019_mii_statchg(device_t self) +dl10019_mii_statchg(struct ifnet *ifp) { - struct dp8390_softc *sc = device_private(self); - struct ne2000_softc *nsc = device_private(self); + struct ne2000_softc *nsc = ifp->if_softc; + struct dp8390_softc *sc = &nsc->sc_dp8390; /* * Disable collision detection on the DL10022 if diff --git a/sys/dev/ic/elink3.c b/sys/dev/ic/elink3.c index 5f98788e1234..703e293cbc90 100644 --- a/sys/dev/ic/elink3.c +++ b/sys/dev/ic/elink3.c @@ -1,4 +1,4 @@ -/* $NetBSD: elink3.c,v 1.132 2012/02/02 19:43:03 tls Exp $ */ +/* $NetBSD: elink3.c,v 1.133 2012/07/22 14:32:56 matt Exp $ */ /*- * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: elink3.c,v 1.132 2012/02/02 19:43:03 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: elink3.c,v 1.133 2012/07/22 14:32:56 matt Exp $"); #include "opt_inet.h" @@ -202,7 +202,7 @@ void ep_media_status(struct ifnet *ifp, struct ifmediareq *req); /* MII callbacks */ int ep_mii_readreg(device_t, int, int); void ep_mii_writereg(device_t, int, int, int); -void ep_statchg(device_t); +void ep_statchg(struct ifnet *); void ep_tick(void *); @@ -2081,9 +2081,9 @@ ep_mii_writereg(device_t self, int phy, int reg, int val) } void -ep_statchg(device_t self) +ep_statchg(struct ifnet *ifp) { - struct ep_softc *sc = device_private(self); + struct ep_softc *sc = ifp->if_softc; bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; int mctl; diff --git a/sys/dev/ic/elinkxl.c b/sys/dev/ic/elinkxl.c index a76c6efcac91..278e196524d4 100644 --- a/sys/dev/ic/elinkxl.c +++ b/sys/dev/ic/elinkxl.c @@ -1,4 +1,4 @@ -/* $NetBSD: elinkxl.c,v 1.114 2012/02/02 19:43:03 tls Exp $ */ +/* $NetBSD: elinkxl.c,v 1.115 2012/07/22 14:32:57 matt Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.114 2012/02/02 19:43:03 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.115 2012/07/22 14:32:57 matt Exp $"); #include #include @@ -102,7 +102,7 @@ static void ex_txstat(struct ex_softc *); int ex_mii_readreg(device_t, int, int); void ex_mii_writereg(device_t, int, int, int); -void ex_mii_statchg(device_t); +void ex_mii_statchg(struct ifnet *); void ex_probemedia(struct ex_softc *); @@ -1924,9 +1924,9 @@ ex_mii_writereg(device_t v, int phy, int reg, int data) } void -ex_mii_statchg(device_t v) +ex_mii_statchg(struct ifnet *ifp) { - struct ex_softc *sc = device_private(v); + struct ex_softc *sc = ifp->if_softc; bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; int mctl; diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c index 3f99bab2c90a..590a52dbb194 100644 --- a/sys/dev/ic/gem.c +++ b/sys/dev/ic/gem.c @@ -1,4 +1,4 @@ -/* $NetBSD: gem.c,v 1.99 2012/07/02 11:23:40 jdc Exp $ */ +/* $NetBSD: gem.c,v 1.100 2012/07/22 14:32:57 matt Exp $ */ /* * @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.99 2012/07/02 11:23:40 jdc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.100 2012/07/22 14:32:57 matt Exp $"); #include "opt_inet.h" @@ -113,7 +113,7 @@ void gem_setladrf(struct gem_softc *); /* MII methods & callbacks */ static int gem_mii_readreg(device_t, int, int); static void gem_mii_writereg(device_t, int, int, int); -static void gem_mii_statchg(device_t); +static void gem_mii_statchg(struct ifnet *); static int gem_ifflags_cb(struct ethercom *); @@ -2419,9 +2419,9 @@ gem_mii_writereg(device_t self, int phy, int reg, int val) } static void -gem_mii_statchg(device_t self) +gem_mii_statchg(struct ifnet *ifp) { - struct gem_softc *sc = device_private(self); + struct gem_softc *sc = ifp->if_softc; #ifdef GEM_DEBUG int instance = IFM_INST(sc->sc_mii.mii_media.ifm_cur->ifm_media); #endif diff --git a/sys/dev/ic/hme.c b/sys/dev/ic/hme.c index 4b176405bcc5..b96aeb1ad3a7 100644 --- a/sys/dev/ic/hme.c +++ b/sys/dev/ic/hme.c @@ -1,4 +1,4 @@ -/* $NetBSD: hme.c,v 1.88 2012/06/24 09:37:28 jdc Exp $ */ +/* $NetBSD: hme.c,v 1.89 2012/07/22 14:32:57 matt Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.88 2012/06/24 09:37:28 jdc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.89 2012/07/22 14:32:57 matt Exp $"); /* #define HMEDEBUG */ @@ -96,7 +96,7 @@ static void hme_setladrf(struct hme_softc *); /* MII methods & callbacks */ static int hme_mii_readreg(device_t, int, int); static void hme_mii_writereg(device_t, int, int, int); -static void hme_mii_statchg(device_t); +static void hme_mii_statchg(struct ifnet *); static int hme_mediachange(struct ifnet *); @@ -1342,9 +1342,9 @@ out: } static void -hme_mii_statchg(device_t dev) +hme_mii_statchg(struct ifnet *ifp) { - struct hme_softc *sc = device_private(dev); + struct hme_softc *sc = ifp->if_softc; bus_space_tag_t t = sc->sc_bustag; bus_space_handle_t mac = sc->sc_mac; uint32_t v; diff --git a/sys/dev/ic/i82557.c b/sys/dev/ic/i82557.c index ec6b9c8db558..a0fb42a52d86 100644 --- a/sys/dev/ic/i82557.c +++ b/sys/dev/ic/i82557.c @@ -1,4 +1,4 @@ -/* $NetBSD: i82557.c,v 1.139 2012/02/02 19:43:03 tls Exp $ */ +/* $NetBSD: i82557.c,v 1.140 2012/07/22 14:32:57 matt Exp $ */ /*- * Copyright (c) 1997, 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.139 2012/02/02 19:43:03 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.140 2012/07/22 14:32:57 matt Exp $"); #include #include @@ -187,7 +187,7 @@ void fxp_rx_hwcksum(struct fxp_softc *,struct mbuf *, void fxp_rxdrain(struct fxp_softc *); int fxp_add_rfabuf(struct fxp_softc *, bus_dmamap_t, int); int fxp_mdi_read(device_t, int, int); -void fxp_statchg(device_t); +void fxp_statchg(struct ifnet *); void fxp_mdi_write(device_t, int, int, int); void fxp_autosize_eeprom(struct fxp_softc*); void fxp_read_eeprom(struct fxp_softc *, uint16_t *, int, int); @@ -2138,7 +2138,7 @@ fxp_mdi_read(device_t self, int phy, int reg) } void -fxp_statchg(device_t self) +fxp_statchg(struct ifnet *ifp) { /* Nothing to do. */ diff --git a/sys/dev/ic/lan9118.c b/sys/dev/ic/lan9118.c index cd0806950797..845eae2b130c 100644 --- a/sys/dev/ic/lan9118.c +++ b/sys/dev/ic/lan9118.c @@ -1,4 +1,4 @@ -/* $NetBSD: lan9118.c,v 1.15 2012/02/02 19:43:03 tls Exp $ */ +/* $NetBSD: lan9118.c,v 1.16 2012/07/22 14:32:57 matt Exp $ */ /* * Copyright (c) 2008 KIYOHARA Takashi * All rights reserved. @@ -25,7 +25,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: lan9118.c,v 1.15 2012/02/02 19:43:03 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lan9118.c,v 1.16 2012/07/22 14:32:57 matt Exp $"); /* * The LAN9118 Family @@ -92,7 +92,7 @@ static void lan9118_ifm_status(struct ifnet *, struct ifmediareq *); static int lan9118_miibus_readreg(device_t, int, int); static void lan9118_miibus_writereg(device_t, int, int, int); -static void lan9118_miibus_statchg(device_t); +static void lan9118_miibus_statchg(struct ifnet *); static uint16_t lan9118_mii_readreg(struct lan9118_softc *, int, int); static void lan9118_mii_writereg(struct lan9118_softc *, int, int, uint16_t); @@ -754,9 +754,9 @@ lan9118_miibus_writereg(device_t dev, int phy, int reg, int val) } static void -lan9118_miibus_statchg(device_t dev) +lan9118_miibus_statchg(struct ifnet *ifp) { - struct lan9118_softc *sc = device_private(dev); + struct lan9118_softc *sc = ifp->if_softc; u_int cr; cr = lan9118_mac_readreg(sc, LAN9118_MAC_CR); diff --git a/sys/dev/ic/mtd803.c b/sys/dev/ic/mtd803.c index 5b28ff168e34..8e660cfb7136 100644 --- a/sys/dev/ic/mtd803.c +++ b/sys/dev/ic/mtd803.c @@ -1,4 +1,4 @@ -/* $NetBSD: mtd803.c,v 1.25 2012/02/02 19:43:03 tls Exp $ */ +/* $NetBSD: mtd803.c,v 1.26 2012/07/22 14:32:57 matt Exp $ */ /*- * @@ -44,7 +44,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mtd803.c,v 1.25 2012/02/02 19:43:03 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mtd803.c,v 1.26 2012/07/22 14:32:57 matt Exp $"); #include @@ -108,7 +108,7 @@ __KERNEL_RCSID(0, "$NetBSD: mtd803.c,v 1.25 2012/02/02 19:43:03 tls Exp $"); int mtd_mii_readreg(device_t, int, int); void mtd_mii_writereg(device_t, int, int, int); -void mtd_mii_statchg(device_t); +void mtd_mii_statchg(struct ifnet *); void mtd_start(struct ifnet *); void mtd_stop(struct ifnet *, int); @@ -397,7 +397,7 @@ mtd_init_desc(struct mtd_softc *sc) void -mtd_mii_statchg(device_t self) +mtd_mii_statchg(struct ifnet *ifp) { /* Should we do something here? :) */ } diff --git a/sys/dev/ic/rtl8169.c b/sys/dev/ic/rtl8169.c index af846d4150f9..0f9e7a826253 100644 --- a/sys/dev/ic/rtl8169.c +++ b/sys/dev/ic/rtl8169.c @@ -1,4 +1,4 @@ -/* $NetBSD: rtl8169.c,v 1.135 2012/03/02 16:23:40 nonaka Exp $ */ +/* $NetBSD: rtl8169.c,v 1.136 2012/07/22 14:32:57 matt Exp $ */ /* * Copyright (c) 1997, 1998-2003 @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.135 2012/03/02 16:23:40 nonaka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.136 2012/07/22 14:32:57 matt Exp $"); /* $FreeBSD: /repoman/r/ncvs/src/sys/dev/re/if_re.c,v 1.20 2004/04/11 20:34:08 ru Exp $ */ /* @@ -167,7 +167,7 @@ static void re_gmii_writereg(device_t, int, int, int); static int re_miibus_readreg(device_t, int, int); static void re_miibus_writereg(device_t, int, int, int); -static void re_miibus_statchg(device_t); +static void re_miibus_statchg(struct ifnet *); static void re_reset(struct rtk_softc *); @@ -362,7 +362,7 @@ re_miibus_writereg(device_t dev, int phy, int reg, int data) } static void -re_miibus_statchg(device_t dev) +re_miibus_statchg(struct ifnet *ifp) { return; diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c index 4da141316859..a0949c2d81d6 100644 --- a/sys/dev/ic/rtl81x9.c +++ b/sys/dev/ic/rtl81x9.c @@ -1,4 +1,4 @@ -/* $NetBSD: rtl81x9.c,v 1.93 2012/02/02 19:43:03 tls Exp $ */ +/* $NetBSD: rtl81x9.c,v 1.94 2012/07/22 14:32:58 matt Exp $ */ /* * Copyright (c) 1997, 1998 @@ -86,7 +86,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.93 2012/02/02 19:43:03 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.94 2012/07/22 14:32:58 matt Exp $"); #include @@ -135,7 +135,7 @@ static int rtk_mii_writereg(struct rtk_softc *, struct rtk_mii_frame *); static int rtk_phy_readreg(device_t, int, int); static void rtk_phy_writereg(device_t, int, int, int); -static void rtk_phy_statchg(device_t); +static void rtk_phy_statchg(struct ifnet *); static void rtk_tick(void *); static int rtk_enable(struct rtk_softc *); @@ -505,7 +505,7 @@ rtk_phy_writereg(device_t self, int phy, int reg, int data) } static void -rtk_phy_statchg(device_t v) +rtk_phy_statchg(struct ifnet *ifp) { /* Nothing to do. */ diff --git a/sys/dev/ic/smc83c170.c b/sys/dev/ic/smc83c170.c index c047d7cf25e7..588d8b5b24f0 100644 --- a/sys/dev/ic/smc83c170.c +++ b/sys/dev/ic/smc83c170.c @@ -1,4 +1,4 @@ -/* $NetBSD: smc83c170.c,v 1.80 2010/11/13 13:52:02 uebayasi Exp $ */ +/* $NetBSD: smc83c170.c,v 1.81 2012/07/22 14:32:58 matt Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: smc83c170.c,v 1.80 2010/11/13 13:52:02 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smc83c170.c,v 1.81 2012/07/22 14:32:58 matt Exp $"); #include @@ -85,7 +85,7 @@ void epic_mii_write(device_t, int, int, int); int epic_mii_wait(struct epic_softc *, uint32_t); void epic_tick(void *); -void epic_statchg(device_t); +void epic_statchg(struct ifnet *); int epic_mediachange(struct ifnet *); #define INTMASK (INTSTAT_FATAL_INT | INTSTAT_TXU | \ @@ -1381,9 +1381,9 @@ epic_mii_write(device_t self, int phy, int reg, int val) * Callback from PHY when media changes. */ void -epic_statchg(device_t self) +epic_statchg(struct ifnet *ifp) { - struct epic_softc *sc = device_private(self); + struct epic_softc *sc = ifp->if_softc; uint32_t txcon, miicfg; /* @@ -1459,7 +1459,7 @@ epic_mediachange(struct ifnet *ifp) mii->mii_media_active = media; mii->mii_media_status = 0; - epic_statchg(sc->sc_dev); + epic_statchg(mii->mii_ifp); return 0; } diff --git a/sys/dev/ic/smc91cxx.c b/sys/dev/ic/smc91cxx.c index 8a37f2e5be33..7734a1a1479a 100644 --- a/sys/dev/ic/smc91cxx.c +++ b/sys/dev/ic/smc91cxx.c @@ -1,4 +1,4 @@ -/* $NetBSD: smc91cxx.c,v 1.81 2012/02/12 16:34:11 matt Exp $ */ +/* $NetBSD: smc91cxx.c,v 1.82 2012/07/22 14:32:58 matt Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: smc91cxx.c,v 1.81 2012/02/12 16:34:11 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smc91cxx.c,v 1.82 2012/07/22 14:32:58 matt Exp $"); #include "opt_inet.h" @@ -173,7 +173,7 @@ const struct mii_bitbang_ops smc91cxx_mii_bitbang_ops = { /* MII callbacks */ int smc91cxx_mii_readreg(device_t, int, int); void smc91cxx_mii_writereg(device_t, int, int, int); -void smc91cxx_statchg(device_t); +void smc91cxx_statchg(struct ifnet *); void smc91cxx_tick(void *); int smc91cxx_mediachange(struct ifnet *); @@ -1575,9 +1575,9 @@ smc91cxx_mii_writereg(device_t self, int phy, int reg, int val) } void -smc91cxx_statchg(device_t self) +smc91cxx_statchg(struct ifnet *ifp) { - struct smc91cxx_softc *sc = device_private(self); + struct smc91cxx_softc *sc = ifp->if_softc; bus_space_tag_t bst = sc->sc_bst; bus_space_handle_t bsh = sc->sc_bsh; int mctl; diff --git a/sys/dev/ic/tulip.c b/sys/dev/ic/tulip.c index 1230738b00dc..ae59e69ff9f0 100644 --- a/sys/dev/ic/tulip.c +++ b/sys/dev/ic/tulip.c @@ -1,4 +1,4 @@ -/* $NetBSD: tulip.c,v 1.180 2012/02/02 19:43:03 tls Exp $ */ +/* $NetBSD: tulip.c,v 1.181 2012/07/22 14:32:58 matt Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.180 2012/02/02 19:43:03 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.181 2012/07/22 14:32:58 matt Exp $"); #include @@ -107,9 +107,9 @@ static void tlp_rxintr(struct tulip_softc *); static void tlp_txintr(struct tulip_softc *); static void tlp_mii_tick(void *); -static void tlp_mii_statchg(device_t); -static void tlp_winb_mii_statchg(device_t); -static void tlp_dm9102_mii_statchg(device_t); +static void tlp_mii_statchg(struct ifnet *); +static void tlp_winb_mii_statchg(struct ifnet *); +static void tlp_dm9102_mii_statchg(struct ifnet *); static void tlp_mii_getmedia(struct tulip_softc *, struct ifmediareq *); static int tlp_mii_setmedia(struct tulip_softc *); @@ -3213,9 +3213,9 @@ tlp_mii_tick(void *arg) * Callback from PHY when media changes. */ static void -tlp_mii_statchg(device_t self) +tlp_mii_statchg(struct ifnet *ifp) { - struct tulip_softc *sc = device_private(self); + struct tulip_softc *sc = ifp->if_softc; /* Idle the transmit and receive processes. */ tlp_idle(sc, OPMODE_ST|OPMODE_SR); @@ -3244,9 +3244,9 @@ tlp_mii_statchg(device_t self) * for the Winbond 89C840F, which has different OPMODE bits. */ static void -tlp_winb_mii_statchg(device_t self) +tlp_winb_mii_statchg(struct ifnet *ifp) { - struct tulip_softc *sc = device_private(self); + struct tulip_softc *sc = ifp->if_softc; /* Idle the transmit and receive processes. */ tlp_idle(sc, OPMODE_ST|OPMODE_SR); @@ -3273,9 +3273,9 @@ tlp_winb_mii_statchg(device_t self) * for the DM9102. */ static void -tlp_dm9102_mii_statchg(device_t self) +tlp_dm9102_mii_statchg(struct ifnet *ifp) { - struct tulip_softc *sc = device_private(self); + struct tulip_softc *sc = ifp->if_softc; /* * Don't idle the transmit and receive processes, here. It @@ -4583,7 +4583,7 @@ const struct tulip_mediasw tlp_2114x_isv_mediasw = { static void tlp_2114x_nway_get(struct tulip_softc *, struct ifmediareq *); static int tlp_2114x_nway_set(struct tulip_softc *); -static void tlp_2114x_nway_statchg(device_t); +static void tlp_2114x_nway_statchg(struct ifnet *); static int tlp_2114x_nway_service(struct tulip_softc *, int); static void tlp_2114x_nway_auto(struct tulip_softc *); static void tlp_2114x_nway_status(struct tulip_softc *); @@ -5142,9 +5142,9 @@ tlp_2114x_nway_set(struct tulip_softc *sc) } static void -tlp_2114x_nway_statchg(device_t self) +tlp_2114x_nway_statchg(struct ifnet *ifp) { - struct tulip_softc *sc = device_private(self); + struct tulip_softc *sc = ifp->if_softc; struct mii_data *mii = &sc->sc_mii; struct ifmedia_entry *ife; @@ -5261,7 +5261,7 @@ tlp_2114x_nway_service(struct tulip_softc *sc, int cmd) */ if (IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO && ife->ifm_data != mii->mii_media_active) { - (*sc->sc_statchg)(sc->sc_dev); + (*sc->sc_statchg)(mii->mii_ifp); ife->ifm_data = mii->mii_media_active; } return (0); @@ -5454,7 +5454,7 @@ const struct tulip_mediasw tlp_pnic_mediasw = { tlp_pnic_tmsw_init, tlp_pnic_tmsw_get, tlp_pnic_tmsw_set }; -static void tlp_pnic_nway_statchg(device_t); +static void tlp_pnic_nway_statchg(struct ifnet *); static void tlp_pnic_nway_tick(void *); static int tlp_pnic_nway_service(struct tulip_softc *, int); static void tlp_pnic_nway_reset(struct tulip_softc *); @@ -5565,9 +5565,9 @@ tlp_pnic_tmsw_set(struct tulip_softc *sc) } static void -tlp_pnic_nway_statchg(device_t self) +tlp_pnic_nway_statchg(struct ifnet *ifp) { - struct tulip_softc *sc = device_private(self); + struct tulip_softc *sc = ifp->if_softc; /* Idle the transmit and receive processes. */ tlp_idle(sc, OPMODE_ST|OPMODE_SR); @@ -5684,7 +5684,7 @@ tlp_pnic_nway_service(struct tulip_softc *sc, int cmd) if ((sc->sc_nway_active == NULL || sc->sc_nway_active->ifm_media != mii->mii_media_active) || cmd == MII_MEDIACHG) { - (*sc->sc_statchg)(sc->sc_dev); + (*sc->sc_statchg)(mii->mii_ifp); tlp_nway_activate(sc, mii->mii_media_active); } return (0); diff --git a/sys/dev/ic/tulipvar.h b/sys/dev/ic/tulipvar.h index 1a5b9438962a..2cbbc2c29e67 100644 --- a/sys/dev/ic/tulipvar.h +++ b/sys/dev/ic/tulipvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: tulipvar.h,v 1.67 2012/02/02 19:43:04 tls Exp $ */ +/* $NetBSD: tulipvar.h,v 1.68 2012/07/22 14:32:58 matt Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -382,7 +382,7 @@ struct tulip_softc { void (*sc_filter_setup)(struct tulip_softc *); /* Media status update function. */ - void (*sc_statchg)(device_t); + void (*sc_statchg)(struct ifnet *); /* Media tick function. */ void (*sc_tick)(void *); diff --git a/sys/dev/marvell/if_gfe.c b/sys/dev/marvell/if_gfe.c index 48f6c4751c20..1e2c69643857 100644 --- a/sys/dev/marvell/if_gfe.c +++ b/sys/dev/marvell/if_gfe.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_gfe.c,v 1.40 2012/02/02 19:43:04 tls Exp $ */ +/* $NetBSD: if_gfe.c,v 1.41 2012/07/22 14:32:59 matt Exp $ */ /* * Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.40 2012/02/02 19:43:04 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.41 2012/07/22 14:32:59 matt Exp $"); #include "opt_inet.h" @@ -155,7 +155,7 @@ STATIC int gfec_search(device_t, cfdata_t, const int *, void *); STATIC int gfec_enet_phy(device_t, int); STATIC int gfec_mii_read(device_t, int, int); STATIC void gfec_mii_write(device_t, int, int, int); -STATIC void gfec_mii_statchg(device_t); +STATIC void gfec_mii_statchg(struct ifnet *); STATIC int gfe_match(device_t, cfdata_t, void *); STATIC void gfe_attach(device_t, device_t, void *); @@ -379,9 +379,9 @@ gfec_mii_write (device_t dev, int phy, int reg, int value) } void -gfec_mii_statchg(device_t dev) +gfec_mii_statchg(struct ifnet *ifp) { - /* struct gfe_softc *sc = device_private(self); */ + /* struct gfe_softc *sc = ifp->if_softc; */ /* do nothing? */ } diff --git a/sys/dev/marvell/if_mvgbe.c b/sys/dev/marvell/if_mvgbe.c index 3e798765cd79..955f47139f6a 100644 --- a/sys/dev/marvell/if_mvgbe.c +++ b/sys/dev/marvell/if_mvgbe.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_mvgbe.c,v 1.17 2012/07/18 09:21:37 kiyohara Exp $ */ +/* $NetBSD: if_mvgbe.c,v 1.18 2012/07/22 14:32:59 matt Exp $ */ /* * Copyright (c) 2007, 2008 KIYOHARA Takashi * All rights reserved. @@ -25,7 +25,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.17 2012/07/18 09:21:37 kiyohara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.18 2012/07/22 14:32:59 matt Exp $"); #include #include @@ -226,7 +226,7 @@ static int mvgbec_search(device_t, cfdata_t, const int *, void *); /* MII funcstions */ static int mvgbec_miibus_readreg(device_t, int, int); static void mvgbec_miibus_writereg(device_t, int, int, int); -static void mvgbec_miibus_statchg(device_t); +static void mvgbec_miibus_statchg(struct ifnet *); static void mvgbec_wininit(struct mvgbec_softc *); @@ -530,7 +530,7 @@ mvgbec_miibus_writereg(device_t dev, int phy, int reg, int val) } static void -mvgbec_miibus_statchg(device_t dev) +mvgbec_miibus_statchg(struct ifnet *ifp) { /* nothing to do */ diff --git a/sys/dev/mii/mii_physubr.c b/sys/dev/mii/mii_physubr.c index 140953714c6c..5d69a7a399e3 100644 --- a/sys/dev/mii/mii_physubr.c +++ b/sys/dev/mii/mii_physubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: mii_physubr.c,v 1.73 2011/12/10 02:46:07 buhrow Exp $ */ +/* $NetBSD: mii_physubr.c,v 1.74 2012/07/22 14:33:00 matt Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.73 2011/12/10 02:46:07 buhrow Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.74 2012/07/22 14:33:00 matt Exp $"); #include #include @@ -408,7 +408,7 @@ mii_phy_update(struct mii_softc *sc, int cmd) sc->mii_media_status != mii->mii_media_status || cmd == MII_MEDIACHG) { mii_phy_statusmsg(sc); - (*mii->mii_statchg)(device_parent(sc->mii_dev)); + (*mii->mii_statchg)(mii->mii_ifp); sc->mii_media_active = mii->mii_media_active; sc->mii_media_status = mii->mii_media_status; } diff --git a/sys/dev/mii/miivar.h b/sys/dev/mii/miivar.h index 16ddc54c9188..b4c78211b2a1 100644 --- a/sys/dev/mii/miivar.h +++ b/sys/dev/mii/miivar.h @@ -1,4 +1,4 @@ -/* $NetBSD: miivar.h,v 1.59 2010/05/30 17:44:08 pgoyette Exp $ */ +/* $NetBSD: miivar.h,v 1.60 2012/07/22 14:33:00 matt Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -42,6 +42,7 @@ * Media Independent Interface datat structure definitions. */ +struct ifnet; struct mii_softc; /* @@ -49,7 +50,7 @@ struct mii_softc; */ typedef int (*mii_readreg_t)(device_t, int, int); typedef void (*mii_writereg_t)(device_t, int, int, int); -typedef void (*mii_statchg_t)(device_t); +typedef void (*mii_statchg_t)(struct ifnet *); /* * A network interface driver has one of these structures in its softc. diff --git a/sys/dev/pci/if_age.c b/sys/dev/pci/if_age.c index 87d3b6ade717..2f709ccd1456 100644 --- a/sys/dev/pci/if_age.c +++ b/sys/dev/pci/if_age.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_age.c,v 1.40 2011/10/25 21:47:38 bouyer Exp $ */ +/* $NetBSD: if_age.c,v 1.41 2012/07/22 14:33:00 matt Exp $ */ /* $OpenBSD: if_age.c,v 1.1 2009/01/16 05:00:34 kevlo Exp $ */ /*- @@ -31,7 +31,7 @@ /* Driver for Attansic Technology Corp. L1 Gigabit Ethernet. */ #include -__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.40 2011/10/25 21:47:38 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.41 2012/07/22 14:33:00 matt Exp $"); #include "vlan.h" @@ -84,7 +84,7 @@ static bool age_resume(device_t, const pmf_qual_t *); static int age_miibus_readreg(device_t, int, int); static void age_miibus_writereg(device_t, int, int, int); -static void age_miibus_statchg(device_t); +static void age_miibus_statchg(struct ifnet *); static int age_init(struct ifnet *); static int age_ioctl(struct ifnet *, u_long, void *); @@ -404,17 +404,14 @@ age_miibus_writereg(device_t dev, int phy, int reg, int val) * Callback from MII layer when media changes. */ static void -age_miibus_statchg(device_t dev) +age_miibus_statchg(struct ifnet *ifp) { - struct age_softc *sc = device_private(dev); - struct ifnet *ifp = &sc->sc_ec.ec_if; - struct mii_data *mii; + struct age_softc *sc = ifp->if_softc; + struct mii_data *mii = &sc->sc_miibus; if ((ifp->if_flags & IFF_RUNNING) == 0) return; - mii = &sc->sc_miibus; - sc->age_flags &= ~AGE_FLAG_LINK; if ((mii->mii_media_status & IFM_AVALID) != 0) { switch (IFM_SUBTYPE(mii->mii_media_active)) { diff --git a/sys/dev/pci/if_alc.c b/sys/dev/pci/if_alc.c index e7747123e68a..47bc47292ee5 100644 --- a/sys/dev/pci/if_alc.c +++ b/sys/dev/pci/if_alc.c @@ -125,7 +125,7 @@ static void alc_init_tx_ring(struct alc_softc *); static int alc_intr(void *); static void alc_mac_config(struct alc_softc *); static int alc_miibus_readreg(device_t, int, int); -static void alc_miibus_statchg(device_t); +static void alc_miibus_statchg(struct ifnet *); static void alc_miibus_writereg(device_t, int, int, int); static int alc_newbuf(struct alc_softc *, struct alc_rxdesc *, int); static void alc_phy_down(struct alc_softc *); @@ -209,18 +209,15 @@ alc_miibus_writereg(device_t dev, int phy, int reg, int val) } static void -alc_miibus_statchg(device_t dev) +alc_miibus_statchg(struct ifnet *ifp) { - struct alc_softc *sc = device_private(dev); - struct ifnet *ifp = &sc->sc_ec.ec_if; - struct mii_data *mii; + struct alc_softc *sc = ifp->if_softc; + struct mii_data *mii = &sc->sc_miibus; uint32_t reg; if ((ifp->if_flags & IFF_RUNNING) == 0) return; - mii = &sc->sc_miibus; - sc->alc_flags &= ~ALC_FLAG_LINK; if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == (IFM_ACTIVE | IFM_AVALID)) { diff --git a/sys/dev/pci/if_ale.c b/sys/dev/pci/if_ale.c index 457067ac352e..eb69cf628b97 100644 --- a/sys/dev/pci/if_ale.c +++ b/sys/dev/pci/if_ale.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ale.c,v 1.13 2011/01/22 08:13:47 cegger Exp $ */ +/* $NetBSD: if_ale.c,v 1.14 2012/07/22 14:33:01 matt Exp $ */ /*- * Copyright (c) 2008, Pyun YongHyeon @@ -32,7 +32,7 @@ /* Driver for Atheros AR8121/AR8113/AR8114 PCIe Ethernet. */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.13 2011/01/22 08:13:47 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.14 2012/07/22 14:33:01 matt Exp $"); #include "vlan.h" @@ -86,7 +86,7 @@ static int ale_detach(device_t, int); static int ale_miibus_readreg(device_t, int, int); static void ale_miibus_writereg(device_t, int, int, int); -static void ale_miibus_statchg(device_t); +static void ale_miibus_statchg(struct ifnet *); static int ale_init(struct ifnet *); static void ale_start(struct ifnet *); @@ -205,18 +205,15 @@ ale_miibus_writereg(device_t dev, int phy, int reg, int val) } static void -ale_miibus_statchg(device_t dev) +ale_miibus_statchg(struct ifnet *ifp) { - struct ale_softc *sc = device_private(dev); - struct ifnet *ifp = &sc->sc_ec.ec_if; - struct mii_data *mii; + struct ale_softc *sc = ifp->if_softc; + struct mii_data *mii = &sc->sc_miibus; uint32_t reg; if ((ifp->if_flags & IFF_RUNNING) == 0) return; - mii = &sc->sc_miibus; - sc->ale_flags &= ~ALE_FLAG_LINK; if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == (IFM_ACTIVE | IFM_AVALID)) { diff --git a/sys/dev/pci/if_bce.c b/sys/dev/pci/if_bce.c index b7f4590d911b..5e278666b3ab 100644 --- a/sys/dev/pci/if_bce.c +++ b/sys/dev/pci/if_bce.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_bce.c,v 1.36 2012/02/20 02:14:34 mrg Exp $ */ +/* $NetBSD: if_bce.c,v 1.37 2012/07/22 14:33:01 matt Exp $ */ /* * Copyright (c) 2003 Clifford Wright. All rights reserved. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.36 2012/02/20 02:14:34 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.37 2012/07/22 14:33:01 matt Exp $"); #include "vlan.h" @@ -176,7 +176,7 @@ static bool bce_resume(device_t, const pmf_qual_t *); static void bce_set_filter(struct ifnet *); static int bce_mii_read(device_t, int, int); static void bce_mii_write(device_t, int, int, int); -static void bce_statchg(device_t); +static void bce_statchg(struct ifnet *); static void bce_tick(void *); CFATTACH_DECL_NEW(bce, sizeof(struct bce_softc), @@ -1433,9 +1433,9 @@ bce_mii_write(device_t self, int phy, int reg, int val) /* sync hardware duplex mode to software state */ void -bce_statchg(device_t self) +bce_statchg(struct ifnet *ifp) { - struct bce_softc *sc = device_private(self); + struct bce_softc *sc = ifp->if_softc; uint32_t reg; /* if needed, change register to match duplex mode */ diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index d270155e4f96..acc91413e150 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_bge.c,v 1.200 2012/02/02 19:43:05 tls Exp $ */ +/* $NetBSD: if_bge.c,v 1.201 2012/07/22 14:33:01 matt Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -79,7 +79,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.200 2012/02/02 19:43:05 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.201 2012/07/22 14:33:01 matt Exp $"); #include "vlan.h" @@ -249,7 +249,7 @@ static void bge_set_max_readrq(struct bge_softc *); static int bge_miibus_readreg(device_t, int, int); static void bge_miibus_writereg(device_t, int, int, int); -static void bge_miibus_statchg(device_t); +static void bge_miibus_statchg(struct ifnet *); #define BGE_RESET_START 1 #define BGE_RESET_STOP 2 @@ -1052,9 +1052,9 @@ bge_miibus_writereg(device_t dev, int phy, int reg, int val) } static void -bge_miibus_statchg(device_t dev) +bge_miibus_statchg(struct ifnet *ifp) { - struct bge_softc *sc = device_private(dev); + struct bge_softc *sc = ifp->if_softc; struct mii_data *mii = &sc->bge_mii; /* diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c index 5ab778260a63..f2379051d350 100644 --- a/sys/dev/pci/if_bnx.c +++ b/sys/dev/pci/if_bnx.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_bnx.c,v 1.46 2012/03/06 18:29:23 bouyer Exp $ */ +/* $NetBSD: if_bnx.c,v 1.47 2012/07/22 14:33:01 matt Exp $ */ /* $OpenBSD: if_bnx.c,v 1.85 2009/11/09 14:32:41 dlg Exp $ */ /*- @@ -35,7 +35,7 @@ #if 0 __FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $"); #endif -__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.46 2012/03/06 18:29:23 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.47 2012/07/22 14:33:01 matt Exp $"); /* * The following controllers are supported by this driver: @@ -319,7 +319,7 @@ void bnx_reg_wr_ind(struct bnx_softc *, u_int32_t, u_int32_t); void bnx_ctx_wr(struct bnx_softc *, u_int32_t, u_int32_t, u_int32_t); int bnx_miibus_read_reg(device_t, int, int); void bnx_miibus_write_reg(device_t, int, int, int); -void bnx_miibus_statchg(device_t); +void bnx_miibus_statchg(struct ifnet *); /****************************************************************************/ /* BNX NVRAM Access Routines */ @@ -1089,9 +1089,9 @@ bnx_miibus_write_reg(device_t dev, int phy, int reg, int val) /* Nothing. */ /****************************************************************************/ void -bnx_miibus_statchg(device_t dev) +bnx_miibus_statchg(struct ifnet *ifp) { - struct bnx_softc *sc = device_private(dev); + struct bnx_softc *sc = ifp->if_softc; struct mii_data *mii = &sc->bnx_mii; int val; diff --git a/sys/dev/pci/if_cas.c b/sys/dev/pci/if_cas.c index 095dffa362d8..b47cb211ca22 100644 --- a/sys/dev/pci/if_cas.c +++ b/sys/dev/pci/if_cas.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_cas.c,v 1.17 2012/02/03 10:11:07 martin Exp $ */ +/* $NetBSD: if_cas.c,v 1.18 2012/07/22 14:33:02 matt Exp $ */ /* $OpenBSD: if_cas.c,v 1.29 2009/11/29 16:19:38 kettenis Exp $ */ /* @@ -44,7 +44,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_cas.c,v 1.17 2012/02/03 10:11:07 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cas.c,v 1.18 2012/07/22 14:33:02 matt Exp $"); #ifndef _MODULE #include "opt_inet.h" @@ -143,7 +143,7 @@ int cas_encap(struct cas_softc *, struct mbuf *, u_int32_t *); /* MII methods & callbacks */ int cas_mii_readreg(device_t, int, int); void cas_mii_writereg(device_t, int, int, int); -void cas_mii_statchg(device_t); +void cas_mii_statchg(struct ifnet *); int cas_pcs_readreg(device_t, int, int); void cas_pcs_writereg(device_t, int, int, int); @@ -1605,9 +1605,9 @@ cas_mii_writereg(device_t self, int phy, int reg, int val) } void -cas_mii_statchg(device_t self) +cas_mii_statchg(struct ifnet *ifp) { - struct cas_softc *sc = device_private(self); + struct cas_softc *sc = ifp->if_softc; #ifdef CAS_DEBUG int instance = IFM_INST(sc->sc_media.ifm_cur->ifm_media); #endif diff --git a/sys/dev/pci/if_et.c b/sys/dev/pci/if_et.c index 0ced050046e5..bf8639cf5753 100644 --- a/sys/dev/pci/if_et.c +++ b/sys/dev/pci/if_et.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_et.c,v 1.3 2012/01/30 19:41:20 drochner Exp $ */ +/* $NetBSD: if_et.c,v 1.4 2012/07/22 14:33:02 matt Exp $ */ /* $OpenBSD: if_et.c,v 1.11 2008/06/08 06:18:07 jsg Exp $ */ /* * Copyright (c) 2007 The DragonFly Project. All rights reserved. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.3 2012/01/30 19:41:20 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.4 2012/07/22 14:33:02 matt Exp $"); #include "opt_inet.h" #include "vlan.h" @@ -101,7 +101,7 @@ int et_shutdown(device_t); int et_miibus_readreg(device_t, int, int); void et_miibus_writereg(device_t, int, int, int); -void et_miibus_statchg(device_t); +void et_miibus_statchg(struct ifnet *); int et_init(struct ifnet *ifp); int et_ioctl(struct ifnet *, u_long, void *); @@ -451,9 +451,9 @@ et_miibus_writereg(device_t dev, int phy, int reg, int val0) } void -et_miibus_statchg(device_t dev) +et_miibus_statchg(struct ifnet *ifp) { - struct et_softc *sc = device_private(dev); + struct et_softc *sc = ifp->if_softc; struct mii_data *mii = &sc->sc_miibus; uint32_t cfg2, ctrl; diff --git a/sys/dev/pci/if_jme.c b/sys/dev/pci/if_jme.c index 4757d153fe77..a4cd2d9dce0c 100644 --- a/sys/dev/pci/if_jme.c +++ b/sys/dev/pci/if_jme.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_jme.c,v 1.20 2012/06/02 21:36:44 dsl Exp $ */ +/* $NetBSD: if_jme.c,v 1.21 2012/07/22 14:33:02 matt Exp $ */ /* * Copyright (c) 2008 Manuel Bouyer. All rights reserved. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_jme.c,v 1.20 2012/06/02 21:36:44 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_jme.c,v 1.21 2012/07/22 14:33:02 matt Exp $"); #include @@ -206,7 +206,7 @@ static void jme_set_filter(jme_softc_t *); int jme_mii_read(device_t, int, int); void jme_mii_write(device_t, int, int, int); -void jme_statchg(device_t); +void jme_statchg(struct ifnet *); static int jme_eeprom_read_byte(struct jme_softc *, uint8_t, uint8_t *); static int jme_eeprom_macaddr(struct jme_softc *); @@ -1037,10 +1037,8 @@ jme_mii_write(device_t self, int phy, int reg, int val) } void -jme_statchg(device_t self) +jme_statchg(struct ifnet *ifp) { - jme_softc_t *sc = device_private(self); - struct ifnet *ifp = &sc->jme_if; if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) == (IFF_UP|IFF_RUNNING)) jme_init(ifp, 0); } diff --git a/sys/dev/pci/if_lii.c b/sys/dev/pci/if_lii.c index 5b52dff3c07a..897bd569b509 100644 --- a/sys/dev/pci/if_lii.c +++ b/sys/dev/pci/if_lii.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_lii.c,v 1.10 2011/04/20 20:15:03 christos Exp $ */ +/* $NetBSD: if_lii.c,v 1.11 2012/07/22 14:33:02 matt Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_lii.c,v 1.10 2011/04/20 20:15:03 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_lii.c,v 1.11 2012/07/22 14:33:02 matt Exp $"); #include @@ -125,7 +125,7 @@ static int lii_free_tx_space(struct lii_softc *); static int lii_mii_readreg(device_t, int, int); static void lii_mii_writereg(device_t, int, int, int); -static void lii_mii_statchg(device_t); +static void lii_mii_statchg(struct ifnet *); static int lii_media_change(struct ifnet *); static void lii_media_status(struct ifnet *, struct ifmediareq *); @@ -635,9 +635,9 @@ lii_mii_writereg(device_t dev, int phy, int reg, int data) } static void -lii_mii_statchg(device_t dev) +lii_mii_statchg(struct ifnet *ifp) { - struct lii_softc *sc = device_private(dev); + struct lii_softc *sc = ifp->if_softc; uint32_t val; DPRINTF(("lii_mii_statchg\n")); diff --git a/sys/dev/pci/if_msk.c b/sys/dev/pci/if_msk.c index 396acf997527..3d244c433072 100644 --- a/sys/dev/pci/if_msk.c +++ b/sys/dev/pci/if_msk.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_msk.c,v 1.40 2012/06/02 21:36:44 dsl Exp $ */ +/* $NetBSD: if_msk.c,v 1.41 2012/07/22 14:33:02 matt Exp $ */ /* $OpenBSD: if_msk.c,v 1.42 2007/01/17 02:43:02 krw Exp $ */ /* @@ -52,7 +52,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.40 2012/06/02 21:36:44 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.41 2012/07/22 14:33:02 matt Exp $"); #include #include @@ -122,7 +122,7 @@ void msk_update_int_mod(struct sk_softc *, int); int msk_miibus_readreg(device_t, int, int); void msk_miibus_writereg(device_t, int, int, int); -void msk_miibus_statchg(device_t); +void msk_miibus_statchg(struct ifnet *); void msk_setfilt(struct sk_if_softc *, void *, int); void msk_setmulti(struct sk_if_softc *); @@ -275,9 +275,9 @@ msk_miibus_writereg(device_t dev, int phy, int reg, int val) } void -msk_miibus_statchg(device_t dev) +msk_miibus_statchg(struct ifnet *ifp) { - struct sk_if_softc *sc_if = device_private(dev); + struct sk_if_softc *sc_if = ifp->if_softc; struct mii_data *mii = &sc_if->sk_mii; struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int gpcr; @@ -313,7 +313,7 @@ msk_miibus_statchg(device_t dev) SK_YU_WRITE_2(sc_if, YUKON_GPCR, gpcr); DPRINTFN(9, ("msk_miibus_statchg: gpcr=%x\n", - SK_YU_READ_2(((struct sk_if_softc *)dev), YUKON_GPCR))); + SK_YU_READ_2(sc_if, YUKON_GPCR))); } #define HASH_BITS 6 diff --git a/sys/dev/pci/if_nfe.c b/sys/dev/pci/if_nfe.c index 6403da327bb0..3c7d0ee47d53 100644 --- a/sys/dev/pci/if_nfe.c +++ b/sys/dev/pci/if_nfe.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_nfe.c,v 1.55 2012/01/30 19:41:20 drochner Exp $ */ +/* $NetBSD: if_nfe.c,v 1.56 2012/07/22 14:33:03 matt Exp $ */ /* $OpenBSD: if_nfe.c,v 1.77 2008/02/05 16:52:50 brad Exp $ */ /*- @@ -21,7 +21,7 @@ /* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */ #include -__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.55 2012/01/30 19:41:20 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.56 2012/07/22 14:33:03 matt Exp $"); #include "opt_inet.h" #include "vlan.h" @@ -77,7 +77,7 @@ int nfe_match(device_t, cfdata_t, void *); void nfe_attach(device_t, device_t, void *); int nfe_detach(device_t, int); void nfe_power(int, void *); -void nfe_miibus_statchg(device_t); +void nfe_miibus_statchg(struct ifnet *); int nfe_miibus_readreg(device_t, int, int); void nfe_miibus_writereg(device_t, int, int, int); int nfe_intr(void *); @@ -476,9 +476,9 @@ nfe_detach(device_t self, int flags) } void -nfe_miibus_statchg(device_t dev) +nfe_miibus_statchg(struct ifnet *ifp) { - struct nfe_softc *sc = device_private(dev); + struct nfe_softc *sc = ifp->if_softc; struct mii_data *mii = &sc->sc_mii; uint32_t phy, seed, misc = NFE_MISC1_MAGIC, link = NFE_MEDIA_SET; diff --git a/sys/dev/pci/if_pcn.c b/sys/dev/pci/if_pcn.c index 03bc711b478e..fabdd0b0f482 100644 --- a/sys/dev/pci/if_pcn.c +++ b/sys/dev/pci/if_pcn.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_pcn.c,v 1.54 2012/02/02 19:43:05 tls Exp $ */ +/* $NetBSD: if_pcn.c,v 1.55 2012/07/22 14:33:03 matt Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -65,7 +65,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_pcn.c,v 1.54 2012/02/02 19:43:05 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_pcn.c,v 1.55 2012/07/22 14:33:03 matt Exp $"); #include #include @@ -403,7 +403,7 @@ static int pcn_rxintr(struct pcn_softc *); static int pcn_mii_readreg(device_t, int, int); static void pcn_mii_writereg(device_t, int, int, int); -static void pcn_mii_statchg(device_t); +static void pcn_mii_statchg(struct ifnet *); static void pcn_79c970_mediainit(struct pcn_softc *); static int pcn_79c970_mediachange(struct ifnet *); @@ -2183,9 +2183,9 @@ pcn_mii_writereg(device_t self, int phy, int reg, int val) * Callback from MII layer when media changes. */ static void -pcn_mii_statchg(device_t self) +pcn_mii_statchg(struct ifnet *ifp) { - struct pcn_softc *sc = device_private(self); + struct pcn_softc *sc = ifp->if_softc; if ((sc->sc_mii.mii_media_active & IFM_FDX) != 0) pcn_bcr_write(sc, LE_BCR9, LE_B9_FDEN); diff --git a/sys/dev/pci/if_sip.c b/sys/dev/pci/if_sip.c index 4132abc9d78f..1dfbe02d2d6c 100644 --- a/sys/dev/pci/if_sip.c +++ b/sys/dev/pci/if_sip.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_sip.c,v 1.153 2012/02/02 19:43:05 tls Exp $ */ +/* $NetBSD: if_sip.c,v 1.154 2012/07/22 14:33:03 matt Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -73,7 +73,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.153 2012/02/02 19:43:05 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.154 2012/07/22 14:33:03 matt Exp $"); @@ -585,15 +585,15 @@ static void gsip_rxintr(struct sip_softc *); static int sipcom_dp83820_mii_readreg(device_t, int, int); static void sipcom_dp83820_mii_writereg(device_t, int, int, int); -static void sipcom_dp83820_mii_statchg(device_t); +static void sipcom_dp83820_mii_statchg(struct ifnet *); static int sipcom_sis900_mii_readreg(device_t, int, int); static void sipcom_sis900_mii_writereg(device_t, int, int, int); -static void sipcom_sis900_mii_statchg(device_t); +static void sipcom_sis900_mii_statchg(struct ifnet *); static int sipcom_dp83815_mii_readreg(device_t, int, int); static void sipcom_dp83815_mii_writereg(device_t, int, int, int); -static void sipcom_dp83815_mii_statchg(device_t); +static void sipcom_dp83815_mii_statchg(struct ifnet *); static void sipcom_mediastatus(struct ifnet *, struct ifmediareq *); @@ -620,7 +620,7 @@ CFATTACH_DECL3_NEW(sip, sizeof(struct sip_softc), struct sip_variant { int (*sipv_mii_readreg)(device_t, int, int); void (*sipv_mii_writereg)(device_t, int, int, int); - void (*sipv_mii_statchg)(device_t); + void (*sipv_mii_statchg)(struct ifnet *); void (*sipv_set_filter)(struct sip_softc *); void (*sipv_read_macaddr)(struct sip_softc *, const struct pci_attach_args *, u_int8_t *); @@ -3374,9 +3374,9 @@ sipcom_dp83820_mii_writereg(device_t self, int phy, int reg, int val) * Callback from MII layer when media changes. */ static void -sipcom_dp83820_mii_statchg(device_t self) +sipcom_dp83820_mii_statchg(struct ifnet *ifp) { - struct sip_softc *sc = device_private(self); + struct sip_softc *sc = ifp->if_softc; struct mii_data *mii = &sc->sc_mii; u_int32_t cfg, pcr; @@ -3536,9 +3536,9 @@ sipcom_sis900_mii_writereg(device_t self, int phy, int reg, int val) * Callback from MII layer when media changes. */ static void -sipcom_sis900_mii_statchg(device_t self) +sipcom_sis900_mii_statchg(struct ifnet *ifp) { - struct sip_softc *sc = device_private(self); + struct sip_softc *sc = ifp->if_softc; struct mii_data *mii = &sc->sc_mii; u_int32_t flowctl; @@ -3648,9 +3648,9 @@ sipcom_dp83815_mii_writereg(device_t self, int phy, int reg, int val) * Callback from MII layer when media changes. */ static void -sipcom_dp83815_mii_statchg(device_t self) +sipcom_dp83815_mii_statchg(struct ifnet *ifp) { - struct sip_softc *sc = device_private(self); + struct sip_softc *sc = ifp->if_softc; /* * Update TXCFG for full-duplex operation. diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c index 257d536dc688..559424d761c2 100644 --- a/sys/dev/pci/if_sk.c +++ b/sys/dev/pci/if_sk.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_sk.c,v 1.71 2012/06/02 21:36:45 dsl Exp $ */ +/* $NetBSD: if_sk.c,v 1.72 2012/07/22 14:33:03 matt Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -115,7 +115,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_sk.c,v 1.71 2012/06/02 21:36:45 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_sk.c,v 1.72 2012/07/22 14:33:03 matt Exp $"); #include #include @@ -191,11 +191,11 @@ void sk_update_int_mod(struct sk_softc *); int sk_xmac_miibus_readreg(device_t, int, int); void sk_xmac_miibus_writereg(device_t, int, int, int); -void sk_xmac_miibus_statchg(device_t); +void sk_xmac_miibus_statchg(struct ifnet *); int sk_marv_miibus_readreg(device_t, int, int); void sk_marv_miibus_writereg(device_t, int, int, int); -void sk_marv_miibus_statchg(device_t); +void sk_marv_miibus_statchg(struct ifnet *); u_int32_t sk_xmac_hash(void *); u_int32_t sk_yukon_hash(void *); @@ -460,9 +460,9 @@ sk_xmac_miibus_writereg(device_t dev, int phy, int reg, int val) } void -sk_xmac_miibus_statchg(device_t dev) +sk_xmac_miibus_statchg(struct ifnet *ifp) { - struct sk_if_softc *sc_if = device_private(dev); + struct sk_if_softc *sc_if = ifp->if_softc; struct mii_data *mii = &sc_if->sk_mii; DPRINTFN(9, ("sk_xmac_miibus_statchg\n")); @@ -545,10 +545,10 @@ sk_marv_miibus_writereg(device_t dev, int phy, int reg, int val) } void -sk_marv_miibus_statchg(device_t dev) +sk_marv_miibus_statchg(struct ifnet *ifp) { DPRINTFN(9, ("sk_marv_miibus_statchg: gpcr=%x\n", - SK_YU_READ_2(((struct sk_if_softc *)device_private(dev)), + SK_YU_READ_2(((struct sk_if_softc *)ifp->if_softc), YUKON_GPCR))); } diff --git a/sys/dev/pci/if_ste.c b/sys/dev/pci/if_ste.c index 7b3d07e96d61..e9c08bd276c0 100644 --- a/sys/dev/pci/if_ste.c +++ b/sys/dev/pci/if_ste.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ste.c,v 1.42 2010/11/13 13:52:07 uebayasi Exp $ */ +/* $NetBSD: if_ste.c,v 1.43 2012/07/22 14:33:03 matt Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ste.c,v 1.42 2010/11/13 13:52:07 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ste.c,v 1.43 2012/07/22 14:33:03 matt Exp $"); #include @@ -217,7 +217,7 @@ static void ste_rxintr(struct ste_softc *); static int ste_mii_readreg(device_t, int, int); static void ste_mii_writereg(device_t, int, int, int); -static void ste_mii_statchg(device_t); +static void ste_mii_statchg(struct ifnet *); static int ste_match(device_t, cfdata_t, void *); static void ste_attach(device_t, device_t, void *); @@ -1616,9 +1616,9 @@ ste_mii_writereg(device_t self, int phy, int reg, int val) * Callback from MII layer when media changes. */ static void -ste_mii_statchg(device_t self) +ste_mii_statchg(struct ifnet *ifp) { - struct ste_softc *sc = device_private(self); + struct ste_softc *sc = ifp->if_softc; if (sc->sc_mii.mii_media_active & IFM_FDX) sc->sc_MacCtrl0 |= MC0_FullDuplexEnable; diff --git a/sys/dev/pci/if_stge.c b/sys/dev/pci/if_stge.c index f5bc3759e377..8bed7e80102c 100644 --- a/sys/dev/pci/if_stge.c +++ b/sys/dev/pci/if_stge.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_stge.c,v 1.54 2012/01/30 19:41:21 drochner Exp $ */ +/* $NetBSD: if_stge.c,v 1.55 2012/07/22 14:33:04 matt Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.54 2012/01/30 19:41:21 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.55 2012/07/22 14:33:04 matt Exp $"); #include @@ -280,7 +280,7 @@ static void stge_rxintr(struct stge_softc *); static int stge_mii_readreg(device_t, int, int); static void stge_mii_writereg(device_t, int, int, int); -static void stge_mii_statchg(device_t); +static void stge_mii_statchg(struct ifnet *); static int stge_match(device_t, cfdata_t, void *); static void stge_attach(device_t, device_t, void *); @@ -1961,9 +1961,9 @@ stge_mii_writereg(device_t self, int phy, int reg, int val) * Callback from MII layer when media changes. */ static void -stge_mii_statchg(device_t self) +stge_mii_statchg(struct ifnet *ifp) { - struct stge_softc *sc = device_private(self); + struct stge_softc *sc = ifp->if_softc; if (sc->sc_mii.mii_media_active & IFM_FDX) sc->sc_MACCtrl |= MC_DuplexSelect; diff --git a/sys/dev/pci/if_tl.c b/sys/dev/pci/if_tl.c index a96057871c7b..9066a77a3f02 100644 --- a/sys/dev/pci/if_tl.c +++ b/sys/dev/pci/if_tl.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_tl.c,v 1.97 2012/02/02 19:43:05 tls Exp $ */ +/* $NetBSD: if_tl.c,v 1.98 2012/07/22 14:33:04 matt Exp $ */ /* * Copyright (c) 1997 Manuel Bouyer. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_tl.c,v 1.97 2012/02/02 19:43:05 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tl.c,v 1.98 2012/07/22 14:33:04 matt Exp $"); #undef TLDEBUG #define TL_PRIV_STATS @@ -142,7 +142,7 @@ static void ether_printheader(struct ether_header *); int tl_mii_read(device_t, int, int); void tl_mii_write(device_t, int, int, int); -void tl_statchg(device_t); +void tl_statchg(struct ifnet *); /* I2C glue */ static int tl_i2c_acquire_bus(void *, int); @@ -891,9 +891,9 @@ tl_mii_write(device_t self, int phy, int reg, int val) } void -tl_statchg(device_t self) +tl_statchg(struct ifnet *ifp) { - tl_softc_t *sc = device_private(self); + tl_softc_t *sc = ifp->if_softc; uint32_t reg; #ifdef TLDEBUG diff --git a/sys/dev/pci/if_vge.c b/sys/dev/pci/if_vge.c index b2a6c1085eff..167d44c43183 100644 --- a/sys/dev/pci/if_vge.c +++ b/sys/dev/pci/if_vge.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_vge.c,v 1.52 2012/01/30 19:41:21 drochner Exp $ */ +/* $NetBSD: if_vge.c,v 1.53 2012/07/22 14:33:04 matt Exp $ */ /*- * Copyright (c) 2004 @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.52 2012/01/30 19:41:21 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.53 2012/07/22 14:33:04 matt Exp $"); /* * VIA Networking Technologies VT612x PCI gigabit ethernet NIC driver. @@ -325,7 +325,7 @@ static void vge_miipoll_start(struct vge_softc *); static void vge_miipoll_stop(struct vge_softc *); static int vge_miibus_readreg(device_t, int, int); static void vge_miibus_writereg(device_t, int, int, int); -static void vge_miibus_statchg(device_t); +static void vge_miibus_statchg(struct ifnet *); static void vge_cam_clear(struct vge_softc *); static int vge_cam_set(struct vge_softc *, uint8_t *); @@ -1960,15 +1960,12 @@ out: } static void -vge_miibus_statchg(device_t self) +vge_miibus_statchg(struct ifnet *ifp) { - struct vge_softc *sc; - struct mii_data *mii; - struct ifmedia_entry *ife; + struct vge_softc *sc = ifp->if_softc; + struct mii_data *mii = &sc->sc_mii; + struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - sc = device_private(self); - mii = &sc->sc_mii; - ife = mii->mii_media.ifm_cur; /* * If the user manually selects a media mode, we need to turn * on the forced MAC mode bit in the DIAGCTL register. If the diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c index 7faf36dbb21a..7b358e41bd5d 100644 --- a/sys/dev/pci/if_vr.c +++ b/sys/dev/pci/if_vr.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_vr.c,v 1.110 2012/02/02 19:43:05 tls Exp $ */ +/* $NetBSD: if_vr.c,v 1.111 2012/07/22 14:33:04 matt Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.110 2012/02/02 19:43:05 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.111 2012/07/22 14:33:04 matt Exp $"); @@ -303,7 +303,7 @@ static void vr_tick(void *); static int vr_mii_readreg(device_t, int, int); static void vr_mii_writereg(device_t, int, int, int); -static void vr_mii_statchg(device_t); +static void vr_mii_statchg(struct ifnet *); static void vr_setmulti(struct vr_softc *); static void vr_reset(struct vr_softc *); @@ -396,9 +396,9 @@ vr_mii_writereg(device_t self, int phy, int reg, int val) } static void -vr_mii_statchg(device_t self) +vr_mii_statchg(struct ifnet *ifp) { - struct vr_softc *sc = device_private(self); + struct vr_softc *sc = ifp->if_softc; /* * In order to fiddle with the 'full-duplex' bit in the netconfig diff --git a/sys/dev/pci/if_vte.c b/sys/dev/pci/if_vte.c index 0ed4206d81e1..97b8187ca429 100644 --- a/sys/dev/pci/if_vte.c +++ b/sys/dev/pci/if_vte.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_vte.c,v 1.6 2012/06/02 21:36:45 dsl Exp $ */ +/* $NetBSD: if_vte.c,v 1.7 2012/07/22 14:33:04 matt Exp $ */ /* * Copyright (c) 2011 Manuel Bouyer. All rights reserved. @@ -55,7 +55,7 @@ /* Driver for DM&P Electronics, Inc, Vortex86 RDC R6040 FastEthernet. */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.6 2012/06/02 21:36:45 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.7 2012/07/22 14:33:04 matt Exp $"); #include #include @@ -119,7 +119,7 @@ static int vte_intr(void *); static int vte_ifioctl(struct ifnet *, u_long, void *); static void vte_mac_config(struct vte_softc *); static int vte_miibus_readreg(device_t, int, int); -static void vte_miibus_statchg(device_t); +static void vte_miibus_statchg(struct ifnet *); static void vte_miibus_writereg(device_t, int, int, int); static int vte_mediachange(struct ifnet *); static int vte_newbuf(struct vte_softc *, struct vte_rxdesc *); @@ -376,14 +376,11 @@ vte_miibus_writereg(device_t dev, int phy, int reg, int val) } static void -vte_miibus_statchg(device_t dev) +vte_miibus_statchg(struct ifnet *ifp) { - struct vte_softc *sc = device_private(dev); - struct ifnet *ifp; + struct vte_softc *sc = ifp->if_softc; uint16_t val; - ifp = &sc->vte_if; - DPRINTF(("vte_miibus_statchg 0x%x 0x%x\n", sc->vte_mii.mii_media_status, sc->vte_mii.mii_media_active)); @@ -1698,7 +1695,7 @@ vte_sysctl_intrxct(SYSCTLFN_ARGS) return EINVAL; sc->vte_int_rx_mod = t; - vte_miibus_statchg(sc->vte_dev); + vte_miibus_statchg(&sc->vte_if); return 0; } @@ -1720,6 +1717,6 @@ vte_sysctl_inttxct(SYSCTLFN_ARGS) if (t < VTE_IM_BUNDLE_MIN || t > VTE_IM_BUNDLE_MAX) return EINVAL; sc->vte_int_tx_mod = t; - vte_miibus_statchg(sc->vte_dev); + vte_miibus_statchg(&sc->vte_if); return 0; } diff --git a/sys/dev/pci/if_wm.c b/sys/dev/pci/if_wm.c index db32cff5b37a..efa19dc1dd3d 100644 --- a/sys/dev/pci/if_wm.c +++ b/sys/dev/pci/if_wm.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_wm.c,v 1.228 2012/05/25 23:37:38 msaitoh Exp $ */ +/* $NetBSD: if_wm.c,v 1.229 2012/07/22 14:33:04 matt Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. @@ -76,7 +76,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.228 2012/05/25 23:37:38 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.229 2012/07/22 14:33:04 matt Exp $"); #include #include @@ -540,7 +540,7 @@ static void wm_gmii_hv_writereg(device_t, int, int, int); static int wm_sgmii_readreg(device_t, int, int); static void wm_sgmii_writereg(device_t, int, int, int); -static void wm_gmii_statchg(device_t); +static void wm_gmii_statchg(struct ifnet *); static void wm_gmii_mediainit(struct wm_softc *, pci_product_id_t); static int wm_gmii_mediachange(struct ifnet *); @@ -6465,9 +6465,9 @@ wm_sgmii_writereg(device_t self, int phy, int reg, int val) * Callback from MII layer when media changes. */ static void -wm_gmii_statchg(device_t self) +wm_gmii_statchg(struct ifnet *ifp) { - struct wm_softc *sc = device_private(self); + struct wm_softc *sc = ifp->if_softc; struct mii_data *mii = &sc->sc_mii; sc->sc_ctrl &= ~(CTRL_TFCE | CTRL_RFCE); @@ -6494,11 +6494,11 @@ wm_gmii_statchg(device_t self) if (sc->sc_mii.mii_media_active & IFM_FDX) { DPRINTF(WM_DEBUG_LINK, - ("%s: LINK: statchg: FDX\n", device_xname(sc->sc_dev))); + ("%s: LINK: statchg: FDX\n", ifp->if_xname)); sc->sc_tctl |= TCTL_COLD(TX_COLLISION_DISTANCE_FDX); } else { DPRINTF(WM_DEBUG_LINK, - ("%s: LINK: statchg: HDX\n", device_xname(sc->sc_dev))); + ("%s: LINK: statchg: HDX\n", ifp->if_xname)); sc->sc_tctl |= TCTL_COLD(TX_COLLISION_DISTANCE_HDX); } diff --git a/sys/dev/pcmcia/if_xi.c b/sys/dev/pcmcia/if_xi.c index 70167ce2be69..593dc8e8ee2c 100644 --- a/sys/dev/pcmcia/if_xi.c +++ b/sys/dev/pcmcia/if_xi.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_xi.c,v 1.72 2012/02/02 19:43:06 tls Exp $ */ +/* $NetBSD: if_xi.c,v 1.73 2012/07/22 14:33:05 matt Exp $ */ /* OpenBSD: if_xe.c,v 1.9 1999/09/16 11:28:42 niklas Exp */ /* @@ -55,7 +55,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_xi.c,v 1.72 2012/02/02 19:43:06 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_xi.c,v 1.73 2012/07/22 14:33:05 matt Exp $"); #include "opt_inet.h" #include "opt_ipx.h" @@ -153,7 +153,7 @@ STATIC u_int16_t xi_get(struct xi_softc *); STATIC void xi_reset(struct xi_softc *); STATIC void xi_set_address(struct xi_softc *); STATIC void xi_start(struct ifnet *); -STATIC void xi_statchg(device_t); +STATIC void xi_statchg(struct ifnet *); STATIC void xi_stop(struct xi_softc *); STATIC void xi_watchdog(struct ifnet *); @@ -612,7 +612,7 @@ xi_mdi_write(device_t self, int phy, int reg, int value) } STATIC void -xi_statchg(device_t self) +xi_statchg(struct ifnet *ifp) { /* XXX Update ifp->if_baudrate */ } diff --git a/sys/dev/sbus/be.c b/sys/dev/sbus/be.c index a392bb0c8888..d680558fce6c 100644 --- a/sys/dev/sbus/be.c +++ b/sys/dev/sbus/be.c @@ -1,4 +1,4 @@ -/* $NetBSD: be.c,v 1.78 2012/02/02 19:43:06 tls Exp $ */ +/* $NetBSD: be.c,v 1.79 2012/07/22 14:33:05 matt Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: be.c,v 1.78 2012/02/02 19:43:06 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: be.c,v 1.79 2012/07/22 14:33:05 matt Exp $"); #include "opt_ddb.h" #include "opt_inet.h" @@ -184,7 +184,7 @@ static void be_mcreset(struct be_softc *); /* MII methods & callbacks */ static int be_mii_readreg(device_t, int, int); static void be_mii_writereg(device_t, int, int, int); -static void be_mii_statchg(device_t); +static void be_mii_statchg(struct ifnet *); /* MII helpers */ static void be_mii_sync(struct be_softc *); @@ -1383,9 +1383,9 @@ be_tick(void *arg) } void -be_mii_statchg(device_t self) +be_mii_statchg(struct ifnet *ifp) { - struct be_softc *sc = device_private(self); + struct be_softc *sc = ifp->if_softc; bus_space_tag_t t = sc->sc_bustag; bus_space_handle_t br = sc->sc_br; uint instance; @@ -1590,7 +1590,7 @@ be_intphy_service(struct be_softc *sc, struct mii_data *mii, int cmd) /* Callback if something changed. */ if (sc->sc_mii_active != mii->mii_media_active || cmd == MII_MEDIACHG) { - (*mii->mii_statchg)(self); + (*mii->mii_statchg)(mii->mii_ifp); sc->sc_mii_active = mii->mii_media_active; } return 0; diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index 4000b6fba270..ada235cf0a42 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_aue.c,v 1.126 2012/03/11 01:06:06 mrg Exp $ */ +/* $NetBSD: if_aue.c,v 1.127 2012/07/22 14:33:05 matt Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -78,7 +78,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.126 2012/03/11 01:06:06 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.127 2012/07/22 14:33:05 matt Exp $"); #include "opt_inet.h" @@ -239,7 +239,7 @@ Static int aue_eeprom_getword(struct aue_softc *, int); Static void aue_read_mac(struct aue_softc *, u_char *); Static int aue_miibus_readreg(device_t, int, int); Static void aue_miibus_writereg(device_t, int, int, int); -Static void aue_miibus_statchg(device_t); +Static void aue_miibus_statchg(struct ifnet *); Static void aue_lock_mii(struct aue_softc *); Static void aue_unlock_mii(struct aue_softc *); @@ -516,10 +516,10 @@ aue_miibus_writereg(device_t dev, int phy, int reg, int data) } Static void -aue_miibus_statchg(device_t dev) +aue_miibus_statchg(struct ifnet *ifp) { - struct aue_softc *sc = device_private(dev); - struct mii_data *mii = GET_MII(sc); + struct aue_softc *sc = ifp->if_softc; + struct mii_data *mii = GET_MII(sc); DPRINTFN(5,("%s: %s: enter\n", device_xname(sc->aue_dev), __func__)); @@ -547,8 +547,8 @@ aue_miibus_statchg(device_t dev) */ if (!sc->aue_dying && (sc->aue_flags & LSYS)) { u_int16_t auxmode; - auxmode = aue_miibus_readreg(dev, 0, 0x1b); - aue_miibus_writereg(dev, 0, 0x1b, auxmode | 0x04); + auxmode = aue_miibus_readreg(sc->aue_dev, 0, 0x1b); + aue_miibus_writereg(sc->aue_dev, 0, 0x1b, auxmode | 0x04); } DPRINTFN(5,("%s: %s: exit\n", device_xname(sc->aue_dev), __func__)); } diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c index aea07c90fca6..c6ebaa82cbcb 100644 --- a/sys/dev/usb/if_axe.c +++ b/sys/dev/usb/if_axe.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_axe.c,v 1.55 2012/06/01 12:38:25 nonaka Exp $ */ +/* $NetBSD: if_axe.c,v 1.56 2012/07/22 14:33:05 matt Exp $ */ /* $OpenBSD: if_axe.c,v 1.96 2010/01/09 05:33:08 jsg Exp $ */ /* @@ -89,7 +89,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.55 2012/06/01 12:38:25 nonaka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.56 2012/07/22 14:33:05 matt Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -193,7 +193,7 @@ static void axe_stop(struct ifnet *, int); static void axe_watchdog(struct ifnet *); static int axe_miibus_readreg(device_t, int, int); static void axe_miibus_writereg(device_t, int, int, int); -static void axe_miibus_statchg(device_t); +static void axe_miibus_statchg(struct ifnet *); static int axe_cmd(struct axe_softc *, int, int, int, void *); static void axe_reset(struct axe_softc *sc); static int axe_ifmedia_upd(struct ifnet *); @@ -321,9 +321,9 @@ axe_miibus_writereg(device_t dev, int phy, int reg, int aval) } static void -axe_miibus_statchg(device_t dev) +axe_miibus_statchg(struct ifnet *ifp) { - struct axe_softc *sc = device_private(dev); + struct axe_softc *sc = ifp->if_softc; struct mii_data *mii = &sc->axe_mii; int val, err; diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c index ad04e67b6348..f214eccd8694 100644 --- a/sys/dev/usb/if_udav.c +++ b/sys/dev/usb/if_udav.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_udav.c,v 1.37 2012/03/11 01:06:06 mrg Exp $ */ +/* $NetBSD: if_udav.c,v 1.38 2012/07/22 14:33:05 matt Exp $ */ /* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */ /* @@ -45,7 +45,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.37 2012/03/11 01:06:06 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.38 2012/07/22 14:33:05 matt Exp $"); #include "opt_inet.h" @@ -110,7 +110,7 @@ Static void udav_lock_mii(struct udav_softc *); Static void udav_unlock_mii(struct udav_softc *); Static int udav_miibus_readreg(device_t, int, int); Static void udav_miibus_writereg(device_t, int, int, int); -Static void udav_miibus_statchg(device_t); +Static void udav_miibus_statchg(struct ifnet *); Static int udav_init(struct ifnet *); Static void udav_setmulti(struct udav_softc *); Static void udav_reset(struct udav_softc *); @@ -1578,16 +1578,14 @@ udav_miibus_writereg(device_t dev, int phy, int reg, int data) } Static void -udav_miibus_statchg(device_t dev) +udav_miibus_statchg(struct ifnet *ifp) { #ifdef UDAV_DEBUG - struct udav_softc *sc; - if (dev == NULL) + if (ifp == NULL) return; - sc = device_private(dev); - DPRINTF(("%s: %s: enter\n", device_xname(sc->sc_dev), __func__)); + DPRINTF(("%s: %s: enter\n", ifp->if_xname, __func__)); #endif /* Nothing to do */ } diff --git a/sys/dev/usb/if_url.c b/sys/dev/usb/if_url.c index bd0d61ba11de..a8d86a2989d4 100644 --- a/sys/dev/usb/if_url.c +++ b/sys/dev/usb/if_url.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_url.c,v 1.43 2012/03/11 01:06:07 mrg Exp $ */ +/* $NetBSD: if_url.c,v 1.44 2012/07/22 14:33:06 matt Exp $ */ /* * Copyright (c) 2001, 2002 @@ -44,7 +44,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.43 2012/03/11 01:06:07 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.44 2012/07/22 14:33:06 matt Exp $"); #include "opt_inet.h" @@ -111,7 +111,7 @@ Static void url_lock_mii(struct url_softc *); Static void url_unlock_mii(struct url_softc *); Static int url_int_miibus_readreg(device_t, int, int); Static void url_int_miibus_writereg(device_t, int, int, int); -Static void url_miibus_statchg(device_t); +Static void url_miibus_statchg(struct ifnet *); Static int url_init(struct ifnet *); Static void url_setmulti(struct url_softc *); Static void url_reset(struct url_softc *); @@ -1484,16 +1484,13 @@ url_int_miibus_writereg(device_t dev, int phy, int reg, int data) } Static void -url_miibus_statchg(device_t dev) +url_miibus_statchg(struct ifnet *ifp) { #ifdef URL_DEBUG - struct url_softc *sc; - - if (dev == NULL) + if (ifp == NULL) return; - sc = device_private(dev); - DPRINTF(("%s: %s: enter\n", device_xname(sc->sc_dev), __func__)); + DPRINTF(("%s: %s: enter\n", ifp->if_xname, __func__)); #endif /* Nothing to do */ }