Subject: Re: Huawei E220 support?
To: None <current-users@netbsd.org>
From: Michael van Elst <mlelstv@serpens.de>
List: current-users
Date: 11/30/2007 07:12:05
dillo@danbala.ifoer.tuwien.ac.at (Dieter Baron) writes:

>  However, I see a lot of these in dmesg:
>ubsa0: ubsa_request: STALLED

These are probably only consequences of sending unsupported commands
to the device. The driver already has a means to disable some commands
for Option N.V. cards. Please try to following patch:


Index: ubsa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/ubsa.c,v
retrieving revision 1.19
diff -u -r1.19 ubsa.c
--- ubsa.c	13 Mar 2007 13:51:55 -0000	1.19
+++ ubsa.c	30 Nov 2007 07:09:55 -0000
@@ -224,25 +224,30 @@
 	NULL
 };
 
-Static const struct usb_devno ubsa_devs[] = {
+Static const struct ubsa_type {
+	struct usb_devno ubsa_dev;
+	int ubsa_quadumts;
+} ubsa_devs[] = {
 	/* BELKIN F5U103 */
-	{ USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5U103 },
+	{ { USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5U103 }, 0 },
 	/* BELKIN F5U120 */
-	{ USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5U120 },
+	{ { USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5U120 }, 0 },
 	/* GoHubs GO-COM232 */
-	{ USB_VENDOR_ETEK, USB_PRODUCT_ETEK_1COM },
+	{ { USB_VENDOR_ETEK, USB_PRODUCT_ETEK_1COM }, 0 },
 	/* GoHubs GO-COM232 */
-	{ USB_VENDOR_GOHUBS, USB_PRODUCT_GOHUBS_GOCOM232 },
+	{ { USB_VENDOR_GOHUBS, USB_PRODUCT_GOHUBS_GOCOM232 }, 0 },
 	/* Peracom */
-	{ USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_SERIAL1 },
+	{ { USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_SERIAL1 }, 0 },
 	/* Option N.V. */
-	{ USB_VENDOR_OPTIONNV, USB_PRODUCT_OPTIONNV_MC3G },
-	{ USB_VENDOR_OPTIONNV, USB_PRODUCT_OPTIONNV_QUADUMTS2 },
-	{ USB_VENDOR_OPTIONNV, USB_PRODUCT_OPTIONNV_QUADUMTS },
-	/* AnyDATA ADU-E100H */
-	{ USB_VENDOR_ANYDATA, USB_PRODUCT_ANYDATA_ADU_E100H },
+	{ { USB_VENDOR_OPTIONNV, USB_PRODUCT_OPTIONNV_MC3G }, 0 },
+	{ { USB_VENDOR_OPTIONNV, USB_PRODUCT_OPTIONNV_QUADUMTS2 }, 1 },
+	{ { USB_VENDOR_OPTIONNV, USB_PRODUCT_OPTIONNV_QUADUMTS }, 1 },
+	{ { USB_VENDOR_OPTIONNV, USB_PRODUCT_OPTIONNV_QUADPLUSUMTS }, 1 },
+	{ { USB_VENDOR_OPTIONNV, USB_PRODUCT_OPTIONNV_HSDPA }, 1 },
+	{ { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE }, 1 },
+	{ { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E220 }, 1 },
 };
-#define ubsa_lookup(v, p) usb_lookup(ubsa_devs, v, p)
+#define ubsa_lookup(v, p) ((const struct ubsa_type *)usb_lookup(ubsa_devs, v, p))
 
 USB_DECLARE_DRIVER(ubsa);
 
@@ -285,15 +290,7 @@
 	 * Quad UMTS cards use different requests to
 	 * control com settings and only some.
 	 */
-	sc->sc_quadumts = 0;
-	if (uaa->vendor == USB_VENDOR_OPTIONNV) {
-		switch (uaa->product) {
-		case USB_PRODUCT_OPTIONNV_QUADUMTS:
-		case USB_PRODUCT_OPTIONNV_QUADUMTS2:
-			sc->sc_quadumts = 1;
-			break;
-		}
-	}
+	sc->sc_quadumts = ubsa_lookup(uaa->vendor, uaa->product)->ubsa_quadumts;
 
 	DPRINTF(("ubsa attach: sc = %p\n", sc));
 

>  I guess the two are related.

I don't think so.

-- 
-- 
                                Michael van Elst
Internet: mlelstv@serpens.de
                                "A potential Snark may lurk in every tree."