usb/122905: [ubsa] [patch] add Huawei E220 to ubsa
Per olof Ljungmark
peo at intersonic.se
Tue Apr 22 23:40:04 UTC 2008
The following reply was made to PR usb/122905; it has been noted by GNATS.
From: Per olof Ljungmark <peo at intersonic.se>
To: bug-followup at FreeBSD.org, wojtek at wojtek.tensor.gdynia.pl
Cc:
Subject: Re: usb/122905: [ubsa] [patch] add Huawei E220 to ubsa
Date: Wed, 23 Apr 2008 01:21:41 +0200
This is a multi-part message in MIME format.
--------------030008040502080503020600
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Just an addendum, the following works very good for me on 7-STABLE.
Changes to ubsa.c and usbdevs are very similar.
In the original patch the PR says Huawei E220 but the pactes says E200B
which I do not completely understand.
--------------030008040502080503020600
Content-Type: text/plain;
name="patch-usbdevs"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="patch-usbdevs"
--- usbdevs 2008-04-12 13:23:21.000000000 +0200
+++ usbdevs-patched 2008-04-23 00:39:29.000000000 +0200
@@ -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
--------------030008040502080503020600
Content-Type: text/plain;
name="patch-usb_subr.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="patch-usb_subr.c"
--- usb_subr.c 2007-06-30 22:18:44.000000000 +0200
+++ usb_subr.c-patched 2008-04-23 00:39:29.000000000 +0200
@@ -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;
@@ -995,7 +1008,14 @@
* We just did not find any drivers, that's all. The device is
* 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);
}
--------------030008040502080503020600
Content-Type: text/plain;
name="patch-usb_quirks.h"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="patch-usb_quirks.h"
--- usb_quirks.h 2007-06-29 23:07:41.000000000 +0200
+++ usb_quirks.h-patched 2008-04-23 00:39:29.000000000 +0200
@@ -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 */
--------------030008040502080503020600
Content-Type: text/plain;
name="patch-usb_quirks.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="patch-usb_quirks.c"
--- usb_quirks.c 2008-04-20 10:52:13.000000000 +0200
+++ usb_quirks.c-patched 2008-04-23 00:39:29.000000000 +0200
@@ -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 } }
};
--------------030008040502080503020600
Content-Type: text/plain;
name="patch-ubsa.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="patch-ubsa.c"
--- ubsa.c 2008-04-12 13:23:21.000000000 +0200
+++ ubsa.c-patched 2008-04-23 00:39:29.000000000 +0200
@@ -236,6 +236,8 @@
{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3GPLUS },
/* Huawei Mobile */
{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE },
+ /* Huawei Mobile E220 */
+ { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E220 },
/* Qualcomm, Inc. ZTE CDMA */
{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_CDMA_MSM },
{ 0, 0 }
--------------030008040502080503020600--
More information about the freebsd-usb
mailing list