1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| cd ~/asuswrt/release/src-rt-5.02p1axhnd.675x/kernel/linux-4.1/ patch -p1 < ~/prebuilt/0001-Add-Quectel-RM500Q-USB-Serial-Driver-Support.patch
#### 补丁文件:~/0001-Add-Quectel-RM500Q-USB-Serial-Driver-Support.patch #### diff -Nur a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
@@ -687,6 +687,7 @@ }; static const struct usb_device_id option_ids[] = { + { USB_DEVICE(0x2C7C, 0x0800) }, /* Quectel RG500Q/RM500Q/RG510Q/RM510Q */ { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) }, @@ -2086,6 +2087,7 @@ #ifdef CONFIG_PM .suspend = usb_wwan_suspend, .resume = usb_wwan_resume, + .reset_resume = usb_wwan_resume, // Added by Quectel #endif }; @@ -2129,6 +2131,18 @@ iface_desc->bInterfaceClass != USB_CLASS_CDC_DATA) return -ENODEV; + //Quectel modules’s interface 4 can be used as USB network device + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C)) { + //some interfaces can be used as USB Network device (ecm, rndis, mbim) + if (serial->interface->cur_altsetting->desc.bInterfaceClass != 0xFF) { + return -ENODEV; + } + //interface 4 can be used as USB Network device (qmi) + else if (serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4) { + return -ENODEV; + } + } + /* Store the blacklist info so we can use it during attach. */ usb_set_serial_data(serial, (void *)blacklist); diff -Nur a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
@@ -471,6 +471,14 @@ usb_sndbulkpipe(serial->dev, endpoint) | dir, buf, len, callback, ctx); + // Added by Quectel for zero packet + if (dir == USB_DIR_OUT) { + struct usb_device_descriptor *desc = &serial->dev->descriptor; + + if (desc->idVendor == cpu_to_le16(0x2C7C)) + urb->transfer_flags |= URB_ZERO_PACKET; + } + return urb; }
|