Huawei K5160 USB LTE Modem

USB Mode Switch

  • usb_modeswitch -W -v 12d1 -p 1f1e -X # huawei-alt-mode for CDC NCM (modem) mode (msg 3)
  • Device: /dev/ttyUSB0
  • OpenWRT’s usb-modeswitch config file /etc/usb-mode.json
    • Using the alternative Huawei switching message as defined in usb_modeswitch, file usb_modeswitch.c, line 755.
    • Using decimal values of TargetVendor and TargetProductList for Vodafone / Huawei K5160 from file ${pkgs.usb-modeswitch-data}/share/usb_modeswitch/12d1:1f1e.
  • Messages for various USB modes: from plain old PPP modem up to Ethernet emulation and CDC NCM modem specification.
  • List t_product contains product ids for inidividual modes (PPP, RNDIS/CDCeth, CDC NCM).
{
	"messages" : [
		"55534243123456780000000000000011063000000100000000000000000000",
		"55534243123456780000000000000011060000000100000100000000000000",
		"55534243123456780000000000000011062000000101000100000000000000",
		"55534243123456780000000000000011063000000000010000000000000000"
	],
	"devices" : {
		"12d1:1f1e": {
			"*": {
				"t_vendor": 4817,
				"t_product": [ 4097, 5503, 5470 ],
				"msg": [ 3 ]
			}
		}
	}
}

Old PPP mode (msg 0)

$ cat /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 13 Spd=480  MxCh= 0
D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=12d1 ProdID=1001 Rev= 1.02
S:  Manufacturer=Vodafone (Huawei)
S:  Product=Vodafone (Huawei)
C:* #Ifs= 3 Cfg#= 1 Atr=80 MxPwr=  2mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

$ dmesg

usb-storage 1-1.1:1.0: USB Mass Storage device detected
scsi host0: usb-storage 1-1.1:1.0
usb 1-1.1: USB disconnect, device number 12
usb 1-1.1: new high-speed USB device number 13 using ehci-platform
option 1-1.1:1.0: GSM modem (1-port) converter detected
usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB0
option 1-1.1:1.1: GSM modem (1-port) converter detected
usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB1
option 1-1.1:1.2: GSM modem (1-port) converter detected
usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB2

RNDIS mode (msg 1)

$ cat /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 15 Spd=480  MxCh= 0
D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=12d1 ProdID=157f Rev= 1.02
S:  Manufacturer=Vodafone (Huawei)
S:  Product=Vodafone (Huawei)
C:* #Ifs= 3 Cfg#= 1 Atr=80 MxPwr=  2mA
A:  FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=03
I:* If#= 0 Alt= 0 #EPs= 1 Cls=e0(wlcon) Sub=01 Prot=03 Driver=(none)
E:  Ad=83(I) Atr=03(Int.) MxPS=   8 Ivl=2ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=(none)
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=125us

$ cat /sys/bus/usb/devices/1-1.1:1.0/interface

RNDIS Communications Control

CDC Ethernet mode (msg 2)

$ cat /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 17 Spd=480  MxCh= 0
D:  Ver= 2.10 Cls=02(comm.) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=12d1 ProdID=157f Rev= 1.02
S:  Manufacturer=Vodafone (Huawei)
S:  Product=Vodafone (Huawei)
C:* #Ifs= 3 Cfg#= 1 Atr=80 MxPwr=  2mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=(none)
E:  Ad=83(I) Atr=03(Int.) MxPS=  16 Ivl=2ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=06 Prot=00 Driver=(none)
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=125us

$ cat /sys/bus/usb/devices/1-1.1:1.0/interface
CDC Ethernet Control Model (ECM)

CDC NCM (modem) mode (msg 3)

$ cat /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 21 Spd=480  MxCh= 0
D:  Ver= 2.10 Cls=02(comm.) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=12d1 ProdID=155e Rev= 1.02
S:  Manufacturer=Vodafone (Huawei)
S:  Product=Vodafone (Huawei)
C:* #Ifs= 5 Cfg#= 1 Atr=80 MxPwr=  2mA
A:  FirstIf#= 3 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0d Prot=00 Driver=(none)
E:  Ad=87(I) Atr=03(Int.) MxPS=  16 Ivl=2ms
I:* If#= 4 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=01 Driver=(none)
I:  If#= 4 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=01 Driver=(none)
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

$ cat /sys/bus/usb/devices/1-1.1:1.3/interface

NCM Network Control Model

$ cat /sys/bus/usb/devices/1-1.1:1.4/interface

CDC Network Data

$ dmesg

usb-storage 1-1.1:1.0: USB Mass Storage device detected
scsi host0: usb-storage 1-1.1:1.0
usb 1-1.1: USB disconnect, device number 12
usb 1-1.1: new high-speed USB device number 13 using ehci-platform
option 1-1.1:1.0: GSM modem (1-port) converter detected
usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB0
option 1-1.1:1.1: GSM modem (1-port) converter detected
usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB1
option 1-1.1:1.2: GSM modem (1-port) converter detected
usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB2

 Share!

 
comments powered by Disqus