diff options
author | archie <archie@FreeBSD.org> | 2000-07-13 22:54:34 +0000 |
---|---|---|
committer | archie <archie@FreeBSD.org> | 2000-07-13 22:54:34 +0000 |
commit | 7357df6b4854f9914c605ad7c7cf3c01ea7700fd (patch) | |
tree | f79218274bf72874f2d01c6213ea088c3a3e768d /sys/dev/usb | |
parent | ef18034ac19957f4a94d28dd906d02cf32260a83 (diff) | |
download | FreeBSD-src-7357df6b4854f9914c605ad7c7cf3c01ea7700fd.zip FreeBSD-src-7357df6b4854f9914c605ad7c7cf3c01ea7700fd.tar.gz |
Make all Ethernet drivers attach using ether_ifattach() and detach using
ether_ifdetach().
The former consolidates the operations of if_attach(), ng_ether_attach(),
and bpfattach(). The latter consolidates the corresponding detach operations.
Reviewed by: julian, freebsd-net
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/if_aue.c | 9 | ||||
-rw-r--r-- | sys/dev/usb/if_cue.c | 9 | ||||
-rw-r--r-- | sys/dev/usb/if_kue.c | 12 |
3 files changed, 10 insertions, 20 deletions
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index acafe1d..d202491 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -736,12 +736,10 @@ USB_ATTACH(aue) aue_qdat.if_rxstart = aue_rxstart; /* - * Call MI attach routines. + * Call MI attach routine. */ - if_attach(ifp); - ether_ifattach(ifp); + ether_ifattach(ifp, ETHER_BPF_SUPPORTED); callout_handle_init(&sc->aue_stat_ch); - bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header)); usb_register_netisr(); sc->aue_gone = 0; @@ -763,8 +761,7 @@ Static int aue_detach(dev) sc->aue_gone = 1; untimeout(aue_tick, sc, sc->aue_stat_ch); - bpfdetach(ifp); - if_detach(ifp); + ether_ifdetach(ifp, ETHER_BPF_SUPPORTED); if (sc->aue_ep[AUE_ENDPT_TX] != NULL) usbd_abort_pipe(sc->aue_ep[AUE_ENDPT_TX]); diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c index 6681517..3de4364 100644 --- a/sys/dev/usb/if_cue.c +++ b/sys/dev/usb/if_cue.c @@ -555,12 +555,10 @@ USB_ATTACH(cue) cue_qdat.if_rxstart = cue_rxstart; /* - * Call MI attach routines. + * Call MI attach routine. */ - if_attach(ifp); - ether_ifattach(ifp); + ether_ifattach(ifp, ETHER_BPF_SUPPORTED); callout_handle_init(&sc->cue_stat_ch); - bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header)); usb_register_netisr(); sc->cue_gone = 0; @@ -582,8 +580,7 @@ Static int cue_detach(dev) sc->cue_gone = 1; untimeout(cue_tick, sc, sc->cue_stat_ch); - bpfdetach(ifp); - if_detach(ifp); + ether_ifdetach(ifp, ETHER_BPF_SUPPORTED); if (sc->cue_ep[CUE_ENDPT_TX] != NULL) usbd_abort_pipe(sc->cue_ep[CUE_ENDPT_TX]); diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index cb6a03c..780c42b 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -500,11 +500,9 @@ USB_ATTACH(kue) kue_qdat.if_rxstart = kue_rxstart; /* - * Call MI attach routines. + * Call MI attach routine. */ - if_attach(ifp); - ether_ifattach(ifp); - bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header)); + ether_ifattach(ifp, ETHER_BPF_SUPPORTED); usb_register_netisr(); sc->kue_gone = 0; @@ -526,10 +524,8 @@ Static int kue_detach(dev) sc->kue_gone = 1; - if (ifp != NULL) { - bpfdetach(ifp); - if_detach(ifp); - } + if (ifp != NULL) + ether_ifdetach(ifp, ETHER_BPF_SUPPORTED); if (sc->kue_ep[KUE_ENDPT_TX] != NULL) usbd_abort_pipe(sc->kue_ep[KUE_ENDPT_TX]); |