diff options
author | Pascal Terjan <pterjan@mandriva.com> | 2009-04-16 19:00:45 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-15 21:44:41 -0700 |
commit | c5be1b52d9ea6ede4931691bf9f0bd454515aa52 (patch) | |
tree | 7094af3b339a6c3babc039f1984250902d386f1f /drivers/usb/serial/option.c | |
parent | cc71329b3b89b4a5be849b617f2c4f151f0b9213 (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/usb/serial/option.c')
-rw-r--r-- | drivers/usb/serial/option.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 648c481605b..f11672a25ea 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -43,6 +43,8 @@ #include <linux/usb/serial.h> /* Function prototypes */ +static int option_probe(struct usb_serial *serial, + const struct usb_device_id *id); static int option_open(struct tty_struct *tty, struct usb_serial_port *port, struct file *filp); static void option_close(struct usb_serial_port *port); @@ -555,6 +557,7 @@ static struct usb_serial_driver option_1port_device = { .usb_driver = &option_driver, .id_table = option_ids, .num_ports = 1, + .probe = option_probe, .open = option_open, .close = option_close, .dtr_rts = option_dtr_rts, @@ -631,6 +634,18 @@ static void __exit option_exit(void) module_init(option_init); module_exit(option_exit); +static int option_probe(struct usb_serial *serial, + const struct usb_device_id *id) +{ + /* 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; + + return 0; +} + static void option_set_termios(struct tty_struct *tty, struct usb_serial_port *port, struct ktermios *old_termios) { |