[PATCH] qmimodem: fix roaming status report
by Christophe Ronco
Hi,
With a MC7304 modem and a roaming SIM card, Status in org.ofono.NetworkRegistration
properties ends up in "registered" instead of roaming.
Both AT command and qmicli indicates we are roaming.
What's happening is the following:
1) first QMI_NAS_SS_INFO_IND indicating we are registered contains a QMI_NAS_RESULT_ROAMING_STATUS parameter.
Parameter inside says we are roaming and qmimidem driver correctly reports status NETWORK_REGISTRATION_STATUS_ROAMING.
2) other QMI_NAS_SS_INFO_IND arrive, saying we are registered without QMI_NAS_RESULT_ROAMING_STATUS parameter.
Driver reports NETWORK_REGISTRATION_STATUS_REGISTERED.
Extract of traces with QMI binary debug interpreted (as far as I can...):
a) first "searching" indication
Dec 13 13:19:40 klk-lpbs-0504B4 daemon.info ofonod[855]: QMI: < 01 3b 00 80 03 01 04 00 00 24 00 2f 00
29 05 00 d0 00 14 00 00 MCC:208 MNC:20
22 05 00 01 02 00 01 00 Detailed Service Status: QMI_NAS_SERVICE_STATUS_LIMITED, QMI_NAS_NETWORK_SERVICE_DOMAIN_PS, ...
15 03 00 01 08 01 LTE, no roaming
12 05 00 d0 00 14 00 00 Current PLMN: MCC:208 MNC:20, no desc
11 01 00 00
10 01 00 01 No roaming
01 06 00 02 02 02 02 01 08 QMI_NAS_REGISTRATION_STATE_NOT_REGISTERED_SEARCHING, CS detached, PS detached, NETWORK_TYPE_3GPP, QMI_NAS_RADIO_INTERFACE_LTE
Dec 13 13:19:40 klk-lpbs-0504B4 daemon.info ofonod[855]: QMI: NAS_ind msg=36 len=47 [client=1,type=4,tid=0,len=59]
Dec 13 13:19:40 klk-lpbs-0504B4 daemon.info ofonod[855]: QMI: {type=41,len=5} {type=34,len=5} {type=21,len=3} {type=18,len=5}
Dec 13 13:19:40 klk-lpbs-0504B4 daemon.info ofonod[855]: QMI: {type=17,len=1} {type=16,len=1} {type=1,len=6}
Dec 13 13:19:40 klk-lpbs-0504B4 daemon.debug ofonod[855]: ofono_netreg_status_notify modem /sierra_0 status 2 lac -1 cellid -1 tech 7
b) second "searching" indication
Dec 13 13:19:41 klk-lpbs-0504B4 daemon.info ofonod[855]: QMI: < 01 21 00 80 03 01 04 00 00 24 00 15 00
22 05 00 03 03 00 01 00 Detailed Service Status: QMI_NAS_SERVICE_STATUS_LIMITED_REGIONAL, CS_PS, ...
11 01 00 00
01 06 00 02 02 02 02 01 08 QMI_NAS_REGISTRATION_STATE_NOT_REGISTERED_SEARCHING, CS detached, PS detached, NETWORK_TYPE_3GPP, QMI_NAS_RADIO_INTERFACE_LTE
Dec 13 13:19:41 klk-lpbs-0504B4 daemon.info ofonod[855]: QMI: NAS_ind msg=36 len=21 [client=1,type=4,tid=0,len=33]
Dec 13 13:19:41 klk-lpbs-0504B4 daemon.info ofonod[855]: QMI: {type=34,len=5} {type=17,len=1} {type=1,len=6}
c) First indication while "registered"
Dec 13 13:19:56 klk-lpbs-0504B4 daemon.info ofonod[855]: QMI: < 01 5e 00 80 03 01 04 00 00 24 00 52 00
2a 01 00 00
29 05 00 d0 00 14 00 00 MCC:208 MNC:20
28 02 00 15 01 UMTS Primary Scrambling Code
26 08 00 03 00 00 00 03 00 00 00 CS: all calls allowed, PS: all calls allowed
22 05 00 02 03 00 01 00 Detailed Service Status: QMI_NAS_SERVICE_STATUS_AVAILABLE, CS_PS, ...
1e 04 00 f7 00 95 04 CID 3GPP
1d 02 00 fb 50 LAC 3GPP
15 03 00 01 05 00 UMTS: roaming
12 05 00 d0 00 14 00 00 Current PLMN: MCC:208 MNC:20, no desc
11 04 00 03 03 04 05
10 01 00 00 ROAMING ON
01 06 00 01 01 01 02 01 05 QMI_NAS_REGISTRATION_STATE_REGISTERED, CS attached, PS attached, NETWORK_TYPE_3GPP, QMI_NAS_RADIO_INTERFACE_UMTS
Dec 13 13:19:56 klk-lpbs-0504B4 daemon.info ofonod[855]: QMI: NAS_ind msg=36 len=82 [client=1,type=4,tid=0,len=94]
Dec 13 13:19:56 klk-lpbs-0504B4 daemon.info ofonod[855]: QMI: {type=42,len=1} {type=41,len=5} {type=40,len=2} {type=38,len=8}
Dec 13 13:19:56 klk-lpbs-0504B4 daemon.info ofonod[855]: QMI: {type=34,len=5} {type=30,len=4} {type=29,len=2} {type=21,len=3}
Dec 13 13:19:56 klk-lpbs-0504B4 daemon.info ofonod[855]: QMI: {type=18,len=5} {type=17,len=4} {type=16,len=1} {type=1,len=6}
Dec 13 13:19:56 klk-lpbs-0504B4 daemon.debug ofonod[855]: ofono_gprs_status_notify modem /sierra_0 status 1
==================> ROAMING status reported <==========================
Dec 13 13:19:56 klk-lpbs-0504B4 daemon.debug ofonod[855]: ofono_netreg_status_notify modem /sierra_0 status 5 lac 20731 cellid 76873975 tech 2
d) second indication while "registered"
Dec 13 13:19:56 klk-lpbs-0504B4 daemon.info ofonod[855]: QMI: < 01 31 00 80 03 01 04 00 00 24 00 25 00
29 05 00 d0 00 14 00 00 MCC:208 MNC:20
28 02 00 15 01 UMTS Primary Scrambling Code
12 05 00 d0 00 14 00 00 Current PLMN: MCC:208 MNC:20, no desc
11 04 00 03 03 04 05
01 06 00 01 01 01 02 01 05 QMI_NAS_REGISTRATION_STATE_REGISTERED, CS attached, PS attached, NETWORK_TYPE_3GPP, QMI_NAS_RADIO_INTERFACE_UMTS
Dec 13 13:19:56 klk-lpbs-0504B4 daemon.info ofonod[855]: QMI: NAS_ind msg=36 len=37 [client=1,type=4,tid=0,len=49]
Dec 13 13:19:56 klk-lpbs-0504B4 daemon.info ofonod[855]: QMI: {type=41,len=5} {type=40,len=2} {type=18,len=5} {type=17,len=4}
Dec 13 13:19:56 klk-lpbs-0504B4 daemon.info ofonod[855]: QMI: {type=1,len=6}
==================> ROAMING information lost <==========================
Dec 13 13:19:56 klk-lpbs-0504B4 daemon.debug ofonod[855]: ofono_netreg_status_notify modem /sierra_0 status 1 lac -1 cellid -1 tech 2
I don't know if this is a problem specific to MC7304 or even to my firmware version or if this is a normal behavior to have ROAMING_STATUS parameter only when status change from anything to registered.
Best Regards,
Christophe
Christophe Ronco (1):
qmimodem: fix roaming status report
drivers/qmimodem/network-registration.c | 50 ++++++++++++++++++++++++++++-----
1 file changed, 43 insertions(+), 7 deletions(-)
--
2.7.4
2 years, 5 months
[PATCH] sim: fix crash in case of invalid sim password type
by Christophe Ronco
Hi,
I have an old Swedish SIM card here that I tried to put in my MC7304 modem.
My ofono version is 1.20 (with some additional patches).
It sometimes return an invalid SIM password type.
After that, ofono crashes. Here is an extract of debug traces when this happens.
Ofono is just starting, modem was here before ofono starts.
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:qmi_read_attributes() file id 0x6fb7 path len 0
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/devinfo.c:string_cb()
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/devinfo.c:qmi_query_serial()
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:get_file_attributes_cb()
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.err ofonod[1120]: Requested file structure differs from SIM: 6fb7
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/src/voicecall.c:ecc_g2_read_cb() 0
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:qmi_read_attributes() file id 0x6fb7 path len 0
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/devinfo.c:get_ids_cb()
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:get_file_attributes_cb()
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:qmi_read_record() file id 0x6fb7 path len 0
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:read_generic_cb()
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/src/voicecall.c:ecc_g3_read_cb() 1
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:qmi_read_record() file id 0x6fb7 path len 0
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:read_generic_cb()
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/src/voicecall.c:ecc_g3_read_cb() 1
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:qmi_read_record() file id 0x6fb7 path len 0
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:read_generic_cb()
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/src/voicecall.c:ecc_g3_read_cb() 1
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:qmi_read_record() file id 0x6fb7 path len 0
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:read_generic_cb()
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/src/voicecall.c:ecc_g3_read_cb() 1
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:qmi_read_record() file id 0x6fb7 path len 0
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:read_generic_cb()
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/src/voicecall.c:ecc_g3_read_cb() 1
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:qmi_read_attributes() file id 0x2fe2 path len 0
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:get_file_attributes_cb()
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:qmi_read_transparent() file id 0x2fe2 path len 0
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:read_generic_cb()
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/src/simfs.c:sim_fs_op_read_block_cb() bufoff: 0, dataoff: 0, tocopy: 10
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:qmi_read_attributes() file id 0x6f05 path len 0
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:get_file_attributes_cb()
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:qmi_read_transparent() file id 0x6f05 path len 0
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:read_generic_cb()
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/src/simfs.c:sim_fs_op_read_block_cb() bufoff: 0, dataoff: 0, tocopy: 6
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:qmi_read_attributes() file id 0x2f05 path len 0
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:get_file_attributes_cb()
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:qmi_read_transparent() file id 0x2f05 path len 0
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:read_generic_cb()
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/src/simfs.c:sim_fs_op_read_block_cb() bufoff: 0, dataoff: 0, tocopy: 6
Jun 27 15:28:41 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:qmi_query_passwd_state()
Jun 27 15:28:42 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:get_card_status() info1->app_state:0x6: OFONO_SIM_PASSWORD_INVALID
Jun 27 15:28:42 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/drivers/qmimodem/sim.c:query_passwd_state_cb() passwd state 16
Jun 27 15:28:42 klk-lpbs-0504B4 daemon.debug ofonod[1120]: ../git/src/sim.c:sim_pin_query_cb() sim->pin_type: 0, pin_type: 16
Jun 27 15:28:42 klk-lpbs-0504B4 daemon.err ofonod[1120]: Aborting (signal 11) [/usr/sbin/ofonod]
Problem is just that we don't have a string corresponding to this password type.
Christophe Ronco (1):
sim: fix crash in case of invalid sim password type
src/sim.c | 1 +
1 file changed, 1 insertion(+)
--
2.7.4
2 years, 10 months
Re: Huawei MS2131
by 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
3 years, 1 month
[PATCH] unit: fix test-simutil failure
by 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),
&res_p, &ck_p, &ik_p, &auts_p,
&kc_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
3 years, 1 month
Re: Huawei MS2131
by 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
3 years, 1 month
Re: Huawei MS2131
by 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&t=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.
55534243123456780000000000000011062000000101000100000000000000
is the standard switch message
while
55534243123456780000000000000011063000000100010000000000000000
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: FFFFFFFFFFFFFFFF
[ 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.111194] 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
3 years, 1 month
[PATCH] unit: Improve idmap.c unit test coverage
by Slava Monich
This brings function, line and branch coverage for idmap.c to 100%
---
unit/test-idmap.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/unit/test-idmap.c b/unit/test-idmap.c
index b072933..2d2e226 100644
--- a/unit/test-idmap.c
+++ b/unit/test-idmap.c
@@ -35,9 +35,12 @@ static void test_alloc(void)
idmap = idmap_new(2);
g_assert(idmap);
+ g_assert(idmap_get_min(idmap) == 1);
bit = idmap_alloc(idmap);
g_assert(bit == 1);
+ g_assert(idmap_find(idmap, bit));
+ g_assert(!idmap_find(idmap, idmap_get_max(idmap) + 1));
bit = idmap_alloc(idmap);
g_assert(bit == 2);
@@ -62,6 +65,12 @@ static void test_alloc(void)
bit = idmap_alloc(idmap);
g_assert(bit == 1);
+ idmap_put(idmap, 1);
+ idmap_take(idmap, 1);
+ idmap_take(idmap, 3);
+ bit = idmap_alloc(idmap);
+ g_assert(bit == 2);
+
idmap_free(idmap);
}
@@ -80,9 +89,24 @@ static void test_alloc_next(void)
bit = idmap_alloc_next(idmap, 255);
g_assert(bit == 1);
+ while (idmap_alloc(idmap) < (sizeof(unsigned long) * 8) + 1);
+ bit = idmap_alloc_next(idmap, 1);
+ g_assert(bit == (sizeof(unsigned long) * 8) + 2);
+
+ idmap_free(idmap);
+
+ idmap = idmap_new(2);
+
+ g_assert(idmap);
+ g_assert(idmap_alloc_next(idmap, 0) == 3);
+ g_assert(idmap_alloc_next(idmap, 3) == 3);
+
bit = idmap_alloc_next(idmap, 1);
g_assert(bit == 2);
+ bit = idmap_alloc_next(idmap, 2);
+ g_assert(bit == 1);
+
idmap_free(idmap);
}
--
1.9.1
3 years, 1 month
Huawei MS2131
by Daniel Wagner
Hi,
Xingxing and I am trying to get the Huawei MS2131 working. After
swapping mdm with pcui interface, oFono starts to talk to the device.
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -332,14 +332,14 @@ static gboolean setup_huawei(struct modem_info *modem)
g_strcmp0(info->interface, "255/2/1") == 0 ||
g_strcmp0(info->interface, "255/3/1") == 0 ||
g_strcmp0(info->interface, "255/1/49") == 0) {
- mdm = info->devnode;
+ pcui = info->devnode;
} else if (g_strcmp0(info->label, "pcui") == 0 ||
g_strcmp0(info->interface, "255/1/2") == 0 ||
g_strcmp0(info->interface, "255/2/2") == 0 ||
g_strcmp0(info->interface, "255/2/18") == 0 ||
g_strcmp0(info->interface, "255/3/18") == 0 ||
g_strcmp0(info->interface, "255/1/50") == 0) {
- pcui = info->devnode;
+ mdm = info->devnode;
} else if (g_strcmp0(info->label, "diag") == 0 ||
g_strcmp0(info->interface, "255/1/3") == 0 ||
g_strcmp0(info->interface, "255/2/3") == 0 ||
A enable-modem and online-modem later oFono gets stuck at netreg searching
for a network.
So to check if the modem and the SIM are working we played with wvdial:
root@iot2000-ebs:/etc# wvdial MS2131
--> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: AT^NDISDUP=1,1
AT^NDISDUP=1,1
OK
--> Sending: AT+CGDCONT=1,"IP","web.vodafone.de"
AT+CGDCONT=1,"IP","web.vodafone.de"
OK
--> Modem initialized.
--> Configuration does not specify a valid phone number.
root@iot2000-ebs:/etc# ifup wwan0
udhcpc (v1.24.1) started
Sending discover...
Sending select for 100.92.86.33...
Lease of 100.92.86.33 obtained, lease time 518400
/etc/udhcpc.d/50default: Adding DNS 139.7.30.126
/etc/udhcpc.d/50default: Adding DNS 139.7.30.125
Stupid mode:
root@iot2000-ebs:/etc# wvdial MSSS
--> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: AT+CGDCONT=1,"IP","web.vodafone.de"
AT+CGDCONT=1,"IP","web.vodafone.de"
OK
--> Modem initialized.
--> Sending: ATDT*99***1#
--> Waiting for carrier.
ATDT*99***1#
CONNECT 21600000
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Thu Jan 18 08:51:33 2018
--> Pid of pppd: 942
PPP generic driver version 2.4.2
--> pppd: ▒e[07][08]
--> Using interface ppp0
--> pppd: ▒e[07][08]
--> pppd: ▒e[07][08]
--> pppd: ▒e[07][08]
--> pppd: ▒e[07][08]
PPP BSD Compression module registered
PPP Deflate Compression module registered
--> pppd: ▒e[07][08]
--> local IP address 100.68.88.182
--> pppd: ▒e[07][08]
--> remote IP address 10.64.64.64
--> pppd: ▒e[07][08]
--> primary DNS address 139.7.30.126
--> pppd: ▒e[07][08]
--> secondary DNS address 139.7.30.125
--> pppd: ▒e[07][08]
^CCaught signal 2: Attempting to exit gracefully...
--> Terminating on signal 15
--> pppd: ▒e[07][08]
--> Connect time 5.4 minutes.
--> pppd: ▒e[07][08]
--> pppd: ▒e[07][08]
--> pppd: ▒e[07][08]
--> Disconnecting at Thu Jan 18 08:56:56 2018
Without stupid mode:
root@iot2000-ebs:/etc# wvdial MSSS
--> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: AT+CGDCONT=1,"IP","web.vodafone.de"
AT+CGDCONT=1,"IP","web.vodafone.de"
OK
--> Modem initialized.
--> Sending: ATDT*99***1#
--> Waiting for carrier.
ATDT*99***1#
CONNECT 21600000
--> Carrier detected. Waiting for prompt.
--> Don't know what to do! Starting pppd and hoping for the best.
--> Starting pppd at Thu Jan 18 08:57:52 2018
--> Pid of pppd: 1021
--> pppd: �e[07][08]
--> Using interface ppp0
--> pppd: �e[07][08]
--> pppd: �e[07][08]
--> pppd: �e[07][08]
--> pppd: �e[07][08]
--> pppd: �e[07][08]
--> local IP address 100.68.122.98
--> pppd: �e[07][08]
--> remote IP address 10.64.64.64
--> pppd: �e[07][08]
--> primary DNS address 139.7.30.126
--> pppd: �e[07][08]
--> secondary DNS address 139.7.30.125
--> pppd: �e[07][08]
As you can see, when the netreg is just ignored and start
with pppd we get a connnection.
Just dumping the debug state. Mabye someone has some input on this.
Thanks,
Daniel
3 years, 1 month
[PATCH] dbus: Use dbus_validate_path
by Slava Monich
Instead of __ofono_dbus_valid_object_path
---
plugins/push-notification.c | 2 +-
plugins/smart-messaging.c | 2 +-
src/dbus.c | 44 --------------------------------------------
src/gnss.c | 2 +-
src/modem.c | 2 +-
src/netmon.c | 2 +-
src/ofono.h | 2 --
src/stk.c | 4 ++--
8 files changed, 7 insertions(+), 53 deletions(-)
diff --git a/plugins/push-notification.c b/plugins/push-notification.c
index ff388d9..f469f9e 100644
--- a/plugins/push-notification.c
+++ b/plugins/push-notification.c
@@ -96,7 +96,7 @@ static DBusMessage *push_notification_register_agent(DBusConnection *conn,
DBUS_TYPE_INVALID) == FALSE)
return __ofono_error_invalid_args(msg);
- if (!__ofono_dbus_valid_object_path(agent_path))
+ if (!dbus_validate_path(agent_path, NULL))
return __ofono_error_invalid_format(msg);
pn->agent = sms_agent_new(AGENT_INTERFACE,
diff --git a/plugins/smart-messaging.c b/plugins/smart-messaging.c
index bbbdaa9..0c9700d 100644
--- a/plugins/smart-messaging.c
+++ b/plugins/smart-messaging.c
@@ -119,7 +119,7 @@ static DBusMessage *smart_messaging_register_agent(DBusConnection *conn,
DBUS_TYPE_INVALID) == FALSE)
return __ofono_error_invalid_args(msg);
- if (!__ofono_dbus_valid_object_path(agent_path))
+ if (!dbus_validate_path(agent_path, NULL))
return __ofono_error_invalid_format(msg);
sm->agent = sms_agent_new(AGENT_INTERFACE,
diff --git a/src/dbus.c b/src/dbus.c
index 45becc1..3e1e162 100644
--- a/src/dbus.c
+++ b/src/dbus.c
@@ -456,50 +456,6 @@ void __ofono_dbus_pending_reply(DBusMessage **msg, DBusMessage *reply)
*msg = NULL;
}
-gboolean __ofono_dbus_valid_object_path(const char *path)
-{
- unsigned int i;
- char c = '\0';
-
- if (path == NULL)
- return FALSE;
-
- if (path[0] == '\0')
- return FALSE;
-
- if (path[0] && !path[1] && path[0] == '/')
- return TRUE;
-
- if (path[0] != '/')
- return FALSE;
-
- for (i = 0; path[i]; i++) {
- if (path[i] == '/' && c == '/')
- return FALSE;
-
- c = path[i];
-
- if (path[i] >= 'a' && path[i] <= 'z')
- continue;
-
- if (path[i] >= 'A' && path[i] <= 'Z')
- continue;
-
- if (path[i] >= '0' && path[i] <= '9')
- continue;
-
- if (path[i] == '_' || path[i] == '/')
- continue;
-
- return FALSE;
- }
-
- if (path[i-1] == '/')
- return FALSE;
-
- return TRUE;
-}
-
DBusConnection *ofono_dbus_get_connection(void)
{
return g_connection;
diff --git a/src/gnss.c b/src/gnss.c
index 97d1152..ba2a97b 100644
--- a/src/gnss.c
+++ b/src/gnss.c
@@ -135,7 +135,7 @@ static DBusMessage *gnss_register_agent(DBusConnection *conn,
&agent_path, DBUS_TYPE_INVALID) == FALSE)
return __ofono_error_invalid_args(msg);
- if (!__ofono_dbus_valid_object_path(agent_path))
+ if (!dbus_validate_path(agent_path, NULL))
return __ofono_error_invalid_format(msg);
gnss->posr_agent = gnss_agent_new(agent_path,
diff --git a/src/modem.c b/src/modem.c
index 0c63d2c..d5fda7c 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -1876,7 +1876,7 @@ struct ofono_modem *ofono_modem_create(const char *name, const char *type)
else
snprintf(path, sizeof(path), "/%s", name);
- if (__ofono_dbus_valid_object_path(path) == FALSE)
+ if (!dbus_validate_path(path, NULL))
return NULL;
modem = g_try_new0(struct ofono_modem, 1);
diff --git a/src/netmon.c b/src/netmon.c
index 3a49587..62e0ec0 100644
--- a/src/netmon.c
+++ b/src/netmon.c
@@ -353,7 +353,7 @@ static DBusMessage *netmon_register_agent(DBusConnection *conn,
DBUS_TYPE_INVALID) == FALSE)
return __ofono_error_invalid_args(msg);
- if (!__ofono_dbus_valid_object_path(agent_path))
+ if (!dbus_validate_path(agent_path, NULL))
return __ofono_error_invalid_format(msg);
if (!period)
diff --git a/src/ofono.h b/src/ofono.h
index deb1b7c..ac3726d 100644
--- a/src/ofono.h
+++ b/src/ofono.h
@@ -76,8 +76,6 @@ DBusMessage *__ofono_error_from_error(const struct ofono_error *error,
void __ofono_dbus_pending_reply(DBusMessage **msg, DBusMessage *reply);
-gboolean __ofono_dbus_valid_object_path(const char *path);
-
struct ofono_watchlist_item {
unsigned int id;
void *notify;
diff --git a/src/stk.c b/src/stk.c
index 49d6365..9cdf2b1 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -722,7 +722,7 @@ static DBusMessage *stk_register_agent(DBusConnection *conn,
DBUS_TYPE_INVALID) == FALSE)
return __ofono_error_invalid_args(msg);
- if (!__ofono_dbus_valid_object_path(agent_path))
+ if (!dbus_validate_path(agent_path, NULL))
return __ofono_error_invalid_format(msg);
stk->default_agent = stk_agent_new(agent_path,
@@ -834,7 +834,7 @@ static DBusMessage *stk_select_item(DBusConnection *conn,
DBUS_TYPE_INVALID) == FALSE)
return __ofono_error_invalid_args(msg);
- if (!__ofono_dbus_valid_object_path(agent_path))
+ if (!dbus_validate_path(agent_path, NULL))
return __ofono_error_invalid_format(msg);
for (i = 0; i < selection && menu->items[i].text; i++);
--
1.9.1
3 years, 1 month
[PATCH 1/2] add qmimodem/voice.h to add USSD defines
by Alexander Couzens
USSD is part of the QMI voice service.
---
drivers/qmimodem/voice.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
create mode 100644 drivers/qmimodem/voice.h
diff --git a/drivers/qmimodem/voice.h b/drivers/qmimodem/voice.h
new file mode 100644
index 000000000000..ca1464910914
--- /dev/null
+++ b/drivers/qmimodem/voice.h
@@ -0,0 +1,62 @@
+/*
+ *
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2017 by sysmocom s.f.m.c. GmbH <info(a)sysmocom.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#define QMI_VOICE_PARAM_USS_DATA 0x01
+
+#define QMI_VOICE_PARAM_ASYNC_USSD_ERROR 0x10
+#define QMI_VOICE_PARAM_ASYNC_USSD_FAILURE_CASE 0x11
+#define QMI_VOICE_PARAM_ASYNC_USSD_DATA 0x12
+
+#define QMI_VOICE_PARAM_USSD_IND_USER_ACTION 0x01
+#define QMI_VOICE_PARAM_USSD_IND_DATA 0x10
+#define QMI_VOICE_PARAM_USSD_IND_UCS2 0x11
+
+/* according to GSM TS 23.038 section 5
+ * coding group 1111, No message class, 8 bit data
+ */
+#define USSD_DCS_8BIT 0xf4
+/* coding group 01xx, Class 0, UCS2 (16 bit) */
+#define USSD_DCS_UCS2 0x48
+/* default alphabet Language unspecific */
+#define USSD_DCS_UNSPECIFIC 0x0f
+
+/* based on qmi ussd definition */
+enum qmi_ussd_dcs {
+ QMI_USSD_DCS_ASCII = 0x1,
+ QMI_USSD_DCS_8BIT,
+ QMI_USSD_DCS_UCS2,
+};
+
+enum qmi_ussd_user_required {
+ QMI_USSD_NO_USER_ACTION_REQUIRED = 0x1,
+ QMI_USSD_USER_ACTION_REQUIRED,
+};
+
+/* QMI service voice. Using an enum to prevent doublicated entries */
+enum voice_commands {
+ QMI_VOICE_CANCEL_USSD = 0x3c,
+ QMI_VOICE_USSD_RELEASE_IND = 0x3d,
+ QMI_VOICE_USSD_IND = 0x3e,
+ QMI_VOICE_SUPS_IND = 0x42,
+ QMI_VOICE_ASYNC_ORIG_USSD = 0x43,
+};
+
+struct qmi_ussd_data {
+ uint8_t dcs;
+ uint8_t length;
+ uint8_t data[0];
+} __attribute__((__packed__));
--
2.15.1
3 years, 1 month