Activation Codes and Methods, Hardware Details, Sniffing
joemeng01
Posts: 8
Joined: 26 Sep 2012, 10:48

How to support Huawei ET302

Post by joemeng01 » 26 Sep 2012, 11:43

Dear Josh,
    I need your help.I can't switch Huawei ET302 successfully,I use the configure file is

Code: Select all

DefaultVendor=0x12d1
DefaultProduct=0x1d50

TargetVendor=0x12d1
TargetProduct=0x1d50

MessageContent="55534243123456780600000080010011060000000000000000000000000000"


TargetClass=0xff

CheckSuccess=20
NeedResponse=1
here is what has printed out from the terminal

Code: Select all


# usb 1-1.1: new high speed USB device using rtl8652-ehci and address 9
usb 1-1.1: New USB device found, idVendor=12d1, idProduct=1d50
usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.1: Product: HUAWEI Mobile System Solution
usb 1-1.1: Manufacturer: HUAWEI Mobile
usb 1-1.1: SerialNumber: 000000-00-0000000
parse_hotplug_info() devinfo:12d1:1d50
usb 1-1.1: configuration #1 chosen from 3 choices
init
++++++Ready start mount usb store++++
scsi4 : SCSI emulation for USB Mass Storage devices

Looking for target devices ...
 No devices in target mode or class found
Looking for default devices ...
 No devices in default mode found. Nothing to do. Bye.

Looking for target devices again ... add by Realtek
Looking for default devices again...add by May
 Found devices in default mode, class or configuration (1)
Accessing device 009 on bus 001 ...
Getting the current device configuration ...
 OK, got current deviusb 1-1.1: usbfs: process 1985 (usb_modeswitch) did not claim interface 0 before use
ce configuration (1)
Ambiguous Class/InterfaceClass: 0x02/0x08
Using endpoints 0x01 (out) and 0x81 (in)
Using endpoints 0x01 (out) and 0x81 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
 OK, driver found ("usb-storage")
 OK, driver "usb-storage" detached

SCSI inquiry data (for identification)
-------------------------
  Vendor String: HUAWEI
   Model String: Mobile CMCC CD
Revision String: 1.00
-------------------------

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI Mobile
     Product: HUAWEI Mobile System Solution
  Serial No.: 000000-00-0000000
-------------------------
Setting up communication with interface 0 ...
Using endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
 OK, message successfully sent
Reading the response to the message (CSW) ...
 OK, response successfully read (0 bytes).
Resetting response endpoint 0x81
Resetting message endpoint 0x01
++++++Ready start mount usb store++++

Checking for mode switch (max. 20 times, once per second) ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Original device still present after the timeout

Mode switch most likely failed. Bye.


mnet built on 2012.09.12-08:04+0000

usb 1-1: USB disconnect, address 7
usb 1-1.1: USB disconnect, address 9
parse_hotplug_info() devinfo:12d1:1d50
++++++Ready start mount usb store++++
parse_hotplug_info() devinfo:05e3:0610
usb 1-1: new high speed USB device using rtl8652-ehci and address 10
usb 1-1: New USB device found, idVendor=05e3, idProduct=0610
usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
usb 1-1: Product: USB2.0 Hub
parse_hotplug_info() devinfo:05e3:0usb 1-1: configuration #1 chosen from 1 choice
610
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
usb 1-1.1: new high speed USB device using rtl8652-ehci and address 11
++++++Ready start mount usb store++++
usb 1-1.1: New USB device found, idVendor=12d1, idProduct=1d50
usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.1: Product: HUAWEI Mobile System Solution
usb 1-1.1: Manufacturer: HUAWEI Mobile
usb 1-1.1: SerialNumber: 000000-00-0000000
parse_hotplug_info() devinfo:12d1:usb 1-1.1: configuration #1 chosen from 3 choices
1d50
scsi5 : SCSI emulation for USB Mass Storage devices
++++++Ready start mount usb store++++
scsi 5:0:0:0: CD-ROM            HUAWEI   Mobile CMCC CD   1.00 PQ: 0 ANSI: 0
sr0: scsi-1 drive
++++++Ready start mount usb store++++

It's certain that it failed.What is wrong with my method and what can I do ?

       I will thank you so much that if you could help me.

joemeng01
Posts: 8
Joined: 26 Sep 2012, 10:48

Re: How to support Huawei ET302

Post by joemeng01 » 26 Sep 2012, 11:50

PS:I try this on am embedded system. Kernel is 2.6.30

bmork
Posts: 167
Joined: 15 Mar 2012, 22:47
Location: Oslo, Norway

Re: How to support Huawei ET302

Post by bmork » 26 Sep 2012, 18:47

joemeng01 wrote:

Code: Select all


usb 1-1.1: configuration #1 chosen from 3 choices

 
Are you sure this is a mode switchable device? What are the two other configurations? Could you post either /sys/kernel/debug/usb/devices with debugfs mounted or the output of lsusb -vd 12d1:1d50

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: How to support Huawei ET302

Post by LOM » 26 Sep 2012, 19:36

Here is something for you to chew on Bjoern, ET302 has a strange combination of interfaces:

ET302

T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=02(comm.) Sub=00 Prot=00 MxPS=64 #Cfgs= 3
P: Vendor=12d1 ProdID=1d50 Rev= 1.00
S: Manufacturer=HUAWEI Mobile
S: Product=HUAWEI Mobile System Solution
S: SerialNumber=000000-00-0000000

C: #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=500mA

I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

C: #Ifs= 6 Cfg#= 2 Atr=80 MxPwr=500mA

I: If#= 0 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=08 Prot=00 Driver=

I: If#= 1 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=0a Prot=00 Driver=

I: If#= 2 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

I: If#= 3 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=09 Prot=01 Driver=

I: If#= 4 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=09 Prot=01 Driver=

I: If#= 5 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=
E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

C:* #Ifs= 8 Cfg#= 3 Atr=a0 MxPwr=500mA

I:* If#= 0 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=08 Prot=00 Driver=(none)

I:* If#= 1 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=09 Prot=01 Driver=(none)

I:* If#= 2 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=09 Prot=01 Driver=(none)

I:* If#= 3 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=09 Prot=01 Driver=(none)

I:* If#= 4 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=0a Prot=00 Driver=(none)

I:* If#= 5 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=(none)

I: If#= 5 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=(none)
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

I: If#= 5 Alt= 2 #EPs= 2 Cls=0a(data ) Sub=00 Prot=ee Driver=(none)
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

I:* If#= 6 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=0a Prot=81 Driver=(none)

I:* If#= 7 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=(none)
E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

bmork
Posts: 167
Joined: 15 Mar 2012, 22:47
Location: Oslo, Norway

Re: How to support Huawei ET302

Post by bmork » 26 Sep 2012, 20:01

LOM wrote:Here is something for you to chew on Bjoern, ET302 has a strange combination of interfaces:

ET302

T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=02(comm.) Sub=00 Prot=00 MxPS=64 #Cfgs= 3
P: Vendor=12d1 ProdID=1d50 Rev= 1.00
S: Manufacturer=HUAWEI Mobile
S: Product=HUAWEI Mobile System Solution
S: SerialNumber=000000-00-0000000

C: #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=500mA

I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I don't think it is that strange, but configuration #1 is not useful for much. It has only usb-storage. Could still be mode switchable, but I think exploring the other configurations is far more interesting....


C: #Ifs= 6 Cfg#= 2 Atr=80 MxPwr=500mA

I: If#= 0 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=08 Prot=00 Driver=

I: If#= 1 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=0a Prot=00 Driver=

I: If#= 2 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

I: If#= 3 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=09 Prot=01 Driver=

I: If#= 4 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=09 Prot=01 Driver=

I: If#= 5 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=
E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
Configuration #2 is interesting. It has the following interfaces
#0 CDC WHCM
#1 CDC MDLM - I assume there is a GUID here too? Try using lsusb.
#2 CDC MDLM data interface
#3 CDC WDM
#4 CDC WDM
#5 storage

The WDM interfaces should be supported by the cdc-wdm driver. There is no way to know what protocol they use, but you could try AT commands.

The MDLM function is most likely ethernet like. cdc_ether has support for some MDLM devices (Ericsson). You could try that. But you would have to know how to initiate a connection.


C:* #Ifs= 8 Cfg#= 3 Atr=a0 MxPwr=500mA

I:* If#= 0 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=08 Prot=00 Driver=(none)

I:* If#= 1 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=09 Prot=01 Driver=(none)

I:* If#= 2 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=09 Prot=01 Driver=(none)

I:* If#= 3 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=09 Prot=01 Driver=(none)

I:* If#= 4 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=0a Prot=00 Driver=(none)

I:* If#= 5 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=(none)

I: If#= 5 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=(none)
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

I: If#= 5 Alt= 2 #EPs= 2 Cls=0a(data ) Sub=00 Prot=ee Driver=(none)
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

I:* If#= 6 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=0a Prot=81 Driver=(none)

I:* If#= 7 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=(none)
E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
Yes, configuration #3 is really interesting. I do not know the CDC WMC good enough to know what all this is, but you've got 2 MDLM functions using different protocols here, and one of them has 3 different data interface altsettings. Probably means that the device supports different encapsulations.

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: How to support Huawei ET302

Post by LOM » 27 Sep 2012, 07:07

I don't own an ET302 so I can't provide you with the output from lsusb -vd, the interface list is from my collection of files nicked on the net and I thought it could be helpful to post what I have. Hopefully joemeng01 may be able to provide something better.

What about all those interfaces without any endpoints, are they usable? Can you communicate with an interface if it doesn't have endpoints? :shock:
There are only 4 endpoints listed for the whole stick with gaps between them which indicates that there should be at least another 4 endpoints, ie 02,03,82,83.

bmork
Posts: 167
Joined: 15 Mar 2012, 22:47
Location: Oslo, Norway

Re: How to support Huawei ET302

Post by bmork » 27 Sep 2012, 09:07

LOM wrote:I don't own an ET302 so I can't provide you with the output from lsusb -vd, the interface list is from my collection of files nicked on the net and I thought it could be helpful to post what I have. Hopefully joemeng01 may be able to provide something better.

What about all those interfaces without any endpoints, are they usable? Can you communicate with an interface if it doesn't have endpoints? :shock:
There are only 4 endpoints listed for the whole stick with gaps between them which indicates that there should be at least another 4 endpoints, ie 02,03,82,83.
Yes, you can communicate with interfaces without endpoints. You are then using endpoint 0 instead, sending only control messages. Some class defintions, like CDC WDM, use this. But I didn't notice that there were no endpoints on the WDM interfaces. That is not according to spec, I believe. There is supposed to be an interrupt IN endpoint which the device use to signal the host that a response is available. The function may still be usable, either one-way from host to device, or by just polling for responses. But it will need a special driver (or usbfs application).

So you are absolutely right: This is a strange device. The WDM class interfaces won't work with the cdc-wdm driver because of the missing endpoint.

joemeng01
Posts: 8
Joined: 26 Sep 2012, 10:48

Re: How to support Huawei ET302

Post by joemeng01 » 27 Sep 2012, 10:36

bmork wrote:
joemeng01 wrote:

Code: Select all


usb 1-1.1: configuration #1 chosen from 3 choices

 
Are you sure this is a mode switchable device? What are the two other configurations? Could you post either /sys/kernel/debug/usb/devices with debugfs mounted or the output of lsusb -vd 12d1:1d50

Dear bmork, you are a warm hearted person ,thanks a lot. The info is as below:

Code: Select all

 
# lsusb 
Bus 002 Device 001: ID 1d6b:0001  
Bus 001 Device 013: ID 12d1:1d50  
Bus 001 Device 012: ID 05e3:0610  
Bus 001 Device 001: ID 1d6b:0002  
# lsusb -vd 12d1:1d50

Bus 001 Device 013: ID 12d1:1d50  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            2 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x12d1 
  idProduct          0x1d50 
  bcdDevice            1.00
  iManufacturer           1 HUAWEI Mobile
  iProduct                2 HUAWEI Mobile System Solution
  iSerial                 3 000000-00-0000000
  bNumConfigurations      3
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength         8192
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 
      bInterfaceSubClass      6 
      bInterfaceProtocol     80 
      iInterface              4 HUAWEI Mobile
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval               0
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength        45824
    bNumInterfaces          6
    bConfigurationValue     2
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         2 
      bInterfaceSubClass      8 
      bInterfaceProtocol      0 
      iInterface              5 HUAWEI Mobile Composite Device
      CDC Header:
        bcdCDC               1.10
      CDC WHCM:
        bcdVersion           1.00
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1 2 3 4 5 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         2 
      bInterfaceSubClass     10 
      bInterfaceProtocol      0 
      iInterface              6 HUAWEI Mobile
      CDC Header:
        bcdCDC               1.10
      CDC Call Management:
        bmCapabilities       0x03
          call management
          use DataInterface
        bDataInterface          2
      CDC ACM:
        bmCapabilities       0x07
          sends break
          line coding and serial state
          get/set/clear comm features
      CDC MDLM:
        bcdCDC               1.20
        bGUID               {15005312-b672-4817-94bf-a507ad4e057e}
      CDC MDLM detail:
        bGuidDescriptorType  00
        bDetailData          00
      CDC Union:
        bMasterInterface        1
        bSlaveInterface         2 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              7 HUAWEI Mobile
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         2 
      bInterfaceSubClass      9 
      bInterfaceProtocol      1 
      iInterface              8 HUAWEI Mobile
      CDC Header:
        bcdCDC               1.10
      CDC Device Management:
        bcdVersion           1.00
        wMaxCommand          1024
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        4
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         2 
      bInterfaceSubClass      9 
      bInterfaceProtocol      1 
      iInterface              9 HUAWEI Mobile
      CDC Header:
        bcdCDC               1.10
      CDC Device Management:
        bcdVersion           1.00
        wMaxCommand          1024
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        5
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 
      bInterfaceSubClass      6 
      bInterfaceProtocol     80 
      iInterface              4 HUAWEI Mobile
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval               0
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength         7425
    bNumInterfaces          8
    bConfigurationValue     3
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         2 
      bInterfaceSubClass      8 
      bInterfaceProtocol      0 
      iInterface              5 HUAWEI Mobile Composite Device
      CDC Header:
        bcdCDC               1.10
      CDC WHCM:
        bcdVersion           1.00
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1 2 3 4 5 6 7 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         2 
      bInterfaceSubClass      9 
      bInterfaceProtocol      1 
      iInterface             10 HUAWEI Mobile
      CDC Header:
        bcdCDC               1.10
      CDC Device Management:
        bcdVersion           1.00
        wMaxCommand          1024
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         2 
      bInterfaceSubClass      9 
      bInterfaceProtocol      1 
      iInterface              8 HUAWEI Mobile
      CDC Header:
        bcdCDC               1.10
      CDC Device Management:
        bcdVersion           1.00
        wMaxCommand          1024
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         2 
      bInterfaceSubClass      9 
      bInterfaceProtocol      1 
      iInterface              9 HUAWEI Mobile
      CDC Header:
        bcdCDC               1.10
      CDC Device Management:
        bcdVersion           1.00
        wMaxCommand          1024
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        4
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         2 
      bInterfaceSubClass     10 
      bInterfaceProtocol      0 
      iInterface             11 HUAWEI Mobile
      CDC Header:
        bcdCDC               1.10
      CDC Union:
        bMasterInterface        4
        bSlaveInterface         5 
      CDC Ethernet:
        iMacAddress                     12 028037070300
        bmEthernetStatistics    0x00000000
        wMaxSegmentSize               1514
        wNumberMCFilters            0x0000
        bNumberPowerFilters              0
      CDC MDLM:
        bcdCDC               1.00
        bGUID               {a317a88b-045e-4f01-a607-c0ffcb7e392a}
      CDC MDLM detail:
        bGuidDescriptorType  00
        bDetailData          03 00
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        5
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass        10 
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface             13 S_TA6_DATA_DISABLED
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        5
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass        10 
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface             14 S_TA6_DATA_1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        5
      bAlternateSetting       2
      bNumEndpoints           2
      bInterfaceClass        10 
      bInterfaceSubClass      0 
      bInterfaceProtocol    238 
      iInterface             15 S_TA6_DATA_2
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        6
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         2 
      bInterfaceSubClass     10 
      bInterfaceProtocol    129 
      iInterface             16 S_TA2
      CDC Header:
        bcdCDC               1.10
      CDC MDLM:
        bcdCDC               1.00
        bGUID               {393036d5-1f95-42e7-a14d-f2780b0d5bba}
      CDC MDLM detail:
        bGuidDescriptorType  00
        bDetailData          00 01
      CDC Union:
        bMasterInterface        6
        bSlaveInterface         7 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        7
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface             17 HUAWEI Mobile
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            2 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      3
Device Status:     0x0000
  (Bus Powered)


What does this tell us??

joemeng01
Posts: 8
Joined: 26 Sep 2012, 10:48

Re: How to support Huawei ET302

Post by joemeng01 » 27 Sep 2012, 10:39

When I run "cat /proc/bus/usb/device",it shows:

Code: Select all


T:  Bus=01 Lev=02 Prnt=12 Port=00 Cnt=01 Dev#= 13 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=02(comm.) Sub=00 Prot=00 MxPS=64 #Cfgs=  3
P:  Vendor=12d1 ProdID=1d50 Rev= 1.00
S:  Manufacturer=HUAWEI Mobile
S:  Product=HUAWEI Mobile System Solution
S:  SerialNumber=000000-00-0000000
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
C:  #Ifs= 6 Cfg#= 2 Atr=80 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=08 Prot=00 Driver=
I:  If#= 1 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=0a Prot=00 Driver=
I:  If#= 2 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:  If#= 3 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=09 Prot=01 Driver=
I:  If#= 4 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=09 Prot=01 Driver=
I:  If#= 5 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
C:  #Ifs= 8 Cfg#= 3 Atr=a0 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=08 Prot=00 Driver=
I:  If#= 1 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=09 Prot=01 Driver=
I:  If#= 2 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=09 Prot=01 Driver=
I:  If#= 3 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=09 Prot=01 Driver=
I:  If#= 4 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=0a Prot=00 Driver=
I:  If#= 5 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=
I:  If#= 5 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:  If#= 5 Alt= 2 #EPs= 2 Cls=0a(data ) Sub=00 Prot=ee Driver=
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:  If#= 6 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=0a Prot=81 Driver=
I:  If#= 7 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
And I have try the configuration #2 too, it doesn't work either.

bmork
Posts: 167
Joined: 15 Mar 2012, 22:47
Location: Oslo, Norway

Re: How to support Huawei ET302

Post by bmork » 27 Sep 2012, 11:05

joemeng01 wrote:And I have try the configuration #2 too, it doesn't work either.
But it should try to load a couple of drivers (cdc_ether and cdc-wdm), and fail. Does it not?

I don't think you can make cdc-wdm support this device easily. It needs the missing interrupt endpoint. But making cdc_ether load should be easy: Just remove the GUID test (or add the appropriate GUID - lsusb -v will show you):

Code: Select all

diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index a03de71..fbd3eca 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -251,8 +251,6 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
                        if (desc->bLength != sizeof(*desc))
                                goto bad_desc;
 
-                       if (memcmp(&desc->bGUID, mbm_guid, 16))
-                               goto bad_desc;
                        break;
                case USB_CDC_MDLM_DETAIL_TYPE:
                        if (detail) {
I have no idea if this will help, though. We don't know anything about the framing, and we do need some management interface to be able to configure and connect the device. I assume the CDC WDM interfaces are supposed to be used for this. But you would have to write the support for that yourself. I'd suggest doing it in userspace.

A small usbsnoop showing how Windows use this modem would be helpful figuring it all out. You can find links to instructions on http://www.draisberghof.de/usb_modeswitch/#contrib

joemeng01
Posts: 8
Joined: 26 Sep 2012, 10:48

Re: How to support Huawei ET302

Post by joemeng01 » 27 Sep 2012, 11:15

I try again,when I do this on command line

Code: Select all

usb_modeswitch  -v 12d1 -p 1d50 -V 12d0 -P 1d50 -W -M 55534243123456780600000080010011060000000000000000000000000000
then

Code: Select all

 echo "12d1 1d50" > /sys/bus/usb-serial/drivers/option1/new_id 
it work, switching has succeed!!

after "cat /proc/bus/usb/device" terminal print

Code: Select all


:  Bus=01 Lev=02 Prnt=18 Port=00 Cnt=01 Dev#= 19 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=02(comm.) Sub=00 Prot=00 MxPS=64 #Cfgs=  3
P:  Vendor=12d1 ProdID=1d50 Rev= 1.00
S:  Manufacturer=HUAWEI Mobile
S:  Product=HUAWEI Mobile System Solution
S:  SerialNumber=000000-00-0000000
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=option
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
...............
   ...............
But there is a question,

I do this

Code: Select all

usb_modeswitch -c us_modeswitch.conf 
then

Code: Select all

echo "12d1 1d50" > /sys/bus/usb-serial/drivers/option1/new_id 
It can't switch successfully.Why ??what is the difference between doing on the command line and using a us_modeswitch.conf file??

bmork
Posts: 167
Joined: 15 Mar 2012, 22:47
Location: Oslo, Norway

Re: How to support Huawei ET302

Post by bmork » 27 Sep 2012, 11:25

joemeng01 wrote:I try again,when I do this on command line

Code: Select all

usb_modeswitch  -v 12d1 -p 1d50 -V 12d0 -P 1d50 -W -M 55534243123456780600000080010011060000000000000000000000000000
then

Code: Select all

 echo "12d1 1d50" > /sys/bus/usb-serial/drivers/option1/new_id 
it work, switching has succeed!!

after "cat /proc/bus/usb/device" terminal print

Code: Select all


:  Bus=01 Lev=02 Prnt=18 Port=00 Cnt=01 Dev#= 19 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=02(comm.) Sub=00 Prot=00 MxPS=64 #Cfgs=  3
P:  Vendor=12d1 ProdID=1d50 Rev= 1.00
S:  Manufacturer=HUAWEI Mobile
S:  Product=HUAWEI Mobile System Solution
S:  SerialNumber=000000-00-0000000
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=option
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
...............
   ...............
It hasn't switched anything. You have just bound the option serial driver to the usb-storage interface. The driver is flexible enough to bind to any function with 2 bulk endpoints, but it does not help anything. This is not a serial function. You just get an unusable ttyUSB0 device.

joemeng01
Posts: 8
Joined: 26 Sep 2012, 10:48

Re: How to support Huawei ET302

Post by joemeng01 » 27 Sep 2012, 11:40

Thank you so much, bmork. I will continue to support it.

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Re: How to support Huawei ET302

Post by Josh » 04 Nov 2012, 16:24

Sorry, I must have missed this post.

If you are still watching this topic, please respond briefly.

bmork
Posts: 167
Joined: 15 Mar 2012, 22:47
Location: Oslo, Norway

Re: How to support Huawei ET302

Post by bmork » 05 Nov 2012, 10:33

Josh wrote:Sorry, I must have missed this post.

If you are still watching this topic, please respond briefly.

I am still watching, but you probably didn't mean me :)

Anyway, somewhat related to this thread and just FYI: One of the patches for the "option" driver currently queued in usb-next for Linux 3.8 is "never bind to a usb-storage interface". It will prevent the option driver from ever binding to a storage class interface, even if you use new_id without any class restriction.


Bjørn

Post Reply