summaryrefslogtreecommitdiffstats
path: root/sys/dev/sbni
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2003-10-30 19:45:58 +0000
committerbrooks <brooks@FreeBSD.org>2003-10-30 19:45:58 +0000
commit38e31120fcd40193d407e469c46607ecc302ab68 (patch)
tree7d01fdeb4d415c1bae5c7bd03a9a32e71d3a786d /sys/dev/sbni
parent24760267308bc1cdadffe3933510627f1a8ebec9 (diff)
downloadFreeBSD-src-38e31120fcd40193d407e469c46607ecc302ab68.zip
FreeBSD-src-38e31120fcd40193d407e469c46607ecc302ab68.tar.gz
There is no way to enter the attach routine twice with the same softc
without a detach call in between so don't try to deal with that possiability. This is a diff-reduction commit for the upcoming if_xname conversion.
Diffstat (limited to 'sys/dev/sbni')
-rw-r--r--sys/dev/sbni/if_sbni.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/sys/dev/sbni/if_sbni.c b/sys/dev/sbni/if_sbni.c
index d932a68..1697a41 100644
--- a/sys/dev/sbni/if_sbni.c
+++ b/sys/dev/sbni/if_sbni.c
@@ -226,26 +226,24 @@ sbni_attach(struct sbni_softc *sc, int unit, struct sbni_flags flags)
set_initial_values(sc, flags);
callout_handle_init(&sc->wch);
- if (!ifp->if_name) {
- /* Initialize ifnet structure */
- ifp->if_softc = sc;
- ifp->if_unit = unit;
- ifp->if_name = "sbni";
- ifp->if_init = sbni_init;
- ifp->if_start = sbni_start;
- ifp->if_output = ether_output;
- ifp->if_ioctl = sbni_ioctl;
- ifp->if_watchdog = sbni_watchdog;
- ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
-
- /* report real baud rate */
- csr0 = sbni_inb(sc, CSR0);
- ifp->if_baudrate =
- (csr0 & 0x01 ? 500000 : 2000000) / (1 << flags.rate);
+ /* Initialize ifnet structure */
+ ifp->if_softc = sc;
+ ifp->if_unit = unit;
+ ifp->if_name = "sbni";
+ ifp->if_init = sbni_init;
+ ifp->if_start = sbni_start;
+ ifp->if_output = ether_output;
+ ifp->if_ioctl = sbni_ioctl;
+ ifp->if_watchdog = sbni_watchdog;
+ ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
+
+ /* report real baud rate */
+ csr0 = sbni_inb(sc, CSR0);
+ ifp->if_baudrate =
+ (csr0 & 0x01 ? 500000 : 2000000) / (1 << flags.rate);
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
- ether_ifattach(ifp, sc->arpcom.ac_enaddr);
- }
+ ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
+ ether_ifattach(ifp, sc->arpcom.ac_enaddr);
/* device attach does transition from UNCONFIGURED to IDLE state */
if_printf(ifp, "speed %ld, address %6D, rxl ",
OpenPOWER on IntegriCloud