From c5be1b52d9ea6ede4931691bf9f0bd454515aa52 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Thu, 16 Apr 2009 19:00:45 +0200 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- drivers/usb/storage/option_ms.c | 3 ++- drivers/usb/storage/unusual_devs.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/usb/storage') diff --git a/drivers/usb/storage/option_ms.c b/drivers/usb/storage/option_ms.c index 353f922939a..126ea3424c0 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) */ if (udev->descriptor.bDeviceClass != 0 || udev->descriptor.bDeviceSubClass != 0 || - udev->descriptor.bDeviceProtocol != 0) + udev->descriptor.bDeviceProtocol != 0 || + udev->actconfig->desc.bNumInterfaces == 3) return USB_STOR_TRANSPORT_GOOD; 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 4b8b69045fe..1b9c5dd0fb2 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, UNUSUAL_DEV( 0x1186, 0x3e04, 0x0000, 0x0000, "D-Link", "USB Mass Storage", - US_SC_DEVICE, US_PR_DEVICE, option_ms_init, 0), + US_SC_DEVICE, US_PR_DEVICE, option_ms_init, US_FL_IGNORE_DEVICE), /* Reported by Kevin Lloyd * Entry is needed for the initializer function override, -- cgit v1.2.3