aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2025-05-08base-sms,sms-list,iface-messaging: move MMBaseSms creation to ↵Dan Williams
MMBroadbandModem class This commit moves creation of the MMBaseSms objects out of MMSmsList and up into MMIfaceModemMessaging (which is already a MMBroadbandModem) and the MMBroadbandModem subclasses themselves. This flattens the creation of MMBaseSms objects by passing them down from the object that creates the SMS parts, rather than having a convoluted callback scheme relying on MMSmsList and MMBaseSms having direct knowledge of their owning modem. The goal is to eventually remove usage of MMBaseModem from MMBaseSms and MMSmsList so that we can test them more easily. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08base-sms,sms-at: split AT-specific SMS code into MMSmsAtDan Williams
Simplify MMBaseSms (making it easier to use from testcases) by splitting the AT-specific code into MMSmsAt rather than keeping it in the base class. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08base-bearer: remove unused includeDan Williams
Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08base-sms,iface-modem-messaging: move lock/unlock logic into the interfaceDan Williams
Allows us to test things that rely on MMBaseSms more easily.. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08base-sms: determine 3GPP vs. CDMA at creation timeDan Williams
It won't ever change over the lifetime of the BaseSMS. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08sms-mbim: remove unused codeDan Williams
Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08base-cbm,cbm-list,iface-cbm: remove usage of MMBaseModemDan Williams
CBM isn't as complicated as SMS, and the CBM class itself doesn't need to be overridden by QMI/MBIM/etc. Now that the log parent and connection binding no longer require MMBaseModem we can flatten the CBM object creation and remove usage of MMBaseModem. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08Move log parent and connection property binding to helperDan Williams
Continues removing usage of MMBaseModem in a bunch of files by splitting out bits of its usage to separate interfaces. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08auth-provider: move auth provider logic into each classDan Williams
Rather than make all of them rely on MMBaseModem for it. This lets us disentangle dependencies for easier unit testing. For interfaces, rather than casting directly to MMBaseModem use intermediate interfaces (MMIfaceAuth and MMIfaceOpLock) that tests can fake out. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08base-modem,auth-provider: move testcase auth bypass to auth providerDan Williams
The bypass when in testcase mode has nothing to do with the base modem class; so make it generic. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08quectel: decrease low-power/power-on/reset wait times to 15 secondsDan Williams
AT docs for many (most?) device state a max timeout of 15 seconds. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08quectel: ensure power down operation waits for POWERED DOWN URCDan Williams
AT docs for many (most?) Quectel devices state that QPOWD=1 receives the OK response very quickly but the caller must wait for the POWERED DOWN URC to avoid data loss. Do that. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08broadband-bearer,modem-helpers: don't use or match disabled profilesDan Williams
When matching profiles ignore disabled ones. When activating a specific profile index, return an error if that profile is marked as disabled. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08broadband-modem-qmi: use correct profile index in error messageDan Williams
Instead of using the loop index, use the actual profile index because they aren't always the same. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08broadband-modem-qmi: implement disabled 3GPP profilesDan Williams
Previously, a disabled profile would cause Profile Manager interface enabling to fail because get_profile_settings_ready() returned an error for disabled profiles. But 3GPP profile objects already have support for the enable/disabled setting, so just hook that up and stop returning an error for disabled ones. This allows successful initialization of the 3GPP Profile Manager on devices that contain disabled profiles. While we're at it, allow creating disabled profiles, and changing profiles back and forth from enabled<->disabled. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08broadband-modem: close serial ports in disposeDan Williams
We want ports to be closed as early as possible; so make sure they are closed in dispose() which is run explicitly by MMDevice when cleaning up and removing the modem. Otherwise they could stay open longer than we want, causing problems for suspend/resume. This caused problems with suspend because cancelling the MMBaseModem's cancellable triggered an idle handler that held a reference to the modem, preventing finalize() from running until after the suspend code was finished, thus preventing ports from being closed and cleaned up. Closing them in dispose() handles this. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08broadband-modem: remove invalid idle handler during disposeDan Williams
base_modem_invalid_idle() needs to keep a reference to the MMBaseModem until its done. But if the modem is cancelled during removal right before we're trying to forget about it, keeping that reference can prevent everything getting cleaned up by MMBaseModem's dispose() until after the mainloop has run again and all our removal operations are supposedly complete. MMDevice uses an explicit dispose() trigger that mitigates most of this (and requires it for other reasons, like breaking reference cycles between the modem and it's various child classes) but it's somewhat error-prone to keep the modem around if we don't really need to. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-07broadband-modem-qmi,mbim: remove redundant port closesDan Williams
This will just be done immediately after by MMBaseModem's dispose() handler. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-07base-manager: convert shutdown to stepsDan Williams
Make the call flow clearer. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-07base-manager,device: consolidate modem cancelling into mm_device_remove_modem()Dan Williams
Every use of mm_device_remove_modem() was already trying to cancel the modem's canellable, so let's just put it there and simplify the callers. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-07base-manager,sleep-monitor: wait for modem operations before sleepingDan Williams
Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-07base-modem: clarify port cleanup/close behavior for serial portsDan Williams
Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-07base-modem: allow port teardown operation to use callbacks if neededDan Williams
Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-07port-serial: don't log force-closes if not really being forced closeDan Williams
Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-07modem-helpers: report C*REG=2 AcT 9 as NB-IOT access technologyDan Williams
Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-01broadband-modem: reload registration info after manual registrationDan Williams
This refreshes operator information after manual registration. QMI and MBIM implementations return operator info along with registration info so they handle this easily, while with AT-based devices we must run additional commands to retrieve that after the manual registration has finished. Suggested by: Kirill Buksha <kirill.buksha@axians.rs> Fixes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/971 Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-04-25fibocom: allow QCDMLukas Voegl
Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
2025-04-25api,modem: new 'IgnoredPorts' propertyLukas Voegl
Expose a new list of 'IgnoredPorts' via D-Bus and therefore remove the use of `MM_MODEM_PORT_TYPE_IGNORED` Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
2025-04-23broadband-modem: detect old Mediatek 62xx chipsets as GSM-capableDan Williams
They don't necessarily reply to +WS46 but like old Motorola ESX devices they reply to +CGMM with a known string. Fixes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/980 Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-04-21iface-modem-voice: recheck call state polling when call is startedDan Williams
When an outgoing call is created and added to the call list its state is UNKNOWN. The call list emits the ADDED signal which MMIfaceModemVoice listens for to check whether to begin polling call state. But since UNKNOWN is not an in-progress call state polling isn't started. And nothing was rechecking whether to start polling when the call state changed to something other than UNKNOWN. Do that so that we can track call progress as it dials out and is answered. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-04-13modem-helpers-cinterion: allow spaces in ^SXRAT test responseDan Williams
^SXRAT: (0-6), (0,2,3), (0,2,3) Fixes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/974 Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-04-13broadband-modem-qmi: implement Time interfaceDan Williams
Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-04-13shared-fibocom: don't assume parent implements the firmware interfaceDan Williams
MMBroadbandModemMbimMtkFibocom doesn't, so don't assert it. Fixes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/975 Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-04-13broadband-modem-qmi: Enable Cell BroadcastGuido Günther
For QMI we have an extra QMI request so use that to make sure receiving messages is actually enabled. Closes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1325 Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-04-13broadband-modem-qmi: Add support for loading channelsGuido Günther
This allows to retrive the list of configured Cell Broadcast channels. Closes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1325 Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-04-13broadband-modem-qmi: Add support for setting channelsGuido Günther
This allows to receive Cell Broadcast messages in the specified channel range on SDM670 based devices (X12 modem) and SDM845 (X20 modem) without any AT ports (like the OnePlus 6/6T and Google Pixel 3a). Helps: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1325 Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-04-13broadband-modem-qmi: Add initial interface bitsGuido Günther
This allows to receive Cell Broadcast messages. Tested with single part CBMs only as my setup currently only allows for these. Helps: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1325 Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-04-12modem-helpers: fix checking of CDMA/EVDO access technologyDan Williams
Missing ! for strncmp() meant the test was backwards and would erroneously report 1xRTT and EVDOr0 when those access technologies were not in use. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-04-09modem-helpers-qmi: better handle no supported modesDan Williams
Dell Snapdragon X62 before FCC Unlock reports no radio interfaces from QMI and no device capabilities from MBIM. Instead of asserting in mm_filter_supported_modes() when called from mm_supported_modes_from_qmi_supported_modes_context() gracefully handle the lack of supported modes. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-04-08modem-helpers-qmi: fix deprecated usage of ↵Dan Williams
QMI_NAS_NETWORK_SERVICE_DOMAIN_UNKNOWN Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-04-03tests: add tests for mm_signal_from_mbim_signal_state()Dan Williams
Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-04-01broadband-modem-mbim: consolidate determination of data classDan Williams
Do it in a function instead of the same thing in a bunch of places. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-04-01broadband-modem-mbim: consistently handle custom data classesDan Williams
Consistently interpret the modem's reported custom data class when loading current mode, supported mode, supported capabilities, setting current mode, and current access technology. Normalize the data class to include any custom data class immediately after reading it from any MBIM message. De-normalize it when sending back to the modem when setting current modes so the modem receives MBIM_DATA_CLASS_CUSTOM for the custom mode. Fixes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/937 Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-03-28modem: Load current channels on startupGuido Günther
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-28modem: Allow to set current channel listGuido Günther
This adds support for setting the channels to override the boot up modem defaults: ``` busctl --system call org.freedesktop.ModemManager1 /org/freedesktop/ModemManager1/Modem/0 org.freedesktop.ModemManager1.Modem.CellBroadcast SetChannels 'a(uu)' 1 0 9999 busctl --system get-property org.freedesktop.ModemManager1 /org/freedesktop/ModemManager1/Modem/0 org.freedesktop.ModemManager1.Modem.CellBroadcast Channels a(uu) 1 0 9999 ``` Closes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/934 Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-28modem-helpers: Add helpers to parse channel listsGuido Günther
`CSCB` has the form ``` CSCB: [0|1],"<channel-list>","<data-coding-scheme>" ``` If the first parameter is `0` this specifies the accepted types if `1` it specifies rejected. So far seen in the wild were CSCB strings with accepted types only and a coding scheme of "" so this is what we handle for the moment. Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-27broadband-modem: detect modem modes with +CEREG and +C5GREGDan Williams
Some AT-based modems like the Quectel Unisoc-based RM500U don't support the older AT commands we used to detect modes like AT*CNTI=2 and AT+WS46. Add support for detecting 4G and 5G with generic commands too. Fixes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/786 Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-03-27telit: use generic early AT port probe logicDan Williams
Use the new early port probe logic to do AT probes before the custom init hook actually starts. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-03-27port-probe: allow per-port ID_MM_TTY_AT_PROBE_TRIES tag for custom number of ↵Dan Williams
AT probes For modems that need more time to respond to AT port probes (like some Telit devices, and Cinterion-based Telit MV31/MV32) allow a custom number of AT probe tries on a per-port basis for generic probing, or plugins that opt into this functionality. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-03-23broadband-modem,iface-modem: don't treat SIM unlocks as hot-swapsDan Williams
If the old IMSI was unavailable because the SIM was locked, but now is available because the SIM was unlocked, don't treat the SIM properties change as a hotswap that may trigger dropping and re-probing the modem. Signed-off-by: Dan Williams <dan@ioncontrol.co>