Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Aug 2014 09:35:25 +0000 (UTC)
From:      Nick Hibma <n_hibma@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r269576 - in head/sys/dev/usb: . quirk serial
Message-ID:  <53e0a55e.5552.63f51aa0@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: n_hibma
Date: Tue Aug  5 09:35:25 2014
New Revision: 269576
URL: http://svnweb.freebsd.org/changeset/base/269576

Log:
  Add a second Huawei SCSI eject command as USB mode switch config files
  sometimes use one or the other. Maybe newer Huawei modems switched.
  
  Add a quirk for it as well.
  
  PR:		145319
  Submitted by:	rozhuk.im gmail.com

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

Modified: head/sys/dev/usb/quirk/usb_quirk.c
==============================================================================
--- head/sys/dev/usb/quirk/usb_quirk.c	Tue Aug  5 08:48:24 2014	(r269575)
+++ head/sys/dev/usb/quirk/usb_quirk.c	Tue Aug  5 09:35:25 2014	(r269576)
@@ -562,6 +562,7 @@ static const char *usb_quirk_str[USB_QUI
 	[UQ_MSC_EJECT_WAIT]		= "UQ_MSC_EJECT_WAIT",
 	[UQ_MSC_EJECT_SAEL_M460]	= "UQ_MSC_EJECT_SAEL_M460",
 	[UQ_MSC_EJECT_HUAWEISCSI]	= "UQ_MSC_EJECT_HUAWEISCSI",
+	[UQ_MSC_EJECT_HUAWEISCSI2]	= "UQ_MSC_EJECT_HUAWEISCSI2",
 	[UQ_MSC_EJECT_TCT]		= "UQ_MSC_EJECT_TCT",
 	[UQ_BAD_MIDI]			= "UQ_BAD_MIDI",
 	[UQ_AU_VENDOR_CLASS]		= "UQ_AU_VENDOR_CLASS",

Modified: head/sys/dev/usb/quirk/usb_quirk.h
==============================================================================
--- head/sys/dev/usb/quirk/usb_quirk.h	Tue Aug  5 08:48:24 2014	(r269575)
+++ head/sys/dev/usb/quirk/usb_quirk.h	Tue Aug  5 09:35:25 2014	(r269576)
@@ -102,6 +102,7 @@ enum {
 	UQ_MSC_EJECT_WAIT,		/* wait for the device to eject */
 	UQ_MSC_EJECT_SAEL_M460,		/* ejects after Sael USB commands */ 
 	UQ_MSC_EJECT_HUAWEISCSI,	/* ejects after Huawei SCSI command */
+	UQ_MSC_EJECT_HUAWEISCSI2,	/* ejects after Huawei SCSI 2 command */
 	UQ_MSC_EJECT_TCT,		/* ejects after TCT SCSI command */
 
 	UQ_BAD_MIDI,		/* device claims MIDI class, but isn't */

Modified: head/sys/dev/usb/serial/u3g.c
==============================================================================
--- head/sys/dev/usb/serial/u3g.c	Tue Aug  5 08:48:24 2014	(r269575)
+++ head/sys/dev/usb/serial/u3g.c	Tue Aug  5 09:35:25 2014	(r269576)
@@ -86,7 +86,8 @@ 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 */
+#define	U3GINIT_HUAWEISCSI2	10	/* Requires Huawei SCSI init command (2) */
+#define	U3GINIT_TCT		11	/* Requires TCT Mobile init command */
 
 enum {
 	U3G_BULK_WR,
@@ -720,6 +721,8 @@ u3g_test_autoinst(void *arg, struct usb_
 		method = U3GINIT_WAIT;
 	else if (usb_test_quirk(uaa, UQ_MSC_EJECT_HUAWEISCSI))
 		method = U3GINIT_HUAWEISCSI;
+	else if (usb_test_quirk(uaa, UQ_MSC_EJECT_HUAWEISCSI2))
+		method = U3GINIT_HUAWEISCSI2;
 	else if (usb_test_quirk(uaa, UQ_MSC_EJECT_TCT))
 		method = U3GINIT_TCT;
 	else if (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa) == 0)
@@ -740,6 +743,9 @@ u3g_test_autoinst(void *arg, struct usb_
 		case U3GINIT_HUAWEISCSI:
 			error = usb_msc_eject(udev, 0, MSC_EJECT_HUAWEI);
 			break;
+		case U3GINIT_HUAWEISCSI2:
+			error = usb_msc_eject(udev, 0, MSC_EJECT_HUAWEI2);
+			break;
 		case U3GINIT_SCSIEJECT:
 			error = usb_msc_eject(udev, 0, MSC_EJECT_STOPUNIT);
 			break;

Modified: head/sys/dev/usb/usb_msctest.c
==============================================================================
--- head/sys/dev/usb/usb_msctest.c	Tue Aug  5 08:48:24 2014	(r269575)
+++ head/sys/dev/usb/usb_msctest.c	Tue Aug  5 09:35:25 2014	(r269576)
@@ -103,6 +103,9 @@ 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_huawei_eject2[] =	{ 0x11, 0x06, 0x20, 0x00, 0x00, 0x01,
+					  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_sync_cache[] =	{ 0x35, 0x00, 0x00, 0x00, 0x00, 0x00,
 					  0x00, 0x00, 0x00, 0x00 };
@@ -840,6 +843,11 @@ usb_msc_eject(struct usb_device *udev, u
 		    &scsi_huawei_eject, sizeof(scsi_huawei_eject),
 		    USB_MS_HZ);
 		break;
+	case MSC_EJECT_HUAWEI2:
+		err = bbb_command_start(sc, DIR_IN, 0, NULL, 0,
+		    &scsi_huawei_eject2, sizeof(scsi_huawei_eject2),
+		    USB_MS_HZ);
+		break;
 	case MSC_EJECT_TCT:
 		/*
 		 * TCTMobile needs DIR_IN flag. To get it, we

Modified: head/sys/dev/usb/usb_msctest.h
==============================================================================
--- head/sys/dev/usb/usb_msctest.h	Tue Aug  5 08:48:24 2014	(r269575)
+++ head/sys/dev/usb/usb_msctest.h	Tue Aug  5 09:35:25 2014	(r269576)
@@ -33,6 +33,7 @@ enum {
 	MSC_EJECT_ZTESTOR,
 	MSC_EJECT_CMOTECH,
 	MSC_EJECT_HUAWEI,
+	MSC_EJECT_HUAWEI2,
 	MSC_EJECT_TCT,
 };
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53e0a55e.5552.63f51aa0>