On Tue, Dec 11, 2007 at 04:58:18PM +0100, [EMAIL PROTECTED]@mgedv.net wrote:
> i'm currently testing the c-code which is provided there (i'm not
> a guru) but the first one does not look that bad (there are some
> errors and problems which i do not really have the time right now
> to look into).
the following diff to umsm(4) sends the proper message to the device
to cause the ucom port to appear.
I still have the problem, that sometimes talking to the ucom will
cause the device to reset itself, I have not figured out what is
causing that.
felix
Index: sys/dev/usb/umsm.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/umsm.c,v
retrieving revision 1.16
diff -u -r1.16 umsm.c
--- sys/dev/usb/umsm.c 19 Jun 2007 23:59:27 -0000 1.16
+++ sys/dev/usb/umsm.c 8 Sep 2007 19:50:44 -0000
@@ -58,6 +58,7 @@
{ USB_VENDOR_AIRPRIME, USB_PRODUCT_AIRPRIME_PC5220 },
{ USB_VENDOR_DELL, USB_PRODUCT_DELL_W5500 },
{ USB_VENDOR_KYOCERA2, USB_PRODUCT_KYOCERA2_KPC650 },
+ { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E220 },
{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_EXPRESSCARD },
{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_MERLINV620 },
{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_S720 },
@@ -123,6 +124,25 @@
devinfop = usbd_devinfo_alloc(uaa->device, 0);
printf("\n%s: %s\n", sc->sc_dev.dv_xname, devinfop);
usbd_devinfo_free(devinfop);
+
+ if(uaa->product == USB_PRODUCT_HUAWEI_E220) {
+ usb_device_request_t req;
+ usbd_status err;
+
+ req.bmRequestType = UT_WRITE_DEVICE;
+ req.bRequest = UR_SET_FEATURE;
+ USETW(req.wValue, 1);
+ USETW(req.wIndex, 0);
+ USETW(req.wLength, 0);
+ err = usbd_do_request(sc->sc_udev, &req, 0);
+
+ if (err) {
+ printf("%s: failed to initialize device ",
+ sc->sc_dev.dv_xname);
+ sc->sc_dying = 1;
+ return;
+ }
+ }
if (usbd_set_config_index(sc->sc_udev, UMSM_CONFIG_NO, 1) != 0) {
printf("%s: could not set configuration no\n",
Index: share/man/man4/umsm.4
===================================================================
RCS file: /cvs/src/share/man/man4/umsm.4,v
retrieving revision 1.21
diff -u -r1.21 umsm.4
--- share/man/man4/umsm.4 21 Jun 2007 00:26:47 -0000 1.21
+++ share/man/man4/umsm.4 8 Sep 2007 19:50:44 -0000
@@ -38,6 +38,7 @@
.Bl -column "Device " "Bus" -compact -offset 6n
.It Em "Device Bus"
.It Li "AirPrime PC5220" Ta Ta CardBus
+.It Li "Huawei Mobile E220" Ta Ta USB
.It Li "Kyocera KPC650" Ta Ta CardBus
.It Li "Novatel Wireless ES620" Ta Ta USB
.It Li "ONDA Communication H600" Ta Ta CardBus