diff options
author | n_hibma <n_hibma@FreeBSD.org> | 2008-10-13 20:38:33 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 2008-10-13 20:38:33 +0000 |
commit | 2e7cf84cd84b53cd8730308fef18674a1f9bca95 (patch) | |
tree | 5413fb20fc83016dbd2ed3f171abf621479045d8 /sys/dev | |
parent | 0d1110647354e7b0e9df7ad73bb933f29d3eb194 (diff) | |
download | FreeBSD-src-2e7cf84cd84b53cd8730308fef18674a1f9bca95.zip FreeBSD-src-2e7cf84cd84b53cd8730308fef18674a1f9bca95.tar.gz |
- Only refuse to attach to the first interface on the Huawei cards as for
example the Huawei Mobile has an SD card slot on the second interface.
- Do not attach to Qualcomm and Novatel cards. If ignored these cards will
switch to modem mode automatically it seems.
- Reduce the priority on generic attachment to the appropriate level.
Note: A better solution is to send an eject command straightaway, but that can
be left till later.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/usb/umass.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 2cf64e0..0f0756c 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -1177,12 +1177,28 @@ umass_match_proto(struct umass_softc *sc, usbd_interface_handle iface, dd = usbd_get_device_descriptor(udev); - /* - * These are radio devices with auto-install flash disks for win/mac. - * We want the ubsa driver to kick them into shape instead. + /* These are 3G modes (E220, Mobile, etc.) devices with auto-install + * flash disks for Windows/MacOSX through the first interface. + * We are assuming that these vendors will not produce mass storage + * devices. See the list of supported parts in u3g, if this happens to + * be a mistake in the future. */ - if (UGETW(dd->idVendor) == USB_VENDOR_HUAWEI) - return(UMATCH_NONE); + if (UGETW(dd->idVendor) == USB_VENDOR_HUAWEI) { + /* The interface is reset in the u3g driver + * (u3g_huawei_reinit()). Allow generic attachment to the + * second interface though. Some Huawei devices contain an SD + * card slot. + */ + id = usbd_get_interface_descriptor(iface); + if (id == NULL || id->bInterfaceNumber == 0) + return UMATCH_NONE; + } else if (UGETW(dd->idVendor) == USB_VENDOR_QUALCOMMINC + || UGETW(dd->idVendor) == USB_VENDOR_NOVATEL) { + /* Device by these vendors will automatically reappear as a + * ucom device if ignored (or if sent an eject command). + */ + return UMATCH_NONE; + } /* An entry specifically for Y-E Data devices as they don't fit in the * device description table. @@ -1279,7 +1295,7 @@ umass_match_proto(struct umass_softc *sc, usbd_interface_handle iface, return(UMATCH_NONE); } - return(UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO); + return(UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO); } static int @@ -1291,6 +1307,7 @@ umass_match(device_t self) sc->sc_dev = self; if (uaa->iface == NULL) return(UMATCH_NONE); + return(umass_match_proto(sc, uaa->iface, uaa->device)); } |