aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2015-11-05 06:55:01 -0500
committerDavid S. Miller <davem@davemloft.net>2015-11-05 11:39:56 -0500
commitb3d8cf019fb9dd28389b08da7bf54ffabf453ed3 (patch)
treeb43a92c61a7537814b7af0f8ba79b573c634574e
parent096273304cb13b1b6a611026759df7c738a0e4e2 (diff)
USB: qmi_wwan: Add quirk for Quectel EC20 Mini PCIe module
This device has same vendor and product IDs as G2K devices, but it has different number of interfaces(4 vs 5) and also different interface layout where EC20 has QMI on interface 4 instead of 0. lsusb output: Bus 002 Device 003: ID 05c6:9215 Qualcomm, Inc. Acer Gobi 2000 Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x05c6 Qualcomm, Inc. idProduct 0x9215 Acer Gobi 2000 Wireless Modem bcdDevice 2.32 iManufacturer 1 Quectel iProduct 2 Quectel LTE Module iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 209 bNumInterfaces 5 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xa0 (Bus Powered) Remote Wakeup MaxPower 500mA Signed-off-by: Petr Štetiar <ynezz@true.cz> Acked-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/usb/qmi_wwan.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index c54719984c4b..34799eaace41 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -771,6 +771,7 @@ static const struct usb_device_id products[] = {
771 {QMI_GOBI_DEVICE(0x05c6, 0x9245)}, /* Samsung Gobi 2000 Modem device (VL176) */ 771 {QMI_GOBI_DEVICE(0x05c6, 0x9245)}, /* Samsung Gobi 2000 Modem device (VL176) */
772 {QMI_GOBI_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */ 772 {QMI_GOBI_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */
773 {QMI_GOBI_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */ 773 {QMI_GOBI_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */
774 {QMI_FIXED_INTF(0x05c6, 0x9215, 4)}, /* Quectel EC20 Mini PCIe */
774 {QMI_GOBI_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */ 775 {QMI_GOBI_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */
775 {QMI_GOBI_DEVICE(0x05c6, 0x9235)}, /* Top Global Gobi 2000 Modem device (VR306) */ 776 {QMI_GOBI_DEVICE(0x05c6, 0x9235)}, /* Top Global Gobi 2000 Modem device (VR306) */
776 {QMI_GOBI_DEVICE(0x05c6, 0x9275)}, /* iRex Technologies Gobi 2000 Modem device (VR307) */ 777 {QMI_GOBI_DEVICE(0x05c6, 0x9275)}, /* iRex Technologies Gobi 2000 Modem device (VR307) */
@@ -802,10 +803,24 @@ static const struct usb_device_id products[] = {
802}; 803};
803MODULE_DEVICE_TABLE(usb, products); 804MODULE_DEVICE_TABLE(usb, products);
804 805
806static bool quectel_ec20_detected(struct usb_interface *intf)
807{
808 struct usb_device *dev = interface_to_usbdev(intf);
809
810 if (dev->actconfig &&
811 le16_to_cpu(dev->descriptor.idVendor) == 0x05c6 &&
812 le16_to_cpu(dev->descriptor.idProduct) == 0x9215 &&
813 dev->actconfig->desc.bNumInterfaces == 5)
814 return true;
815
816 return false;
817}
818
805static int qmi_wwan_probe(struct usb_interface *intf, 819static int qmi_wwan_probe(struct usb_interface *intf,
806 const struct usb_device_id *prod) 820 const struct usb_device_id *prod)
807{ 821{
808 struct usb_device_id *id = (struct usb_device_id *)prod; 822 struct usb_device_id *id = (struct usb_device_id *)prod;
823 struct usb_interface_descriptor *desc = &intf->cur_altsetting->desc;
809 824
810 /* Workaround to enable dynamic IDs. This disables usbnet 825 /* Workaround to enable dynamic IDs. This disables usbnet
811 * blacklisting functionality. Which, if required, can be 826 * blacklisting functionality. Which, if required, can be
@@ -817,6 +832,12 @@ static int qmi_wwan_probe(struct usb_interface *intf,
817 id->driver_info = (unsigned long)&qmi_wwan_info; 832 id->driver_info = (unsigned long)&qmi_wwan_info;
818 } 833 }
819 834
835 /* Quectel EC20 quirk where we've QMI on interface 4 instead of 0 */
836 if (quectel_ec20_detected(intf) && desc->bInterfaceNumber == 0) {
837 dev_dbg(&intf->dev, "Quectel EC20 quirk, skipping interface 0\n");
838 return -ENODEV;
839 }
840
820 return usbnet_probe(intf, id); 841 return usbnet_probe(intf, id);
821} 842}
822 843