aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
8 daysbase-call: split AT-specific call code into MMCallAtDan Williams
Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-23port-scheduler: implement LOG_OBJECT interface and add scheduler loggingMaciej S. Szmigiero
Otherwise log functions crash. Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
2025-05-23port-serial: add serial port command schedulerDan Williams
Add an interface and implementation for a port scheduler that round- robins between ports the scheduler is attached to, serializing command execution among one or more MMPortSerial instances. Theory of operation: Sources (e.g. MMPort subclasses) register themselves with the scheduler. Each source notifies the scheduler whenever its command queue depth changes, for example when new commands are submitted, when commands are completed, or when commands are canceled. The scheduler will round-robin between all sources with pending commands, sleeping when there are no pending commands from any source. For each source with a pending command the scheduler will emit the 'send-command' signal with that source's ID. The given source should send the next command in its queue to the modem. When that command is finished (either successfully or with an error/timeout) the source must call mm_port_scheduler_notify_command_done() to notify the scheduler that it may advance to the next source with a pending command, if any. If the 'send-command' signal and the notify_command_done() call are not balanced the scheduler may stall. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-23log-object: don't construct log ID with NULL self_idDan Williams
If the object has an owner ID already but doesn't yet have enough information to build its log ID, don't cache a less-than-useful log ID string for it. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-23log-object: Add possibility to reset logger idMaciej S. Szmigiero
Logger id (the one generated from build_id interface method and owner_id property) is generated and cached the first time it is required, further uses just return the cached value. Add a cache reset method so if the interface implementer knows that its logger id could have changed it could force its re-generation. Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
2025-05-23base-cbm: Export the lang property on DBusGuido Günther
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-05-23cbm-part: Handle additional coding schemes and parse languagesGuido Günther
We store the language as iso639 as this is what the what TS 23.038 references. Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-05-23cbm-part: Fix parsing of language encodingsGuido Günther
According to TS 23.038 the language is stored at the beginning of the information page not in the "header". Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-05-23cbm-part: Use automatic cleanupGuido Günther
Safer than freeing the the struct in multiple places Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-05-23mtk-legacy: read IMSI if CPIN response is an errorDan Williams
Some older MTK-based phones (Tecno T528 NEW) reply to +CPIN with an error but are (obviously) unlocked, otherwise they wouldn't be able to boot up to the point of talking to a computer. Since they are actually unlocked they will happily give out the IMSI even if +CPIN errors. To work around the +CPIN issue treat the device as unlocked if we can successfully read the IMSI. Fixes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/980 Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-23broadband-modem,modem-helpers: move +CPIN response parsing to modem helpersDan Williams
Unit test it better, plus remove code duplication in various plugins. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-22broadband-modem-mbim: add qdu firmware update checkFlorian Eckert
The manufacturers can offer a firmware update file 'ota.bin' with which the firmware can be updated in the modem via a manufacturer tool using windows. The tool is only available for Windows and can therefore not be used for embedded devices. A investigation has shown that this tool updates the firmware via 'mbim-qdu'. The update service 'fwupd' which has a 'modemmanager' plugin can install the firmware via 'mbim-qdu'. For this to work, the ModemManager must export this update method via the firmware interface. As the 'mbim-qdu' is a generic update method, the check is integrated into the 'mm-broadband-modem-mbim' class. If 'mbim-qdu' update method is supported by the mbim interface and the udev env variable 'ID_MM_MBIM_QDU' is set for this modem, then the 'mbim-qdu' update is exported via dbus. The following line must be added to the '77-mm-cinterion-port-types.rules' udev rules file, for example, so that the mbim-qdu update for the 'MV31' can be used. ATTRS{vendor}=="0x1e2d", ATTRS{device}=="0x00b3", ENV{ID_MM_MBIM_QDU}="1" This is the corresponding output of the 'mmcli' command to show the supported update method for the 'MV31'. root@G3-10940 ~ # mmcli -m Modem1 --firmware-status Firmware | method: mbim-qdu | device ids: USB\VID_1E2D&PID_00B3&REV_0414&CARRIER_GCF | USB\VID_1E2D&PID_00B3&REV_0414 | USB\VID_1E2D&PID_00B3 | USB\VID_1E2D | version: T99W175.F0.1.0.0.9.GC.004.063 - 0A000804 Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2025-05-22base-cbm: Install properties one by oneGuido Günther
`g_object_class_install_property` picks up `PROP_BIND_TO` resulting in a crash on the first CBM received. Fixes: ec5104c9a ("Move log parent and connection property binding to helper") Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-05-22serial-parsers: don't echo-remove strange call start/end URCsDan Williams
Some Sierra devices omit the leading <CR> from call start/end URCs like NO CARRIER and CONNECT, which caused the echo-removal code to remove from the response buffer because the leading <CR><LF> did not exist. That can break call control and hangup handling on those devices. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-22serial-parsers,port-serial-at: move echo removal into serial parserDan Williams
Mainly because we need somewhere to stash the call end regex, and it's silly to have a 3rd instance of that in MMPortSerialAt when we already have one in the serial parsers that MMPortSerialAt relies on pretty heavily. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-22broadband-modem,modem-helpers: generalize call end regex creationDan Williams
Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-20modem-helpers: handle spaces in +CPMS query responseDan Williams
Fixes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/990 Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-20broadband-modem-qmi/cellbroadcast: Allow for G_MAXUINT16Guido Günther
It's a valid channel value. Since start and end are guint16 we can drop the check altogether. Fixes: e25dd7db9 ("broadband-modem-qmi: Add support for loading channels") Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-05-20broadband-modem-qmi/cellbroadcast: Return on failureGuido Günther
Return after setting the error Fixes: e25dd7db9 ("broadband-modem-qmi: Add support for loading channels") Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-05-19telit: add ECM bearer for LE910Q1/ELS63-IDaniele Palmas
Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
2025-05-19broadband-modem-telit: use +COPS to get AcT for LE910Q1/ELS63-IDaniele Palmas
Use +COPS to retrieve AcT for LE910Q1/ELS63-I since they do not support #PSNT and +SERVICE. Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
2025-05-19telit: add port hints for LE910Q1/ELS63-IDaniele Palmas
Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
2025-05-19modem-helpers: remove unused variable in mm_3gpp_parse_cmer_test_responseDaniele Palmas
Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
2025-05-19broadband-modem: support +CGEREP values different than 2Daniele Palmas
Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
2025-05-16base-bearer: set dbus disconnect_request on ignored disconnectionDominique Martinet
When we get a disconnect event that we wanted to ignore, set the DisconnectRequest property instead so clients on dbus can act on it. Also upgrade the logs from dbg to msg (info) as there would be otherwise no message indicating the disconnect request if it is not acted on. This was checked with dbus-monitor: ``` $ dbus-monitor --system "type='signal',sender='org.freedesktop.ModemManager1'" signal time=1747362238.227804 sender=:1.73798 -> destination=(null destination) serial=741 path=/org/freedesktop/ModemManager1/Bearer/0; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged string "org.freedesktop.ModemManager1.Bearer" array [ dict entry( string "DisconnectRequest" variant boolean true ) ] array [ ] ``` Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
2025-05-16dispatcher-connection: add new 'disconnect-request' eventDominique Martinet
When bearer gets an event that should trigger a disconnection but we cannot disconnect (for example because we're waiting for pppd to close), we now trigger a new 'disconnect-request' event instead This was tested with the following hook: ``` $ cat /etc/ModemManager/connection.d/handle-disconnect-request.sh #!/bin/sh if [ "$4" != disconnect-request ]; then exit 0 fi iface=$(mmcli -b "$2" -K | awk '/bearer.status.interface/ { print $3 }') if pkill -f "pppd\>.*\<$iface\>"; then logger -t mm-disconnect-request "Killed $iface pppd" else logger -t mm-disconnect-request "No pppd found for $iface" fi ``` Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
2025-05-16dispatcher-connection: replace 'connected' boolean with a new enumDominique Martinet
The next commit will introduce a new dispatcher event. This commit should not change anything user-facing Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
2025-05-14modem-helpers: fix method for distinguishing lac and stat valuesKirill Buksha
Stat value may be multidigit e.g. 10 or 11. Signed-off-by: Kirill Buksha <kirbuk200@gmail.com>
2025-05-14tests,modem-helpers: add cases for multidigit "stat" value in CREG responseKirill Buksha
Signed-off-by: Kirill Buksha <kirbuk200@gmail.com>
2025-05-14modem-helpers: support multi-digit "stat" values in CREG responseKirill Buksha
The 'stat' field in CREG responce may contain multi-digit numbers, such as "10" meaning "registered for "CSFB not preferred", roaming". Furtermore, some modems use value "11" to indicate that only emergency services are available. Signed-off-by: Kirill Buksha <kirbuk200@gmail.com>
2025-05-11base-sim: Setup auth provider and its cancellableMaciej S. Szmigiero
Otherwise we'll get a NULL pointer dereference segfault in mm_auth when sending SIM PIN. Looks like MMBaseSim was accidentally missed during the conversion done by the commit in the Fixes tag below. Fixes: ef5cee3ab578 ("auth-provider: move auth provider logic into each class") Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
2025-05-09intel: implement support for RPC-powered xmm7360Thomas Vogt
Signed-off-by: Thomas Vogt <acc-github@tovotu.de>
2025-05-08modem-helpers: add IPv6 support to +CGCONTRDP parsingDan Williams
Add some test responses from the Quectel EG915Q and some other Quectel devices. Then try to parse those responses. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08broadband-modem-qmi,broadband-modem-mbim: always use SMS_PART_INVALID_INDEX ↵Dan Williams
unstored parts MMSmsList has logic to allow multiple unstored messages as long as they use SMS_PART_INVALID_INDEX. These messages aren't stored so they don't have an index. But the MBIM and QMI modems used index 0 for unstored messages, meaning there could only ever be one and also that multipart messages would fail to be combined. Let's fix that by just using SMS_PART_INVALID_INDEX for every scenario where an unstored message comes in. Fixes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/979 Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08sms-list: remove usage of MMBaseModemDan Williams
Not used for anything anymore so we can remove the property. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08base-sms: remove MODEM propertyDan Williams
No longer depend on MMBaseModem since everything that specifically uses it is now removed. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08base-sms,sms-list: use signals to set multipart referenceDan Williams
Instead of going through the messaging interface, which just asks the MMSmsList anyway, just go straight to the list. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08base-sms: reduce possibility of leaking multipart referenceDan Williams
Move error paths after getting a multipart reference to before getting one, to reduce the possiblity that we get a reference from the MMSmsList that ultimately doesn't end up getting used. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08base-sms: pass supported storages in at creation timeDan Williams
They won't change, and this lets us get rid of one more usage of MMIfaceModemMessaging. Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-05-08base-sms: pass SMS default storage at creation time and update as neededDan Williams
Instead of getting it from the MMIfaceModemMessaging when the SMS is stored. This flattens dependencies between MMBaseSms and MMIfaceModemMessaging. Signed-off-by: Dan Williams <dan@ioncontrol.co>
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>