Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153075826
D15537.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D15537.id.diff
View Options
Index: head/sys/dev/usb/net/if_muge.c
===================================================================
--- head/sys/dev/usb/net/if_muge.c
+++ head/sys/dev/usb/net/if_muge.c
@@ -122,6 +122,8 @@
static const struct usb_device_id lan78xx_devs[] = {
#define MUGE_DEV(p,i) { USB_VPI(USB_VENDOR_SMC2, USB_PRODUCT_SMC2_##p, i) }
MUGE_DEV(LAN7800_ETH, 0),
+ MUGE_DEV(LAN7801_ETH, 0),
+ MUGE_DEV(LAN7850_ETH, 0),
#undef MUGE_DEV
};
@@ -174,7 +176,8 @@
uint32_t sc_pfilter_table[MUGE_NUM_PFILTER_ADDRS_][2];
uint32_t sc_flags;
-#define MUGE_FLAG_LINK 0x0001
+#define MUGE_FLAG_LINK 0x0001
+#define MUGE_FLAG_INIT_DONE 0x0002
};
#define MUGE_IFACE_IDX 0
@@ -1125,6 +1128,7 @@
buf |= ETH_FCT_TX_CTL_EN_;
err = lan78xx_write_reg(sc, ETH_FCT_RX_CTL, buf);
+ sc->sc_flags |= MUGE_FLAG_INIT_DONE;
return (0);
init_failed:
@@ -2116,7 +2120,7 @@
muge_config, MUGE_N_TRANSFER, sc, &sc->sc_mtx);
if (err) {
device_printf(dev, "error: allocating USB transfers failed\n");
- goto detach;
+ goto err;
}
ue->ue_sc = sc;
@@ -2128,12 +2132,22 @@
err = uether_ifattach(ue);
if (err) {
device_printf(dev, "error: could not attach interface\n");
- goto detach;
+ goto err_usbd;
}
+
+ /* Wait for lan78xx_chip_init from post-attach callback to complete. */
+ uether_ifattach_wait(ue);
+ if (!(sc->sc_flags & MUGE_FLAG_INIT_DONE))
+ goto err_attached;
+
return (0);
-detach:
- muge_detach(dev);
+err_attached:
+ uether_ifdetach(ue);
+err_usbd:
+ usbd_transfer_unsetup(sc->sc_xfer, MUGE_N_TRANSFER);
+err:
+ mtx_destroy(&sc->sc_mtx);
return (ENXIO);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 19, 11:46 PM (6 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31808823
Default Alt Text
D15537.id.diff (1 KB)
Attached To
Mode
D15537: if_muge: move chip type detection into muge_attach
Attached
Detach File
Event Timeline
Log In to Comment