summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_sk.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/pci/if_sk.c')
-rw-r--r--sys/pci/if_sk.c13
1 files changed, 7 insertions, 6 deletions
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);
OpenPOWER on IntegriCloud