summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/serial/umct.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-03-02 02:44:10 +0000
committerthompsa <thompsa@FreeBSD.org>2009-03-02 02:44:10 +0000
commit4613abf36a1a86bece089d14c8f98998cc45c0fa (patch)
tree74b7a00cf7a7405145b74c9131304c9b7ec5803a /sys/dev/usb/serial/umct.c
parentddc28333969dfde04f6c179cab0e3cd36971ddde (diff)
downloadFreeBSD-src-4613abf36a1a86bece089d14c8f98998cc45c0fa.zip
FreeBSD-src-4613abf36a1a86bece089d14c8f98998cc45c0fa.tar.gz
Move the serial drivers from Giant to using their own mutexs.
Tested with: u3g, ubser, uplcom
Diffstat (limited to 'sys/dev/usb/serial/umct.c')
-rw-r--r--sys/dev/usb/serial/umct.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/usb/serial/umct.c b/sys/dev/usb/serial/umct.c
index 52265fc..722b571 100644
--- a/sys/dev/usb/serial/umct.c
+++ b/sys/dev/usb/serial/umct.c
@@ -93,6 +93,7 @@ struct umct_softc {
struct usb2_device *sc_udev;
struct usb2_xfer *sc_xfer[UMCT_N_TRANSFER];
+ struct mtx sc_mtx;
uint32_t sc_unit;
@@ -233,6 +234,7 @@ umct_attach(device_t dev)
sc->sc_unit = device_get_unit(dev);
device_set_usb2_desc(dev);
+ mtx_init(&sc->sc_mtx, "umct", NULL, MTX_DEF);
snprintf(sc->sc_name, sizeof(sc->sc_name),
"%s", device_get_nameunit(dev));
@@ -241,7 +243,7 @@ umct_attach(device_t dev)
iface_index = UMCT_IFACE_INDEX;
error = usb2_transfer_setup(uaa->device, &iface_index,
- sc->sc_xfer, umct_config, UMCT_N_TRANSFER, sc, &Giant);
+ sc->sc_xfer, umct_config, UMCT_N_TRANSFER, sc, &sc->sc_mtx);
if (error) {
device_printf(dev, "allocating USB "
@@ -274,7 +276,7 @@ umct_attach(device_t dev)
}
}
error = usb2_com_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc,
- &umct_callback, &Giant);
+ &umct_callback, &sc->sc_mtx);
if (error) {
goto detach;
}
@@ -291,8 +293,8 @@ umct_detach(device_t dev)
struct umct_softc *sc = device_get_softc(dev);
usb2_com_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1);
-
usb2_transfer_unsetup(sc->sc_xfer, UMCT_N_TRANSFER);
+ mtx_destroy(&sc->sc_mtx);
return (0);
}
OpenPOWER on IntegriCloud