Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] usb-serial: option: Don't match Huawei driver CD images

19 views
Skip to first unread message

Michael Karcher

unread,
Apr 17, 2008, 7:50:09 PM4/17/08
to
From: Michael Karcher <ker...@mkarcher.dialup.fu-berlin.de>

Add the interface info matching to all Huawei cards, as they all also
contain a Mass Storage Device interface (usually containing Windows
drivers) which should not get bound by this driver.

See also drivers/usb/storage/unusual_devs.h

Signed-off-by: Michael Karcher <ker...@mkarcher.dialup.fu-berlin.de>

---

Formatting as one-liners is done like in HUAWEI_PRODUCT_E220 entries
that were already present. This breaks the 80 chars/line recommendation,
feel free to reformat (or tell me to submit a reformatted patch).

diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index d101025..45a2eff 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -231,25 +231,25 @@ static struct usb_device_id option_ids[] = {
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_NETWORK_EX) },
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_MODEM) },
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_NETWORK) },
- { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) },
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220BIS, 0xff, 0xff, 0xff) },
- { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1401) },
- { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1403) },
- { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1405) },
- { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1406) },
- { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1408) },
- { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1409) },
- { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1410) },
- { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1411) },
- { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1412) },
- { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1413) },
- { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1414) },
- { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1415) },
- { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1416) },
- { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1417) },
- { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1418) },
- { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1419) },
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1401, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1403, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1405, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1406, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1408, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1409, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1410, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1411, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1412, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1413, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1414, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1415, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1416, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1417, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1418, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1419, 0xff, 0xff, 0xff) },
{ USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_9508) },
{ USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) }, /* Novatel Merlin V640/XV620 */
{ USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) }, /* Novatel Merlin V620/S620 */


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Greg KH

unread,
Apr 17, 2008, 11:20:05 PM4/17/08
to
On Fri, Apr 18, 2008 at 12:49:29AM +0200, Michael Karcher wrote:
> From: Michael Karcher <ker...@mkarcher.dialup.fu-berlin.de>
>
> Add the interface info matching to all Huawei cards, as they all also
> contain a Mass Storage Device interface (usually containing Windows
> drivers) which should not get bound by this driver.
>
> See also drivers/usb/storage/unusual_devs.h
>
> Signed-off-by: Michael Karcher <ker...@mkarcher.dialup.fu-berlin.de>
>
> ---
>
> Formatting as one-liners is done like in HUAWEI_PRODUCT_E220 entries
> that were already present. This breaks the 80 chars/line recommendation,
> feel free to reformat (or tell me to submit a reformatted patch).
>
> diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c

What is this patch against? We have a change that went into 2.6.25
after 2.6.25-rc9 that should make this patch not be needed.

Can you try that release and verify this?

thanks,

greg k-h

Michael Karcher

unread,
Apr 18, 2008, 2:10:08 AM4/18/08
to
Am Donnerstag, den 17.04.2008, 20:24 -0700 schrieb Greg KH:
> What is this patch against? We have a change that went into 2.6.25
> after 2.6.25-rc9 that should make this patch not be needed.
The patch is developed against 2.6.25-rc8 + some git patches, but I have
forward-ported it to current git.

I *guess* you are talking about commit aad8a278 (USB: support more
Huawei data card product IDs), as I could not find . The header of this
patch talks about three changes (declaration of unusual devices,
disabling product ID matching in driver.c and finally declaring the
product in option.c). I find only the first and the last point if this
reflected in the patch, and there are *no* patches at all to
drivers/usb/core/driver.c in the timeframe you mentioned. This patch
addresses the second point of that list, but in another way.

The problem is that those huawei products have four USB interfaces,
three usb-serial like interfaces handled by the option driver and a
fourth one to be handled by usb-storage. When the stick gets initially
plugged, only the mass storage device is visible and needs a magic kick
to expose the other interfaces. aad8a278 contains a valid and working
patch to kick those USB devices if the mass storage interface gets bound
by usb-storage. At least in 2.6.25-rc8, if the option module is loaded,
the mass storage device gets bound to the option driver instead that
exposes a useless and non-functional serial interface on the mass
storage endpoint. This prevents the usb-storage driver to perform the
needed kicking.

> Can you try that release and verify this?

I will try with a current git kernel without my patch and report back,
but I will be surprised if the problem described above is gone. System
is currently compiling.

> thanks,
You're welcome.

Kind regards,
Michael Karcher

Michael Karcher

unread,
Apr 18, 2008, 3:20:06 AM4/18/08
to

Am Freitag, den 18.04.2008, 08:01 +0200 schrieb Michael Karcher:
> Am Donnerstag, den 17.04.2008, 20:24 -0700 schrieb Greg KH:
> > What is this patch against? We have a change that went into 2.6.25
> > after 2.6.25-rc9 that should make this patch not be needed.
> The patch is developed against 2.6.25-rc8 + some git patches, but I have
> forward-ported it to current git.
>
> I *guess* you are talking about commit aad8a278 (USB: support more
> Huawei data card product IDs), as I could not find .
insert "any other patches applying to usb/usb-serial that might be
involved" before the full stop.
[...]

> > Can you try that release and verify this?
> I will try with a current git kernel without my patch and report back,
> but I will be surprised if the problem described above is gone. System
> is currently compiling.

Kernel compiled & booted. Won't work without the patch.

Relevant dmesg and lsusb -v output follows.

Regards,
Michael Karcher

dmesg:
usb 2-1: new full speed USB device using uhci_hcd and address 2
usb 2-1: configuration #1 chosen from 1 choice
usbcore: registered new interface driver usbserial
drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
drivers/usb/serial/usb-serial.c: USB Serial Driver core
drivers/usb/serial/usb-serial.c: USB Serial support registered for GSM modem (1-port)
option 2-1:1.0: GSM modem (1-port) converter detected
usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0
usbcore: registered new interface driver option
drivers/usb/serial/option.c: USB Driver for GSM modems: v0.7.1
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.

lsusb -v:
Bus 002 Device 002: ID 12d1:1001 Huawei Technologies Co., Ltd. E620 USB Modem
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x12d1 Huawei Technologies Co., Ltd.
idProduct 0x1001 E620 USB Modem
bcdDevice 0.00
iManufacturer 1 �������������������
iProduct 2 HUAWEI Mobile
iSerial 1 �������������������
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 8 Mass Storage
bInterfaceSubClass 6 SCSI
bInterfaceProtocol 80 Bulk (Zip)
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x04 EP 4 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Device Status: 0x0000
(Bus Powered)


signature.asc

Greg KH

unread,
May 28, 2008, 1:40:11 PM5/28/08
to
On Fri, Apr 18, 2008 at 08:30:41AM +0200, Michael Karcher wrote:
>
> Am Freitag, den 18.04.2008, 08:01 +0200 schrieb Michael Karcher:
> > Am Donnerstag, den 17.04.2008, 20:24 -0700 schrieb Greg KH:
> > > What is this patch against? We have a change that went into 2.6.25
> > > after 2.6.25-rc9 that should make this patch not be needed.
> > The patch is developed against 2.6.25-rc8 + some git patches, but I have
> > forward-ported it to current git.
> >
> > I *guess* you are talking about commit aad8a278 (USB: support more
> > Huawei data card product IDs), as I could not find .
> insert "any other patches applying to usb/usb-serial that might be
> involved" before the full stop.
> [...]
>
> > > Can you try that release and verify this?
> > I will try with a current git kernel without my patch and report back,
> > but I will be surprised if the problem described above is gone. System
> > is currently compiling.
> Kernel compiled & booted. Won't work without the patch.

Oops, sorry, I lost this message in the queue.

Can you regenerate your patch against 2.6.26-rc4 and resend it?

thanks,

greg k-h

0 new messages