Please find attached at the end of this mail a diff for the MediaTek
Inc. "DC_4COM" (that is the product name that the Linux "option" driver
uses:
https://raw.githubusercontent.com/torvalds/linux/master/drivers/usb/serial/option.c)
UMTS USB stick (= MEDION S4222). It solves the problems described at
http://article.gmane.org/gmane.os.openbsd.misc/219029 . This gives me

umsm0 at uhub7 port 1 configuration 1 interface 0 "MediaTek Inc Product" rev 
2.00/3.00 addr 4
umsm0 detached
umsm0 at uhub7 port 1 configuration 1 interface 2 "MediaTek Inc Product" rev 
2.00/3.00 addr 4
ucom0 at umsm0
umsm1 at uhub7 port 1 configuration 1 interface 3 "MediaTek Inc Product" rev 
2.00/3.00 addr 4
ucom1 at umsm1
umsm2 at uhub7 port 1 configuration 1 interface 4 "MediaTek Inc Product" rev 
2.00/3.00 addr 4
ucom2 at umsm2
umsm3 at uhub7 port 1 configuration 1 interface 5 "MediaTek Inc Product" rev 
2.00/3.00 addr 4
ucom3 at umsm3
umass0 at uhub7 port 1 configuration 1 interface 6 "MediaTek Inc Product" rev 
2.00/3.00 addr 4
umass0: using SCSI over Bulk-Only
scsibus4 at umass0: 2 targets, initiator 0
sd1 at scsibus4 targ 1 lun 0: <MEDIATEK, FLASH DISK, 6225> SCSI0 0/direct 
removable
ugen0 at uhub7 port 1 configuration 1 "MediaTek Inc Product" rev 2.00/3.00 addr 
4

and ucom0 (cuaU0) now works as expected (successfully tested with cu and pppd).

Please note that I had to ignore the first two interfaces when umsm
attaches (otherwise ucom[0-3] do not work although they attach).

Best regards,
Ingo

Index: sys/dev/usb/usbdevs
===================================================================
RCS file: /cvs/src/sys/dev/usb/usbdevs,v
retrieving revision 1.641
diff -u -p -r1.641 usbdevs
--- sys/dev/usb/usbdevs 4 Dec 2014 10:41:42 -0000       1.641
+++ sys/dev/usb/usbdevs 5 Jan 2015 11:20:33 -0000
@@ -452,6 +452,7 @@ vendor CTC          0x0e5e  CONWISE Technology
 vendor HAWKING         0x0e66  Hawking
 vendor FOSSIL          0x0e67  Fossil
 vendor GMATE           0x0e7e  G.Mate
+vendor MEDIATEK                0x0e8d  MediaTek Inc.
 vendor OTI             0x0ea0  Ours Technology
 vendor PILOTECH                0x0eaf  Pilotech
 vendor NOVATECH                0x0eb0  Nova Tech
@@ -2824,6 +2825,10 @@ product MCT ML_4500              0x0302  ML-4500
 
 /* MDS products */
 product MDS ISDBT              0x0001  MDS ISDB-T tuner
+
+/* MediaTek Inc. products */
+product MEDIATEK UMASS_INSTALLER       0x0002  USB installer
+product MEDIATEK DC_4COM       0x00a5  UMTS USB modem
 
 /* MEI products */
 product MEI CASHFLOW_SC                0x1100  Cashflow-SC
Index: sys/dev/usb/umsm.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/umsm.c,v
retrieving revision 1.100
diff -u -p -r1.100 umsm.c
--- sys/dev/usb/umsm.c  12 Jul 2014 21:24:33 -0000      1.100
+++ sys/dev/usb/umsm.c  5 Jan 2015 11:20:33 -0000
@@ -109,8 +109,9 @@ struct umsm_type {
 #define        DEV_UMASS5      0x0100
 #define        DEV_UMASS6      0x0200
 #define        DEV_UMASS7      0x0400
+#define        DEV_UMASS8      0x1000
 #define DEV_UMASS      (DEV_UMASS1 | DEV_UMASS2 | DEV_UMASS3 | DEV_UMASS4 | \
-    DEV_UMASS5 | DEV_UMASS6 | DEV_UMASS7)
+    DEV_UMASS5 | DEV_UMASS6 | DEV_UMASS7 | DEV_UMASS8)
 };
 
 static const struct umsm_type umsm_devs[] = {
@@ -154,6 +155,9 @@ static const struct umsm_type umsm_devs[
 
        {{ USB_VENDOR_KYOCERA2, USB_PRODUCT_KYOCERA2_KPC650 }, 0},
 
+       {{ USB_VENDOR_MEDIATEK, USB_PRODUCT_MEDIATEK_UMASS_INSTALLER }, 
DEV_UMASS8},
+       {{ USB_VENDOR_MEDIATEK, USB_PRODUCT_MEDIATEK_DC_4COM }, 0},
+
        /* XXX Some qualcomm devices are missing */
        {{ USB_VENDOR_QUALCOMM, USB_PRODUCT_QUALCOMM_MSM_DRIVER }, DEV_UMASS1},
        {{ USB_VENDOR_QUALCOMM, USB_PRODUCT_QUALCOMM_MSM_DRIVER2 }, DEV_UMASS4},
@@ -303,6 +307,11 @@ umsm_match(struct device *parent, void *
                                return UMATCH_VENDOR_IFACESUBCLASS;
                        } else
                                return UMATCH_NONE;
+               /* Ignore first two (MBIM?) interfaces of 
USB_PRODUCT_MEDIATEK_DC_4COM */
+               } else if (uaa->vendor == USB_VENDOR_MEDIATEK &&
+                          uaa->product == USB_PRODUCT_MEDIATEK_DC_4COM &&
+                          (uaa->ifaceno == 0 || uaa->ifaceno == 1)) {
+                       return UMATCH_NONE;
                } else
                        return UMATCH_VENDOR_IFACESUBCLASS;
        }
@@ -703,6 +712,13 @@ umsm_umass_changemode(struct umsm_softc 
                cbw.bCBWFlags = CBWFLAGS_IN;
                cbw.CBWCDB[0] = UMASS_SERVICE_ACTION_OUT;
                cbw.CBWCDB[1] = 0x03;
+               break;
+       case DEV_UMASS8:
+               USETDW(cbw.dCBWDataTransferLength, 0x0);
+               cbw.bCBWFlags = CBWFLAGS_OUT;
+               cbw.CBWCDB[0] = 0xf0;
+               cbw.CBWCDB[1] = 0x01;
+               cbw.CBWCDB[2] = 0x03;
                break;
        default:
                DPRINTF(("%s: unknown device type.\n", sc->sc_dev.dv_xname));

Reply via email to