summaryrefslogtreecommitdiffstats
path: root/sys/dev/ray
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2000-12-08 21:35:11 +0000
committerwpaul <wpaul@FreeBSD.org>2000-12-08 21:35:11 +0000
commited5dbfbd3cd619638a7baac288f548aa1398edac (patch)
tree3644dc776f5cd1623927f15fb4ce3e1812572592 /sys/dev/ray
parenta212ca690ee57ac3a213419e671a78b6e1dc5a4f (diff)
downloadFreeBSD-src-ed5dbfbd3cd619638a7baac288f548aa1398edac.zip
FreeBSD-src-ed5dbfbd3cd619638a7baac288f548aa1398edac.tar.gz
Fix probe/attach a little. We don't have to call bpfattach() anymore
since ether_ifattach() does it for us. We do need to call ether_ifdetach() instead of if_detach(). And we don't have to check for ifp->if_name already being initialized because it never will be in FreeBSD 4.x and above. Reviewed by: Warner Losh, Duncan Barclay
Diffstat (limited to 'sys/dev/ray')
-rw-r--r--sys/dev/ray/if_ray.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/sys/dev/ray/if_ray.c b/sys/dev/ray/if_ray.c
index 772e951..2e34b3c 100644
--- a/sys/dev/ray/if_ray.c
+++ b/sys/dev/ray/if_ray.c
@@ -491,26 +491,24 @@ ray_attach(device_t dev)
/*
* Initialise the network interface structure
*/
- if (!ifp->if_name) {
- bcopy((char *)&ep->e_station_addr,
- (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
- ifp->if_softc = sc;
- ifp->if_name = "ray";
- ifp->if_unit = device_get_unit(dev);
- ifp->if_timer = 0;
- ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST);
- ifp->if_hdrlen = sizeof(struct ieee80211_frame) +
- sizeof(struct ether_header);
- ifp->if_baudrate = 1000000; /* Is this baud or bps ;-) */
- ifp->if_output = ether_output;
- ifp->if_start = ray_tx;
- ifp->if_ioctl = ray_ioctl;
- ifp->if_watchdog = ray_watchdog;
- ifp->if_init = ray_init_user;
- ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
-
- ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
- }
+ bcopy((char *)&ep->e_station_addr,
+ (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
+ ifp->if_softc = sc;
+ ifp->if_name = "ray";
+ ifp->if_unit = device_get_unit(dev);
+ ifp->if_timer = 0;
+ ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST);
+ ifp->if_hdrlen = sizeof(struct ieee80211_frame) +
+ sizeof(struct ether_header);
+ ifp->if_baudrate = 1000000; /* Is this baud or bps ;-) */
+ ifp->if_output = ether_output;
+ ifp->if_start = ray_tx;
+ ifp->if_ioctl = ray_ioctl;
+ ifp->if_watchdog = ray_watchdog;
+ ifp->if_init = ray_init_user;
+ ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
+
+ ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
/*
* Initialise the timers and driver
@@ -518,7 +516,6 @@ ray_attach(device_t dev)
callout_handle_init(&sc->com_timerh);
callout_handle_init(&sc->tx_timerh);
TAILQ_INIT(&sc->sc_comq);
- bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
/*
* Print out some useful information
@@ -587,7 +584,7 @@ ray_detach(device_t dev)
sc->gone = 1;
sc->sc_havenet = 0;
ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
- if_detach(ifp);
+ ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
/*
* Stop the runq and wake up anyone sleeping for us.
OpenPOWER on IntegriCloud