diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2005-08-09 10:20:02 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2005-08-09 10:20:02 +0000 |
| commit | 13f4c340aeeeb104844712bb36899d1adef50579 (patch) | |
| tree | bb70e59641e2310a3c26ec449af5ab0cb7420d9d /sys/dev/usb | |
| parent | 292ee7be1c404a624dda68ddff1bd988a1851e5a (diff) | |
Notes
Diffstat (limited to 'sys/dev/usb')
| -rw-r--r-- | sys/dev/usb/if_aue.c | 28 | ||||
| -rw-r--r-- | sys/dev/usb/if_axe.c | 26 | ||||
| -rw-r--r-- | sys/dev/usb/if_cdce.c | 30 | ||||
| -rw-r--r-- | sys/dev/usb/if_cue.c | 26 | ||||
| -rw-r--r-- | sys/dev/usb/if_kue.c | 26 | ||||
| -rw-r--r-- | sys/dev/usb/if_rue.c | 28 | ||||
| -rw-r--r-- | sys/dev/usb/if_udav.c | 41 | ||||
| -rw-r--r-- | sys/dev/usb/if_ural.c | 23 |
8 files changed, 130 insertions, 98 deletions
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index af5fe5f46f32..5112d7b4e6a2 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -818,7 +818,7 @@ aue_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) AUE_LOCK(sc); ifp = sc->aue_ifp; - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { AUE_UNLOCK(sc); return; } @@ -897,7 +897,7 @@ aue_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) AUE_LOCK(sc); ifp = sc->aue_ifp; - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { AUE_UNLOCK(sc); return; } @@ -986,7 +986,7 @@ aue_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) } ifp->if_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; usbd_get_xfer_status(c->ue_xfer, NULL, NULL, NULL, &err); if (c->ue_mbuf != NULL) { @@ -1095,7 +1095,7 @@ aue_start(struct ifnet *ifp) return; } - if (ifp->if_flags & IFF_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { AUE_UNLOCK(sc); return; } @@ -1108,7 +1108,7 @@ aue_start(struct ifnet *ifp) if (aue_encap(sc, m_head, 0)) { IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; AUE_UNLOCK(sc); return; } @@ -1119,7 +1119,7 @@ aue_start(struct ifnet *ifp) */ BPF_MTAP(ifp, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; /* * Set a timeout in case the chip goes out to lunch. @@ -1142,7 +1142,7 @@ aue_init(void *xsc) AUE_LOCK(sc); - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { AUE_UNLOCK(sc); return; } @@ -1232,8 +1232,8 @@ aue_init(void *xsc) usbd_transfer(c->ue_xfer); } - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->aue_stat_ch = timeout(aue_tick, sc, hz); @@ -1291,18 +1291,18 @@ aue_ioctl(struct ifnet *ifp, u_long command, caddr_t data) switch(command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->aue_if_flags & IFF_PROMISC)) { AUE_SETBIT(sc, AUE_CTL2, AUE_CTL2_RX_PROMISC); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->aue_if_flags & IFF_PROMISC) { AUE_CLRBIT(sc, AUE_CTL2, AUE_CTL2_RX_PROMISC); - } else if (!(ifp->if_flags & IFF_RUNNING)) + } else if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) aue_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) aue_stop(sc); } sc->aue_if_flags = ifp->if_flags; @@ -1426,7 +1426,7 @@ aue_stop(struct aue_softc *sc) sc->aue_link = 0; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); AUE_UNLOCK(sc); return; diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c index c5493900d83a..349c917069bd 100644 --- a/sys/dev/usb/if_axe.c +++ b/sys/dev/usb/if_axe.c @@ -612,7 +612,7 @@ axe_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) AXE_LOCK(sc); ifp = sc->axe_ifp; - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { AXE_UNLOCK(sc); return; } @@ -691,7 +691,7 @@ axe_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) } ifp->if_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; usbd_get_xfer_status(c->ue_xfer, NULL, NULL, NULL, &err); if (c->ue_mbuf != NULL) { @@ -791,7 +791,7 @@ axe_start(struct ifnet *ifp) return; } - if (ifp->if_flags & IFF_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { AXE_UNLOCK(sc); return; } @@ -804,7 +804,7 @@ axe_start(struct ifnet *ifp) if (axe_encap(sc, m_head, 0)) { IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; AXE_UNLOCK(sc); return; } @@ -815,7 +815,7 @@ axe_start(struct ifnet *ifp) */ BPF_MTAP(ifp, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; /* * Set a timeout in case the chip goes out to lunch. @@ -836,7 +836,7 @@ axe_init(void *xsc) int i; int rxmode; - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) return; AXE_LOCK(sc); @@ -918,8 +918,8 @@ axe_init(void *xsc) usbd_transfer(c->ue_xfer); } - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; AXE_UNLOCK(sc); @@ -940,7 +940,7 @@ axe_ioctl(struct ifnet *ifp, u_long command, caddr_t data) switch(command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->axe_if_flags & IFF_PROMISC)) { AXE_LOCK(sc); @@ -951,7 +951,7 @@ axe_ioctl(struct ifnet *ifp, u_long command, caddr_t data) 0, rxmode, NULL); AXE_UNLOCK(sc); axe_setmulti(sc); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->axe_if_flags & IFF_PROMISC) { AXE_LOCK(sc); @@ -962,10 +962,10 @@ axe_ioctl(struct ifnet *ifp, u_long command, caddr_t data) 0, rxmode, NULL); AXE_UNLOCK(sc); axe_setmulti(sc); - } else if (!(ifp->if_flags & IFF_RUNNING)) + } else if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) axe_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) axe_stop(sc); } sc->axe_if_flags = ifp->if_flags; @@ -1084,7 +1084,7 @@ axe_stop(struct axe_softc *sc) /* Free TX resources. */ usb_ether_tx_list_free(&sc->axe_cdata); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); sc->axe_link = 0; AXE_UNLOCK(sc); diff --git a/sys/dev/usb/if_cdce.c b/sys/dev/usb/if_cdce.c index fabbbbeabdc2..b44b2991e6d3 100644 --- a/sys/dev/usb/if_cdce.c +++ b/sys/dev/usb/if_cdce.c @@ -322,7 +322,7 @@ USB_DETACH(cdce) CDCE_LOCK(sc); sc->cdce_dying = 1; ifp = GET_IFP(sc); - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) cdce_shutdown(sc->cdce_dev); ether_ifdetach(ifp); @@ -344,8 +344,8 @@ cdce_start(struct ifnet *ifp) if (sc->cdce_dying || - ifp->if_flags & IFF_OACTIVE || - !(ifp->if_flags & IFF_RUNNING)) { + ifp->if_drv_flags & IFF_DRV_OACTIVE || + !(ifp->if_drv_flags & IFF_DRV_RUNNING)) { CDCE_UNLOCK(sc); return; } @@ -358,14 +358,14 @@ cdce_start(struct ifnet *ifp) if (cdce_encap(sc, m_head, 0)) { IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; CDCE_UNLOCK(sc); return; } BPF_MTAP(ifp, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; CDCE_UNLOCK(sc); @@ -445,7 +445,7 @@ cdce_stop(struct cdce_softc *sc) usb_ether_rx_list_free(&sc->cdce_cdata); usb_ether_tx_list_free(&sc->cdce_cdata); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); CDCE_UNLOCK(sc); return; @@ -474,10 +474,10 @@ cdce_ioctl(struct ifnet *ifp, u_long command, caddr_t data) switch(command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (!(ifp->if_flags & IFF_RUNNING)) + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) cdce_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) cdce_stop(sc); } error = 0; @@ -507,7 +507,7 @@ cdce_init(void *xsc) usbd_status err; int i; - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) return; CDCE_LOCK(sc); @@ -555,8 +555,8 @@ cdce_init(void *xsc) usbd_transfer(c->ue_xfer); } - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; CDCE_UNLOCK(sc); @@ -575,7 +575,7 @@ cdce_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) CDCE_LOCK(sc); ifp = GET_IFP(sc); - if (sc->cdce_dying || !(ifp->if_flags & IFF_RUNNING)) { + if (sc->cdce_dying || !(ifp->if_drv_flags & IFF_DRV_RUNNING)) { CDCE_UNLOCK(sc); return; } @@ -643,7 +643,7 @@ cdce_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) ifp = GET_IFP(sc); if (sc->cdce_dying || - !(ifp->if_flags & IFF_RUNNING)) { + !(ifp->if_drv_flags & IFF_DRV_RUNNING)) { CDCE_UNLOCK(sc); return; } @@ -662,7 +662,7 @@ cdce_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) return; } - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; usbd_get_xfer_status(c->ue_xfer, NULL, NULL, NULL, &err); if (c->ue_mbuf != NULL) { @@ -690,7 +690,7 @@ cdce_rxstart(struct ifnet *ifp) sc = ifp->if_softc; CDCE_LOCK(sc); - if (sc->cdce_dying || !(ifp->if_flags & IFF_RUNNING)) { + if (sc->cdce_dying || !(ifp->if_drv_flags & IFF_DRV_RUNNING)) { CDCE_UNLOCK(sc); return; } diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c index ae219579a72c..e5970513dac8 100644 --- a/sys/dev/usb/if_cue.c +++ b/sys/dev/usb/if_cue.c @@ -620,7 +620,7 @@ cue_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) CUE_LOCK(sc); ifp = sc->cue_ifp; - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { CUE_UNLOCK(sc); return; } @@ -704,7 +704,7 @@ cue_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) } ifp->if_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; usbd_get_xfer_status(c->ue_xfer, NULL, NULL, NULL, &err); if (c->ue_mbuf != NULL) { @@ -798,7 +798,7 @@ cue_start(struct ifnet *ifp) sc = ifp->if_softc; CUE_LOCK(sc); - if (ifp->if_flags & IFF_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { CUE_UNLOCK(sc); return; } @@ -811,7 +811,7 @@ cue_start(struct ifnet *ifp) if (cue_encap(sc, m_head, 0)) { IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; CUE_UNLOCK(sc); return; } @@ -822,7 +822,7 @@ cue_start(struct ifnet *ifp) */ BPF_MTAP(ifp, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; /* * Set a timeout in case the chip goes out to lunch. @@ -842,7 +842,7 @@ cue_init(void *xsc) usbd_status err; int i; - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) return; CUE_LOCK(sc); @@ -928,8 +928,8 @@ cue_init(void *xsc) usbd_transfer(c->ue_xfer); } - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; CUE_UNLOCK(sc); @@ -949,20 +949,20 @@ cue_ioctl(struct ifnet *ifp, u_long command, caddr_t data) switch(command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->cue_if_flags & IFF_PROMISC)) { CUE_SETBIT(sc, CUE_ETHCTL, CUE_ETHCTL_PROMISC); cue_setmulti(sc); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->cue_if_flags & IFF_PROMISC) { CUE_CLRBIT(sc, CUE_ETHCTL, CUE_ETHCTL_PROMISC); cue_setmulti(sc); - } else if (!(ifp->if_flags & IFF_RUNNING)) + } else if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) cue_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) cue_stop(sc); } sc->cue_if_flags = ifp->if_flags; @@ -1074,7 +1074,7 @@ cue_stop(struct cue_softc *sc) /* Free TX resources. */ usb_ether_tx_list_free(&sc->cue_cdata); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); CUE_UNLOCK(sc); return; diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index fce9adf95aad..f8c9d9548525 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -598,7 +598,7 @@ Static void kue_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, KUE_LOCK(sc); ifp = sc->kue_ifp; - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { KUE_UNLOCK(sc); return; } @@ -672,7 +672,7 @@ kue_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) ifp = sc->kue_ifp; ifp->if_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (status != USBD_NORMAL_COMPLETION) { if (status == USBD_NOT_STARTED || status == USBD_CANCELLED) { @@ -752,7 +752,7 @@ kue_start(struct ifnet *ifp) sc = ifp->if_softc; KUE_LOCK(sc); - if (ifp->if_flags & IFF_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { KUE_UNLOCK(sc); return; } @@ -765,7 +765,7 @@ kue_start(struct ifnet *ifp) if (kue_encap(sc, m_head, 0)) { IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; KUE_UNLOCK(sc); return; } @@ -776,7 +776,7 @@ kue_start(struct ifnet *ifp) */ BPF_MTAP(ifp, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; /* * Set a timeout in case the chip goes out to lunch. @@ -798,7 +798,7 @@ kue_init(void *xsc) KUE_LOCK(sc); - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { KUE_UNLOCK(sc); return; } @@ -872,8 +872,8 @@ kue_init(void *xsc) usbd_transfer(c->ue_xfer); } - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; KUE_UNLOCK(sc); @@ -891,22 +891,22 @@ kue_ioctl(struct ifnet *ifp, u_long command, caddr_t data) switch(command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->kue_if_flags & IFF_PROMISC)) { sc->kue_rxfilt |= KUE_RXFILT_PROMISC; kue_setword(sc, KUE_CMD_SET_PKT_FILTER, sc->kue_rxfilt); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->kue_if_flags & IFF_PROMISC) { sc->kue_rxfilt &= ~KUE_RXFILT_PROMISC; kue_setword(sc, KUE_CMD_SET_PKT_FILTER, sc->kue_rxfilt); - } else if (!(ifp->if_flags & IFF_RUNNING)) + } else if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) kue_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) kue_stop(sc); } sc->kue_if_flags = ifp->if_flags; @@ -1012,7 +1012,7 @@ kue_stop(struct kue_softc *sc) /* Free TX resources. */ usb_ether_tx_list_free(&sc->kue_cdata); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); KUE_UNLOCK(sc); return; diff --git a/sys/dev/usb/if_rue.c b/sys/dev/usb/if_rue.c index e544e11f94ec..ff6551ab3519 100644 --- a/sys/dev/usb/if_rue.c +++ b/sys/dev/usb/if_rue.c @@ -766,7 +766,7 @@ rue_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) RUE_LOCK(sc); ifp = sc->rue_ifp; - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { RUE_UNLOCK(sc); return; } @@ -842,7 +842,7 @@ rue_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) RUE_LOCK(sc); ifp = sc->rue_ifp; - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { RUE_UNLOCK(sc); return; } @@ -929,7 +929,7 @@ rue_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) } ifp->if_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; usbd_get_xfer_status(c->ue_xfer, NULL, NULL, NULL, &err); if (c->ue_mbuf != NULL) { @@ -1032,7 +1032,7 @@ rue_start(struct ifnet *ifp) return; } - if (ifp->if_flags & IFF_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { RUE_UNLOCK(sc); return; } @@ -1045,7 +1045,7 @@ rue_start(struct ifnet *ifp) if (rue_encap(sc, m_head, 0)) { IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; RUE_UNLOCK(sc); return; } @@ -1056,7 +1056,7 @@ rue_start(struct ifnet *ifp) */ BPF_MTAP(ifp, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; /* * Set a timeout in case the chip goes out to lunch. @@ -1079,7 +1079,7 @@ rue_init(void *xsc) RUE_LOCK(sc); - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { RUE_UNLOCK(sc); return; } @@ -1183,8 +1183,8 @@ rue_init(void *xsc) usbd_transfer(c->ue_xfer); } - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->rue_stat_ch = timeout(rue_tick, sc, hz); @@ -1240,22 +1240,22 @@ rue_ioctl(struct ifnet *ifp, u_long command, caddr_t data) switch (command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->rue_if_flags & IFF_PROMISC)) { RUE_SETBIT_2(sc, RUE_RCR, (RUE_RCR_AAM | RUE_RCR_AAP)); rue_setmulti(sc); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->rue_if_flags & IFF_PROMISC) { RUE_CLRBIT_2(sc, RUE_RCR, (RUE_RCR_AAM | RUE_RCR_AAP)); rue_setmulti(sc); - } else if (!(ifp->if_flags & IFF_RUNNING)) + } else if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) rue_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) rue_stop(sc); } sc->rue_if_flags = ifp->if_flags; @@ -1381,7 +1381,7 @@ rue_stop(struct rue_softc *sc) sc->rue_link = 0; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); RUE_UNLOCK(sc); } diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c index 19f64cb9211a..690c9ded613a 100644 --- a/sys/dev/usb/if_udav.c +++ b/sys/dev/usb/if_udav.c @@ -519,7 +519,11 @@ USB_DETACH(udav) /* Wait for processes to go away */ usb_detach_wait(USBDEV(sc->sc_dev)); } +#if defined(__FreeBSD__) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) +#else if (ifp->if_flags & IFF_RUNNING) +#endif udav_stop(GET_IFP(sc), 1); #if NRND > 0 @@ -913,8 +917,13 @@ udav_init(void *xsc) } } +#if defined(__FreeBSD__) + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; +#else ifp->if_flags |= IFF_RUNNING; ifp->if_flags &= ~IFF_OACTIVE; +#endif #if defined(__NetBSD__) splx(s); @@ -1151,7 +1160,11 @@ udav_start(struct ifnet *ifp) if (!sc->sc_link) return; +#if defined(__FreeBSD__) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) +#else if (ifp->if_flags & IFF_OACTIVE) +#endif return; #if defined(__NetBSD__) IFQ_POLL(&ifp->if_snd, m_head); @@ -1164,8 +1177,10 @@ udav_start(struct ifnet *ifp) if (udav_send(sc, m_head, 0)) { #if defined(__FreeBSD__) IF_PREPEND(&ifp->if_snd, m_head); -#endif + ifp->if_drv_flags |= IFF_DRV_OACTIVE; +#else ifp->if_flags |= IFF_OACTIVE; +#endif return; } @@ -1177,7 +1192,11 @@ udav_start(struct ifnet *ifp) BPF_MTAP(ifp, m_head); #endif +#if defined(__FreeBSD__) + ifp->if_drv_flags |= IFF_DRV_OACTIVE; +#else ifp->if_flags |= IFF_OACTIVE; +#endif /* Set a timeout in case the chip goes out to lunch. */ ifp->if_timer = 5; @@ -1257,7 +1276,11 @@ udav_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) DPRINTF(("%s: %s: enter\n", USBDEVNAME(sc->sc_dev), __func__)); ifp->if_timer = 0; +#if defined(__FreeBSD__) + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; +#else ifp->if_flags &= ~IFF_OACTIVE; +#endif if (status != USBD_NORMAL_COMPLETION) { if (status == USBD_NOT_STARTED || status == USBD_CANCELLED) { @@ -1458,11 +1481,11 @@ udav_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) #if defined(__FreeBSD__) case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC) { UDAV_SETBIT(sc, UDAV_RCR, UDAV_RCR_ALL|UDAV_RCR_PRMSC); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC)) { if (ifp->if_flags & IFF_ALLMULTI) UDAV_CLRBIT(sc, UDAV_RCR, @@ -1470,10 +1493,10 @@ udav_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) else UDAV_CLRBIT(sc, UDAV_RCR, UDAV_RCR_ALL|UDAV_RCR_PRMSC); - } else if (!(ifp->if_flags & IFF_RUNNING)) + } else if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) udav_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) udav_stop(ifp, 1); } error = 0; @@ -1617,7 +1640,11 @@ udav_stop(struct ifnet *ifp, int disable) usb_ether_tx_list_free(&sc->sc_cdata); sc->sc_link = 0; +#if defined(__FreeBSD__) + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); +#else ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); +#endif } /* Set media options */ @@ -1655,7 +1682,11 @@ udav_ifmedia_status(struct ifnet *ifp, struct ifmediareq *ifmr) if (sc->sc_dying) return; +#if defined(__FreeBSD__) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { +#else if ((ifp->if_flags & IFF_RUNNING) == 0) { +#endif ifmr->ifm_active = IFM_ETHER | IFM_NONE; ifmr->ifm_status = 0; return; diff --git a/sys/dev/usb/if_ural.c b/sys/dev/usb/if_ural.c index 239dc22ec1c9..00836523592d 100644 --- a/sys/dev/usb/if_ural.c +++ b/sys/dev/usb/if_ural.c @@ -677,7 +677,8 @@ ural_media_change(struct ifnet *ifp) return error; } - if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == (IFF_UP | IFF_RUNNING)) + if ((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) ural_init(sc); RAL_UNLOCK(sc); @@ -820,7 +821,7 @@ ural_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) DPRINTFN(10, ("tx done\n")); sc->sc_tx_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ural_start(ifp); } @@ -1275,7 +1276,7 @@ ural_start(struct ifnet *ifp) IF_POLL(&ic->ic_mgtq, m0); if (m0 != NULL) { if (sc->tx_queued >= RAL_TX_LIST_COUNT) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } IF_DEQUEUE(&ic->ic_mgtq, m0); @@ -1297,7 +1298,7 @@ ural_start(struct ifnet *ifp) break; if (sc->tx_queued >= RAL_TX_LIST_COUNT) { IFQ_DRV_PREPEND(&ifp->if_snd, m0); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -1391,12 +1392,12 @@ ural_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) switch (cmd) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) ural_update_promisc(sc); else ural_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) ural_stop(sc); } break; @@ -1406,8 +1407,8 @@ ural_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } if (error == ENETRESET) { - if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == - (IFF_UP | IFF_RUNNING)) + if ((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) ural_init(sc); error = 0; } @@ -2033,8 +2034,8 @@ ural_init(void *priv) } ural_write(sc, RAL_TXRX_CSR2, tmp); - ifp->if_flags &= ~IFF_OACTIVE; - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; if (ic->ic_opmode == IEEE80211_M_MONITOR) ieee80211_new_state(ic, IEEE80211_S_RUN, -1); @@ -2058,7 +2059,7 @@ ural_stop(void *priv) sc->sc_tx_timer = 0; ifp->if_timer = 0; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); /* disable Rx */ ural_write(sc, RAL_TXRX_CSR2, RAL_DISABLE_RX); |
