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.
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.
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.
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.
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
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
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...
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.
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.
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.
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.
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.
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.
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.
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.
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.
==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)
==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)
==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)
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.
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.
Certain modems doesn't support manual registering (gobi 2000).
Translate the error code into ofono error to report a
more detailed debug error message.
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.
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.
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.
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.
This provides the list of available technologies in the radio-settings
atom. The list is queried by the DMS Get Capabilities method; ofono
takes care of caching the available technologies for us so we don't need
to worry about this method being called excessively.