Author Message

<  Setup Discussion  ~  E3131 modeswitching options for multiple device modes

PostPosted: Sun Apr 23, 2017 11:05 am Reply with quote
Posts: 14 Joined: Fri Feb 19, 2016 5:40 pm
As I might have bricked my old E3131, I've got me a new one yesterday. New stick, new behaviour!
Apparently this is the HiLink version, although on the PCB it, too, reads 3131h-2.
I sampled all modswitch lines I could find on the net and tried them out.

tested:
Code:
VedorId is of course 12d1 Huawei, Device Id unswitched is 0x1f01.
This is what one get, depending on modswitch message contents:

1f01 -> 1442   2 tty                   55534243000000000000000000000611060000000000000000000000000000
1f01 -> 1442   2 tty                   55534243123456780000000000000011060000000100000000000000000000
 
1f01 -> 14dc   rndis cdc_ether         55534243123456780000000000000011060000000000000100000000000000
1f01 -> 14dc   rndis cdc_ether         55534243123456780000000000000011061000000000000100000000000000
1f01 -> 14dc   rndis cdc_ether         55534243123456780000000000000011062000000000000100000000000000  my pick for rndis
1f01 -> 14dc   rndis cdc_ether         55534243123456780000000000000a11062000000000000100000000000000
1f01 -> 14dc   rndis cdc_ether         55534243123456780000000000000611062000000000000100000000000000
1f01 -> 14dc   rndis cdc_ether         55534243123456780000000000000011062000000100000100000000000000 
1f01 -> 14dc   rndis cdc_ether         55534243123456780000000000000011062000000101000100000000000000 "huawei new"


1f01 -> 1001   modem  3 tty            55534243123456780000000000000011062000000100000000000000000000 my pick for modem
1f01 -> 1001   modem  3 tty            55534243000000000000000000000611062000000000000000000000000000
1f01 -> 1001   modem  3 ttx            55534243123456780000000000000011062000000000000200000000000000

1f01 -> 1f01   1 tty! whatsthat?       55534243123456780000000000000011060000000000000200000000000000
1f01 -> 1f01   1 tty! whatsthat?       55534243123456780000000000000011062000000000000300000000000000
1f01 -> 1f01   1 tty! whatsthat?       55534243123456780000000000000601000000000000000000000000000000 "option1"


My conclusions:
The initial 55534243 is the mandatory prefix for modeswitch messages
the stuff from after 55534243 to before 1106 is irrelevant. (leading 12345678 or all zeroes, trailing "a" or "6" has no effect)

The fun starts at 1106, apparently the header of true switch message.
14dc rndis behaviour is activated by the 1 in the middle of the message (a.k.a. rndis-1)
1001 modem tty behaviour is activated by absence of rndis-1 and header reading 11062
1442 diag mode(?) is activated by absence of rndis-1 and header reading 11060
1f01 weird mode (single tty) is activated by the last two examples

Is there somewhere other than inside a Huaweis's engineers secret drawer a documentation of the effect of the mesage bits?

Apparently Huawei card can be switched to a multitude of "switched personalities", am I correct?

Testing the switched device:
lsusb; ls -l /dev/ttyUSB*; ifconfig -a (-a shows new, not yet actived rndis interfaces)

mind you, there are cases where one has to coerce the option1 kernel module to create the tty devices,
by writing the usb ids into /sys/bus/usb-serial/drivers/option1/new_id (thx usrus)
example: echo “12d1 1f01″ > /sys/bus/usb-serial/drivers/option1/new_id


Did I miss anything? What mode are the last two lines activating?
Which are the official messages? (and where is that fact documented)


Offline
PostPosted: Mon Apr 24, 2017 8:07 pm Reply with quote
Posts: 166 Joined: Thu Mar 15, 2012 10:47 pm Location: Oslo, Norway
dipr wrote:
My conclusions:
The initial 55534243 is the mandatory prefix for modeswitch messages
the stuff from after 55534243 to before 1106 is irrelevant. (leading 12345678 or all zeroes, trailing "a" or "6" has no effect)

See http://www.usb.org/developers/docs/devc ... ulk_10.pdf


Quote:
Is there somewhere other than inside a Huaweis's engineers secret drawer a documentation of the effect of the mesage bits?

No. The requests are valid USB mass storage commands, but their meaning in a mode switching context is entirely up to the firmware designer.


Offline
PostPosted: Tue Apr 25, 2017 10:42 pm Reply with quote
Posts: 14 Joined: Fri Feb 19, 2016 5:40 pm
Actually I expected to learn that there is a "preferred", "more modern" modeswitch target (rndis "HiLink")
that usb_modeswitch opts for when called with -J

and at least the old modeswitch target of "ppp modem" .

For instance is it common consent that
55534243123456780000000000000011062000000100000000000000000000
is the typical switch to "ppp modem" message ?


Offline

Display posts from previous:  Sort by:

All times are UTC+02:00
Page 1 of 1
3 posts
Users browsing this forum: No registered users and 1 guest
Search for:
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum