Re: USBid/interfaces for Huawei E398

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alex Hermann <alex-lists@xxxxxxxxx> writes:

> Hello,
>
> the E398 shares an usb id with the E353, but seems to use different 
> interfaces. The ones already present in the option driver don't autoload the 
> driver for this device.
>
> The driver/device seems to work perfectly after modprobing and adding the id 
> via sysfs:
>
> echo "12d1 1506" > /sys/bus/usb-serial/drivers/option1/new_id
>
> For some reason the driver/device used to work in 2.6.39 and i think even in 
> 3.0.0, but not in 3.1.x (This might have been some modeswitch/udev/userspace 
> action that is now removed).
>
>
> lsusb output is below, i have no idea which of the 6 interfaces would be the 
> correct one to add to the driver.

As noted by Marcel Holtmann:  Huawei seems to have switched to a
protocol based scheme instead of mapping fixed interface numbers. 
This means that the mapping should really be

 idVendor 0x12d1
 bInterfaceClass 0xff
 bInterfaceSubClass x
 bInterfaceProtocol y

where x and y preferably should be verified against the Windows driver
*.inf files.


>
> Bus 002 Device 008: ID 12d1:1506 Huawei Technologies Co., Ltd. E398 
> LTE/UMTS/GSM Modem/Networkcard
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               2.00
>   bDeviceClass            0 (Defined at Interface level)
>   bDeviceSubClass         0 
>   bDeviceProtocol         0 
>   bMaxPacketSize0        64
>   idVendor           0x12d1 Huawei Technologies Co., Ltd.
>   idProduct          0x1506 E398 LTE/UMTS/GSM Modem/Networkcard
>   bcdDevice            1.02
>   iManufacturer           3 HUAWEI
>   iProduct                2 HUAWEI Mobile
>   iSerial                 0 
>   bNumConfigurations      1
>   Configuration Descriptor:
>     bLength                 9
>     bDescriptorType         2
>     wTotalLength          206
>     bNumInterfaces          6
>     bConfigurationValue     1
>     iConfiguration          0 


Do you happen to know what usb_modeswitch command you used to switch the
device to this mode?  I happen to ha a similar device (E392) using the
exact same USB IDs, but I have not seen any NCM descriptor there (yet).

The header is similar, but not identical, and the interfaces are all
different:

Bus 002 Device 081: ID 12d1:1506 Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x12d1 Huawei Technologies Co., Ltd.
  idProduct          0x1506 E398 LTE/UMTS/GSM Modem/Networkcard
  bcdDevice            0.00
  iManufacturer           4 Huawei Technologies
  iProduct                3 HUAWEI Mobile
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          193
    bNumInterfaces          7
    bConfigurationValue     1
    iConfiguration          2 Huawei Configuration


>     bmAttributes         0x80
>       (Bus Powered)
>     MaxPower              500mA
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        0
>       bAlternateSetting       0
>       bNumEndpoints           3
>       bInterfaceClass       255 Vendor Specific Class
>       bInterfaceSubClass      2 
>       bInterfaceProtocol      1 


The Windows driver indicates that this is a modem (serial/AT) interface:

bjorn@canardo:/tmp/w$ grep 'VID_12D1&Subclass_02&Prot_01' common/Driver/Driver/X64/*.inf
common/Driver/Driver/X64/ew_jubusenum.inf:%EnumDeviceDesc% = DevInstall, USB\VID_12D1&Subclass_02&Prot_01
common/Driver/Driver/X64/ew_jubusenum.inf:%EnumDeviceDesc% = DevInstall, USB\VID_12D1&Subclass_02&Prot_01
common/Driver/Driver/X64/ew_jubusenum.inf:%EnumDeviceDesc% = DevInstall, USB\VID_12D1&Subclass_02&Prot_01
common/Driver/Driver/X64/ew_jucdcmdm.inf:%MDMDeviceDesc% = DevInstall, USBCDCACM\VID_12D1&Subclass_02&Prot_01
common/Driver/Driver/X64/ew_jucdcmdm.inf:%MDMDeviceDesc% = DevInstall, USBCDCACM\VID_12D1&Subclass_02&Prot_01
common/Driver/Driver/X64/ew_jucdcmdm.inf:%MDMDeviceDesc% = DevInstall, USBCDCACM\VID_12D1&Subclass_02&Prot_01
bjorn@canardo:/tmp/w$ egrep ^MDMDeviceDesc  common/Driver/Driver/X64/*.inf
common/Driver/Driver/X64/ew_jucdcmdm.inf:MDMDeviceDesc = "HUAWEI Mobile Connect - 3G Modem"


>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        1
>       bAlternateSetting       0
>       bNumEndpoints           1
>       bInterfaceClass       255 Vendor Specific Class
>       bInterfaceSubClass      2 
>       bInterfaceProtocol     22 

The Windows driver indicates that this is a CDC NCM (?) interface:

bjorn@canardo:/tmp/w$ grep 'VID_12D1&Subclass_02&Prot_16' common/Driver/Driver/X64/*.inf
common/Driver/Driver/X64/ew_jubusenum.inf:%EnumDeviceDesc% = DevInstallNet, USB\VID_12D1&Subclass_02&Prot_16
common/Driver/Driver/X64/ew_jubusenum.inf:%EnumDeviceDesc% = DevInstallNet, USB\VID_12D1&Subclass_02&Prot_16
common/Driver/Driver/X64/ew_jubusenum.inf:%EnumDeviceDesc% = DevInstallNet, USB\VID_12D1&Subclass_02&Prot_16
common/Driver/Driver/X64/ew_jucdcecm.inf:%NCMDeviceDesc% = ew_jucdcncm.ndi, USBCDCNCM\VID_12D1&Subclass_02&Prot_16
common/Driver/Driver/X64/ew_jucdcecm.inf:%NCMDeviceDesc% = ew_jucdcncm.ndi, USBCDCNCM\VID_12D1&Subclass_02&Prot_16
common/Driver/Driver/X64/ew_jucdcecm.inf:%NCMDeviceDesc% = ew_jucdcncm.ndi, USBCDCNCM\VID_12D1&Subclass_02&Prot_16
common/Driver/Driver/X64/ew_juextctrl.inf:%dc_ecm_dev.DevDesc% = DevInstall, USBCDCNCM\VID_12D1&Subclass_02&Prot_16&ext_ctrl
common/Driver/Driver/X64/ew_juextctrl.inf:%dc_ecm_dev.DevDesc% = DevInstall, USBCDCNCM\VID_12D1&Subclass_02&Prot_16&ext_ctrl
common/Driver/Driver/X64/ew_juextctrl.inf:%dc_ecm_dev.DevDesc% = DevInstall, USBCDCNCM\VID_12D1&Subclass_02&Prot_16&ext_ctrl
common/Driver/Driver/X64/ew_juwwanecm.inf:%NCMDeviceDesc% = ew_juwwanncm.ndi, USBCDCNCM\VID_12D1&Subclass_02&Prot_16&wwan
common/Driver/Driver/X64/ew_juwwanecm.inf:%NCMDeviceDesc% = ew_juwwanncm.ndi, USBCDCNCM\VID_12D1&Subclass_02&Prot_16&wwan
common/Driver/Driver/X64/ew_juwwanecm.inf:%NCMDeviceDesc% = ew_juwwanncm.ndi, USBCDCNCM\VID_12D1&Subclass_02&Prot_16&wwan
bjorn@canardo:/tmp/w$ egrep ^NCMDeviceDesc  common/Driver/Driver/X64/*.inf
common/Driver/Driver/X64/ew_jucdcecm.inf:NCMDeviceDesc = "HUAWEI Mobile Connect - Network Adapter"
common/Driver/Driver/X64/ew_juwwanecm.inf:NCMDeviceDesc = "HUAWEI Mobile Connect - Network Adapter"


>       iInterface              0 
>       ** UNRECOGNIZED:  05 24 00 10 01
>       ** UNRECOGNIZED:  06 24 1a 00 01 1f
>       ** UNRECOGNIZED:  0d 24 0f 01 05 00 00 00 ea 05 03 00 01
>       ** UNRECOGNIZED:  05 24 06 01 01


The UNRECOGNIZED data here are really (nearly?) valid CDC NCM functional
descriptors:

 CDC Header
 CDC NCM
 CDC Ethernet
 CDC Union (which looks weird to me, giving 1 as both control and data
            interface, but I don't know NCM.  Maybe that's allowed?)

but lsusb can of course not understand that, since Huawei are stupid
enough to label this as "vendor specific".

It would be extremely interesting to know if you are able to use the
cdc_ncm class driver on this card, though.  It might need some
modifications to allow it to load for a vendor specific interface.
Haven't looket at the details.

>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        1
>       bAlternateSetting       1
>       bNumEndpoints           3
>       bInterfaceClass       255 Vendor Specific Class
>       bInterfaceSubClass      2 
>       bInterfaceProtocol     22 

This is the "real" interface, containing the bulk endpoints, as dictated
by the NCM spec.

[..]
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        2
>       bAlternateSetting       0
>       bNumEndpoints           2
>       bInterfaceClass       255 Vendor Specific Class
>       bInterfaceSubClass      2 
>       bInterfaceProtocol      3 

The Windows driver indicates that this another serial interface

bjorn@canardo:/tmp/w$ grep 'VID_12D1&Subclass_02&Prot_03' common/Driver/Driver/X64/*.inf
common/Driver/Driver/X64/ew_jubusenum.inf:%EnumDeviceDesc% = DevInstall, USB\VID_12D1&Subclass_02&Prot_03
common/Driver/Driver/X64/ew_jubusenum.inf:%EnumDeviceDesc% = DevInstall, USB\VID_12D1&Subclass_02&Prot_03
common/Driver/Driver/X64/ew_jubusenum.inf:%EnumDeviceDesc% = DevInstall, USB\VID_12D1&Subclass_02&Prot_03
common/Driver/Driver/X64/ew_jucdcacm.inf:%DIAGDeviceDesc% = DevInstall, USBCDCACM\VID_12D1&Subclass_02&Prot_03
common/Driver/Driver/X64/ew_jucdcacm.inf:%DIAGDeviceDesc% = DevInstall, USBCDCACM\VID_12D1&Subclass_02&Prot_03
common/Driver/Driver/X64/ew_jucdcacm.inf:%DIAGDeviceDesc% = DevInstall, USBCDCACM\VID_12D1&Subclass_02&Prot_03
bjorn@canardo:/tmp/w$ egrep ^DIAGDeviceDesc  common/Driver/Driver/X64/*.inf
common/Driver/Driver/X64/ew_jucdcacm.inf:DIAGDeviceDesc = "HUAWEI Mobile Connect - 3G Application Interface"


>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        3
>       bAlternateSetting       0
>       bNumEndpoints           2
>       bInterfaceClass       255 Vendor Specific Class
>       bInterfaceSubClass      2 
>       bInterfaceProtocol      2 

The Windows driver indicates that this yet another serial interface

bjorn@canardo:/tmp/w$ grep 'VID_12D1&Subclass_02&Prot_02' common/Driver/Driver/X64/*.inf
common/Driver/Driver/X64/ew_jubusenum.inf:%EnumDeviceDesc% = DevInstall, USB\VID_12D1&Subclass_02&Prot_02
common/Driver/Driver/X64/ew_jubusenum.inf:%EnumDeviceDesc% = DevInstall, USB\VID_12D1&Subclass_02&Prot_02
common/Driver/Driver/X64/ew_jubusenum.inf:%EnumDeviceDesc% = DevInstall, USB\VID_12D1&Subclass_02&Prot_02
common/Driver/Driver/X64/ew_jucdcacm.inf:%PCUIDeviceDesc% = DevInstall, USBCDCACM\VID_12D1&Subclass_02&Prot_02
common/Driver/Driver/X64/ew_jucdcacm.inf:%PCUIDeviceDesc% = DevInstall, USBCDCACM\VID_12D1&Subclass_02&Prot_02
common/Driver/Driver/X64/ew_jucdcacm.inf:%PCUIDeviceDesc% = DevInstall, USBCDCACM\VID_12D1&Subclass_02&Prot_02
bjorn@canardo:/tmp/w$ egrep ^PCUIDeviceDesc  common/Driver/Driver/X64/*.inf
common/Driver/Driver/X64/ew_jucdcacm.inf:PCUIDeviceDesc = "HUAWEI Mobile Connect - 3G PC UI Interface"


So I guess you should add something like
       { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x02, 0x01) },
       { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x02, 0x02) },
       { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x02, 0x03) },
to the option driver.




Bjørn
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux