Re: [PATCH] unit: fix test-simutil failure

2018-01-19 Thread Denis Kenzior

Hi James,

On 01/19/2018 12:29 PM, James Prestwood wrote:

A fixup was made in simauth to fix the AUTS length
and the simutil unit test was never updated to reflect
the length change.
---
  unit/test-simutil.c | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)



Applied, thanks.

Regards,
-Denis

___
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono


[PATCH] unit: fix test-simutil failure

2018-01-19 Thread James Prestwood
A fixup was made in simauth to fix the AUTS length
and the simutil unit test was never updated to reflect
the length change.
---
 unit/test-simutil.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/unit/test-simutil.c b/unit/test-simutil.c
index ddf9d28..1b27a95 100644
--- a/unit/test-simutil.c
+++ b/unit/test-simutil.c
@@ -539,15 +539,15 @@ static void test_auth_build_parse(void)
0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76,
0x54, 0x32, 0x10, 0x08, 0xab, 0xcd, 0xef, 0x12, 0x34,
0x56, 0x78, 0x9a };
-   const unsigned char umts_sync_failure[] = { 0xdc, 0x10, 0xde, 0xea,
+   const unsigned char umts_sync_failure[] = { 0xdc, 0x0e, 0xde, 0xea,
0xbe, 0xef, 0xde, 0xea, 0xbe, 0xef, 0xde, 0xea, 0xbe,
-   0xef, 0xde, 0xea, 0xbe, 0xef };
+   0xef, 0xde, 0xea };
int len = 0;
 
/* test GSM auth command */
len = sim_build_gsm_authenticate(auth_cmd, 40, rand);
 
-   g_assert(len == 22);
+   g_assert(len == 23);
g_assert(auth_cmd[0] == 0x00);
g_assert(auth_cmd[1] == 0x88);
g_assert(auth_cmd[2] == 0x00);
@@ -589,7 +589,7 @@ static void test_auth_build_parse(void)
sizeof(umts_sync_failure),
_p, _p, _p, _p,
_p));
-   g_assert(!memcmp(auts_p, auts, 16));
+   g_assert(!memcmp(auts_p, auts, 14));
 
/* test UMTS success parse, with kc */
g_assert(sim_parse_umts_authenticate(umts_success_kc,
-- 
2.7.4

___
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono


Re: Huawei MS2131

2018-01-19 Thread Denis Kenzior

Hi Xingxing,


root@iot2000-ebs:/usr/lib/ofono/test# ./activate-context
Error activating /huawei_0/context1: org.ofono.Error.NotImplemented: 
Implementation not provided.


This tells me that the gprs context driver has failed to initialize.  Do 
you have TUN/TAP support enabled in your kernel?  Is there a log with 
ofono running with debug enabled, e.g. '-n -d' you can provide?


Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono


Re: Huawei MS2131

2018-01-19 Thread Daniel Wagner

Hi Xingxing,

On 01/19/2018 03:27 PM, He, Xingxing wrote:

Hi Denis,

Applying usb-modeswith patch for switching MS2131 to PPP mode, without swapping 
ports(mdm<->pcui), the modem finally registered network successfully:
[ org.ofono.NetworkRegistration ]
 MobileCountryCode = 262
 MobileNetworkCode = 02
 Name = Vodafone.de
 Status = registered
 Technology = umts
 Strength = 83
 Mode = auto
   [ org.ofono.ConnectionManager ]
 Attached = 1
 Powered = 1
 Suspended = 0
 RoamingAllowed = 0
 Bearer = umts

However, when I tried "./activate-context", there was an error. The modem is 
still failed to access internet. :(
root@iot2000-ebs:/usr/lib/ofono/test# ./activate-context
Error activating /huawei_0/context1: org.ofono.Error.NotImplemented: 
Implementation not provided.


IIRC, the MCC (MobileContryCode) and MNC (MobileNetworkCode) are not in 
the mobile-broadband-provider-info and therefore there is no automatic 
provisioning of the context. Not sure what happens when the context is 
not setup correctly.


Thanks,
Daniel
___
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono


Re: Huawei MS2131

2018-01-19 Thread Christophe Ronco

Hi Xingxing,


On 01/19/2018 10:52 AM, He, Xingxing wrote:

Hi Christophe,

May I get the patch in usb-modeswitch for switch device to PPP mode? I would 
like to have a try, thank you in advance.

Best regards,
Xingxing
I use usb-modeswitch 2.5.0 
(http://www.draisberghof.de/usb_modeswitch/usb-modeswitch-2.5.0.tar.bz2).
I had to patch usb-modeswitch to support huawei E3372 with firmware 
22.X. I have done that before trying MS2131 so I can't tell if it is 
necessary for this device (or device firmware).

Here is the comment I wrote when I have implemented the modification:

After some research I found this interesting message on a forum 
(http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=4=1734):


What has been labelled "fall back" message in this thread is not a 
Huawei official switch message, it just happens to work in some firmwares.


5553424312345678001106200101000100

is the standard switch message

while

555342431234567800110630010001

is a Huawei official fall back switch msg switching any modern Huawei 
dongle into 12d1:1001.



The first binary message is the message sent by usb-modeswitch to many 
Huawei devices.
I modified usb-modeswitch to send the second binary message instead. 
Here is what happens when inserting USB key with this modification:


[ 174.120901] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[ 174.273073] usb 1-1: New USB device found, idVendor=12d1, idProduct=1f01
[ 174.279807] usb 1-1: New USB device strings: Mfr=1, Product=2, 
SerialNumber=3

[ 174.287016] usb 1-1: Product: HUAWEI_MOBILE
[ 174.291237] usb 1-1: Manufacturer: HUAWEI_MOBILE
[ 174.295876] usb 1-1: SerialNumber: 0123456789ABCDEF
[ 174.340649] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 174.348241] scsi host0: usb-storage 1-1:1.0
[ 175.322850] usb 1-1: USB disconnect, device number 2
[ 175.890898] usb 1-1: new high-speed USB device number 3 using ci_hdrc
[ 176.049944] usb 1-1: New USB device found, idVendor=12d1, idProduct=155e
[ 176.056720] usb 1-1: New USB device strings: Mfr=1, Product=2, 
SerialNumber=0

[ 176.063911] usb 1-1: Product: HUAWEI_MOBILE
[ 176.068104] usb 1-1: Manufacturer: HUAWEI_MOBILE
[ 176.119262] option 1-1:1.0: GSM modem (1-port) converter detected
[ 176.140098] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 176.163530] option 1-1:1.1: GSM modem (1-port) converter detected
[ 176.188362] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 176.221032] option 1-1:1.2: GSM modem (1-port) converter detected
[ 176.250351] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[ 176.322577] cdc_ncm 1-1:1.3: MAC-Address: 00:1e:10:1f:00:00
[ 176.328169] cdc_ncm 1-1:1.3: setting rx_max = 16384
[ 176.354358] cdc_ncm 1-1:1.3 wwan0: register 'cdc_ncm' at 
usb-ci_hdrc.0-1, Mobile Broadband Network Device, 00:1e:10:1f:00:00
A USB device 12d1:155e appears, creates 3 USB serial channels and a 
cdc_ncm interface.



End of comment

When I insert an MS2131, here is what I see on my system:
[  178.452861] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[  178.604840] usb 1-1: New USB device found, idVendor=12d1, idProduct=14fe
[  178.611574] usb 1-1: New USB device strings: Mfr=1, Product=2, 
SerialNumber=3

[  178.618782] usb 1-1: Product: HUAWEI Mobile
[  178.622991] usb 1-1: Manufacturer: HUAWEI
[  178.627009] usb 1-1: SerialNumber: 
[  178.652141] usb-storage 1-1:1.0: USB Mass Storage device detected
[  178.659862] scsi host0: usb-storage 1-1:1.0
[  179.648202] usb 1-1: USB disconnect, device number 2
[  179.952752] usb 1-1: new high-speed USB device number 3 using ci_hdrc
[  180.104463] usb 1-1: New USB device found, idVendor=12d1, idProduct=155e
[  180.94] usb 1-1: New USB device strings: Mfr=1, Product=2, 
SerialNumber=0

[  180.118390] usb 1-1: Product: HUAWEI Mobile
[  180.122581] usb 1-1: Manufacturer: HUAWEI
[  180.184692] option 1-1:1.0: GSM modem (1-port) converter detected
[  180.205743] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[  180.225687] option 1-1:1.1: GSM modem (1-port) converter detected
[  180.251829] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[  180.275843] option 1-1:1.2: GSM modem (1-port) converter detected
[  180.307996] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[  180.351223] cdc_ncm 1-1:1.3: MAC-Address: 00:1e:10:1f:00:00
[  180.388163] cdc_ncm 1-1:1.3 wwan0: register 'cdc_ncm' at 
usb-ci_hdrc.0-1, Mobile Broadband Network Device, 00:1e:10:1f:00:00


and a lsusb after that:
root@klk-wifc-030122:~ # lsusb
Bus 001 Device 003: ID 12d1:155e

My usbmodeswitch patch is attached to this mail.

Hoping this helps,

Christophe
diff -Naur a/usb_modeswitch.c b/usb_modeswitch.c
--- a/usb_modeswitch.c
+++ b/usb_modeswitch.c
@@ -740,7 +740,9 @@ int main(int argc, char **argv)
 	} else if (ModeMap & HUAWEINEW_MODE) {
 		SHOW_PROGRESS(output,"Using standard Huawei switching