The Sierra Wireless USBConnect 881 card presents itself as umass containing

the driver to be installed for it. We don't need this crap. Tell it to become
a modem.
This commit is contained in:
christos 2008-10-25 17:35:44 +00:00
parent e7901a5f9a
commit b311f98821
2 changed files with 39 additions and 1 deletions

View File

@ -262,6 +262,32 @@ u3g_huawei_reinit(usbd_device_handle dev)
return (UMATCH_HIGHEST); /* Match to prevent umass from attaching */
}
static int
u3g_sierra_reinit(usbd_device_handle dev)
{
/* Some Sierra devices presents themselves as a umass device with
* Windows drivers on it. After installation of the driver, it
* reinits into a * 3G serial device.
*/
usb_device_request_t req;
usb_config_descriptor_t *cdesc;
/* Get the config descriptor */
cdesc = usbd_get_config_descriptor(dev);
if (cdesc == NULL)
return (UMATCH_NONE);
req.bmRequestType = UT_VENDOR;
req.bRequest = UR_SET_INTERFACE;
USETW(req.wValue, UF_DEVICE_REMOTE_WAKEUP);
USETW(req.wIndex, UHF_PORT_CONNECTION);
USETW(req.wLength, 0);
(void) usbd_do_request(dev, &req, 0);
return (UMATCH_HIGHEST); /* Match to prevent umass from attaching */
}
static int
u3g_match(device_t parent, cfdata_t match, void *aux)
{
@ -274,6 +300,10 @@ u3g_match(device_t parent, cfdata_t match, void *aux)
uaa->product == USB_PRODUCT_NOVATEL2_MC950D_DRIVER)
return u3g_novatel_reinit(uaa);
if (uaa->vendor == USB_VENDOR_SIERRA &&
uaa->product == USB_PRODUCT_SIERRA_INSTALLER)
return u3g_sierra_reinit(uaa->device);
if (usb_lookup(u3g_devs, uaa->vendor, uaa->product))
return UMATCH_VENDOR_PRODUCT;
@ -330,6 +360,13 @@ u3g_attach(device_t parent, device_t self, void *aux)
return;
}
if (uaa->vendor == USB_VENDOR_SIERRA &&
uaa->product == USB_PRODUCT_SIERRA_INSTALLER) {
/* About to disappear... */
sc->sc_pseudodev = true;
return;
}
sc->sc_udev = dev;
sc->numports = (cdesc->bNumInterface <= U3G_MAXPORTS)?cdesc->bNumInterface:U3G_MAXPORTS;
for ( i = 0; i < sc->numports; i++ ) {

View File

@ -1,4 +1,4 @@
$NetBSD: usbdevs,v 1.518 2008/10/22 10:23:51 haad Exp $
$NetBSD: usbdevs,v 1.519 2008/10/25 17:35:44 christos Exp $
/*
* Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@ -2057,6 +2057,7 @@ product SIERRA MC8775_2 0x6815 MC8775
product SIERRA AIRCARD875 0x6820 Aircard 875 HSDPA
product SIERRA MC8780 0x6832 MC8780
product SIERRA MC8781 0x6833 MC8781
product SIERRA INSTALLER 0x0fff Aircard Driver Installer
/* Sigmatel products */
product SIGMATEL SIR4116 0x4116 StIR4116 SIR