This reverts commit dad3e82747.
Disabling profile change indications just before doing our profile
updates and re-enabling them just after is not enough. The modem may
still emit the profile change indication right after, so all this
logic is unnecessary.
GError structure may not be initialized after execution of
mm_3gpp_parse_cgdcont_read_response() and accessing it's
fields will cause a segmentation fault.
Just ignoring the received indications is not enough, because they
could arrive after the operation response has been processed.
We now explicitly disable the indications by reconfiguring the modem
before and after every profile update operation triggered by our own
logic.
When Telit FN990 is integrated through PCIe, but also USB lines are
available, ModemManager will consider the port on the USB composition
as a different modem:
oem@sw-test:~$ mmcli -L
/org/freedesktop/ModemManager1/Modem/1 [telit] FN990A40
/org/freedesktop/ModemManager1/Modem/0 [Telit] FN990A40
oem@sw-test:~$ mmcli -m 0
<snip>
| equipment id: 359172390022295
--------------------------------
System | device: /sys/devices/pci0000:00/0000:00:14.0/usb2/2-5
| drivers: option
| plugin: telit
| primary port: ttyUSB0
| ports: ttyUSB0 (at)
oem@sw-test:~$ mmcli -m 1
<snip>
| equipment id: 359172390022295
-----------------------------------
System | device: /sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0
| drivers: mhi-pci-generic
| plugin: telit
| primary port: wwan0mbim0
| ports: wwan0 (net), wwan0at0 (at), wwan0at1 (at),
| wwan0mbim0 (mbim), wwan0nmea0 (ignored), wwan0qcdm0 (ignored)
Ignore composition 0x1075, since it should not be used by ModemManager
and can only show when PCIe is used.
On MBIM modems that do not support mbimex v2, extra steps are required
to retrieve 3G/4G signal quality markers from the modem when using
thresholds to trigger signal quality indications.
[1/2] Compiling C object src/ModemManager.p/mm-base-manager.c.o
../src/mm-base-manager.c: In function ‘remove_device_inhibition’:
../src/mm-base-manager.c:1127:20: warning: declaration of ‘l’ shadows a previous local [-Wshadow]
1127 | GList *l;
| ^
../src/mm-base-manager.c:1116:16: note: shadowed declaration is here
1116 | GList *l;
| ^
If the device is not fully removed from the system during inhibition
and port additions happen, we reach a state where the MMDevice object
is still tracked by ModemManager and we also have new port additions
tracked that will require explicit port probings before a new modem
object can be created.
Solve this mixup by faking the removal of all existing device ports,
which will end up completely removing hte MMDevice, so that new port
additions reported afterwards also involve the full device probing
process triggered by the plugin manager.
The issue could be reproduced easily on a MBIM device that also
exposed TTYs, as follows:
* mmcli -m a --inhibit, leave it running
* rmmod cdc_mbim && sleep 5 && modprobe cdc_mbim (so that the
cdc-wdm and net ports go away from the system but NOT the TTYs.)
* Cltr+C to stop the inhibit in the mmcli call.
ModemManager would assert as follows:
0x000079918bcf2a3f (libc.so.6 + 0x00087a3f) pthread_key_delete
0x000079918bca7c6c (libc.so.6 + 0x0003cc6c) gsignal
0x000079918bc93462 (libc.so.6 + 0x00028462) abort
0x000079918bf26f03 (libglib-2.0.so.0 - gtestutils.c: 3253) g_assertion_message
0x000079918bf26f66 (libglib-2.0.so.0 - gtestutils.c: 3279) g_assertion_message_expr
0x0000594ff1093d0c (ModemManager - mm-base-manager.c: 1110) remove_device_inhibition
0x0000594ff1093968 (ModemManager - mm-base-manager.c: 1247) inhibit_device_auth_ready
0x000079918c0536a8 (libgio-2.0.so.0 - gtask.c: 1230) g_task_return_now
0x000079918c0536db (libgio-2.0.so.0 - gtask.c: 1244) complete_in_idle_cb
0x000079918bf053fc (libglib-2.0.so.0 - gmain.c: 3417) g_main_context_dispatch
0x000079918bf05704 (libglib-2.0.so.0 - gmain.c: 4211) g_main_context_iterate
0x000079918bf05978 (libglib-2.0.so.0 - gmain.c: 4411) g_main_loop_run
0x0000594ff108de66 (ModemManager - main.c: 217) main
0x000079918bc936c5 (libc.so.6 + 0x000286c5) __libc_init_first
0x000079918bc93781 (libc.so.6 + 0x00028781) __libc_start_main
0x0000594ff108db80 (ModemManager + 0x00061b80) _start
The Tethering context type UUID was defined by Microsoft in its
extensions as `5e4e0601-48dc-4e2b-acb8-08b4016bbaac` (along with
others like Admin, Xcap, App and EmergencyCalling), see
https://learn.microsoft.com/en-us/windows-hardware/drivers/network/mb-provisioned-context-operations.
These UUIDs are expected to be usable only if the modem supports
`MBIM_CID_MS_PROVISIONED_CONTEXT_V2` (CID=1) in the Basic Connect
Extensions service (3d01dcc5-fef5-4d05-0d3abef7058e9aaf).
If the modem doesn't support these, we should try to fallback to a
more generic APN type automatically, e.g. "Internet", which was
defined in MBIM 1.0 and should always be supported.
There should be no problem in a modem to have 2 separate PDN
connections with the same context type.
If we remove the current element being iterated in the GList, we can
no longer call g_list_next() on it. Ensure we keep a valid pointer to
the next element in the list before removing the current one.
adding bandwidth information in mm-dbus interface
for the serving cell. In serving cell, the details
on whether the pcell/scell are from MCS or SCG is
also updated.
Co-author: Shilpa Shivakumar
A network scan with json output currently returns the following:
root@G3-10940 ~ # mmcli -m 0 -J --3gpp-scan --timeout=300 | jq
{
"modem": {
"3gpp": {
"scan-networks": [
"operator-code: 26201, operator-name: TDG, access-technologies: lte, availability: forbidden",
"operator-code: 26203, operator-name: o2 - de, access-technologies: lte, availability: forbidden",
"operator-code: 26202, operator-name: vodafone.de, access-technologies: lte, availability: current"
]
}
}
}
This is a valid JSON, but in order to be able to access the individual
data elements more easily, the line can also be dumped as a json object.
The following commit converts the lines into a JSON obejct, so that it
looks like this:
root@G3-10940 ~ # mmcli -m 0 -J --3gpp-scan --timeout=300 | jq
{
"modem": {
"3gpp": {
"scan-networks": [
{
"operator-code": "26201",
"operator-name": "TDG",
"access-technologies": "lte",
"availability": "forbidden"
},
{
"operator-code": "26203",
"operator-name": "o2 - de",
"access-technologies": "lte",
"availability": "forbidden"
},
{
"operator-code": "26202",
"operator-name": "vodafone.de",
"access-technologies": "lte",
"availability": "current"
}
]
}
}
}
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
It was not possible to read IMEI of modem when SIM was not inserted or
initialization failed due to modem facility locks. To load IMEI, the
3gpp interface need to be initialized before going to FALLBACK_LIMITED.
In Nixpkgs, sysconfdir is not writeable in the sandbox in which
packages are built, so it's important for us to be able to disable
installing example files. (We create configuration files and install
them into /etc separately through our "module system".)
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Some firmware versions return an empty string for the revision when
using the device caps MBIM request, so use AT commands as a fallback
in case this happens.
This commit modifies the QMI DMS Operating Mode indication registration logic.
During the power sequence chance, if a QMI_PROTOCOL_ERROR_MISSING_ARGUMENT error
was returned in "DMS Set Event Report" operation for Operating Mode Reporting failed,
the whole sequence was aborted, leading the modem to be disabled.
<debug> [modem0] Power indication registration request is sent
...
<debug> [modem0] couldn't update power state: Couldn't register for power indications: QMI protocol error (17): 'MissingArgument'
<warn> [modem0] couldn't enable interface: 'Couldn't register for power indications: QMI protocol error (17): 'MissingArgument''
<debug> [modem0] running implicit disable after failed enable...
This commit modifies the logic to properly detect the failure and
continue the sequence without the indications.
Fixes#683
Signed-off-by: Louis-Alexis Eyraud <louis-alexis.eyraud@unabiz.com>
When using qmi uim service from mbim broadband modem, a fallback from using
qmi uim service to normal mbim operations is done every time a call to
qmi_set_primary_sim_slot fails. But this may fall for various reasons,
and a fallback only makes sense when the device does not support that call
Patch reworked by Aleksander Morgado <aleksandermj@chromium.org>