? e220-usb.diff Index: ubsa.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/ubsa.c,v retrieving revision 1.32 diff -u -r1.32 ubsa.c --- ubsa.c 22 Jun 2007 05:56:05 -0000 1.32 +++ ubsa.c 22 Jan 2008 11:21:41 -0000 @@ -234,6 +234,8 @@ { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3GPLUS }, /* Huawei Mobile */ { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE }, + /* Huawei E220 G3 Modem */ + { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E220 }, { 0, 0 } }; Index: usb_quirks.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/usb_quirks.c,v retrieving revision 1.64 diff -u -r1.64 usb_quirks.c --- usb_quirks.c 11 Nov 2007 20:57:08 -0000 1.64 +++ usb_quirks.c 22 Jan 2008 11:22:10 -0000 @@ -112,6 +112,8 @@ ANY, { UQ_KBD_IGNORE }}, { USB_VENDOR_METAGEEK, USB_PRODUCT_METAGEEK_WISPY24X, ANY, { UQ_KBD_IGNORE }}, + { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E220, + ANY, { UQ_FEATURE2 }}, { 0, 0, 0, { 0 } } }; Index: usb_quirks.h =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/usb_quirks.h,v retrieving revision 1.25 diff -u -r1.25 usb_quirks.h --- usb_quirks.h 29 Jun 2007 21:07:41 -0000 1.25 +++ usb_quirks.h 22 Jan 2008 11:22:10 -0000 @@ -52,6 +52,7 @@ #define UQ_AU_NO_FRAC 0x00000400 /* don't adjust for fractional samples */ #define UQ_AU_INP_ASYNC 0x00000800 /* input is async despite claim of adaptive */ #define UQ_BROKEN_BIDIR 0x00002000 /* printer has broken bidir mode */ +#define UQ_FEATURE2 0x4000 /* requires the enabling of feature 2 */ #define UQ_OPEN_CLEARSTALL 0x04000 /* device needs clear endpoint stall */ #define UQ_HID_IGNORE 0x00008000 /* device should be ignored by hid class */ #define UQ_KBD_IGNORE 0x00018000 /* device should be ignored by both kbd and hid class */ Index: usb_subr.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/usb_subr.c,v retrieving revision 1.95 diff -u -r1.95 usb_subr.c --- usb_subr.c 30 Jun 2007 20:18:44 -0000 1.95 +++ usb_subr.c 22 Jan 2008 11:22:11 -0000 @@ -526,6 +526,19 @@ } static usbd_status +usbd_set_feature(usbd_device_handle dev, int feature) +{ + usb_device_request_t req; + + req.bmRequestType = UT_WRITE; + req.bRequest = UR_SET_FEATURE; + USETW(req.wValue, 1); + USETW(req.wIndex, feature); + USETW(req.wLength, 0); + return (usbd_do_request(dev, &req, 0)); +} + +static usbd_status usbd_set_config(usbd_device_handle dev, int conf) { usb_device_request_t req; @@ -996,6 +1009,12 @@ * fully operational and not harming anyone. */ DPRINTF(("usbd_probe_and_attach: generic attach failed\n")); + + if (dev->quirks->uq_flags & UQ_FEATURE2) { + printf("%s: Enabling feature UHF_PORT_SUSPEND\n", device_get_nameunit(parent)); + usbd_set_feature(dev, UHF_PORT_SUSPEND); + } + return (USBD_NORMAL_COMPLETION); } Index: usbdevs =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/usbdevs,v retrieving revision 1.337 diff -u -r1.337 usbdevs --- usbdevs 7 Jan 2008 09:14:37 -0000 1.337 +++ usbdevs 22 Jan 2008 11:22:16 -0000 @@ -1387,6 +1387,7 @@ /* HUAWEI products */ product HUAWEI MOBILE 0x1001 Huawei Mobile +product HUAWEI E220 0x1003 Huawei E220 HSDPA USB Modem /* HUAWEI 3com products */ product HUAWEI3COM WUB320G 0x0009 Aolynk WUB320g