Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Oct 2010 14:29:00 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r213480 - in head/sys/dev/usb: . serial
Message-ID:  <201010061429.o96ET0RW006850@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Wed Oct  6 14:29:00 2010
New Revision: 213480
URL: http://svn.freebsd.org/changeset/base/213480

Log:
  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

Modified:
  head/sys/dev/usb/serial/u3g.c
  head/sys/dev/usb/usb_msctest.c
  head/sys/dev/usb/usb_msctest.h
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/serial/u3g.c
==============================================================================
--- head/sys/dev/usb/serial/u3g.c	Wed Oct  6 12:41:42 2010	(r213479)
+++ head/sys/dev/usb/serial/u3g.c	Wed Oct  6 14:29:00 2010	(r213480)
@@ -93,6 +93,7 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug,
 #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_de
 	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_
 		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;

Modified: head/sys/dev/usb/usb_msctest.c
==============================================================================
--- head/sys/dev/usb/usb_msctest.c	Wed Oct  6 12:41:42 2010	(r213479)
+++ head/sys/dev/usb/usb_msctest.c	Wed Oct  6 14:29:00 2010	(r213480)
@@ -97,6 +97,8 @@ static uint8_t scsi_cmotech_eject[] =   
 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, u
 		    &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;

Modified: head/sys/dev/usb/usb_msctest.h
==============================================================================
--- head/sys/dev/usb/usb_msctest.h	Wed Oct  6 12:41:42 2010	(r213479)
+++ head/sys/dev/usb/usb_msctest.h	Wed Oct  6 14:29:00 2010	(r213480)
@@ -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,

Modified: head/sys/dev/usb/usbdevs
==============================================================================
--- head/sys/dev/usb/usbdevs	Wed Oct  6 12:41:42 2010	(r213479)
+++ head/sys/dev/usb/usbdevs	Wed Oct  6 14:29:00 2010	(r213480)
@@ -3148,6 +3148,7 @@ product TAUGA CAMERAMATE	0x0005	CameraMa
 
 /* 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010061429.o96ET0RW006850>