aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mandriva.com>2009-04-16 13:00:45 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-16 00:44:41 -0400
commitc5be1b52d9ea6ede4931691bf9f0bd454515aa52 (patch)
tree7094af3b339a6c3babc039f1984250902d386f1f /drivers
parentcc71329b3b89b4a5be849b617f2c4f151f0b9213 (diff)
USB: Ignore storage device in modem mode on DWN-652
D-Link DWN-652 in Modem mode exposes 3 interfaces - First one is the USB storage one - Second one is for both control and connection - Third one is unknown This patch avoids usb-storage trying to switch again when already in modem mode, and exposes only 2 ttyUSB instead of 3 by not attaching to the storage interface Signed-off-by: Pascal Terjan <pterjan@mandriva.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/serial/option.c15
-rw-r--r--drivers/usb/storage/option_ms.c3
-rw-r--r--drivers/usb/storage/unusual_devs.h2
3 files changed, 18 insertions, 2 deletions
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 648c481605b1..f11672a25ead 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -43,6 +43,8 @@
43#include <linux/usb/serial.h> 43#include <linux/usb/serial.h>
44 44
45/* Function prototypes */ 45/* Function prototypes */
46static int option_probe(struct usb_serial *serial,
47 const struct usb_device_id *id);
46static int option_open(struct tty_struct *tty, struct usb_serial_port *port, 48static int option_open(struct tty_struct *tty, struct usb_serial_port *port,
47 struct file *filp); 49 struct file *filp);
48static void option_close(struct usb_serial_port *port); 50static void option_close(struct usb_serial_port *port);
@@ -555,6 +557,7 @@ static struct usb_serial_driver option_1port_device = {
555 .usb_driver = &option_driver, 557 .usb_driver = &option_driver,
556 .id_table = option_ids, 558 .id_table = option_ids,
557 .num_ports = 1, 559 .num_ports = 1,
560 .probe = option_probe,
558 .open = option_open, 561 .open = option_open,
559 .close = option_close, 562 .close = option_close,
560 .dtr_rts = option_dtr_rts, 563 .dtr_rts = option_dtr_rts,
@@ -631,6 +634,18 @@ static void __exit option_exit(void)
631module_init(option_init); 634module_init(option_init);
632module_exit(option_exit); 635module_exit(option_exit);
633 636
637static int option_probe(struct usb_serial *serial,
638 const struct usb_device_id *id)
639{
640 /* D-Link DWM 652 still exposes CD-Rom emulation interface in modem mode */
641 if (serial->dev->descriptor.idVendor == DLINK_VENDOR_ID &&
642 serial->dev->descriptor.idProduct == DLINK_PRODUCT_DWM_652 &&
643 serial->interface->cur_altsetting->desc.bInterfaceClass == 0x8)
644 return -ENODEV;
645
646 return 0;
647}
648
634static void option_set_termios(struct tty_struct *tty, 649static void option_set_termios(struct tty_struct *tty,
635 struct usb_serial_port *port, struct ktermios *old_termios) 650 struct usb_serial_port *port, struct ktermios *old_termios)
636{ 651{
diff --git a/drivers/usb/storage/option_ms.c b/drivers/usb/storage/option_ms.c
index 353f922939a4..126ea3424c03 100644
--- a/drivers/usb/storage/option_ms.c
+++ b/drivers/usb/storage/option_ms.c
@@ -94,7 +94,8 @@ int option_ms_init(struct us_data *us)
94 */ 94 */
95 if (udev->descriptor.bDeviceClass != 0 || 95 if (udev->descriptor.bDeviceClass != 0 ||
96 udev->descriptor.bDeviceSubClass != 0 || 96 udev->descriptor.bDeviceSubClass != 0 ||
97 udev->descriptor.bDeviceProtocol != 0) 97 udev->descriptor.bDeviceProtocol != 0 ||
98 udev->actconfig->desc.bNumInterfaces == 3)
98 return USB_STOR_TRANSPORT_GOOD; 99 return USB_STOR_TRANSPORT_GOOD;
99 100
100 US_DEBUGP("Option MS: option_ms_init called\n"); 101 US_DEBUGP("Option MS: option_ms_init called\n");
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 4b8b69045fe6..1b9c5dd0fb27 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1385,7 +1385,7 @@ UNUSUAL_DEV( 0x10d6, 0x2200, 0x0100, 0x0100,
1385UNUSUAL_DEV( 0x1186, 0x3e04, 0x0000, 0x0000, 1385UNUSUAL_DEV( 0x1186, 0x3e04, 0x0000, 0x0000,
1386 "D-Link", 1386 "D-Link",
1387 "USB Mass Storage", 1387 "USB Mass Storage",
1388 US_SC_DEVICE, US_PR_DEVICE, option_ms_init, 0), 1388 US_SC_DEVICE, US_PR_DEVICE, option_ms_init, US_FL_IGNORE_DEVICE),
1389 1389
1390/* Reported by Kevin Lloyd <linux@sierrawireless.com> 1390/* Reported by Kevin Lloyd <linux@sierrawireless.com>
1391 * Entry is needed for the initializer function override, 1391 * Entry is needed for the initializer function override,