3.10 kernel support more Huawei 3G dongles
authorxxh <xxh@rock-chips.com>
Fri, 9 Jan 2015 09:38:08 +0000 (17:38 +0800)
committerxxh <xxh@rock-chip.com>
Fri, 9 Jan 2015 09:38:08 +0000 (17:38 +0800)
drivers/usb/storage/initializers.c
drivers/usb/storage/initializers.h
drivers/usb/storage/unusual_devs.h

index 5a8b5ff1e45bf597d9028c80e585047b0148e838..a684f69f2566f7674ed493ef213a7689621d3d07 100644 (file)
@@ -91,7 +91,39 @@ int usb_stor_ucr61s2b_init(struct us_data *us)
 
        return 0;
 }
-
+ int usb_stor_huawei_init(struct us_data *us)
+ {
+        int idProduct;
+        idProduct = us->pusb_dev->descriptor.idProduct;
+        if(idProduct==0x1F01){
+        int result ;
+        int act_len;
+        unsigned  char  cmd[32] =  {0x55,  0x53, 0x42,  0x43,  0x00, 0x00,  0x00, 0x00,
+                                     0x00,  0x00, 0x00,  0x00,  0x00,  0x00,  0x00, 0x11,
+                                     0x06,  0x30, 0x00,  0x00,  0x01,  0x00,  0x01, 0x00,
+                                     0x00,  0x00, 0x00,  0x00,  0x00,  0x00, 0x00};
+        result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, cmd, 31, &act_len);
+        printk("usb_stor_bulk_transfer_buf performing result is %d, transfer the actual length=%d\n", result,act_len);
+        return result;
+    } else {
+        int result = 0;
+        int act_len = 0;
+        struct bulk_cb_wrap *bcbw = (struct bulk_cb_wrap *) us->iobuf;
+        char rewind_cmd[] = {0x11, 0x06, 0x20, 0x00, 0x00, 0x01, 0x01, 0x00,
+                            0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+         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);
+         memset(bcbw->CDB, 0, sizeof(bcbw->CDB));
+         memcpy(bcbw->CDB, rewind_cmd, sizeof(rewind_cmd)); 
+         result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, bcbw,
+                                         US_BULK_CB_WRAP_LEN, &act_len);
+         printk("transfer actual length=%d, result=%d\n", act_len, result);
+         return result;
+     }
+}
 /* This places the HUAWEI E220 devices in multi-port mode */
 int usb_stor_huawei_e220_init(struct us_data *us)
 {
index 529327fbb06be1b6876e8802b84bd281287291c3..bf35dc4a6824d5e24531b6c0e3ab869340aa6f34 100644 (file)
@@ -48,3 +48,5 @@ 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);
+
+int usb_stor_huawei_init(struct us_data *us);
index 042c83b010463078c19e03b92940521fa69fd921..7c4a412edeb8ca4dcdae79b50580be3074bcdbbf 100644 (file)
@@ -1908,6 +1908,12 @@ UNUSUAL_DEV(  0x12d1, 0x143F, 0x0000, 0x0000,
                USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
                0),
 
+UNUSUAL_VENDOR_INTF(0x12d1, 0x08, 0x06, 0x50,
+                 "HUAWEI MOBILE",
+                 "Mass Storage",
+                 USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_init,
+                 0),
+
 /* Reported by Vilius Bilinkevicius <vilisas AT xxx DOT lt) */
 UNUSUAL_DEV(  0x132b, 0x000b, 0x0001, 0x0001,
                "Minolta",