svn commit: r203905 - in head/sys/dev/usb: . serial

Andrew Thompson thompsa at FreeBSD.org
Sun Feb 14 20:05:12 UTC 2010


Author: thompsa
Date: Sun Feb 14 20:05:12 2010
New Revision: 203905
URL: http://svn.freebsd.org/changeset/base/203905

Log:
  Add support for the E1752 3G modem and the required eject command.
  
  Submitted by:	Milan Obuch

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	Sun Feb 14 20:00:21 2010	(r203904)
+++ head/sys/dev/usb/serial/u3g.c	Sun Feb 14 20:05:12 2010	(r203905)
@@ -92,6 +92,7 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug,
 #define	U3GINIT_CMOTECH		6	/* Requires CMOTECH SCSI command */
 #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 */
 
 enum {
 	U3G_BULK_WR,
@@ -281,6 +282,7 @@ static const struct usb_device_id u3g_de
 	U3G_DEV(HUAWEI, E220, U3GINIT_HUAWEI),
 	U3G_DEV(HUAWEI, E220BIS, U3GINIT_HUAWEI),
 	U3G_DEV(HUAWEI, MOBILE, U3GINIT_HUAWEI),
+	U3G_DEV(HUAWEI, E1752, U3GINIT_HUAWEISCSI),
 	U3G_DEV(KYOCERA2, CDMA_MSM_K, 0),
 	U3G_DEV(KYOCERA2, KPC680, 0),
 	U3G_DEV(MERLIN, V620, 0),
@@ -649,6 +651,9 @@ u3g_test_autoinst(void *arg, struct usb_
 		case U3GINIT_HUAWEI:
 			error = u3g_huawei_init(udev);
 			break;
+		case U3GINIT_HUAWEISCSI:
+			error = usb_msc_eject(udev, 0, MSC_EJECT_HUAWEI);
+			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	Sun Feb 14 20:00:21 2010	(r203904)
+++ head/sys/dev/usb/usb_msctest.c	Sun Feb 14 20:05:12 2010	(r203905)
@@ -94,6 +94,9 @@ static uint8_t scsi_ztestor_eject[] =   
 					  0x01, 0x01, 0x01, 0x01, 0x00, 0x00 };
 static uint8_t scsi_cmotech_eject[] =   { 0xff, 0x52, 0x44, 0x45, 0x56, 0x43,
 					  0x48, 0x47 };
+static uint8_t scsi_huawei_eject[] =	{ 0x11, 0x06, 0x00, 0x00, 0x00, 0x00,
+					  0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+					  0x00, 0x00, 0x00, 0x00 };
 
 #define	BULK_SIZE		64	/* dummy */
 #define	ERR_CSW_FAILED		-1
@@ -611,6 +614,11 @@ usb_msc_eject(struct usb_device *udev, u
 		    &scsi_cmotech_eject, sizeof(scsi_cmotech_eject),
 		    USB_MS_HZ);
 		break;
+	case MSC_EJECT_HUAWEI:
+		err = bbb_command_start(sc, DIR_IN, 0, NULL, 0,
+		    &scsi_huawei_eject, sizeof(scsi_huawei_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	Sun Feb 14 20:00:21 2010	(r203904)
+++ head/sys/dev/usb/usb_msctest.h	Sun Feb 14 20:05:12 2010	(r203905)
@@ -31,7 +31,8 @@ enum {
 	MSC_EJECT_STOPUNIT,
 	MSC_EJECT_REZERO,
 	MSC_EJECT_ZTESTOR,
-	MSC_EJECT_CMOTECH
+	MSC_EJECT_CMOTECH,
+	MSC_EJECT_HUAWEI,
 };
 
 int usb_iface_is_cdrom(struct usb_device *udev,

Modified: head/sys/dev/usb/usbdevs
==============================================================================
--- head/sys/dev/usb/usbdevs	Sun Feb 14 20:00:21 2010	(r203904)
+++ head/sys/dev/usb/usbdevs	Sun Feb 14 20:05:12 2010	(r203905)
@@ -1723,6 +1723,7 @@ product HUAWEI E143C		0x143c	3G modem
 product HUAWEI E143D		0x143d	3G modem
 product HUAWEI E143E		0x143e	3G modem
 product HUAWEI E143F		0x143f	3G modem
+product HUAWEI E1752		0x1446	3G modem
 product HUAWEI E14AC		0x14ac	3G modem
 
 /* HUAWEI 3com products */


More information about the svn-src-all mailing list