* [PATCH 1/2]linux-usb:Define a new macro for USB storage match rules
@ 2012-12-18 2:42 fangxiaozhi 00110321
2012-12-18 2:44 ` [PATCH 2/2]linux-usb:optimize to match the Huawei USB storage devices and support new switch command fangxiaozhi 00110321
0 siblings, 1 reply; 16+ messages in thread
From: fangxiaozhi 00110321 @ 2012-12-18 2:42 UTC (permalink / raw)
To: linux-usb
Cc: linux-kernel, zihan, Lin.Lei, greg, neil.yi, wangyuhua, huqiao36,
balbi
From: fangxiaozhi <huananhu@huawei.com>
1. Define a new macro for USB storage match rules:
matching with Vendor ID and interface descriptors.
Signed-off-by: fangxiaozhi <huananhu@huawei.com>
--------------------------------------------------------------------
diff -uprN linux-3.7_bak/drivers/usb/storage/usb.c linux-3.7/drivers/usb/storage/usb.c
--- linux-3.7_bak/drivers/usb/storage/usb.c 2012-12-11 09:56:11.000000000 +0800
+++ linux-3.7/drivers/usb/storage/usb.c 2012-12-12 11:46:06.000000000 +0800
@@ -120,6 +120,17 @@ MODULE_PARM_DESC(quirks, "supplemental l
.useTransport = use_transport, \
}
+#define UNUSUAL_VENDOR_INTF(idVendor, cl, sc, pr, \
+ vendor_name, product_name, use_protocol, use_transport, \
+ init_function, Flags) \
+{ \
+ .vendorName = vendor_name, \
+ .productName = product_name, \
+ .useProtocol = use_protocol, \
+ .useTransport = use_transport, \
+ .initFunction = init_function, \
+}
+
static struct us_unusual_dev us_unusual_dev_list[] = {
# include "unusual_devs.h"
{ } /* Terminating entry */
@@ -131,6 +142,7 @@ static struct us_unusual_dev for_dynamic
#undef UNUSUAL_DEV
#undef COMPLIANT_DEV
#undef USUAL_DEV
+#undef UNUSUAL_VENDOR_INTF
#ifdef CONFIG_LOCKDEP
diff -uprN linux-3.7_bak/drivers/usb/storage/usual-tables.c linux-3.7/drivers/usb/storage/usual-tables.c
--- linux-3.7_bak/drivers/usb/storage/usual-tables.c 2012-12-11 09:56:11.000000000 +0800
+++ linux-3.7/drivers/usb/storage/usual-tables.c 2012-12-13 20:51:27.000000000 +0800
@@ -41,6 +41,19 @@
#define USUAL_DEV(useProto, useTrans) \
{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans) }
+/* Define the device is matched with Vendor ID and interface descriptors */
+#define UNUSUAL_VENDOR_INTF(id_vendor, cl, sc, pr, \
+ vendorName, productName, useProtocol, useTransport, \
+ initFunction, flags) \
+{ \
+ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
+ | USB_DEVICE_ID_MATCH_VENDOR, \
+ .idVendor = (id_vendor), \
+ .bInterfaceClass = (cl), \
+ .bInterfaceSubClass = (sc), \
+ .bInterfaceProtocol = (pr), \
+ .driver_info = (flags) }
+
struct usb_device_id usb_storage_usb_ids[] = {
# include "unusual_devs.h"
{ } /* Terminating entry */
@@ -50,6 +63,7 @@ MODULE_DEVICE_TABLE(usb, usb_storage_usb
#undef UNUSUAL_DEV
#undef COMPLIANT_DEV
#undef USUAL_DEV
+#undef UNUSUAL_VENDOR_INTF
/*
* The table of devices to ignore
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 2/2]linux-usb:optimize to match the Huawei USB storage devices and support new switch command
2012-12-18 2:42 [PATCH 1/2]linux-usb:Define a new macro for USB storage match rules fangxiaozhi 00110321
@ 2012-12-18 2:44 ` fangxiaozhi 00110321
2012-12-18 14:10 ` Sebastian Andrzej Siewior
0 siblings, 1 reply; 16+ messages in thread
From: fangxiaozhi 00110321 @ 2012-12-18 2:44 UTC (permalink / raw)
To: linux-usb
Cc: linux-kernel, zihan, Lin.Lei, greg, neil.yi, wangyuhua, huqiao36,
balbi
From: fangxiaozhi <huananhu@huawei.com>
1. Optimize the match rules with new macro for Huawei USB storage devices,
to avoid to load USB storage driver for the modem interface
with Huawei devices.
2. Add to support new switch command for new Huawei USB dongles.
Signed-off-by: fangxiaozhi <huananhu@huawei.com>
--------------------------------------------------------------------
diff -uprN linux-3.7_bak/drivers/usb/storage/initializers.c linux-3.7/drivers/usb/storage/initializers.c
--- linux-3.7_bak/drivers/usb/storage/initializers.c 2012-12-11 09:56:11.000000000 +0800
+++ linux-3.7/drivers/usb/storage/initializers.c 2012-12-17 11:12:12.000000000 +0800
@@ -92,8 +92,8 @@ int usb_stor_ucr61s2b_init(struct us_dat
return 0;
}
-/* This places the HUAWEI E220 devices in multi-port mode */
-int usb_stor_huawei_e220_init(struct us_data *us)
+/* This places the HUAWEI usb dongles in multi-port mode */
+static int usb_stor_huawei_feature_init(struct us_data *us)
{
int result;
@@ -104,3 +104,59 @@ int usb_stor_huawei_e220_init(struct us_
US_DEBUGP("Huawei mode set result is %d\n", result);
return 0;
}
+
+/* Find the supported Huawei USB dongles */
+static int usb_stor_huawei_dongles_pid(struct us_data *us)
+{
+ struct usb_interface_descriptor *idesc;
+ int idProduct;
+
+ idesc = &us->pusb_intf->cur_altsetting->desc;
+ idProduct = us->pusb_dev->descriptor.idProduct;
+ if (idesc && idesc->bInterfaceNumber == 0) {
+ if ((idProduct == 0x1001)
+ || (idProduct == 0x1003)
+ || (idProduct == 0x1004)
+ || (idProduct >= 0x1401 && idProduct < 0x1501)
+ || (idProduct > 0x1504 && idProduct <= 0x1600)
+ || (idProduct >= 0x1c02 && idProduct <= 0x2202)) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
+static int usb_stor_huawei_scsi_init(struct us_data *us)
+{
+ int result = 0;
+ int act_len = 0;
+ char rewind_cmd[] = {0x11, 0x06, 0x20, 0x00, 0x00, 0x01, 0x01, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+ struct bulk_cb_wrap *bcbw = (struct bulk_cb_wrap *) us->iobuf;
+
+ memset(bcbw, 0, sizeof(struct bulk_cb_wrap));
+ bcbw->Signature = cpu_to_le32(US_BULK_CB_SIGN);
+ bcbw->Tag = 0;
+ bcbw->DataTransferLength = 0;
+ bcbw->Flags = bcbw->Lun = 0;
+ bcbw->Length = sizeof(rewind_cmd);
+ memcpy(bcbw->CDB, rewind_cmd, sizeof(rewind_cmd));
+
+ result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, &bcbw,
+ US_BULK_CS_WRAP_LEN, &act_len);
+ US_DEBUGP("transfer actual length=%d, result=%d\n", act_len, result);
+ return result;
+}
+
+int usb_stor_huawei_init(struct us_data *us)
+{
+ int result = 0;
+
+ if (usb_stor_huawei_dongles_pid(us)) {
+ if (us->pusb_dev->descriptor.idProduct >= 0x1446)
+ result = usb_stor_huawei_scsi_init(us);
+ else
+ result = usb_stor_huawei_feature_init(us);
+ }
+ return result;
+}
diff -uprN linux-3.7_bak/drivers/usb/storage/initializers.h linux-3.7/drivers/usb/storage/initializers.h
--- linux-3.7_bak/drivers/usb/storage/initializers.h 2012-12-11 09:56:11.000000000 +0800
+++ linux-3.7/drivers/usb/storage/initializers.h 2012-12-17 10:39:55.000000000 +0800
@@ -46,5 +46,5 @@ int usb_stor_euscsi_init(struct us_data
* flash reader */
int usb_stor_ucr61s2b_init(struct us_data *us);
-/* This places the HUAWEI E220 devices in multi-port mode */
-int usb_stor_huawei_e220_init(struct us_data *us);
+/* This places the HUAWEI usb dongles in multi-port mode */
+int usb_stor_huawei_init(struct us_data *us);
Binary files linux-3.7_bak/drivers/usb/storage/initializers.o and linux-3.7/drivers/usb/storage/initializers.o differ
diff -uprN linux-3.7_bak/drivers/usb/storage/unusual_devs.h linux-3.7/drivers/usb/storage/unusual_devs.h
--- linux-3.7_bak/drivers/usb/storage/unusual_devs.h 2012-12-11 09:56:11.000000000 +0800
+++ linux-3.7/drivers/usb/storage/unusual_devs.h 2012-12-17 10:40:10.000000000 +0800
@@ -1527,335 +1527,10 @@ UNUSUAL_DEV( 0x1210, 0x0003, 0x0100, 0x
/* Reported by fangxiaozhi <huananhu@huawei.com>
* This brings the HUAWEI data card devices into multi-port mode
*/
-UNUSUAL_DEV( 0x12d1, 0x1001, 0x0000, 0x0000,
+UNUSUAL_VENDOR_INTF(0x12d1, 0x08, 0x06, 0x50,
"HUAWEI MOBILE",
"Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1003, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1004, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1401, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1402, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1403, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1404, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1405, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1406, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1407, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1408, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1409, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x140A, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x140B, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x140C, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x140D, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x140E, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x140F, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1410, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1411, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1412, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1413, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1414, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1415, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1416, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1417, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1418, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1419, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x141A, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x141B, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x141C, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x141D, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x141E, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x141F, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1420, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1421, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1422, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1423, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1424, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1425, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1426, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1427, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1428, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1429, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x142A, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x142B, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x142C, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x142D, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x142E, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x142F, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1430, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1431, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1432, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1433, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1434, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1435, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1436, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1437, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1438, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x1439, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x143A, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x143B, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x143C, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x143D, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x143E, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
- 0),
-UNUSUAL_DEV( 0x12d1, 0x143F, 0x0000, 0x0000,
- "HUAWEI MOBILE",
- "Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_init,
0),
/* Reported by Vilius Bilinkevicius <vilisas AT xxx DOT lt) */
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 2/2]linux-usb:optimize to match the Huawei USB storage devices and support new switch command
2012-12-18 2:44 ` [PATCH 2/2]linux-usb:optimize to match the Huawei USB storage devices and support new switch command fangxiaozhi 00110321
@ 2012-12-18 14:10 ` Sebastian Andrzej Siewior
2012-12-19 3:13 ` Fangxiaozhi (Franko)
0 siblings, 1 reply; 16+ messages in thread
From: Sebastian Andrzej Siewior @ 2012-12-18 14:10 UTC (permalink / raw)
To: fangxiaozhi 00110321
Cc: linux-usb, linux-kernel, zihan, Lin.Lei, greg, neil.yi, wangyuhua,
huqiao36, balbi
On Tue, Dec 18, 2012 at 10:44:19AM +0800, fangxiaozhi 00110321 wrote:
> diff -uprN linux-3.7_bak/drivers/usb/storage/initializers.c linux-3.7/drivers/usb/storage/initializers.c
> --- linux-3.7_bak/drivers/usb/storage/initializers.c 2012-12-11 09:56:11.000000000 +0800
> +++ linux-3.7/drivers/usb/storage/initializers.c 2012-12-17 11:12:12.000000000 +0800
> US_DEBUGP("Huawei mode set result is %d\n", result);
> return 0;
> }
> +
> +/* Find the supported Huawei USB dongles */
> +static int usb_stor_huawei_dongles_pid(struct us_data *us)
> +{
> + struct usb_interface_descriptor *idesc;
> + int idProduct;
> +
> + idesc = &us->pusb_intf->cur_altsetting->desc;
> + idProduct = us->pusb_dev->descriptor.idProduct;
> + if (idesc && idesc->bInterfaceNumber == 0) {
> + if ((idProduct == 0x1001)
> + || (idProduct == 0x1003)
> + || (idProduct == 0x1004)
> + || (idProduct >= 0x1401 && idProduct < 0x1501)
> + || (idProduct > 0x1504 && idProduct <= 0x1600)
> + || (idProduct >= 0x1c02 && idProduct <= 0x2202)) {
> + return 1;
> + }
> + }
> + return 0;
> +}
> +
> +static int usb_stor_huawei_scsi_init(struct us_data *us)
> +{
> + int result = 0;
> + int act_len = 0;
> + char rewind_cmd[] = {0x11, 0x06, 0x20, 0x00, 0x00, 0x01, 0x01, 0x00,
> + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
Has this something to do with the SPACE command as defined in SSC-2? I don't
see the code (0x6 here) to be defined. But then you name is rewind.
> + struct bulk_cb_wrap *bcbw = (struct bulk_cb_wrap *) us->iobuf;
> +
> + memset(bcbw, 0, sizeof(struct bulk_cb_wrap));
> + bcbw->Signature = cpu_to_le32(US_BULK_CB_SIGN);
> + bcbw->Tag = 0;
> + bcbw->DataTransferLength = 0;
> + bcbw->Flags = bcbw->Lun = 0;
A memset() followed by an init of each member of the struct. Could please
chose one side?
> + bcbw->Length = sizeof(rewind_cmd);
> + memcpy(bcbw->CDB, rewind_cmd, sizeof(rewind_cmd));
> +
> + result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, &bcbw,
> + US_BULK_CS_WRAP_LEN, &act_len);
I am a little confused here. Shouldn't this be bcbw aka us->iobuf and not
&bcbw ?
And shouldn't you read something from the us->recv_bulk_pipe after that?
> + US_DEBUGP("transfer actual length=%d, result=%d\n", act_len, result);
> + return result;
> +}
> +
Sebastian
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [PATCH 2/2]linux-usb:optimize to match the Huawei USB storage devices and support new switch command
2012-12-18 14:10 ` Sebastian Andrzej Siewior
@ 2012-12-19 3:13 ` Fangxiaozhi (Franko)
2012-12-19 8:34 ` Sebastian Andrzej Siewior
0 siblings, 1 reply; 16+ messages in thread
From: Fangxiaozhi (Franko) @ 2012-12-19 3:13 UTC (permalink / raw)
To: Sebastian Andrzej Siewior
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Xueguiying (Zihan), Linlei (Lei Lin), greg@kroah.com, Yili (Neil),
Wangyuhua (Roger, Credit), Huqiao, balbi@ti.com
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 3509 bytes --]
Dear Sebastian:
Please see the comments follows yours.
By the way, I found the kernel is updated to 3.7.1 today. So I have to update my patch based on 3.7.1, and resubmit it?
Right?
Best Regards,
Franko Fang
> -----Original Message-----
> From: Sebastian Andrzej Siewior [mailto:sebastian@breakpoint.cc]
> Sent: Tuesday, December 18, 2012 10:10 PM
> To: Fangxiaozhi (Franko)
> Cc: linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org; Xueguiying
> (Zihan); Linlei (Lei Lin); greg@kroah.com; Yili (Neil); Wangyuhua (Roger,
> Credit); Huqiao; balbi@ti.com
> Subject: Re: [PATCH 2/2]linux-usb:optimize to match the Huawei USB
> storage devices and support new switch command
>
> On Tue, Dec 18, 2012 at 10:44:19AM +0800, fangxiaozhi 00110321 wrote:
> > diff -uprN linux-3.7_bak/drivers/usb/storage/initializers.c
> linux-3.7/drivers/usb/storage/initializers.c
> > --- linux-3.7_bak/drivers/usb/storage/initializers.c 2012-12-11
> 09:56:11.000000000 +0800
> > +++ linux-3.7/drivers/usb/storage/initializers.c 2012-12-17
> 11:12:12.000000000 +0800
> > US_DEBUGP("Huawei mode set result is %d\n", result);
> > return 0;
> > }
> > +
> > +/* Find the supported Huawei USB dongles */ static int
> > +usb_stor_huawei_dongles_pid(struct us_data *us) {
> > + struct usb_interface_descriptor *idesc;
> > + int idProduct;
> > +
> > + idesc = &us->pusb_intf->cur_altsetting->desc;
> > + idProduct = us->pusb_dev->descriptor.idProduct;
> > + if (idesc && idesc->bInterfaceNumber == 0) {
> > + if ((idProduct == 0x1001)
> > + || (idProduct == 0x1003)
> > + || (idProduct == 0x1004)
> > + || (idProduct >= 0x1401 && idProduct < 0x1501)
> > + || (idProduct > 0x1504 && idProduct <= 0x1600)
> > + || (idProduct >= 0x1c02 && idProduct <= 0x2202)) {
> > + return 1;
> > + }
> > + }
> > + return 0;
> > +}
> > +
> > +static int usb_stor_huawei_scsi_init(struct us_data *us) {
> > + int result = 0;
> > + int act_len = 0;
> > + char rewind_cmd[] = {0x11, 0x06, 0x20, 0x00, 0x00, 0x01, 0x01, 0x00,
> > + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
>
> Has this something to do with the SPACE command as defined in SSC-2? I
> don't see the code (0x6 here) to be defined. But then you name is rewind.
Yes, we redefine the SPACE based on our need, and named it "rewind"
>
> > + struct bulk_cb_wrap *bcbw = (struct bulk_cb_wrap *) us->iobuf;
> > +
> > + memset(bcbw, 0, sizeof(struct bulk_cb_wrap));
> > + bcbw->Signature = cpu_to_le32(US_BULK_CB_SIGN);
> > + bcbw->Tag = 0;
> > + bcbw->DataTransferLength = 0;
> > + bcbw->Flags = bcbw->Lun = 0;
>
> A memset() followed by an init of each member of the struct. Could please
> chose one side?
>
> > + bcbw->Length = sizeof(rewind_cmd);
> > + memcpy(bcbw->CDB, rewind_cmd, sizeof(rewind_cmd));
> > +
> > + result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, &bcbw,
> > + US_BULK_CS_WRAP_LEN, &act_len);
>
> I am a little confused here. Shouldn't this be bcbw aka us->iobuf and not
> &bcbw ?
Yes, you are right.
>
> And shouldn't you read something from the us->recv_bulk_pipe after
> that?
Well, because our device will re-connect to switch the ports if it receives the command.
So it is not necessary to read the response of the command.
>
> > + US_DEBUGP("transfer actual length=%d, result=%d\n", act_len,
> result);
> > + return result;
> > +}
> > +
>
> Sebastian
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 2/2]linux-usb:optimize to match the Huawei USB storage devices and support new switch command
2012-12-19 3:13 ` Fangxiaozhi (Franko)
@ 2012-12-19 8:34 ` Sebastian Andrzej Siewior
2012-12-19 15:40 ` Matthew Dharm
0 siblings, 1 reply; 16+ messages in thread
From: Sebastian Andrzej Siewior @ 2012-12-19 8:34 UTC (permalink / raw)
To: Fangxiaozhi (Franko)
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Xueguiying (Zihan), Linlei (Lei Lin), greg@kroah.com, Yili (Neil),
Wangyuhua (Roger, Credit), Huqiao, balbi@ti.com
On Wed, Dec 19, 2012 at 03:13:32AM +0000, Fangxiaozhi (Franko) wrote:
> By the way, I found the kernel is updated to 3.7.1 today. So I have to update my patch based on 3.7.1, and resubmit it?
> Right?
You should rebase your patch on top of Greg's usb-next branch of his usb tree.
http://git.kernel.org/?p=linux/kernel/git/gregkh/usb.git;a=shortlog;h=refs/heads/usb-next
but I guess that there are hardly any changes in that area. The last change in
drivers/usb/storage/initializers.* is yours "USB: usb-storage fails to attach
to Huawei Datacard cdrom device".
If you call ./scripts/get_maintainer.pl on your patch you should learn that
you miss
|Matthew Dharm <mdharm-usb@one-eyed-alien.net>
|usb-storage@lists.one-eyed-alien.net
> > And shouldn't you read something from the us->recv_bulk_pipe after
> > that?
> Well, because our device will re-connect to switch the ports if it receives the command.
> So it is not necessary to read the response of the command.
Hmm. I guess this for Matthew / Greg to decide, I don't insist on anything.
Maybe a comment would be nice because now it looks, atleast to me, that
something is missing.
Sebastian
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 2/2]linux-usb:optimize to match the Huawei USB storage devices and support new switch command
2012-12-19 8:34 ` Sebastian Andrzej Siewior
@ 2012-12-19 15:40 ` Matthew Dharm
2013-01-04 7:30 ` Fangxiaozhi (Franko)
0 siblings, 1 reply; 16+ messages in thread
From: Matthew Dharm @ 2012-12-19 15:40 UTC (permalink / raw)
To: Sebastian Andrzej Siewior
Cc: Fangxiaozhi (Franko), linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, Xueguiying (Zihan),
Linlei (Lei Lin), greg@kroah.com, Yili (Neil),
Wangyuhua (Roger, Credit), Huqiao, balbi@ti.com
On Wed, Dec 19, 2012 at 12:34 AM, Sebastian Andrzej Siewior
<sebastian@breakpoint.cc> wrote:
> On Wed, Dec 19, 2012 at 03:13:32AM +0000, Fangxiaozhi (Franko) wrote:
>> > And shouldn't you read something from the us->recv_bulk_pipe after
>> > that?
>> Well, because our device will re-connect to switch the ports if it receives the command.
>> So it is not necessary to read the response of the command.
>
> Hmm. I guess this for Matthew / Greg to decide, I don't insist on anything.
> Maybe a comment would be nice because now it looks, atleast to me, that
> something is missing.
I think an unusual situation like that deserves a comment that
explains that the device is about to disconnect / reconnect, so
reading status is not necessary.
I am also concerned about the error of using &bcbw instead of bcbw. I
doubt this code would have worked with that typo in place. How was
this patch tested?
Also, the dongles_pid function is really just a different
implementation of the unusual_devs.h table. I think that it is much
easier for people to add new entries to the table, rather than edit
your code, when new dongles are released. BUT, your code includes
many more PIDs than the table did. Again, how was this tested for the
new PIDs covered? At a minimum, some comment in dongles_pid is
required to highlight this area of code for possible future expansion
as new devices are released.
Matt
--
Matthew Dharm
Maintainer, USB Mass Storage driver for Linux
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [PATCH 2/2]linux-usb:optimize to match the Huawei USB storage devices and support new switch command
2012-12-19 15:40 ` Matthew Dharm
@ 2013-01-04 7:30 ` Fangxiaozhi (Franko)
0 siblings, 0 replies; 16+ messages in thread
From: Fangxiaozhi (Franko) @ 2013-01-04 7:30 UTC (permalink / raw)
To: Matthew Dharm, Sebastian Andrzej Siewior
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Xueguiying (Zihan), Linlei (Lei Lin), greg@kroah.com, Yili (Neil),
Wangyuhua (Roger, Credit), Huqiao (C), balbi@ti.com
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 3056 bytes --]
Dear Matthew:
> -----Original Message-----
> From: Matthew Dharm [mailto:mdharm-usb@one-eyed-alien.net]
> Sent: Wednesday, December 19, 2012 11:41 PM
> To: Sebastian Andrzej Siewior
> Cc: Fangxiaozhi (Franko); linux-usb@vger.kernel.org;
> linux-kernel@vger.kernel.org; Xueguiying (Zihan); Linlei (Lei Lin);
> greg@kroah.com; Yili (Neil); Wangyuhua (Roger, Credit); Huqiao; balbi@ti.com
> Subject: Re: [PATCH 2/2]linux-usb:optimize to match the Huawei USB storage
> devices and support new switch command
>
> On Wed, Dec 19, 2012 at 12:34 AM, Sebastian Andrzej Siewior
> <sebastian@breakpoint.cc> wrote:
> > On Wed, Dec 19, 2012 at 03:13:32AM +0000, Fangxiaozhi (Franko) wrote:
> >> > And shouldn't you read something from the us->recv_bulk_pipe after
> >> > that?
> >> Well, because our device will re-connect to switch the ports if it
> receives the command.
> >> So it is not necessary to read the response of the command.
> >
> > Hmm. I guess this for Matthew / Greg to decide, I don't insist on anything.
> > Maybe a comment would be nice because now it looks, atleast to me,
> > that something is missing.
>
> I think an unusual situation like that deserves a comment that explains that the
> device is about to disconnect / reconnect, so reading status is not necessary.
You mean that we have to add some comment in the source code,
to explain why we don't read the response. Right?
>
> I am also concerned about the error of using &bcbw instead of bcbw. I doubt
> this code would have worked with that typo in place. How was this patch
> tested?
>
> Also, the dongles_pid function is really just a different implementation of the
> unusual_devs.h table. I think that it is much easier for people to add new
> entries to the table, rather than edit your code, when new dongles are released.
> BUT, your code includes many more PIDs than the table did. Again, how was
> this tested for the new PIDs covered?
In the dongles_pid function, we have check all the product IDs for our dongles, which is assigned for all of our Mobile Broadband products in our company. So the product ID of our new dongle in future, will also be included in this list.
In our lab, we can configure our dongle firmware to support all of these product ID. We have test them(cover all the product ID), and this function works fine.
>At a minimum, some comment in
> dongles_pid is required to highlight this area of code for possible future
> expansion as new devices are released.
As far as I know, the product ID list in dongles_pid function includes all. We will not add any other product ID for our dongle. So we need not update the product ID list in dongles_pid function in future.
However, I also will add the comment to highlight the area of code, as your advice did.
>
> Matt
>
> --
> Matthew Dharm
> Maintainer, USB Mass Storage driver for Linux
Best Regards,
Franko Fang
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 1/2]linux-usb:Define a new macro for USB storage match rules
@ 2013-01-25 2:44 fangxiaozhi 00110321
2013-01-25 12:18 ` Sergei Shtylyov
2013-01-27 18:42 ` Sebastian Andrzej Siewior
0 siblings, 2 replies; 16+ messages in thread
From: fangxiaozhi 00110321 @ 2013-01-25 2:44 UTC (permalink / raw)
To: linux-usb
Cc: linux-kernel, zihan, Lin.Lei, greg, neil.yi, wangyuhua, huqiao36,
balbi, mdharm-usb, sebastian
From: fangxiaozhi <huananhu@huawei.com>
1. Define a new macro for USB storage match rules:
matching with Vendor ID and interface descriptors.
Signed-off-by: fangxiaozhi <huananhu@huawei.com>
--------------------------------------------------------------------
diff -uprN linux-3.8-rc4_orig/drivers/usb/storage/usb.c linux-3.8-rc4/drivers/usb/storage/usb.c
--- linux-3.8-rc4_orig/drivers/usb/storage/usb.c 2013-01-22 14:12:42.595238727 +0800
+++ linux-3.8-rc4/drivers/usb/storage/usb.c 2013-01-22 14:16:01.398250305 +0800
@@ -120,6 +120,17 @@ MODULE_PARM_DESC(quirks, "supplemental l
.useTransport = use_transport, \
}
+#define UNUSUAL_VENDOR_INTF(idVendor, cl, sc, pr, \
+ vendor_name, product_name, use_protocol, use_transport, \
+ init_function, Flags) \
+{ \
+ .vendorName = vendor_name, \
+ .productName = product_name, \
+ .useProtocol = use_protocol, \
+ .useTransport = use_transport, \
+ .initFunction = init_function, \
+}
+
static struct us_unusual_dev us_unusual_dev_list[] = {
# include "unusual_devs.h"
{ } /* Terminating entry */
@@ -131,6 +142,7 @@ static struct us_unusual_dev for_dynamic
#undef UNUSUAL_DEV
#undef COMPLIANT_DEV
#undef USUAL_DEV
+#undef UNUSUAL_VENDOR_INTF
#ifdef CONFIG_LOCKDEP
diff -uprN linux-3.8-rc4_orig/drivers/usb/storage/usual-tables.c linux-3.8-rc4/drivers/usb/storage/usual-tables.c
--- linux-3.8-rc4_orig/drivers/usb/storage/usual-tables.c 2013-01-22 14:12:42.594238726 +0800
+++ linux-3.8-rc4/drivers/usb/storage/usual-tables.c 2013-01-22 14:16:01.426250199 +0800
@@ -41,6 +41,19 @@
#define USUAL_DEV(useProto, useTrans) \
{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans) }
+/* Define the device is matched with Vendor ID and interface descriptors */
+#define UNUSUAL_VENDOR_INTF(id_vendor, cl, sc, pr, \
+ vendorName, productName, useProtocol, useTransport, \
+ initFunction, flags) \
+{ \
+ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
+ | USB_DEVICE_ID_MATCH_VENDOR, \
+ .idVendor = (id_vendor), \
+ .bInterfaceClass = (cl), \
+ .bInterfaceSubClass = (sc), \
+ .bInterfaceProtocol = (pr), \
+ .driver_info = (flags) }
+
struct usb_device_id usb_storage_usb_ids[] = {
# include "unusual_devs.h"
{ } /* Terminating entry */
@@ -50,6 +63,7 @@ MODULE_DEVICE_TABLE(usb, usb_storage_usb
#undef UNUSUAL_DEV
#undef COMPLIANT_DEV
#undef USUAL_DEV
+#undef UNUSUAL_VENDOR_INTF
/*
* The table of devices to ignore
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2]linux-usb:Define a new macro for USB storage match rules
2013-01-25 2:44 [PATCH 1/2]linux-usb:Define a new macro for USB storage match rules fangxiaozhi 00110321
@ 2013-01-25 12:18 ` Sergei Shtylyov
2013-01-25 17:44 ` Greg KH
2013-01-27 18:42 ` Sebastian Andrzej Siewior
1 sibling, 1 reply; 16+ messages in thread
From: Sergei Shtylyov @ 2013-01-25 12:18 UTC (permalink / raw)
To: fangxiaozhi 00110321
Cc: linux-usb, linux-kernel, zihan, Lin.Lei, greg, neil.yi, wangyuhua,
huqiao36, balbi, mdharm-usb, sebastian
Hello.
On 25-01-2013 6:44, fangxiaozhi 00110321 wrote:
> From: fangxiaozhi <huananhu@huawei.com>
> 1. Define a new macro for USB storage match rules:
> matching with Vendor ID and interface descriptors.
> Signed-off-by: fangxiaozhi <huananhu@huawei.com>
> --------------------------------------------------------------------
>
> diff -uprN linux-3.8-rc4_orig/drivers/usb/storage/usb.c linux-3.8-rc4/drivers/usb/storage/usb.c
> --- linux-3.8-rc4_orig/drivers/usb/storage/usb.c 2013-01-22 14:12:42.595238727 +0800
> +++ linux-3.8-rc4/drivers/usb/storage/usb.c 2013-01-22 14:16:01.398250305 +0800
> @@ -120,6 +120,17 @@ MODULE_PARM_DESC(quirks, "supplemental l
> .useTransport = use_transport, \
> }
>
> +#define UNUSUAL_VENDOR_INTF(idVendor, cl, sc, pr, \
> + vendor_name, product_name, use_protocol, use_transport, \
> + init_function, Flags) \
> +{ \
> + .vendorName = vendor_name, \
> + .productName = product_name, \
> + .useProtocol = use_protocol, \
> + .useTransport = use_transport, \
> + .initFunction = init_function, \
> +}
Shouldn't the field initilaizers be indented with tab, not space?
> diff -uprN linux-3.8-rc4_orig/drivers/usb/storage/usual-tables.c linux-3.8-rc4/drivers/usb/storage/usual-tables.c
> --- linux-3.8-rc4_orig/drivers/usb/storage/usual-tables.c 2013-01-22 14:12:42.594238726 +0800
> +++ linux-3.8-rc4/drivers/usb/storage/usual-tables.c 2013-01-22 14:16:01.426250199 +0800
> @@ -41,6 +41,19 @@
> #define USUAL_DEV(useProto, useTrans) \
> { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans) }
>
> +/* Define the device is matched with Vendor ID and interface descriptors */
> +#define UNUSUAL_VENDOR_INTF(id_vendor, cl, sc, pr, \
> + vendorName, productName, useProtocol, useTransport, \
> + initFunction, flags) \
> +{ \
> + .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
> + | USB_DEVICE_ID_MATCH_VENDOR, \
> + .idVendor = (id_vendor), \
> + .bInterfaceClass = (cl), \
> + .bInterfaceSubClass = (sc), \
> + .bInterfaceProtocol = (pr), \
> + .driver_info = (flags) }
Same question. And trailing '}' should be on a separate line.
WBR, Sergei
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2]linux-usb:Define a new macro for USB storage match rules
2013-01-25 12:18 ` Sergei Shtylyov
@ 2013-01-25 17:44 ` Greg KH
2013-01-26 1:39 ` Fangxiaozhi (Franko)
0 siblings, 1 reply; 16+ messages in thread
From: Greg KH @ 2013-01-25 17:44 UTC (permalink / raw)
To: fangxiaozhi 00110321
Cc: Sergei Shtylyov, linux-usb, linux-kernel, zihan, Lin.Lei, neil.yi,
wangyuhua, huqiao36, balbi, mdharm-usb, sebastian
On Fri, Jan 25, 2013 at 04:18:34PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 25-01-2013 6:44, fangxiaozhi 00110321 wrote:
>
> >From: fangxiaozhi <huananhu@huawei.com>
>
> >1. Define a new macro for USB storage match rules:
> > matching with Vendor ID and interface descriptors.
>
> >Signed-off-by: fangxiaozhi <huananhu@huawei.com>
> >--------------------------------------------------------------------
> >
> > diff -uprN linux-3.8-rc4_orig/drivers/usb/storage/usb.c linux-3.8-rc4/drivers/usb/storage/usb.c
> >--- linux-3.8-rc4_orig/drivers/usb/storage/usb.c 2013-01-22 14:12:42.595238727 +0800
> >+++ linux-3.8-rc4/drivers/usb/storage/usb.c 2013-01-22 14:16:01.398250305 +0800
> >@@ -120,6 +120,17 @@ MODULE_PARM_DESC(quirks, "supplemental l
> > .useTransport = use_transport, \
> > }
> >
> >+#define UNUSUAL_VENDOR_INTF(idVendor, cl, sc, pr, \
> >+ vendor_name, product_name, use_protocol, use_transport, \
> >+ init_function, Flags) \
> >+{ \
> >+ .vendorName = vendor_name, \
> >+ .productName = product_name, \
> >+ .useProtocol = use_protocol, \
> >+ .useTransport = use_transport, \
> >+ .initFunction = init_function, \
> >+}
>
> Shouldn't the field initilaizers be indented with tab, not space?
Yes it must. fangxiaozhi, please always run your patches through the
scripts/checkpatch.pl tool before sending them out (note, you will have
to ignore the CamelCase warnings your patch produces, but not the other
ones.)
Please do that on both of these patches and resend them.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [PATCH 1/2]linux-usb:Define a new macro for USB storage match rules
2013-01-25 17:44 ` Greg KH
@ 2013-01-26 1:39 ` Fangxiaozhi (Franko)
2013-01-26 2:05 ` Greg KH
0 siblings, 1 reply; 16+ messages in thread
From: Fangxiaozhi (Franko) @ 2013-01-26 1:39 UTC (permalink / raw)
To: Greg KH
Cc: Sergei Shtylyov, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, Xueguiying (Zihan),
Linlei (Lei Lin), Yili (Neil), Wangyuhua (Roger, Credit),
Huqiao (C), balbi@ti.com, mdharm-usb@one-eyed-alien.net,
sebastian@breakpoint.cc
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2483 bytes --]
> -----Original Message-----
> From: Greg KH [mailto:greg@kroah.com]
> Sent: Saturday, January 26, 2013 1:45 AM
> To: Fangxiaozhi (Franko)
> Cc: Sergei Shtylyov; linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org;
> Xueguiying (Zihan); Linlei (Lei Lin); Yili (Neil); Wangyuhua (Roger, Credit);
> Huqiao (C); balbi@ti.com; mdharm-usb@one-eyed-alien.net;
> sebastian@breakpoint.cc
> Subject: Re: [PATCH 1/2]linux-usb:Define a new macro for USB storage match
> rules
>
> On Fri, Jan 25, 2013 at 04:18:34PM +0400, Sergei Shtylyov wrote:
> > Hello.
> >
> > On 25-01-2013 6:44, fangxiaozhi 00110321 wrote:
> >
> > >From: fangxiaozhi <huananhu@huawei.com>
> >
> > >1. Define a new macro for USB storage match rules:
> > > matching with Vendor ID and interface descriptors.
> >
> > >Signed-off-by: fangxiaozhi <huananhu@huawei.com>
> > >--------------------------------------------------------------------
> > >
> > > diff -uprN linux-3.8-rc4_orig/drivers/usb/storage/usb.c
> > >linux-3.8-rc4/drivers/usb/storage/usb.c
> > >--- linux-3.8-rc4_orig/drivers/usb/storage/usb.c 2013-01-22
> > >14:12:42.595238727 +0800
> > >+++ linux-3.8-rc4/drivers/usb/storage/usb.c 2013-01-22
> > >+++ 14:16:01.398250305 +0800
> > >@@ -120,6 +120,17 @@ MODULE_PARM_DESC(quirks, "supplemental l
> > > .useTransport = use_transport, \
> > > }
> > >
> > >+#define UNUSUAL_VENDOR_INTF(idVendor, cl, sc, pr, \
> > >+ vendor_name, product_name, use_protocol, use_transport, \
> > >+ init_function, Flags) \
> > >+{ \
> > >+ .vendorName = vendor_name, \
> > >+ .productName = product_name, \
> > >+ .useProtocol = use_protocol, \
> > >+ .useTransport = use_transport, \
> > >+ .initFunction = init_function, \
> > >+}
> >
> > Shouldn't the field initilaizers be indented with tab, not space?
>
> Yes it must. fangxiaozhi, please always run your patches through the
> scripts/checkpatch.pl tool before sending them out (note, you will have to
> ignore the CamelCase warnings your patch produces, but not the other
> ones.)
>
-----What's wrong with it?
-----I have checked the patches with scripts/checkpatch.pl before sending.
-----There is no other warning or error in my patches except CamelCase warnings.
-----So what's wrong now?
> Please do that on both of these patches and resend them.
>
> thanks,
>
> greg k-h
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2]linux-usb:Define a new macro for USB storage match rules
2013-01-26 1:39 ` Fangxiaozhi (Franko)
@ 2013-01-26 2:05 ` Greg KH
2013-01-26 3:10 ` Matthew Dharm
0 siblings, 1 reply; 16+ messages in thread
From: Greg KH @ 2013-01-26 2:05 UTC (permalink / raw)
To: Fangxiaozhi (Franko)
Cc: Sergei Shtylyov, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, Xueguiying (Zihan),
Linlei (Lei Lin), Yili (Neil), Wangyuhua (Roger, Credit),
Huqiao (C), balbi@ti.com, mdharm-usb@one-eyed-alien.net,
sebastian@breakpoint.cc
On Sat, Jan 26, 2013 at 01:39:50AM +0000, Fangxiaozhi (Franko) wrote:
>
>
> > -----Original Message-----
> > From: Greg KH [mailto:greg@kroah.com]
> > Sent: Saturday, January 26, 2013 1:45 AM
> > To: Fangxiaozhi (Franko)
> > Cc: Sergei Shtylyov; linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org;
> > Xueguiying (Zihan); Linlei (Lei Lin); Yili (Neil); Wangyuhua (Roger, Credit);
> > Huqiao (C); balbi@ti.com; mdharm-usb@one-eyed-alien.net;
> > sebastian@breakpoint.cc
> > Subject: Re: [PATCH 1/2]linux-usb:Define a new macro for USB storage match
> > rules
> >
> > On Fri, Jan 25, 2013 at 04:18:34PM +0400, Sergei Shtylyov wrote:
> > > Hello.
> > >
> > > On 25-01-2013 6:44, fangxiaozhi 00110321 wrote:
> > >
> > > >From: fangxiaozhi <huananhu@huawei.com>
> > >
> > > >1. Define a new macro for USB storage match rules:
> > > > matching with Vendor ID and interface descriptors.
> > >
> > > >Signed-off-by: fangxiaozhi <huananhu@huawei.com>
> > > >--------------------------------------------------------------------
> > > >
> > > > diff -uprN linux-3.8-rc4_orig/drivers/usb/storage/usb.c
> > > >linux-3.8-rc4/drivers/usb/storage/usb.c
> > > >--- linux-3.8-rc4_orig/drivers/usb/storage/usb.c 2013-01-22
> > > >14:12:42.595238727 +0800
> > > >+++ linux-3.8-rc4/drivers/usb/storage/usb.c 2013-01-22
> > > >+++ 14:16:01.398250305 +0800
> > > >@@ -120,6 +120,17 @@ MODULE_PARM_DESC(quirks, "supplemental l
> > > > .useTransport = use_transport, \
> > > > }
> > > >
> > > >+#define UNUSUAL_VENDOR_INTF(idVendor, cl, sc, pr, \
> > > >+ vendor_name, product_name, use_protocol, use_transport, \
> > > >+ init_function, Flags) \
> > > >+{ \
> > > >+ .vendorName = vendor_name, \
> > > >+ .productName = product_name, \
> > > >+ .useProtocol = use_protocol, \
> > > >+ .useTransport = use_transport, \
> > > >+ .initFunction = init_function, \
> > > >+}
> > >
> > > Shouldn't the field initilaizers be indented with tab, not space?
> >
> > Yes it must. fangxiaozhi, please always run your patches through the
> > scripts/checkpatch.pl tool before sending them out (note, you will have to
> > ignore the CamelCase warnings your patch produces, but not the other
> > ones.)
> >
> -----What's wrong with it?
> -----I have checked the patches with scripts/checkpatch.pl before sending.
> -----There is no other warning or error in my patches except CamelCase warnings.
> -----So what's wrong now?
Then your email client messed up the patches and put spaces in the code
instead of tabs. Try looking at the message on the mailing list and run
that through checkpatch, it will show you the problems.
What I received isn't ok, sorry.
greg k-h
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2]linux-usb:Define a new macro for USB storage match rules
2013-01-26 2:05 ` Greg KH
@ 2013-01-26 3:10 ` Matthew Dharm
2013-01-26 3:38 ` Greg KH
0 siblings, 1 reply; 16+ messages in thread
From: Matthew Dharm @ 2013-01-26 3:10 UTC (permalink / raw)
To: Greg KH
Cc: Fangxiaozhi (Franko), Sergei Shtylyov, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, Xueguiying (Zihan),
Linlei (Lei Lin), Yili (Neil), Wangyuhua (Roger, Credit),
Huqiao (C), balbi@ti.com, sebastian@breakpoint.cc
On Fri, Jan 25, 2013 at 6:05 PM, Greg KH <greg@kroah.com> wrote:
> On Sat, Jan 26, 2013 at 01:39:50AM +0000, Fangxiaozhi (Franko) wrote:
>>
>>
>> > -----Original Message-----
>> > From: Greg KH [mailto:greg@kroah.com]
>> > Sent: Saturday, January 26, 2013 1:45 AM
>> > To: Fangxiaozhi (Franko)
>> > Cc: Sergei Shtylyov; linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org;
>> > Xueguiying (Zihan); Linlei (Lei Lin); Yili (Neil); Wangyuhua (Roger, Credit);
>> > Huqiao (C); balbi@ti.com; mdharm-usb@one-eyed-alien.net;
>> > sebastian@breakpoint.cc
>> > Subject: Re: [PATCH 1/2]linux-usb:Define a new macro for USB storage match
>> > rules
>> >
>> > On Fri, Jan 25, 2013 at 04:18:34PM +0400, Sergei Shtylyov wrote:
>> > > Hello.
>> > >
>> > > On 25-01-2013 6:44, fangxiaozhi 00110321 wrote:
>> > >
>> > > >From: fangxiaozhi <huananhu@huawei.com>
>> > >
>> > > >1. Define a new macro for USB storage match rules:
>> > > > matching with Vendor ID and interface descriptors.
>> > >
>> > > >Signed-off-by: fangxiaozhi <huananhu@huawei.com>
>> > > >--------------------------------------------------------------------
>> > > >
>> > > > diff -uprN linux-3.8-rc4_orig/drivers/usb/storage/usb.c
>> > > >linux-3.8-rc4/drivers/usb/storage/usb.c
>> > > >--- linux-3.8-rc4_orig/drivers/usb/storage/usb.c 2013-01-22
>> > > >14:12:42.595238727 +0800
>> > > >+++ linux-3.8-rc4/drivers/usb/storage/usb.c 2013-01-22
>> > > >+++ 14:16:01.398250305 +0800
>> > > >@@ -120,6 +120,17 @@ MODULE_PARM_DESC(quirks, "supplemental l
>> > > > .useTransport = use_transport, \
>> > > > }
>> > > >
>> > > >+#define UNUSUAL_VENDOR_INTF(idVendor, cl, sc, pr, \
>> > > >+ vendor_name, product_name, use_protocol, use_transport, \
>> > > >+ init_function, Flags) \
>> > > >+{ \
>> > > >+ .vendorName = vendor_name, \
>> > > >+ .productName = product_name, \
>> > > >+ .useProtocol = use_protocol, \
>> > > >+ .useTransport = use_transport, \
>> > > >+ .initFunction = init_function, \
>> > > >+}
>> > >
>> > > Shouldn't the field initilaizers be indented with tab, not space?
>> >
>> > Yes it must. fangxiaozhi, please always run your patches through the
>> > scripts/checkpatch.pl tool before sending them out (note, you will have to
>> > ignore the CamelCase warnings your patch produces, but not the other
>> > ones.)
>> >
>> -----What's wrong with it?
>> -----I have checked the patches with scripts/checkpatch.pl before sending.
>> -----There is no other warning or error in my patches except CamelCase warnings.
>> -----So what's wrong now?
>
> Then your email client messed up the patches and put spaces in the code
> instead of tabs. Try looking at the message on the mailing list and run
> that through checkpatch, it will show you the problems.
>
> What I received isn't ok, sorry.
Fangxiaozhi --
According to the headers of your E-mail, you are using MS Outlook to
send your patches. Outlook commonly mangles patches, unfortunately.
It is not a very good e-mail client.
I suggest one of two options:
1) Setup an alternative mail client. There are many to choose from
which will not damage your patches. I personally like 'mutt' (which
you should be able to install on your linux machine). Others may be
able to recommend ones that work for them; in general, I think you
will find that most e-mail clients that run on Linux will be suitable.
2) If you plan on contributing to the linux kernel in the future, it
may be worth your time to setup a repo on github that Greg can then
directly pull from. All you would need to do is send Greg a "pull
request" indicating the URL of the branch in your repo that he should
pull from. Greg can then pull directly from your repo, bypassing this
issue entirely.
Matt
--
Matthew Dharm
Maintainer, USB Mass Storage driver for Linux
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2]linux-usb:Define a new macro for USB storage match rules
2013-01-26 3:10 ` Matthew Dharm
@ 2013-01-26 3:38 ` Greg KH
0 siblings, 0 replies; 16+ messages in thread
From: Greg KH @ 2013-01-26 3:38 UTC (permalink / raw)
To: Matthew Dharm
Cc: Fangxiaozhi (Franko), Sergei Shtylyov, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, Xueguiying (Zihan),
Linlei (Lei Lin), Yili (Neil), Wangyuhua (Roger, Credit),
Huqiao (C), balbi@ti.com, sebastian@breakpoint.cc
On Fri, Jan 25, 2013 at 07:10:29PM -0800, Matthew Dharm wrote:
> I suggest one of two options:
>
> 1) Setup an alternative mail client. There are many to choose from
> which will not damage your patches. I personally like 'mutt' (which
> you should be able to install on your linux machine). Others may be
> able to recommend ones that work for them; in general, I think you
> will find that most e-mail clients that run on Linux will be suitable.
The file, Documentation/email_clients.txt will help out here.
> 2) If you plan on contributing to the linux kernel in the future, it
> may be worth your time to setup a repo on github that Greg can then
> directly pull from. All you would need to do is send Greg a "pull
> request" indicating the URL of the branch in your repo that he should
> pull from. Greg can then pull directly from your repo, bypassing this
> issue entirely.
No, sorry, I only pull trees from a _very_ few people, patches are what
I prefer for almost all stuff. Only subsystem maintainers who I have
been working with for many years will I pull trees from.
sorry,
greg k-h
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2]linux-usb:Define a new macro for USB storage match rules
2013-01-25 2:44 [PATCH 1/2]linux-usb:Define a new macro for USB storage match rules fangxiaozhi 00110321
2013-01-25 12:18 ` Sergei Shtylyov
@ 2013-01-27 18:42 ` Sebastian Andrzej Siewior
1 sibling, 0 replies; 16+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-01-27 18:42 UTC (permalink / raw)
To: fangxiaozhi 00110321
Cc: linux-usb, linux-kernel, zihan, Lin.Lei, greg, neil.yi, wangyuhua,
huqiao36, balbi, mdharm-usb
On Fri, Jan 25, 2013 at 10:44:50AM +0800, fangxiaozhi 00110321 wrote:
> diff -uprN linux-3.8-rc4_orig/drivers/usb/storage/usual-tables.c linux-3.8-rc4/drivers/usb/storage/usual-tables.c
> --- linux-3.8-rc4_orig/drivers/usb/storage/usual-tables.c 2013-01-22 14:12:42.594238726 +0800
> +++ linux-3.8-rc4/drivers/usb/storage/usual-tables.c 2013-01-22 14:16:01.426250199 +0800
> @@ -41,6 +41,19 @@
> #define USUAL_DEV(useProto, useTrans) \
> { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans) }
>
> +/* Define the device is matched with Vendor ID and interface descriptors */
> +#define UNUSUAL_VENDOR_INTF(id_vendor, cl, sc, pr, \
> + vendorName, productName, useProtocol, useTransport, \
> + initFunction, flags) \
> +{ \
> + .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
> + | USB_DEVICE_ID_MATCH_VENDOR, \
> + .idVendor = (id_vendor), \
> + .bInterfaceClass = (cl), \
> + .bInterfaceSubClass = (sc), \
> + .bInterfaceProtocol = (pr), \
> + .driver_info = (flags) }
The braces aren't required and you did not need in UNUSUAL_VENDOR_INTF.
Sebastian
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 1/2]linux-usb:Define a new macro for USB storage match rules
@ 2013-02-04 7:14 fangxiaozhi 00110321
0 siblings, 0 replies; 16+ messages in thread
From: fangxiaozhi 00110321 @ 2013-02-04 7:14 UTC (permalink / raw)
To: linux-usb
Cc: linux-kernel, zihan, Lin.Lei, greg, neil.yi, wangyuhua, huqiao36,
balbi, mdharm-usb, sebastian
From: fangxiaozhi <huananhu@huawei.com>
1. Define a new macro for USB storage match rules:
matching with Vendor ID and interface descriptors.
Signed-off-by: fangxiaozhi <huananhu@huawei.com>
--------------------------------------------------------------------
diff -uprN linux-3.8-rc6_orig/drivers/usb/storage/usb.c linux-3.8-rc6/drivers/usb/storage/usb.c
--- linux-3.8-rc6_orig/drivers/usb/storage/usb.c 2013-02-04 14:38:34.268154216 +0800
+++ linux-3.8-rc6/drivers/usb/storage/usb.c 2013-02-04 14:42:17.103167073 +0800
@@ -120,6 +120,17 @@ MODULE_PARM_DESC(quirks, "supplemental l
.useTransport = use_transport, \
}
+#define UNUSUAL_VENDOR_INTF(idVendor, cl, sc, pr, \
+ vendor_name, product_name, use_protocol, use_transport, \
+ init_function, Flags) \
+{ \
+ .vendorName = vendor_name, \
+ .productName = product_name, \
+ .useProtocol = use_protocol, \
+ .useTransport = use_transport, \
+ .initFunction = init_function, \
+}
+
static struct us_unusual_dev us_unusual_dev_list[] = {
# include "unusual_devs.h"
{ } /* Terminating entry */
@@ -131,6 +142,7 @@ static struct us_unusual_dev for_dynamic
#undef UNUSUAL_DEV
#undef COMPLIANT_DEV
#undef USUAL_DEV
+#undef UNUSUAL_VENDOR_INTF
#ifdef CONFIG_LOCKDEP
diff -uprN linux-3.8-rc6_orig/drivers/usb/storage/usual-tables.c linux-3.8-rc6/drivers/usb/storage/usual-tables.c
--- linux-3.8-rc6_orig/drivers/usb/storage/usual-tables.c 2013-02-04 14:38:34.268154216 +0800
+++ linux-3.8-rc6/drivers/usb/storage/usual-tables.c 2013-02-04 14:49:48.256193103 +0800
@@ -41,6 +41,20 @@
#define USUAL_DEV(useProto, useTrans) \
{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans) }
+/* Define the device is matched with Vendor ID and interface descriptors */
+#define UNUSUAL_VENDOR_INTF(id_vendor, cl, sc, pr, \
+ vendorName, productName, useProtocol, useTransport, \
+ initFunction, flags) \
+{ \
+ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
+ | USB_DEVICE_ID_MATCH_VENDOR, \
+ .idVendor = (id_vendor), \
+ .bInterfaceClass = (cl), \
+ .bInterfaceSubClass = (sc), \
+ .bInterfaceProtocol = (pr), \
+ .driver_info = (flags) \
+}
+
struct usb_device_id usb_storage_usb_ids[] = {
# include "unusual_devs.h"
{ } /* Terminating entry */
@@ -50,6 +64,7 @@ MODULE_DEVICE_TABLE(usb, usb_storage_usb
#undef UNUSUAL_DEV
#undef COMPLIANT_DEV
#undef USUAL_DEV
+#undef UNUSUAL_VENDOR_INTF
/*
* The table of devices to ignore
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2013-02-04 7:15 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-18 2:42 [PATCH 1/2]linux-usb:Define a new macro for USB storage match rules fangxiaozhi 00110321
2012-12-18 2:44 ` [PATCH 2/2]linux-usb:optimize to match the Huawei USB storage devices and support new switch command fangxiaozhi 00110321
2012-12-18 14:10 ` Sebastian Andrzej Siewior
2012-12-19 3:13 ` Fangxiaozhi (Franko)
2012-12-19 8:34 ` Sebastian Andrzej Siewior
2012-12-19 15:40 ` Matthew Dharm
2013-01-04 7:30 ` Fangxiaozhi (Franko)
-- strict thread matches above, loose matches on Subject: below --
2013-01-25 2:44 [PATCH 1/2]linux-usb:Define a new macro for USB storage match rules fangxiaozhi 00110321
2013-01-25 12:18 ` Sergei Shtylyov
2013-01-25 17:44 ` Greg KH
2013-01-26 1:39 ` Fangxiaozhi (Franko)
2013-01-26 2:05 ` Greg KH
2013-01-26 3:10 ` Matthew Dharm
2013-01-26 3:38 ` Greg KH
2013-01-27 18:42 ` Sebastian Andrzej Siewior
2013-02-04 7:14 fangxiaozhi 00110321
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).