ofono/drivers/qmimodem
Christophe Ronco 157d188587 qmimodem: fix roaming status report
Problem seen 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
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 NAS_REGISTRATION_STATE_NOT_REGISTERED_SEARCHING,
                           CS detached, PS detached, NETWORK_TYPE_3GPP,
                           QMI_NAS_RADIO_INTERFACE_LTE
ofonod[855]: QMI: NAS_ind msg=36 len=47 [client=1,type=4,tid=0,len=59]
ofonod[855]: QMI: {type=41,len=5} {type=34,len=5} {type=21,len=3}
             {type=18,len=5}
ofonod[855]: QMI: {type=17,len=1} {type=16,len=1} {type=1,len=6}
ofonod[855]: ofono_netreg_status_notify modem /sierra_0 status 2 lac -1
             cellid -1 tech 7

b) second "searching" indication
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 NAS_REGISTRATION_STATE_NOT_REGISTERED_SEARCHING,
                           CS detached, PS detached, NETWORK_TYPE_3GPP,
                           QMI_NAS_RADIO_INTERFACE_LTE

ofonod[855]: QMI: NAS_ind msg=36 len=21 [client=1,type=4,tid=0,len=33]
ofonod[855]: QMI: {type=34,len=5} {type=17,len=1} {type=1,len=6}

c) First indication while "registered"
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 NAS_REGISTRATION_STATE_REGISTERED, CS attached,
                           PS attached, NETWORK_TYPE_3GPP,
                           QMI_NAS_RADIO_INTERFACE_UMTS
ofonod[855]: QMI: NAS_ind msg=36 len=82 [client=1,type=4,tid=0,len=94]
ofonod[855]: QMI: {type=42,len=1} {type=41,len=5} {type=40,len=2}
             {type=38,len=8}
ofonod[855]: QMI: {type=34,len=5} {type=30,len=4} {type=29,len=2}
             {type=21,len=3}
ofonod[855]: QMI: {type=18,len=5} {type=17,len=4} {type=16,len=1}
             {type=1,len=6}
ofonod[855]: ofono_gprs_status_notify modem /sierra_0 status 1

==================> ROAMING status reported <==========================
ofonod[855]: ofono_netreg_status_notify modem /sierra_0 status 5 lac 20731
             cellid 76873975 tech 2

d) second indication while "registered"
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 NAS_REGISTRATION_STATE_REGISTERED, CS attached,
                           PS attached, NETWORK_TYPE_3GPP,
                           QMI_NAS_RADIO_INTERFACE_UMTS
ofonod[855]: QMI: NAS_ind msg=36 len=37 [client=1,type=4,tid=0,len=49]
ofonod[855]: QMI: {type=41,len=5} {type=40,len=2} {type=18,len=5}
                  {type=17,len=4}
ofonod[855]: QMI: {type=1,len=6}
==================> ROAMING information lost <==========================
ofonod[855]: ofono_netreg_status_notify modem /sierra_0 status 1 lac -1
             cellid -1 tech 2

I can't tell if not having the ROAMING_STATUS parameter in all indication
is something happening only on MC7304 or if it happens on all "QMI" modems.

I have also seen (on MC7430, with a roaming SIM card):
 - first notification indicating status
QMI_NAS_REGISTRATION_STATE_SEARCHING and roaming ON
 - following notifications indicating status
QMI_NAS_REGISTRATION_STATE_REGISTERED and no roaming notification

So we must handle roaming information even when not registered.
2018-09-07 11:33:56 -05:00
..
common.h qmimodem: Add common constants for GSM, UMTS and LTE bands 2012-06-24 22:21:39 -07:00
ctl.h qmimodem: Add support for QMI control point handling 2012-06-21 15:18:36 -07:00
devinfo.c qmi: Fix memory leak 2018-03-19 11:48:34 -05:00
dms.h qmimodem: Add common constants for GSM, UMTS and LTE bands 2012-06-24 22:21:39 -07:00
gprs-context.c qmi: use shared services 2017-05-01 12:07:41 -05:00
gprs.c qmimodem: release WDS service on GPRS atom removal 2018-03-07 10:13:29 -06:00
location-reporting.c qmimodem: Add support for GPS location reporting 2012-06-21 21:08:31 -07:00
lte.c qmimodem: Update to the new LTE API 2018-03-12 09:37:58 -05:00
nas.c qmi: move rat_to_tech() into own module 2017-04-18 09:48:04 -05:00
nas.h qmimodem: extract network time from serving system 2017-09-07 16:50:14 -05:00
netmon.c qmi: add NetworkMonitor interface 2017-09-12 12:52:42 -05:00
network-registration.c qmimodem: fix roaming status report 2018-09-07 11:33:56 -05:00
pds.h qmimodem: Add support for GPS location reporting 2012-06-21 21:08:31 -07:00
qmi.c qmi: make services always shared 2018-04-04 10:03:13 -05:00
qmi.h qmi: make version_list private 2018-04-04 09:59:44 -05:00
qmimodem.c qmi: add LTE atom driver 2018-03-05 11:32:30 -06:00
qmimodem.h qmi: add LTE atom driver 2018-03-05 11:32:30 -06:00
radio-settings.c qmimodem: release DMS service on radio-settings atom removal 2018-03-07 10:13:32 -06:00
sim-legacy.c qmi: Update sim-legacy driver to the new API 2012-11-22 10:26:34 -06:00
sim.c qmi: report SIM not inserted when unable to get PIN type 2018-04-19 10:29:40 -05:00
sms.c qmi: support SMS receive on Quectel EC21 2017-10-17 09:35:02 -05:00
uim.h qmimodem: add pin_send feature 2017-01-11 09:57:53 -06:00
ussd.c qmi: Fix memory leak 2018-03-19 11:49:42 -05:00
util.h qmimodem: add define CALLBACK_WITH_CME_ERROR(cb, err, args..) 2017-12-05 22:06:44 -06:00
voice.h add qmimodem/voice.h to add USSD defines 2018-01-16 11:17:14 -06:00
voicecall.c qmimodem: Add skeleton for voice call support 2012-06-25 12:11:08 -07:00
wda.h qmimodem: change kernel driver data format if needed 2017-02-02 11:48:38 -06:00
wds.h qmi: retrieve GPRS context parameters 2017-04-11 11:43:16 -05:00
wms.h qmi: support SMS receive on Quectel EC21 2017-10-17 09:35:02 -05:00