summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2010-10-06 14:29:00 +0000
committerglebius <glebius@FreeBSD.org>2010-10-06 14:29:00 +0000
commitff60b600fd22ef1399e00ce49fd2f33d709f10f7 (patch)
treec32765ccd19abee6d78d5dad1d28e0175cb341e2
parentce0838f76027fe60b391104523d17c8dc66b0f8a (diff)
downloadFreeBSD-src-ff60b600fd22ef1399e00ce49fd2f33d709f10f7.zip
FreeBSD-src-ff60b600fd22ef1399e00ce49fd2f33d709f10f7.tar.gz
Add support to Alcatel/TCTMobile X080S USB 3G modem. The device needs
special eject command to reappear as modem. It also requires DIR_IN flag in the command message, so we supply some dummy data along with the command. Feedback from X080S owners appreciated. I have not a pure Alcatel/TCTMobile device, but another one under "Svyaznoy" (Связной) brand, and I didn't yet managed to get it working. It is successfully recognized, it responds to AT commands, but it shuts up right after successfull CONNECT response. Reviewed by: hps
-rw-r--r--sys/dev/usb/serial/u3g.c5
-rw-r--r--sys/dev/usb/usb_msctest.c7
-rw-r--r--sys/dev/usb/usb_msctest.h1
-rw-r--r--sys/dev/usb/usbdevs1
4 files changed, 14 insertions, 0 deletions
diff --git a/sys/dev/usb/serial/u3g.c b/sys/dev/usb/serial/u3g.c
index 5509a8c..fb7351d 100644
--- a/sys/dev/usb/serial/u3g.c
+++ b/sys/dev/usb/serial/u3g.c
@@ -93,6 +93,7 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, CTLFLAG_RW,
#define U3GINIT_WAIT 7 /* Device reappears after a delay */
#define U3GINIT_SAEL_M460 8 /* Requires vendor init */
#define U3GINIT_HUAWEISCSI 9 /* Requires Huawei SCSI init command */
+#define U3GINIT_TCT 10 /* Requires TCT Mobile init command */
enum {
U3G_BULK_WR,
@@ -492,6 +493,7 @@ static const struct usb_device_id u3g_devs[] = {
U3G_DEV(STELERA, E1011, 0),
U3G_DEV(STELERA, E1012, 0),
U3G_DEV(TCTMOBILE, X060S, 0),
+ U3G_DEV(TCTMOBILE, X080S, U3GINIT_TCT),
U3G_DEV(TELIT, UC864E, 0),
U3G_DEV(TELIT, UC864G, 0),
U3G_DEV(TLAYTECH, TEU800, 0),
@@ -669,6 +671,9 @@ u3g_test_autoinst(void *arg, struct usb_device *udev,
case U3GINIT_CMOTECH:
error = usb_msc_eject(udev, 0, MSC_EJECT_CMOTECH);
break;
+ case U3GINIT_TCT:
+ error = usb_msc_eject(udev, 0, MSC_EJECT_TCT);
+ break;
case U3GINIT_SIERRA:
error = u3g_sierra_init(udev);
break;
diff --git a/sys/dev/usb/usb_msctest.c b/sys/dev/usb/usb_msctest.c
index ed9eac4..15b0ead 100644
--- a/sys/dev/usb/usb_msctest.c
+++ b/sys/dev/usb/usb_msctest.c
@@ -97,6 +97,8 @@ static uint8_t scsi_cmotech_eject[] = { 0xff, 0x52, 0x44, 0x45, 0x56, 0x43,
static uint8_t scsi_huawei_eject[] = { 0x11, 0x06, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00 };
+static uint8_t scsi_tct_eject[] = { 0x06, 0xf5, 0x04, 0x02, 0x52, 0x70 };
+static uint8_t scsi_tct_dummy[4];
#define BULK_SIZE 64 /* dummy */
#define ERR_CSW_FAILED -1
@@ -619,6 +621,11 @@ usb_msc_eject(struct usb_device *udev, uint8_t iface_index, int method)
&scsi_huawei_eject, sizeof(scsi_huawei_eject),
USB_MS_HZ);
break;
+ case MSC_EJECT_TCT:
+ err = bbb_command_start(sc, DIR_IN, 0, &scsi_tct_dummy,
+ sizeof(scsi_tct_dummy), &scsi_tct_eject,
+ sizeof(scsi_tct_eject), USB_MS_HZ);
+ break;
default:
printf("usb_msc_eject: unknown eject method (%d)\n", method);
break;
diff --git a/sys/dev/usb/usb_msctest.h b/sys/dev/usb/usb_msctest.h
index ce763df..807d5f5 100644
--- a/sys/dev/usb/usb_msctest.h
+++ b/sys/dev/usb/usb_msctest.h
@@ -33,6 +33,7 @@ enum {
MSC_EJECT_ZTESTOR,
MSC_EJECT_CMOTECH,
MSC_EJECT_HUAWEI,
+ MSC_EJECT_TCT,
};
int usb_iface_is_cdrom(struct usb_device *udev,
diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs
index 3120963..a733326 100644
--- a/sys/dev/usb/usbdevs
+++ b/sys/dev/usb/usbdevs
@@ -3148,6 +3148,7 @@ product TAUGA CAMERAMATE 0x0005 CameraMate (DPCM_USB)
/* TCTMobile products */
product TCTMOBILE X060S 0x0000 X060S 3G modem
+product TCTMOBILE X080S 0xf000 X080S 3G modem
/* TDK products */
product TDK UPA9664 0x0115 USB-PDC Adapter UPA9664
OpenPOWER on IntegriCloud