Commit Graph

7030 Commits

Author SHA1 Message Date
Aleksander Morgado
f280573f6d cinterion: setup SGAUTH response parser as a helper method 2020-11-04 09:50:13 +01:00
Aleksander Morgado
eb338c967f cinterion: move auth helpers to the helpers sources 2020-11-04 09:50:13 +01:00
Aleksander Morgado
9ce496613b cinterion: improve logging when loading initial EPS status or settings 2020-11-04 09:50:13 +01:00
Aleksander Morgado
411cce677d cinterion: refactor the initial EPS related logic
Multiple changes that shouldn't affect behavior:

 * Avoid reusing the same context and state machine for the set and
   the load operations, because they truly have different behaviors.

 * Setup the common load operation in a separate async method, and
   reuse the common operation for both the runtime state loading and
   the settings configuration loading.

 * Avoid having a "generic step ready" method, and instead provide
   proper ready methods for each step, so that we can give
   comprehensive warning logs when things fail.

 * Use the common CFUN? response parser instead of a custom
   implementation.
2020-11-04 09:50:13 +01:00
Andrew Lassalle
ff7c0794f4 mm-broadband-modem: Allow hot SIM insertion
If the QMI modem is initialized without a SIM card in it, and it goes
to failed state, allow the modem to be reprobed when a SIM card is
inserted.
2020-10-30 12:44:20 -07:00
Aleksander Morgado
c385031941 base-modem: sort port info array by port name
So that the list of ports shown in the Ports DBus property is also
alphabetically sorted by port name, instead of having a mess like
this:

  -----------------------------
  System   |            device: qcom-soc
           |           drivers: bam-dmux
           |            plugin: qcom-soc
           |      primary port: rpmsg0
           |             ports: rmnet5 (net), rmnet_usb0 (unknown), rmnet4 (net),
           |                    rpmsg1 (at), rmnet3 (net), rpmsg0 (qmi), rmnet2 (net), rmnet1 (net),
           |                    rmnet7 (net), rmnet0 (net), rmnet6 (net)
2020-10-30 09:30:46 +01:00
Stephan Gerhold
a174edb74d api: expose ignored ports as MM_MODEM_PORT_TYPE_IGNORED
At the moment, ignored ports show up as (unknown) in the ports list
in mmcli. This makes it look like something went wrong while probing.

Actually ModemManager already tracks unknown and ignored ports separately
(MM_PORT_TYPE_UNKNOWN vs MM_PORT_TYPE_IGNORED) but the API always exposes
them as MM_MODEM_PORT_TYPE_UNKNOWN.

Add MM_MODEM_PORT_TYPE_IGNORED and use this for ignored ports so they
show up as (ignored) instead in mmcli.
2020-10-30 09:26:24 +01:00
Aleksander Morgado
fb14d0dbb2 helpers-qmi: 'illegal' card application state is fatal
No need to retry checking card status when the application state is
illegal, just treat the SIM card as unusable right away.

  https://forum.sierrawireless.com/t/uim-card-application-state-illegal/21842
2020-10-29 23:04:42 +00:00
Aleksander Morgado
9c1843c381 shared-qmi: ignore NoEffect errors on slot switching
When "UIM Switch Slot" returns a NoEffect error it's because we're
already in the desired slot, so just treat it as a successful
operation.
2020-10-29 22:52:06 +01:00
Aleksander Morgado
a31d762250 log: ignore fatal flag for logging purposes
Running with G_DEBUG=fatal-warnings will end up reporting warning logs
with G_LOG_FLAG_FATAL, which breaks our own logging logic.
2020-10-25 21:38:01 +01:00
Aleksander Morgado
ba1d3f944b libmm-glib,docs: add missing reference to mm_gdbus_sim_set_eid()
It's a private method, so add it in the Private subsection.
2020-10-25 21:37:47 +01:00
Aleksander Morgado
7d6647968d broadband-modem-qmi: minor coding style fix 2020-10-21 12:32:24 +02:00
Aleksander Morgado
8a54baa346 broadband-modem-qmi: fix crash when device removed during init
If the modem goes away (ports removed) during the initialization
phase (e.g. while QMI clients are being allocated), the MMPortQmi
object will be closed and it will lose its internal QmiDevice.

We should therefore consider the lack of QmiDevice a valid usecase in
track_qmi_device_removed() and return a GError when that happens.

    #0  0x00007fb544618cc9 in raise () from /lib/libc.so.6
    #1  0x00007fb54461bd68 in abort () from /lib/libc.so.6
    #2  0x00007fb544e2213d in g_assertion_message () from /usr/lib/libglib-2.0.so.0
    #3  0x00007fb544e221ba in g_assertion_message_expr () from /usr/lib/libglib-2.0.so.0
    #4  0x00000000004be584 in track_qmi_device_removed ()
    #5  0x00000000004be5e3 in allocate_next_client ()
    #6  0x00000000004be7b1 in qmi_port_allocate_client_ready ()
    #7  0x00007fb5453690a3 in g_task_return_now () from /usr/lib/libgio-2.0.so.0
    #8  0x00007fb54536967e in g_task_return () from /usr/lib/libgio-2.0.so.0
    #9  0x00000000004dd8f8 in allocate_client_ready ()
    #10 0x00007fb5453690a3 in g_task_return_now () from /usr/lib/libgio-2.0.so.0
    #11 0x00007fb54536967e in g_task_return () from /usr/lib/libgio-2.0.so.0
    #12 0x00007fb54591d4de in allocate_cid_ready () from /usr/lib/libqmi-glib.so.5
    ...
2020-10-19 21:14:23 +00:00
Eric Caruso
61739ab934 libmm-glib,mmcli: add mm_sim_get_eid and add EID to mmcli output
This exposes the new EID property of the SIM object on mmcli.
2020-10-19 20:38:43 +00:00
Eric Caruso
e24a8240cb mm-shared-qmi: load EID during SIM slot loading
SIMs can be created with an EID fetched during load_sim_slots
while initializing the modem, if present.

Since load_eid would be implemented with the same mechanism
we avoid using it here (if Get Slot Status fails once, it
probably doesn't make a lot of sense to try it again).
2020-10-19 20:38:43 +00:00
Eric Caruso
9fca046780 mm-base-sim: add EID D-Bus property
This provides a new D-Bus property on the Sim object that
exposes the EID of the SIM, if available.
2020-10-19 20:38:43 +00:00
Aleksander Morgado
1ed9f7e94e broadband-modem-qmi: minor coding style fixes 2020-10-19 22:34:35 +02:00
Eric Caruso
1800983b6c mm-modem-helpers: add low_nybble_first argument to mm_bcd_to_string
All BCD-encoded strings used by MM currently have the low nybble
of each byte come before the high nybble, but some strings (such
as the EID string returned by QMI Get Slot Status) are meant to
be read in order with the high nybble before the low one. As such,
extend mm_bcd_to_string to decode both.
2020-10-16 11:22:37 -07:00
Aleksander Morgado
f013e94ff8 xmm: fix missing GError initialization 2020-10-14 14:41:19 +02:00
Aleksander Morgado
3b6176cbe2 simtech: fix missing GError initialization 2020-10-14 14:41:19 +02:00
Aleksander Morgado
50c1550c9f cinterion: fix missing GError initialization 2020-10-14 14:41:19 +02:00
Aleksander Morgado
df9cb4a8f6 iface-modem-location: log old and new 3GPP location ids when updating 2020-10-10 15:43:57 +02:00
Aleksander Morgado
135d484501 iface-modem-location: allow Cell ID only updates
The "Serving System" indications reported via QMI when the device is
moving may contain LAC/TAC+CID updates or just CID updates.

E.g. this one has "CID 3GPP" (0x1e):

  Mon Aug  3 11:22:42 2020 daemon.debug [1567]: [/dev/cdc-wdm0] received
  generic indication (translated)... <<<<<< QMUX: <<<<<<   length  = 33
  <<<<<<   flags   = 0x80 <<<<<<   service = "nas" <<<<<<   client  = 3
  <<<<<< QMI: <<<<<<   flags       = "indication" <<<<<<   transaction =
  4512 <<<<<<   tlv_length  = 21 <<<<<<   message     = "Serving System"
  (0x0024) <<<<<< TLV: <<<<<<   type       = "Serving System" (0x01)
  <<<<<<   length     = 6 <<<<<<   value      = 01:01:01:02:01:08 <<<<<<
    translated = [ registration_state = 'registered' cs_attach_state =
  'attached' ps_attach_state = 'attached' selected_network = '3gpp'
  radio_interfaces = '{ [0] = 'lte '}' ] <<<<<< TLV: <<<<<<   type
  = "Data Service Capability" (0x11) <<<<<<   length     = 2 <<<<<<
  value      = 01:0B <<<<<<   translated = { [0] = 'lte '} <<<<<< TLV:
  <<<<<<   type       = "CID 3GPP" (0x1e) <<<<<<   length     = 4 <<<<<<
    value      = 14:C2:A8:00 <<<<<<   translated = 11059732

And this one has both "CID 3GPP" (0x1e) and "LTE TAC" (0x25):

  Mon Aug  3 11:23:05 2020 daemon.debug [1567]: [/dev/cdc-wdm0] received
  generic indication (translated)... <<<<<< QMUX: <<<<<<   length  = 38
  <<<<<<   flags   = 0x80 <<<<<<   service = "nas" <<<<<<   client  = 3
  <<<<<< QMI: <<<<<<   flags       = "indication" <<<<<<   transaction =
  4513 <<<<<<   tlv_length  = 26 <<<<<<   message     = "Serving System"
  (0x0024) <<<<<< TLV: <<<<<<   type       = "Serving System" (0x01)
  <<<<<<   length     = 6 <<<<<<   value      = 01:01:01:02:01:08 <<<<<<
    translated = [ registration_state = 'registered' cs_attach_state =
  'attached' ps_attach_state = 'attached' selected_network = '3gpp'
  radio_interfaces = '{ [0] = 'lte '}' ] <<<<<< TLV: <<<<<<   type
  = "Data Service Capability" (0x11) <<<<<<   length     = 2 <<<<<<
  value      = 01:0B <<<<<<   translated = { [0] = 'lte '} <<<<<< TLV:
  <<<<<<   type       = "CID 3GPP" (0x1e) <<<<<<   length     = 4 <<<<<<
    value      = 32:36:BC:00 <<<<<<   translated = 12334642 <<<<<< TLV:
  <<<<<<   type       = "LTE TAC" (0x25) <<<<<<   length     = 2 <<<

We should therefore allow changes only in the CID, maintaining
whatever LAC/TAC value we had before.
2020-10-10 15:43:57 +02:00
Aleksander Morgado
c6f38ecac3 iface-modem-3gpp: print consolidated reg state info only when updating 2020-10-10 15:22:18 +02:00
Eric Caruso
408a3d58c2 mm-bearer-qmi: remove default_ip_family_set check
According to QC, we should set the IP family in both the
Set IP Family and Start Network messages. After removing this
check the member is never read, only written; this means it's
effectively dead and can be removed.
2020-10-08 07:54:50 +00:00
Pavan Holla
b0c212635d broadband-modem: Disconnect bearers during disable
Fixes a bug introduced in commit 7e386389, which caused user requested
disable operations to go to step
DISABLING_STEP_FIRST_AFTER_ENABLE_FAILED. For user requested disable,
the first step should be DISABLING_STEP_FIRST.
2020-10-07 22:33:27 +00:00
Daniele Palmas
075bcb74f3 port-qmi: increase qmi_device_open retries
Telit FN980 requires more time for becoming responsive to
qmi requests after device appearance.
2020-10-05 21:49:44 +02:00
Daniele Palmas
dcf188d2ef telit: add tag ID_MM_TELIT_PORT_DELAY for initial delay mechanism 2020-10-05 21:49:44 +02:00
Daniele Palmas
f6c4e3369a telit: add initial delay for AT ports to become responsive
Add a polling mechanism for port responsiveness, since some modem
families require some time before being usable after the serial
ports have been exposed by the kernel.
2020-10-05 21:49:44 +02:00
Daniele Palmas
71cd727425 telit: add FN980 and LM9x0 MBIM compositions rules 2020-10-05 21:49:44 +02:00
Daniele Palmas
ed8cf8d04c telit: fix LM9x0 udev rules 2020-10-05 21:49:44 +02:00
Pavan Holla
bab0f44e74 broadband-modem-qmi: Report FIXED_DIALING lock correctly
Querying facility locks should return a FIXED_DIALING lock if PIN2 lock
is enabled.
2020-10-03 13:14:21 +00:00
Pavan Holla
74ab15d323 broadband-modem-qmi: Return error if get_pin_status fails
Prior to this CL, failure to get pin status while probing facility locks
would not flag an error. Failure to read a pin lock is a critical error
and we return it to higher layers.
2020-10-03 13:14:21 +00:00
Pavan Holla
aa4dce2afc broadband-modem-qmi: Use UIM service for querying facility locks
DMS_UIM messages have been deprecated, and have been replaced by
equivalent UIM messages. Use UIM_GET_CARD_STATUS while querying for facility
locks if dms_uim messages were found to be deprecated.
2020-10-03 13:14:21 +00:00
wicadmin
72d8bae65b ci: create release tarball and hash as build artifacts 2020-09-29 08:58:08 +00:00
Aleksander Morgado
2494645448 shared-qmi: cleanup UIM client if SIM hot swap setup fails
The cleanup was missing in one of the steps.
2020-09-28 12:00:09 +02:00
Aleksander Morgado
f3619f99f5 shared-qmi: minor style changes in SIM hot swap logic 2020-09-28 12:00:09 +02:00
Aleksander Morgado
e4308a529e quectel: setup parent SIM hot swap in addition to +QUSIM
So that e.g. in QMI-based devices we have both things, not just one.
2020-09-28 12:00:08 +02:00
Aleksander Morgado
a2eb80e170 broadband-modem-mbim: also setup SIM hot swap with QMI over MBIM
On QMI-capable MBIM devices, also setup the SIM hot swap logic using
QMI over MBIM, so that profile changes are detected.
2020-09-28 12:00:08 +02:00
Aleksander Morgado
18b33e2e4a broadband-modem-mbim: don't cleanup subscriber info on disable
The SIM hot swap setup is run during initialization and if it succeeds
it must be available throughout the whole execution of this modem
object.

So, do not cleanup the SUBSCRIBER_INFO flag on 3GPP interface disable,
which is completely unrelated to the SIM hot swap setup logic.
2020-09-28 12:00:08 +02:00
Aleksander Morgado
20176767ad broadband-modem-mbim: cleanup the subscriber info setup if enabling fails
If enabling the subscriber info notifications fails, we should no
longer have the setup for those notifications, so make sure it's
cleaned up on error.
2020-09-28 12:00:08 +02:00
Teijo Kinnunen
5285720c48 shared-qmi: implement SIM/profile change detection
Implement eUICC change detection for QMI based modems using one of the
following mechanisms (in order of preference):

1. If the modem supports "get slot status" operation, we monitor
   physical slot status indications from the modem for the active
   slot to detect when ICCID changes.
2. Use "refresh register all" to subscribe refresh indications when
   the eUICC triggers REFRESH operation following the enablement of
   a new profile.
3. Use "refresh register" to subscribe refresh indications (file
   path of EF_ICCID is used) in a similar way. This is used with
   older modems that do not support "refresh register all".

If ICCID change is detected, the already existing SIM hot swap
mechanism in MM is triggered.
2020-09-28 12:00:08 +02:00
Aleksander Morgado
0880bf3f9a Revert "shared-qmi: implement SIM/profile change detection"
This reverts commit e91f2ef315.

This was wrongly merged squashing multiple commits together. Reverting
to merge separate commits.
2020-09-28 11:57:55 +02:00
Teijo Kinnunen
e91f2ef315 shared-qmi: implement SIM/profile change detection
Implement eUICC change detection for QMI based modems using one of the
following mechanisms (in order of preference):

1. If the modem supports "get slot status" operation, we monitor
   physical slot status indications from the modem for the active
   slot to detect when ICCID changes.
2. Use "refresh register all" to subscribe refresh indications when
   the eUICC triggers REFRESH operation following the enablement of
   a new profile.
3. Use "refresh register" to subscribe refresh indications (file
   path of EF_ICCID is used) in a similar way. This is used with
   older modems that do not support "refresh register all".

If ICCID change is detected, the already existing SIM hot swap
mechanism in MM is triggered.
2020-09-28 09:29:09 +00:00
Dušan Kazik
318b2b01e3 po: slovak translation update 2020-09-28 08:44:23 +00:00
Aleksander Morgado
9397ed420d gosuncn: new plugin
For now, just with port type hints for the GM800 in MBIM mode.
2020-09-28 08:22:35 +00:00
Aleksander Morgado
8e8c794815 samsung: fix typo in plugin name 2020-09-25 09:40:51 +02:00
Aleksander Morgado
4e0f849bb9 iface-modem-messaging: if sms list doesn't exist, free part
If the device goes away while we are listing SMS messages, it may
happen that we ask the messaging interface to take a part and the
sms list object has already been disposed. Make sure the part is freed
in that case, so that we avoid memory leaks.

  ==19138== 6,914 (1,232 direct, 5,682 indirect) bytes in 11 blocks are definitely lost in loss record 5,282 of 5,287
  ==19138==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
  ==19138==    by 0x5023349: g_malloc (in /usr/lib/libglib-2.0.so.0.6600.0)
  ==19138==    by 0x50446FF: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.6600.0)
  ==19138==    by 0x5044D6A: g_slice_alloc0 (in /usr/lib/libglib-2.0.so.0.6600.0)
  ==19138==    by 0x2577FC: mm_sms_part_new (mm-sms-part.c:180)
  ==19138==    by 0x2504D0: mm_sms_part_3gpp_new_from_binary_pdu (mm-sms-part-3gpp.c:385)
  ==19138==    by 0x21A15C: add_sms_part (mm-broadband-modem-mbim.c:5169)
  ==19138==    by 0x21A31F: sms_read_query_ready (mm-broadband-modem-mbim.c:5215)
  ==19138==    by 0x4E600F3: ??? (in /usr/lib/libgio-2.0.so.0.6600.0)
  ==19138==    by 0x4E64638: ??? (in /usr/lib/libgio-2.0.so.0.6600.0)
  ==19138==    by 0x4D3870D: transaction_task_complete_and_free (mbim-device.c:236)
  ==19138==    by 0x4D396B9: process_message (mbim-device.c:616)
2020-09-19 20:53:25 +02:00
Aleksander Morgado
00949c4ad3 core: add autoptr cleanup methods to all internal types 2020-09-19 20:27:10 +02:00
Anders Jonsson
19ddfa18bb po: Update Swedish translation 2020-09-19 00:05:53 +02:00