PATCH: umsm support for ZTE AC2746 (MTS MBLAZE)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

PATCH: umsm support for ZTE AC2746 (MTS MBLAZE)

Martin Furter-2
Hello,

My provider (mts mblaze) gave me a ZTE AC2746 USB modem to connect to
the internet. It works fine with WinDOS but OpenBSD just recognized it
as umass device.
Attached is a patch against 4.9 sources which adds support for ZTE
AC2746 to the umsm driver. I also attached a patch which changes the
return value of ucom_match from (1) to UMATCH_GENERIC.

Here is the dmesg output after booting a GENERIC kernel with the patch
applied:

umsm0 at uhub0 port 2 configuration 1 interface 0 "ZTE, Incorporated USB
Storage" rev 1.10/0.00 addr 3
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
root on wd0a swap on wd0b dump on wd0b
umsm0 detached
umsm0 at uhub0 port 2 configuration 1 interface 0 "ZTE, Incorporated ZTE
CDMA Tech" rev 1.10/0.00 addr 3
ucom0 at umsm0
umsm1 at uhub0 port 2 configuration 1 interface 1 "ZTE, Incorporated ZTE
CDMA Tech" rev 1.10/0.00 addr 3
ucom1 at umsm1
umsm2 at uhub0 port 2 configuration 1 interface 2 "ZTE, Incorporated ZTE
CDMA Tech" rev 1.10/0.00 addr 3
ucom2 at umsm2
umsm3 at uhub0 port 2 configuration 1 interface 3 "ZTE, Incorporated ZTE
CDMA Tech" rev 1.10/0.00 addr 3
ucom3 at umsm3
umsm4 at uhub0 port 2 configuration 1 interface 4 "ZTE, Incorporated ZTE
CDMA Tech" rev 1.10/0.00 addr 3
ucom4 at umsm4
umass0 at uhub0 port 2 configuration 1 interface 5 "ZTE, Incorporated
ZTE CDMA Tech" rev 1.10/0.00 addr 3
umass0: using SCSI over Bulk-Only
scsibus2 at umass0: 2 targets, initiator 0
sd0 at scsibus2 targ 1 lun 0: <ZTE, USB Storage FFF1, 2.31> SCSI2
0/direct removable
sd0: drive offline

I don't know why it adds so many umsm/ucom devices, but using cuaU0
works fine. Here's the ppp.conf entry for MTS:

MTS:
 set device /dev/cuaU0
 set speed 115200
 set dial "ABORT ERROR ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \
           \"\" ATZ OK-ATZ-OK ATD\\T TIMEOUT 40 CONNECT"
 set hangup "\"\" AT OK-AT-OK ATZ OK"
 set phone "#777"
 set authname [hidden email]
 set authkey mts
 set redial 15 4
 set timeout 0
 set reconnect 15 20
 set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
 add default HISADDR
 enable dns

If you have any advice how to find out why it adds so many devices
please tell me.
Please CC my since I'm not on the list.

Thanks,
Martin
diff -ur sys49/dev/usb/umsm.c sys/dev/usb/umsm.c
--- sys49/dev/usb/umsm.c Tue Feb 22 08:34:37 2011
+++ sys/dev/usb/umsm.c Thu Jun  9 05:51:56 2011
@@ -114,8 +114,9 @@
 #define DEV_UMASS4 0x0080
 #define DEV_UMASS5 0x0100
 #define DEV_UMASS6 0x0200
+#define DEV_UMASS7 0x0400
 #define DEV_UMASS (DEV_UMASS1 | DEV_UMASS2 | DEV_UMASS3 | DEV_UMASS4 | \
-    DEV_UMASS5 | DEV_UMASS6)
+    DEV_UMASS5 | DEV_UMASS6 | DEV_UMASS7)
 };
 
 static const struct umsm_type umsm_devs[] = {
@@ -161,6 +162,8 @@
  {{ USB_VENDOR_ZTE, USB_PRODUCT_ZTE_MF112 }, DEV_UMASS4},
  {{ USB_VENDOR_ZTE, USB_PRODUCT_ZTE_MF633 }, 0},
  {{ USB_VENDOR_ZTE, USB_PRODUCT_ZTE_MF637 }, 0},
+ {{ USB_VENDOR_ZTE, USB_PRODUCT_ZTE_AC2746 }, 0},
+ {{ USB_VENDOR_ZTE, USB_PRODUCT_ZTE_UMASS_INSTALLER3 }, DEV_UMASS7},
 
  {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_EXPRESSCARD }, 0},
  {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_MERLINV620 }, 0},
@@ -705,6 +708,12 @@
  cbw.CBWCDB[7] = 0x01;
  cbw.CBWCDB[8] = 0x01;
  cbw.CBWCDB[9] = 0x01;
+ break;
+ case DEV_UMASS7: /* ZTE */
+ USETDW(cbw.dCBWDataTransferLength, 0xc0);
+ cbw.bCBWFlags = CBWFLAGS_IN;
+ cbw.CBWCDB[0] = 0x9f;
+ cbw.CBWCDB[1] = 0x03;
  break;
  default:
  DPRINTF(("%s: unknown device type.\n", sc->sc_dev.dv_xname));
diff -ur sys49/dev/usb/usbdevs.h sys/dev/usb/usbdevs.h
--- sys49/dev/usb/usbdevs.h Tue Feb 22 08:34:37 2011
+++ sys/dev/usb/usbdevs.h Thu Jun  9 05:37:32 2011
@@ -3121,6 +3121,8 @@
 #define USB_PRODUCT_ZTE_UMASS_INSTALLER2 0x0103 /* ZTE USB MSM installer */
 #define USB_PRODUCT_ZTE_MF112 0x0117 /* ZTE MF112 HSUPA USB modem */
 #define USB_PRODUCT_ZTE_UMASS_INSTALLER 0x2000 /* ZTE USB MSM installer */
+#define USB_PRODUCT_ZTE_AC2746 0xfff1 /* AC2746 CDMA2000 USB modem */
+#define USB_PRODUCT_ZTE_UMASS_INSTALLER3 0xfff5 /* ZTE USB CDMA installer */
 #define USB_PRODUCT_ZTE_AC8700 0xfffe /* AC8700 CDMA USB modem */
 
 /* Quanta products */
diff -ur sys49/dev/usb/usbdevs_data.h sys/dev/usb/usbdevs_data.h
--- sys49/dev/usb/usbdevs_data.h Tue Feb 22 08:34:37 2011
+++ sys/dev/usb/usbdevs_data.h Thu Jun  9 05:39:50 2011
@@ -7558,6 +7558,14 @@
     "ZTE USB MSM installer",
  },
  {
+    USB_VENDOR_ZTE, USB_PRODUCT_ZTE_AC2746,
+    "AC2746 CDMA2000 USB modem",
+ },
+ {
+    USB_VENDOR_ZTE, USB_PRODUCT_ZTE_UMASS_INSTALLER3,
+    "ZTE USB MSM installer",
+ },
+ {
     USB_VENDOR_ZTE, USB_PRODUCT_ZTE_AC8700,
     "AC8700 CDMA USB modem",
  },
diff -ur sys49/dev/usb/ucom.c sys/dev/usb/ucom.c
--- sys49/dev/usb/ucom.c Mon Nov 29 21:56:11 2010
+++ sys/dev/usb/ucom.c Wed Jun  8 12:39:50 2011
@@ -176,7 +176,7 @@
 int
 ucom_match(struct device *parent, void *match, void *aux)
 {
- return (1);
+ return UMATCH_GENERIC;
 }
 
 void

Reply | Threaded
Open this post in threaded view
|

Re: PATCH: umsm support for ZTE AC2746 (MTS MBLAZE)

Jonathan Gray
I've committed this with some changes
- you should be editing usbdevs then running make not editing the
  generated .h files directly
- made the scsi code (SERVICE ACTION OUT) a define to match the other
  parts of umsm
- alphabetically sorted devs array
- added an entry to the man page

The other interfaces are likely various undocumented protocols for
signalling and diagnostics, see
http://blogs.gnome.org/dcbw/2010/04/15/mobile-broadband-and-qualcomm-proprietary-protocols/