Date: Sun, 17 Oct 2010 17:39:54 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r213987 - in stable/8/sys/dev/usb: . serial Message-ID: <201010171739.o9HHdsOE040023@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Sun Oct 17 17:39:54 2010 New Revision: 213987 URL: http://svn.freebsd.org/changeset/base/213987 Log: Merge from head 213480,213481,213717: 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. Modified: stable/8/sys/dev/usb/serial/u3g.c stable/8/sys/dev/usb/usb_msctest.c stable/8/sys/dev/usb/usb_msctest.h stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/8/sys/dev/usb/serial/u3g.c Sun Oct 17 17:31:49 2010 (r213986) +++ stable/8/sys/dev/usb/serial/u3g.c Sun Oct 17 17:39:54 2010 (r213987) @@ -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, @@ -491,6 +492,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), @@ -668,6 +670,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: stable/8/sys/dev/usb/usb_msctest.c ============================================================================== --- stable/8/sys/dev/usb/usb_msctest.c Sun Oct 17 17:31:49 2010 (r213986) +++ stable/8/sys/dev/usb/usb_msctest.c Sun Oct 17 17:39:54 2010 (r213987) @@ -97,6 +97,7 @@ 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 }; #define BULK_SIZE 64 /* dummy */ #define ERR_CSW_FAILED -1 @@ -467,7 +468,6 @@ bbb_command_start(struct bbb_transfer *s sc->data_rem = data_len; sc->data_timeout = (data_timeout + USB_MS_HZ); sc->actlen = 0; - sc->data_ptr = data_ptr; sc->cmd_len = cmd_len; bzero(&sc->cbw.CBWCDB, sizeof(sc->cbw.CBWCDB)); bcopy(cmd_ptr, &sc->cbw.CBWCDB, cmd_len); @@ -619,6 +619,15 @@ usb_msc_eject(struct usb_device *udev, u &scsi_huawei_eject, sizeof(scsi_huawei_eject), USB_MS_HZ); break; + case MSC_EJECT_TCT: + /* + * TCTMobile needs DIR_IN flag. To get it, we + * supply a dummy data with the command. + */ + err = bbb_command_start(sc, DIR_IN, 0, &sc->buffer, + sizeof(sc->buffer), &scsi_tct_eject, + sizeof(scsi_tct_eject), USB_MS_HZ); + break; default: printf("usb_msc_eject: unknown eject method (%d)\n", method); break; Modified: stable/8/sys/dev/usb/usb_msctest.h ============================================================================== --- stable/8/sys/dev/usb/usb_msctest.h Sun Oct 17 17:31:49 2010 (r213986) +++ stable/8/sys/dev/usb/usb_msctest.h Sun Oct 17 17:39:54 2010 (r213987) @@ -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: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Sun Oct 17 17:31:49 2010 (r213986) +++ stable/8/sys/dev/usb/usbdevs Sun Oct 17 17:39:54 2010 (r213987) @@ -3127,6 +3127,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?201010171739.o9HHdsOE040023>