PERFORCE change 149837 for review
Andrew Thompson
thompsa at FreeBSD.org
Mon Sep 15 23:26:16 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=149837
Change 149837 by thompsa at thompsa_burger on 2008/09/15 23:25:55
Remove Gaint from ugensa, tested with a Novatel card.
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb2/serial/ugensa2.c#9 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb2/serial/ugensa2.c#9 (text+ko) ====
@@ -82,6 +82,7 @@
struct usb2_com_softc sc_ucom[UGENSA_IFACE_MAX];
struct ugensa_sub_softc sc_sub[UGENSA_IFACE_MAX];
+ struct mtx sc_mtx;
uint8_t sc_niface;
};
@@ -253,6 +254,7 @@
return (ENOMEM);
device_set_usb2_desc(dev);
+ mtx_init(&sc->sc_mtx, "ugensa", NULL, MTX_DEF);
/* Figure out how many interfaces this device has got */
for (cnt = 0; cnt < UGENSA_IFACE_MAX; cnt++) {
@@ -279,7 +281,7 @@
iface_index = (UGENSA_IFACE_INDEX + x);
error = usb2_transfer_setup(uaa->device,
&iface_index, ssc->sc_xfer, ugensa_xfer_config,
- UGENSA_N_TRANSFER, ssc, &Giant);
+ UGENSA_N_TRANSFER, ssc, &sc->sc_mtx);
if (error) {
device_printf(dev, "allocating USB "
@@ -300,7 +302,7 @@
device_printf(dev, "Found %d interfaces.\n", sc->sc_niface);
error = usb2_com_attach(&sc->sc_super_ucom, sc->sc_ucom, sc->sc_niface, sc,
- &ugensa_callback, &Giant);
+ &ugensa_callback, &sc->sc_mtx);
if (error) {
DPRINTF("attach failed\n");
goto detach;
@@ -323,6 +325,7 @@
for (x = 0; x < sc->sc_niface; x++) {
usb2_transfer_unsetup(sc->sc_sub[x].sc_xfer, UGENSA_N_TRANSFER);
}
+ mtx_destroy(&sc->sc_mtx);
return (0);
}
More information about the p4-projects
mailing list