Activation Codes and Methods, Hardware Details, Sniffing
Post Reply
richirich
Posts: 15
Joined: 31 Dec 2010, 13:58

ZTE MF626+kernel 2.6.27-45: modeswitch failed with option.

Post by richirich » 08 Aug 2011, 13:51

Hi Josh,
I am facing one small issue. Forgive me if this query is redundant to you. I searched but didnt get concerned answer.
Well it is very well known modem ZTE MF626. My kernel is 2.6.27-45 (usb-storage is disabled).
usb_modeswitch version is 1.1.6.

Problem is, when option driver is loaded already and then i plugged in modem to system. (option driver is *just* modprobed in system, it is nor binded to modem(storage mode) neither echoed in new_id)
Its original vid =19d2 and pid =2000.
Then i fire the modeswitch command by commandline.(Here i have changed the source code of usb_modeswitch to support multiple message content through command line too.)

usb_ms -v 0x19d2 -p 0x2000 -V 0x19d2 -P 0x0031 -M 5553424312345678000000000000061e000000000000000000000000000000 -2 55534243123456
79000000000000061b000000020000000000000000000000 -3 55534243123456702000000080000c85010101180101010101000000000000 -I -n 1 -s 10

Looking for target devices ...
No devices in target mode or class found
Looking for default devices ...
Found devices in default mode, class or configuration (1)
Accessing device 003 on bus 001 ...
Getting the current device configuration ...
OK, got current device configuration (1)
Using endpoints 0x01 (out) and 0x81 (in)
Using endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: ZTE, Incorporated
Product: ZTE CDMA Technologies MSM
Serial No.: not provided
-------------------------
Looking for active driver ...
No driver found. Either detached before or never attached
Setting up communication with interface 0 ...
Using endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
Sending the message returned error -110. Trying to continue
Reading the response to the message (CSW) ...
Response reading got error -110, can probably be ignored
Device is gone, skipping any further commands

Checking for mode switch (max. 10 times, once per second) ...
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...
No new devices in target mode or class found

Mode switch has failed. Bye.


Then after some trial, i got that when i rmmod the option driver from system and then plugged in the modem then modeswitch gets succeeded. Below is output:

usb_ms -v 0x19d2 -p 0x2000 -V 0x19d2 -P 0x0031 -M 5553424312345678000000000000061e000000000000000000000000000000 -2 5553424312345
679000000000000061b000000020000000000000000000000 -3 55534243123456702000000080000c85010101180101010101000000000000 -I -n 1 -s 10

Looking for target devices ...
No devices in target mode or class found
Looking for default devices ...
Found devices in default mode, class or configuration (1)
Accessing device 006 on bus 001 ...
Getting the current device configuration ...
OK, got current device configuration (1)
Using endpoints 0x01 (out) and 0x81 (in)
Using endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: ZTE, Incorporated
Product: ZTE CDMA Technologies MSM
Serial No.: not provided
-------------------------
Looking for active driver ...
No driver found. Either detached before or never attached
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 (13 bytes).
Trying to send message 2 to endpoint 0x01 ...
OK, message successfully sent
Reading the response to message 2 ...
OK, response successfully read (13 bytes).
Trying to send message 3 to endpoint 0x01 ...
OK, message successfully sent
Reading the response to message 3 ...
OK, response successfully read (13 bytes).
Resetting response endpoint 0x81
Resetting message endpoint 0x01

Checking for mode switch (max. 10 times, once per second) ...
Waiting for original device to vanish ...
Waiting for original device to vanish ...
Original device can't be accessed anymore. Good.
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...

Found target device, now opening
Found correct target device

Mode switch succeeded. Bye.


And its output was in /proc/bus/usb/devices
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 7 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=19d2 ProdID=0031 Rev= 0.00
S: Manufacturer=ZTE, Incorporated
S: Product=ZTE CDMA Technologies MSM
S: SerialNumber=1234567890ABCDEF
C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=01(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=(none)
E: Ad=03(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=83(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E: Ad=84(I) Atr=03(Int.) MxPS= 64 Ivl=5ms
E: Ad=85(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
#

Then modprobing the option and then wvdial gets connected successfully.
[ In wvdial i have used AT+ZCDRUN=8 ].

So i am not able to understand, option driver should be loaded or not at the time of modeswitching? Does it really affect the modeswitching or there is something missing in system ?

Hope to get answer soon.

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

Re: ZTE MF626+kernel 2.6.27-45: modeswitch failed with optio

Post by Josh » 08 Aug 2011, 16:33

richirich wrote:My kernel is 2.6.27-45 (usb-storage is disabled).
Especially with ZTE devices, switching seems to work more reliable when usb-storage is present and has had a chance to initialize the device.
richirich wrote:usb_modeswitch version is 1.1.6. [...] Then i fire the modeswitch command by commandline.(Here i have changed the source code of usb_modeswitch to support multiple message content through command line too.)
Strange, 1.1.6 should be able to handle three messages without modification ...

Anyway, this may contribute to the problem:

Code: Select all

Looking for active driver ...
 No driver found. Either detached before or never attached
The pre-loaded "option" driver should in no way affect the switching process.

Annother thing you want to check in your kernel source code:
Is the ID 19d2:2000 listed in the usb-storage tree, in the file "unusual_devs.h"? It had gotten in there for two kernel versions IIRC and caused all kinds of side effects, preventing usb-storage to initialize all devices with that ID.


richirich
Posts: 15
Joined: 31 Dec 2010, 13:58

Post by richirich » 09 Aug 2011, 08:03

Code: Select all

Strange, 1.1.6 should be able to handle three messages without modification ...
Oh sorry it was my mistake. I have changed for supporting TargetProductList through commandline, not message content. Multiple message support is already there in 1.1.6 . True.

Although i didnt use my custom option(TargetProductList (-L) on command line) in above mentioned command line. So just ignore that.

I checked in kernel source code. This ID is mentioned in unusual_devs.h file.
But i guess, it comes in picture only when usb_storage driver is compiled/loaded. Please correct me if it is wrong. And in my case, usb_storage is not compiled/loaded.

So i guess here it is not affecting this.
It can be that, zte devices need usb_storage for proper initailization as you said.

Probably i can't back to you with its results, as modem is not with me.
So thanks for all your input.

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

Post by Josh » 09 Aug 2011, 08:20

richirich wrote:It can be that, zte devices need usb_storage for proper initailization as you said.
Mind that "unusual_devs.h" is part of the usb-storage code. The entry for the ZTE ID results in the device to be ignored. If you leave it unchanged, the device will not be initialized even if the usb-storage driver is present.

You need to delete / outcomment that entry and re-compile usbstorage.


richirich
Posts: 15
Joined: 31 Dec 2010, 13:58

Post by richirich » 09 Aug 2011, 08:42

I understood that.
But If I dont compile USB_STORAGE module in kernel, then how unusual_devs.h will come in picture.
In my scenario, I used system's usb ports only for modems, so I dont need USB_STORAGE so i dont compile kernel with it. I disabled that option already from kernel. I just have enabled the host controller and serial driver like usbserial/option in kernel for modem to work.

I hope i am able to make this understandable.

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

Post by Josh » 09 Aug 2011, 18:32

I figured you had problems switching the ZTE device, hadn't you ?

To overcome these problems you need usb-storage ...

???

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

Post by Josh » 09 Aug 2011, 18:35

I figured you had problems switching the ZTE device, hadn't you ?

To overcome these problems you need usb-storage ...

???

richirich
Posts: 15
Joined: 31 Dec 2010, 13:58

Post by richirich » 10 Aug 2011, 07:10

Ok. It seems even though I dont need usb_storage, I need to use usb_storage compulsory :(
after removing the entry from unusual_devs.h for making zte devices work in linux-2.6.27.

Thank you so much for all your quick response.
:)

Post Reply