diff options
-rw-r--r-- | sys/dev/sk/if_sk.c | 13 | ||||
-rw-r--r-- | sys/pci/if_sk.c | 13 |
2 files changed, 14 insertions, 12 deletions
diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c index 4b5e7f6..83d5720 100644 --- a/sys/dev/sk/if_sk.c +++ b/sys/dev/sk/if_sk.c @@ -1148,6 +1148,12 @@ static int sk_attach_xmac(dev) ifp->if_snd.ifq_maxlen = SK_TX_RING_CNT - 1; /* + * Call MI attach routine. + */ + ether_ifattach(ifp, ETHER_BPF_SUPPORTED); + callout_handle_init(&sc_if->sk_tick_ch); + + /* * Do miibus setup. */ sk_init_xmac(sc_if); @@ -1156,16 +1162,11 @@ static int sk_attach_xmac(dev) printf("skc%d: no PHY found!\n", sc_if->sk_unit); contigfree(sc_if->sk_rdata, sizeof(struct sk_ring_data), M_DEVBUF); + ether_ifdetach(ifp, ETHER_BPF_SUPPORTED); SK_UNLOCK(sc); return(ENXIO); } - /* - * Call MI attach routine. - */ - ether_ifattach(ifp, ETHER_BPF_SUPPORTED); - callout_handle_init(&sc_if->sk_tick_ch); - SK_UNLOCK(sc); return(0); diff --git a/sys/pci/if_sk.c b/sys/pci/if_sk.c index 4b5e7f6..83d5720 100644 --- a/sys/pci/if_sk.c +++ b/sys/pci/if_sk.c @@ -1148,6 +1148,12 @@ static int sk_attach_xmac(dev) ifp->if_snd.ifq_maxlen = SK_TX_RING_CNT - 1; /* + * Call MI attach routine. + */ + ether_ifattach(ifp, ETHER_BPF_SUPPORTED); + callout_handle_init(&sc_if->sk_tick_ch); + + /* * Do miibus setup. */ sk_init_xmac(sc_if); @@ -1156,16 +1162,11 @@ static int sk_attach_xmac(dev) printf("skc%d: no PHY found!\n", sc_if->sk_unit); contigfree(sc_if->sk_rdata, sizeof(struct sk_ring_data), M_DEVBUF); + ether_ifdetach(ifp, ETHER_BPF_SUPPORTED); SK_UNLOCK(sc); return(ENXIO); } - /* - * Call MI attach routine. - */ - ether_ifattach(ifp, ETHER_BPF_SUPPORTED); - callout_handle_init(&sc_if->sk_tick_ch); - SK_UNLOCK(sc); return(0); |