Commit Graph

136 Commits

Author SHA1 Message Date
Alexey Andreyev ce86a6c207 qmimodem: Add USSD indication support
Handle USSD QMI indication messages.
Add support for UCS2 USS Data coding scheme.
Check for User Action TLV type.
2021-02-22 10:02:16 -06:00
Denis Kenzior 52091a1af0 qmimodem: Fix format warning
../../drivers/qmimodem/network-registration.c: In function
‘extract_ss_info’:
../../drivers/qmimodem/network-registration.c:131:54: warning: ‘%03d’
directive output may be truncated writing between 3 and 5 bytes into a
region of size 4 [-Wformat-truncation=]
  131 |   snprintf(operator->mcc, OFONO_MAX_MCC_LENGTH + 1, "%03d",
        |                                                      ^~~~
	../../drivers/qmimodem/network-registration.c:131:53: note:
	directive argument in the range [0, 65535]
  131 |   snprintf(operator->mcc, OFONO_MAX_MCC_LENGTH + 1,
	      "%03d",
	            |
		    ^~~~~~

The MCC/MNC fields are limited to three digits.  Clamp the input to 999
to avoid the warning.
2020-09-08 11:19:54 -05:00
Marius Gripsgard 4e61dc355e qmimodem: Implement data capability bearer notify
This implements data capability bearer notify to qmi modem.
Since this is included in the serving system response this
just adds a new data extraction for dc.
2020-06-10 14:23:06 -05:00
Christophe Ronco 17bf6ac7c0 qmimodem: remember lac and cellid
Lac and cellid information are optional in ss_info notifications.
Remember them in order to give a correct information each time a
notification is received.
2019-07-19 01:19:23 -05:00
Tom Nguyen df36faccd9 qmimodem: change msg class none to store/notify
Change message class none configuration from directly delivering a new
message in the event indication to storing it in the modem's NV then
sending an event indication identifying the new message. Also, add
checking for stored, unread messages at boot up.

This fixes a scenario where the modem powers on, automatically
connects to the network, receives a message, and sends an indication
before oFono has fully initialized. Now, the message is saved and
retrieved after initialization.

This also helps with suspend/resume on platforms where the modem,
supports waking the host CPU upon SMS reception. And, the platform
design limitation is that the modem's interfaces (eg, cdc-wdm, wwan,
etc) disconnect on suspend and reconnect on resume. This causes oFono
to re-initialize and miss the message indication because it was sent
before oFono is ready. Now, the wake up message is saved and retrieved
after initialization.
2019-06-05 14:54:59 -05:00
Denis Kenzior 0d40114a14 qmi: Fix style issues 2019-05-24 12:27:27 -05:00
Denis Kenzior fbd9974998 qmimodem: Fix potential memory leak
In case strlen(ICCID) > 20, we simply return without freeing the ICCID
value first.
2019-04-29 14:20:25 -05:00
Alexander Couzens 64df5344c5 qmi: netmon: fix crashs on get_rssi_cb when BER or RSSI are empty
The message can be emitted without the fields being present. In this case ber or rssi are 0
resulting in a null pointer deref.
2019-04-28 10:13:51 -05:00
Tom Nguyen 0ddb7c6e2f qmimodem: return all serial numbers
Some modems, eg. Quectel EC25E, return the ESN, IMEI, and MEID even
though they support only one network type in a region. Current serial
number query gives precedence to the ESN if it exists, and does not
consider the IMEI and MEID.

Add a check of the supported radio interfaces in deciding which
serial number to return. If radio interfaces are 3GPP based, then
return the IMEI, else return the ESN. If neither exist, return MEID
if available, else fail.
2019-04-16 11:51:37 -05:00
Christophe Ronco 34225d2681 qmi: support sim hotplug
Use card status indication to detect SIM removal and insertions
2019-02-17 20:48:54 -06:00
Nicolas Serafini 5e173b28d0 qmimodem: Notify when SIM is initialized
Since the commit that introduced the notification API of a SIM inserted
and initialized I can not unlock the SIM card on a WP7607 modem.

The previously mentioned commit: 54d56d763e
2019-02-08 14:02:02 -06:00
Pau Espin 1749018577 qmi: Fix Secondary DNS overwriting Primary DNS
inet_ntoa was called twice in a row and as a result both primay and
secondary DNS were pointing to same static buffer containing last
value (secondary DNS).

As a result, ofono always advertised the secondary DNS twice through
DBus ConnectionContext.GetProperties 'DomainNameServers'.

Related: https://osmocom.org/issues/3031
2018-12-11 14:14:40 -06:00
Jonas Bonn a1141ae393 qmimodem: prevent use of unitialized variable
'index' may not be initialized in the error path so don't try to print a
message with it.
2018-10-29 13:35:01 -05:00
Jonas Bonn 3beeff758d treewide: Remove superfluous use of _GNU_SOURCE
There are a large number of files in the tree that define _GNU_SOURCE
despite not actually using features hidden behind this flag.  This patch
removes all these definitions in one fell swoop...
2018-10-17 10:01:57 -05:00
Jonas Bonn 67701b1c40 drivers: constify vtables
The driver vtables are read-only structures.  This patch declares them as
'const' allowing the compiler to (optionally) put them in the RELRO
section.  RELRO pages may be marked as read-only by the linker after
the relocations have been done ensuring that they aren't inadvertently
or maliciously altered at runtime.
2018-10-17 09:56:27 -05:00
Giacinto Cifelli bd6f807849 drivers: support for auth NONE
Added the explicit support for auth NONE.
It needs to be added in all drivers/*/gprs-context.c atoms.

This method is already supported by all atoms that support
authentication (ie, all but Sierra' swmodem driver).

The behavior is left unchanged in case of inconsistent parameters:
if username is empty, then fallback to auth NONE.
2018-10-09 12:35:44 -05:00
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
Christophe Ronco beed2aee9e qmi: report SIM not inserted when unable to get PIN type 2018-04-19 10:29:40 -05:00
Christophe Ronco 8af406a45d qmi: report failure or retry in case of invalid pin type
QMI_UIM_GET_CARD_STATUS is retried in more error cases
when trying to get password type.
In case of failure, driver report an error instead of
OFONO_SIM_PASSWORD_INVALID. This avoids a crash.
2018-04-19 10:27:32 -05:00
Christophe Ronco bfa0ac979e qmi: use right slot and application during SIM detection
Use right slot and application to get card status, PIN status and PIN
retries. Without this patch, SIMs where selected application and slot
numbers are different are not detected.
2018-04-19 10:24:50 -05:00
Jonas Bonn 88d9b1a32d qmi: make services always shared 2018-04-04 10:03:13 -05:00
Jonas Bonn 6485522c91 qmi: make version_list private 2018-04-04 09:59:44 -05:00
Jonas Bonn 76471964e2 qmi: assume version_list is up to date
The way things are currently coded, the gobi plugin calls
qmi_device_discover and does nothing else until it succeeds.  As such,
we can safely assume that the version_list is set up when we go to
create a service.
2018-04-04 09:56:22 -05:00
Jonas Bonn 81180147cf qmi: drop header output parameter from request_alloc
The only thing this output parameter is being used for now is for
getting the transaction ID.  Return the TID directly from
__submit_requesta and drop the 'head' parameter altogether.
2018-04-04 09:55:56 -05:00
Jonas Bonn a357565377 qmi: request_alloc has no meaningful failure path
The only way request_alloc can fail is if one of the memory allocation
routines fail to allocate memory.  However, Linux memory allocation
doesn't really fail in this manner; memory can be overcommited and the
out-of-memory reaper will take care of re-establishing the balance when
excess memory is actually accessed.

Given this, request_alloc will never return anything other than success
and the failure paths will never be exercised.
2018-04-04 09:55:21 -05:00
Jonas Bonn 093bdda7be qmi: unify common request header setup
The service and control requests differ slightly in their headers, but
this difference is minor enough that we can handle it directly in the
request submission routine.  This patch unifies the header setup for the
two request types.
2018-04-04 09:55:13 -05:00
Jonas Bonn 4ef8814215 qmi: remove headroom parameter from req_alloc
The headroom can be established from the service type, so it's redundant
to pass it as a parameter.
2018-03-29 09:54:39 -05:00
Jonas Bonn 4846c26948 qmi: remove unused fields of service_send_data
After setting up the request structure, qmi_service_send makes no
further use of the 'param' and 'service' fields of the service_send_data
structure.  This patch removes those fields and frees 'param'
immediately after the request has been allocated and the parameter data
thereby copied into the send buffer.
2018-03-29 09:52:22 -05:00
Denis Kenzior 501de60ec0 qmi: Fix uninitialized value use
==2870== Conditional jump or move depends on uninitialised value(s)
==2870==    at 0x4C2ED31: __memcmp_sse4_1 (vg_replace_strmem.c:972)
==2870==    by 0x4F451A: sim_pin_retries_query_cb (sim.c:462)
==2870==    by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870==    by 0x45544A: service_send_callback (qmi.c:2143)
==2870==    by 0x452D00: handle_packet (qmi.c:815)
==2870==    by 0x452E85: received_data (qmi.c:863)
==2870==    by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x4C680B: main (main.c:256)
==2870==  Uninitialised value was created by a stack allocation
==2870==    at 0x459B1A: query_pin_retries_cb (sim.c:531)
==2870==
==2870== Conditional jump or move depends on uninitialised value(s)
==2870==    at 0x4F451D: sim_pin_retries_query_cb (sim.c:462)
==2870==    by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870==    by 0x45544A: service_send_callback (qmi.c:2143)
==2870==    by 0x452D00: handle_packet (qmi.c:815)
==2870==    by 0x452E85: received_data (qmi.c:863)
==2870==    by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x4C680B: main (main.c:256)
==2870==  Uninitialised value was created by a stack allocation
==2870==    at 0x459B1A: query_pin_retries_cb (sim.c:531)
==2870==
==2870== Conditional jump or move depends on uninitialised value(s)
==2870==    at 0x4F3DFB: get_pin_retries (sim.c:278)
==2870==    by 0x4F4553: sim_pin_retries_query_cb (sim.c:467)
==2870==    by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870==    by 0x45544A: service_send_callback (qmi.c:2143)
==2870==    by 0x452D00: handle_packet (qmi.c:815)
==2870==    by 0x452E85: received_data (qmi.c:863)
==2870==    by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x4C680B: main (main.c:256)
==2870==  Uninitialised value was created by a stack allocation
==2870==    at 0x459B1A: query_pin_retries_cb (sim.c:531)
==2870==
==2870== Conditional jump or move depends on uninitialised value(s)
==2870==    at 0x4F3E65: get_pin_retries (sim.c:288)
==2870==    by 0x4F4553: sim_pin_retries_query_cb (sim.c:467)
==2870==    by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870==    by 0x45544A: service_send_callback (qmi.c:2143)
==2870==    by 0x452D00: handle_packet (qmi.c:815)
==2870==    by 0x452E85: received_data (qmi.c:863)
==2870==    by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x4C680B: main (main.c:256)
==2870==  Uninitialised value was created by a stack allocation
==2870==    at 0x459B1A: query_pin_retries_cb (sim.c:531)
2018-03-19 12:01:05 -05:00
Denis Kenzior ad86c7e529 qmi: Fix memory leak
==14399== 28 bytes in 4 blocks are definitely lost in loss record 151 of 390
==14399==    at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
==14399==    by 0x209065: convert_gsm_to_utf8_with_lang (util.c:651)
==14399==    by 0x2091D1: convert_gsm_to_utf8 (util.c:690)
==14399==    by 0x22DDA7: ussd_decode (smsutil.c:4738)
==14399==    by 0x18BF71: qmi_ussd_request (ussd.c:233)
==14399==    by 0x2183EA: ussd_initiate (ussd.c:614)
==14399==    by 0x27B6C8: process_message (object.c:259)
==14399==    by 0x27D1CD: generic_message (object.c:1070)
==14399==    by 0x5170732: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.14)
==14399==    by 0x5161D83: dbus_connection_dispatch (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.14)
==14399==    by 0x27907C: message_dispatch (mainloop.c:72)
==14399==    by 0x4E826A9: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
2018-03-19 11:49:42 -05:00
Denis Kenzior 452a6e5421 qmi: Fix memory leak
==14399== 16 bytes in 8 blocks are definitely lost in loss record 132 of 390
==14399==    at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
==14399==    by 0x59E03D9: strndup (strndup.c:43)
==14399==    by 0x18277E: qmi_result_get_string (qmi.c:1794)
==14399==    by 0x184221: get_ids_cb (devinfo.c:129)
==14399==    by 0x18353B: service_send_callback (qmi.c:2286)
==14399==    by 0x18093C: handle_packet (qmi.c:831)
==14399==    by 0x180ADD: received_data (qmi.c:880)
==14399==    by 0x4E826A9: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==14399==    by 0x4E82A5F: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==14399==    by 0x4E82D81: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==14399==    by 0x201900: main (main.c:306)
2018-03-19 11:48:34 -05:00
Denis Kenzior 375aa5efbb qmimodem: Update to the new LTE API 2018-03-12 09:37:58 -05:00
Jonas Bonn b4aff8549d qmimodem: release DMS service on radio-settings atom removal 2018-03-07 10:13:32 -06:00
Jonas Bonn 924f37b4b5 qmimodem: release WDS service on GPRS atom removal 2018-03-07 10:13:29 -06:00
Jonas Bonn b7b0b4ab73 qmimodem: get LTE default bearer APN from modem
When an LTE modem registers with the network, a default bearer is
automatically established.  The APN used for this bearer is taken from
whatever default settings the modem has.

The LTE atom takes cares of setting up the default context/profile with
the APN to use.  From there, a default bearer will be established when
the modem registers with the network.  This results in a call to 'Get
LTE Attach Parameters' which tells us what APN the gateway negotiated
with us.

If we can't get the APN, we do what the AT driver does:  pretend the
bearer wasn't established.  This is a reasonable fallback, currently,
because connman can't handle zero-length APN's anyway; the previous
approach of setting the APN to 'automatic' breaks connman badly when it
needs to switch between LTE and non-LTE networks.
2018-03-05 11:33:26 -06:00
Jonas Bonn f2e38a6b42 qmi: add LTE atom driver
This patch adds an LTE atom for QMI modems.

This atom sets the APN that the LTE default bearer should use when
establishing its PDP context.  This APN needs to be set on the 'default'
profile so the atom queries which profile is the default and resets
it before allowing the APN to be set.

Once configured, the default profile settings are used when the
modem connects to the network; for this reason, the LTE atom needs
to be instantiated in post_sim, before the modem is set online.
2018-03-05 11:32:30 -06:00
Alexander Couzens f7544d87a3 qmi: add USSD support for MO services 2018-01-16 11:32:03 -06:00
Alexander Couzens 23dc3cb701 add qmimodem/voice.h to add USSD defines
USSD is part of the QMI voice service.
2018-01-16 11:17:14 -06:00
Alexander Couzens 070608b899 qmimodem: convert register_net_cb errors into CMEs
Certain modems doesn't support manual registering (gobi 2000).
Translate the error code into ofono error to report a
more detailed debug error message.
2017-12-05 22:06:44 -06:00
Alexander Couzens 5066a45762 qmimodem: add translator qmi_error_to_ofono_cme()
Translates qmi error codes into ofono cme errors
2017-12-05 22:06:44 -06:00
Alexander Couzens 85a0c9b595 qmimodem: add define CALLBACK_WITH_CME_ERROR(cb, err, args..) 2017-12-05 22:06:44 -06:00
Alexander Couzens 78ab13470a qmi: implement the control sync command
The sync command resets the QMI interface state. It will flushs all
previous assigned sessions and transactions.
2017-12-05 22:04:15 -06:00
Alexander Couzens f02363181f qmi: include the CTL in the debug output
The CTL version is important for certain calls. This is
a useful information for debugging.
2017-12-05 22:04:15 -06:00
Alexander Couzens 5f33ec2d5d qmi/discovery: remove useless code 2017-12-05 22:04:15 -06:00
Christophe Ronco 5be941c608 qmi: remove request when it timeouts
When modem does not answer or answers slowly to a discovery request,
a timeout occurs.
In timeout callback, request should be removed from queues to avoid
treating answer if it arrives later.
2017-10-30 09:03:59 -05:00
Jonas Bonn 35636752ad qmi: support SMS receive on Quectel EC21
The Quectel EC21 does not provide the SMS PDU on the message event
notification.

This patch adds a call to 'raw read' on the message ID from the event
notification if the event notification does not already contain the
message data.

The message data begins with the SMSC length, type, and address so
the TPDU length is adjusted accordingly in the raw_read callback.  This
differs from the way the raw message data is handled in the case
that it is included in the event notification itself.  As I don't have
access to any other QMI modem at this time, I'm can not confirm that
this difference is reasonable.
2017-10-17 09:35:02 -05:00
Jonas Bonn fd453816cc qmi: add NetworkMonitor interface
This is a rudimentary implementation that contains technology and RSSI
and BitErrorRate, plus RSRQ/RSRP for LTE networks.  More data can be
added as needed.

This implementations uses the 'Get Signal Strength' QMI method to retrieve
the data.  Operator fields (MNC, LAC, etc) can be gotten from the 'Serving
Cell' method if needed, but since this data is already provided in the
NetworkRegistration object it doesn't seem necessary to repeat it here
when an additional communication to the modem is required.
2017-09-12 12:52:42 -05:00
Joey Hewitt d80b3da897 qmimodem: implement SIM write functions 2017-09-12 12:39:26 -05:00
Alexander Couzens a18c892c64 qmimodem: register callbacks after netreg_register
When registering callbacks before ofono_netreg_register(), callbacks
will use the netreg api which might lead into undefined behaviour,
because certain fields aren't yet initilized.
2017-09-11 10:41:14 -05:00
Denis Kenzior 0f2d1278c4 qmimodem: Fix whitespace issue 2017-09-08 09:56:32 -05:00