USB: option.c: Add Pirelli VID/PID and indicate Pirelli's modem interface is 0xff
authorspark <spark@bandrich.com>
Fri, 5 Mar 2010 06:18:05 +0000 (14:18 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 19 Mar 2010 14:24:18 +0000 (07:24 -0700)
Signed-off-by: spark <spark@bandrich.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/option.c

index 3af1eb8aa6351559c1768252080733bc914044c2..950cb311ca9445dac5315ebdb538d3e00a0cb205 100644 (file)
@@ -335,6 +335,24 @@ static int  option_resume(struct usb_serial *serial);
 #define ALCATEL_VENDOR_ID                      0x1bbb
 #define ALCATEL_PRODUCT_X060S                  0x0000
 
+#define PIRELLI_VENDOR_ID                      0x1266
+#define PIRELLI_PRODUCT_C100_1                 0x1002
+#define PIRELLI_PRODUCT_C100_2                 0x1003
+#define PIRELLI_PRODUCT_1004                   0x1004
+#define PIRELLI_PRODUCT_1005                   0x1005
+#define PIRELLI_PRODUCT_1006                   0x1006
+#define PIRELLI_PRODUCT_1007                   0x1007
+#define PIRELLI_PRODUCT_1008                   0x1008
+#define PIRELLI_PRODUCT_1009                   0x1009
+#define PIRELLI_PRODUCT_100A                   0x100a
+#define PIRELLI_PRODUCT_100B                   0x100b
+#define PIRELLI_PRODUCT_100C                   0x100c
+#define PIRELLI_PRODUCT_100D                   0x100d
+#define PIRELLI_PRODUCT_100E                   0x100e
+#define PIRELLI_PRODUCT_100F                   0x100f
+#define PIRELLI_PRODUCT_1011                   0x1011
+#define PIRELLI_PRODUCT_1012                   0x1012
+
 /* Airplus products */
 #define AIRPLUS_VENDOR_ID                      0x1011
 #define AIRPLUS_PRODUCT_MCD650                 0x3198
@@ -679,6 +697,24 @@ static const struct usb_device_id option_ids[] = {
          .driver_info = (kernel_ulong_t)&four_g_w14_blacklist
        },
        { USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) },
+       /* Pirelli  */
+       { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_1)},
+       { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_2)},
+       { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1004)},
+       { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1005)},
+       { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1006)},
+       { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1007)},
+       { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1008)},
+       { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1009)},
+       { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100A)},
+       { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100B) },
+       { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100C) },
+       { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100D) },
+       { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100E) },
+       { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100F) },
+       { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011)},
+       { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012)},
+
        { } /* Terminating entry */
 };
 MODULE_DEVICE_TABLE(usb, option_ids);
@@ -802,12 +838,19 @@ static int option_probe(struct usb_serial *serial,
                        const struct usb_device_id *id)
 {
        struct option_intf_private *data;
+
        /* D-Link DWM 652 still exposes CD-Rom emulation interface in modem mode */
        if (serial->dev->descriptor.idVendor == DLINK_VENDOR_ID &&
                serial->dev->descriptor.idProduct == DLINK_PRODUCT_DWM_652 &&
                serial->interface->cur_altsetting->desc.bInterfaceClass == 0x8)
                return -ENODEV;
 
+       /* Bandrich modem and AT command interface is 0xff */
+       if ((serial->dev->descriptor.idVendor == BANDRICH_VENDOR_ID ||
+               serial->dev->descriptor.idVendor == PIRELLI_VENDOR_ID) &&
+               serial->interface->cur_altsetting->desc.bInterfaceClass != 0xff)
+               return -ENODEV;
+
        data = serial->private = kzalloc(sizeof(struct option_intf_private), GFP_KERNEL);
        if (!data)
                return -ENOMEM;