The Cinterion specific implementation relies on the generic one but
adds the authentication information support using ^SGAUTH.
The loading of the initial EPS bearer status (i.e. the one agreed with
the network, not the settings) no longer has any Cinterion specific
behavior. The auth settings are NOT reported in the initial EPS bearer
status.
The implementation in the generic MMBroadbandModem object should fit
well instead of the custom implementation.
There is also no need to specify via udev tags which is the initial
EPS bearer context id, we try to automatically guess it in runtime.
The main issue here is how to select the id of the context that is
used for attach in the modem.
We will assume that the lowest cid value for the IP range returned in
the CGDCONT=? test is the one used for the attach context. This
assumption works with modems following the 3GPP specs (with cid=0) and
also in Qualcomm based modems (with cid=1).
Before the operation to update the current initial EPS bearer
settings, we will now unconditionally put the modem in low power
mode. so that when the next network registration happens we are sure
the new settings are in place.
This approach was previously applied already to all QMI-based modems
as well as to all Fibocom modems. The approach applies now to all
modems of all vendors and in all control protocols.
Let the caller of mm_iface_modem_set_power_state() know which was the
power state in the device before the actual update happened.
This is useful in cases where we want to temporarily switch to a given
power state (e.g. low) before returning to the original power state.
ptr_array_add_sysfs_attribute_link_basename() already reads the
current subsystem, so we should avoid overwriting the pointer.
==1630== 13 bytes in 2 blocks are definitely lost in loss record 270 of 3,092
==1630== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==1630== by 0x4A1DDE8: g_malloc (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.1)
==1630== by 0x4A329E3: g_strdup (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.1)
==1630== by 0x26128E: ptr_array_add_sysfs_attribute_link_basename (mm-kernel-device-generic.c:244)
==1630== by 0x263FD0: preload_contents_platform (mm-kernel-device-generic.c:314)
==1630== by 0x263FD0: preload_contents (mm-kernel-device-generic.c:549)
==1630== by 0x263FD0: check_preload (mm-kernel-device-generic.c:992)
==1630== by 0x263FD0: initable_init (mm-kernel-device-generic.c:1139)
==1630== by 0x4B6DDB9: g_initable_new_valist (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.6800.1)
==1630== by 0x4B6DE6C: g_initable_new (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.6800.1)
==1630== by 0x262087: mm_kernel_device_generic_new_with_rules (mm-kernel-device-generic.c:1054)
==1630== by 0x17F66F: handle_kernel_event (mm-base-manager.c:689)
==1630== by 0x17F7D2: report_kernel_event_auth_ready (mm-base-manager.c:1238)
==1630== by 0x4BA37D8: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.6800.1)
==1630== by 0x4BA3A1A: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.6800.1)
The logic initializing the SIM object already prints the loaded
fields, taking into account that some of them should be treated as
personal info (so redacted by default).
[modem0/sim0] loaded SIM identifier: 8988211000000123456
[modem0/sim0] loaded SIM identifier: ###
[modem0/sim0] loaded IMSI: 901700000012345
[modem0/sim0] loaded IMSI: ###
In Nixpkgs packages are installed in separate prefixes.
Starting from GLib / gobject-introspection 2.80, GLib introspection data
is provided by GLib itself instead of gobject-introspection. This causes
tests failures in Nixpkgs because the GI_TYPELIB_PATH set by the build
environment was overridden, leaving it unable to find GLib:
ImportError: cannot import name GLib, introspection typelib not found
Only GI_TYPELIB_PATH needs to be preserved in our case, but I've made
the same change for LD_LIBRARY_PATH, other environments might rely on
that in a similar way.