aboutsummaryrefslogtreecommitdiff
path: root/plugins/cinterion
AgeCommit message (Collapse)Author
2023-01-03build: move plugins directory to src/pluginsAleksander Morgado
We are going to allow including the plugin sources built within the ModemManager daemon binary; moving the sources within the daemon sources directory makes it easier.
2022-11-28cinterion: add retry mechanism to the ^SWWAN? commandHeiko Thiery
Since it is possible that the delayed status request for the connection (^SWWAN?) also does not return the updated status a retry is needed. This retry is only done for the activation path. So the connection status monitoring and the deactivation path is not affected. Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
2022-11-28cinterion: add a delay to the ^SWWAN? commandHeiko Thiery
There are modems where the status in response is not available immediatly. Doing a delayed request will solve the issue. Suggested-by: Giacinto Cifelli <gciofono@gmail.com> Suggested-by: Aleksander Morgado <aleksandermj@chromium.org> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
2022-11-04core,log: new 'MSG' log level between 'INFO' and 'WARN'Aleksander Morgado
We're bumping the current "INFO" level messages to the new "MSG" level, also making the new level the default. The old "INFO" level will be used to setup an intermediate level of logging which is not as verbose as "DEBUG" but still provides some capabilities to analyze the behavior of a modem.
2022-09-28cinterion: Fix CDC-ECM support for ELS61-E2Christian Taedcke
When the data connection is started with AT^SWWAN, the modem expects the DHCP discover packet from the TE while the command is running, i.e. while the modem has not replied yet. In order to achieve that, the bearer is marked as connected as soon as the command is issued. This makes the NetworkManager start the DHCP process. If the modem replies with an error, the bearer will be marked disconnected later on. See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/50 for a similar functionality in the ublox driver. Includes minor coding style fixes from Aleksander Morgado <aleksandermj@chromium.org>. Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2022-09-28cinterion: add support for mode setting using SXRATChristian Taedcke
The previously used COPS command to set to LTE-only mode did not work for an ELS81 modem. Now ^SXRAT is used to switch modes instead of COPS, if SXRAT is supported by the modem.
2022-09-08cinterion: add support thales PCIE vid(0x1269) in the cinterion.Fanice.luo
For SDX55 and SDX65 can identify the corrrect plugin(cinterion), and the plugin is updated to support the wwan subsystem.
2022-09-05modem-helpers-cinterion: rework CNMI test response parserAleksander Morgado
We setup all output variables with g_autoptr() and then use g_steal_pointer() to return the needed ones.
2022-09-05core: port GRegex/GMatchInfo to use autoptr()Aleksander Morgado
The behavior of GRegex changed in 2.73.2 once it was ported from pcre1 to pcre2. In some cases it was made more strict, which is fine, in other cases it exposed some change in how it behaves on certain matches that is not extremely clear whether it's ok or not. See https://gitlab.gnome.org/GNOME/glib/-/issues/2729 See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/601 See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/621 Either way, one thing that was assumed was that initializing all GRegex/GMatchInfo variables to NULL and making sure they're NULL before they're initialized by glib (especially the GMatchInfo) was a good and safer approach. So, whenever possible, g_autoptr() is used to cleanup the allocated GMatchInfo/GRegex variables, and otherwise, g_clear_pointer() is used to ensure that no free/unref is attempted unless the given variable is not NULL, and also so that the variable is reseted to NULL after being disposed.
2022-06-09suspend: add suspend/resume support with powerd on ChromeOSRukun Mao
ModemManager handles suspend and resume signals sent from powerd Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/547
2022-05-24base-modem: add subsystem vendor ID propertyDaniele Palmas
Subsystem vendor ID can be used for identifying PCI modems, so expose the property.
2022-05-20iface-modem: common SIM event reporting logicAleksander Morgado
We no longer have separate mm_base_modem_process_sim_event() and mm_broadband_modem_sim_hot_swap_detected() methods. The only difference between both of them was that one of them would attempt to cleanup the ports context associated to the SIM hot swap event logic as soon as a swap was detected, in order to avoid queueing up multiple such events. The previous logic wasn't working well, though, as there could be mixed AT+QMI or AT+MBIM devices that would also require that same cleanup and so we didn't always know which one should have been called. Now we have a single mm_iface_modem_process_sim_event() method, which will trigger the reprobe and disabling, but which will also perform the cleanup of the SIM ports swap setup as specified by the implementation. So, if a plugin explicitly initializes the serial ports context for SIM hot swap handling, it should also explicitly clean it up. Also, the initialization of the serial ports context for SIM hot swap handling is no longer done automatically for all modems, it will be done only for those modems using it; i.e. the modems that explicitly report support SIM hot swap handling using AT URCs.
2022-05-20iface-modem: remove MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED propertyAleksander Morgado
This property is used in the MMIfaceModem to flag whether the SIM hot swap setup has been performed or not. The flag is now moved to the iface-specific private context. The property was also used in AT-based modems, so that implementations supporting the SIM hot swap via AT URCs could flag the upper layers whether the enabling of the feature was done correctly or not, and if so, create and keep the AT ports context open. But this feature only made sense in AT-based modems, i.e. an MBIM modem that detects SIM hot swaps via MBIM indications exclusively should not require the AT ports context open for anything. The check in the MMBroadbandModem object has therefore been removed, and the logic will be updated so that it only applies to AT-based modems.
2022-04-13cinterion: add PLS63 port type hintsKonrad Zapałowicz
The PLS63 is a drop-in replacement for PLS62 model, however it uses different USB SoC and enumerates differently on the USB bus. This commit adds relevant type hints with a correct Vendor and Product IDs so that the device is correctly discovered. Without these type hints the modem would not work correctly as it uses wrong port for PPP.
2022-04-08sms: prevent crash if date is out of rangeCarlo Lobrano
g_date_time_new, and g_date_time_new_utc return NULL if inputs are out of range, and currently mm_new_iso8601_time passes the GDateTime created by those two functions to date_time_format_iso8601 without checking for NULL values, causing a g_date_time_format_iso8601 crash if PDU data is corrupted with wrong date. To prevent this, mm_new_iso8601_time now can return NULL and set a new GError if GDateTime created by g_date_time_new is NULL. Fixes #546
2022-03-25cinterion: Add support for PLSx3w modemsTheodore A. Roth
Signed-off-by: Theodore A. Roth <theodore_roth@trimble.com>
2021-10-22cli, plugins: factorize usage of iso8601 datetime formatFrederic Martinsons
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com> Includes updates by Aleksander Morgado to fix coding style issues.
2021-07-29cinterion: increase ^SCFG? timeout to 120sAleksander Morgado
The timeout in this command is extremely large, because there are some modules like the EGS5 that build the response based on the current network registration, and that implies the module needs to be registered. If for any reason there is no serving network where to register, the response comes after a very long time, up to 100s. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/408
2021-07-13plugins: AT/QCDM/GPS port type hints only applicable to TTY portsAleksander Morgado
There are modems out there, that reuse the same vid:pid for multiple USB layouts, so there may be port type hints that are not really applicable in all layouts. E.g. the EM7565 in MBIM layout uses interface #0 for the MBIM port, while in QMI layout it uses interface #0 for the QCDM port (which is what the port type hint included in MM states). With these rules, if we don't bind the port type hint to TTY ports only, we would be wrongly flagging the MBIM port as possible QCDM port: <debug> [plugin/sierra] probes required for port cdc-wdm0: 'mbim' <debug> [cdc-wdm0/probe] no AT/QMI/MBIM probing in possible QCDM port <debug> [cdc-wdm0/probe] port is not AT-capable <debug> [cdc-wdm0/probe] port is not QMI-capable <debug> [cdc-wdm0/probe] port is not MBIM-capable <debug> [cdc-wdm0/probe] port probing finished: no more probings needed Avoid this, by making sure all port type hints are added exclusively to TTY ports. It's not a perfect solution, but it's enough for the known cases.
2021-07-11cinterion: ignore Intel Firmware Update service completelyAleksander Morgado
2021-07-11cinterion,shared: add missing interface prerequisitesAleksander Morgado
2021-07-10cinterion: implement custom shared reset operationAleksander Morgado
Implemented for all QMI, MBIM and AT based modems. The parent reset operation always takes priority if available.
2021-07-10cinterion: new custom MBIM modem objectAleksander Morgado
2021-06-30cinterion: fix double free when loading initial EPS contextAleksander Morgado
The properties object stored in the context is being returned as task result; so we should make sure that object is no longer left in the context so that it's not freed twice. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/395
2021-05-27cinterion: avoid maybe-uninitialized warning by GCC 10Felipe Borges
Reported at https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1371
2021-05-26cinterion: reuse the same method for load and reloadAleksander Morgado
The load_() method is used for connection monitoring; while the reload_() method is used to sync connection status after a suspend/resume operation. The same method can be used for both things in the Cinterion plugin.
2021-05-26broadband-modem-qmi: assume all QMI based modems support SIM hot swapAleksander Morgado
As we have a generic SIM hot swap implementation in the QMI broadband modem object.
2021-04-30core: strict return type in g_object_ref()Aleksander Morgado
This is now a requirement when using glib 2.56.
2021-04-29broadband-bearer: rely on profile management for the cid selectionAleksander Morgado
There is no longer need to perform all the CID selection logic in the broadband bearer connection procedure, we can rely on the new profile management operations to do the same thing. We can do this because we're sure that all the MMBroadbandModem objects implement the MMModem3gppProfileManager interface. Additionally, given that we now provide the profile ID value as part of the MMBearerConnectResult, we no longer need a custom mm_broadband_bearer_get_3gpp_cid() as we can use the generic mm_base_bearer_get_profile_id() for the same purpose.
2021-03-31cinterion: remove unused checkup of default IP familyAleksander Morgado
Looks like the logic is just there to write a debug log, as the selected IP family is not used anywhere else. Just remove this.
2021-03-21cinterion: make sure FALSE sets GError in parse_smong_response()Aleksander Morgado
The g_regex_match_full() method may return FALSE without setting the GError, so that case needs to be considered. In addition to that, the following g_assert() was not doing what it should have been, as it was comparing the address of the variable and not the variable itself; rework the code to avoid that as well: g_assert (access_tech != MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN);
2021-03-21cinterion: make sure FALSE sets GError in provcfg_response_to_cid()Aleksander Morgado
The g_regex_match_full() method may return FALSE without setting the GError, so that case needs to be considered. Reported by Jan Mazura. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/347
2021-03-21cinterion: allow '*' in Prov/Cfg responseAleksander Morgado
E.g. in a Cinterion PLS8-E (REVISION 04.004) to match the following line: ^SCFG: "MEopMode/Prov/Cfg","fallback*" Fix suggested by Jan Mazura. See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/347
2021-03-04base-modem: explicitly say if NET or TTY data ports are supportedAleksander Morgado
A modem that creates exclusively bearer objects that work with NET ports (e.g. all QMI or MBIM modems) must not add any TTY port in the list of data ports. A modem that creates exclusively bearer objects that work with TTY ports (e.g. the generic modem) must not add any NET port in the list of data ports. A modem that may use both TTY and NET ports should add all in the list of data ports. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/324 Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/329
2021-02-24kernel-device: add get_interface_number() methodAleksander Morgado
We already have methods to query for interface specific attributes like class/subclass/protocol, so add a new one for the interface number, and make sure we use ATTRS{bInterfaceNumber} to load it always, instead of assuming the ID_USB_INTERFACE_NUM property is set.
2021-02-23cinterion: rework mno decoding to use str_to_utf8()Aleksander Morgado
2021-02-23cinterion: rework band encoding to use str_to_utf8()Aleksander Morgado
Also providing support to report errors when attempting to decode the strings.
2021-02-23cinterion: move sequence to set bands to private ctxAleksander Morgado
The sequence of commands is exclusively used during the set current bands operation, so there is no point in storing it in the private object data.
2021-02-23charsets: use new str_from_utf8() instead of ↵Aleksander Morgado
take_and_convert_to_current_charset()
2021-02-03cinterion: remove unused variablesAndrew Lassalle
2020-12-14cinterion: add AT primary/secondary port type hints for PLS8Aleksander Morgado
2020-12-14cinterion: add QCDM and GPS port type hints for PLS62Aleksander Morgado
2020-12-14cinterion: add PLS83 port type hintsAleksander Morgado
2020-11-14core,plugins: consolidate connection/disconnection timeout valuesAleksander Morgado
Each different plugin or protocol had a different connection attempt value. E.g. QMI and MBIM both used 60s max for the connection attempt, while the u-blox plugin had up to 180s for ECM based connection setups. This commit consolidates all plugins and protocols to use the same timeout values for commands that may take long to respond, e.g. a connection atempt under low signal quality conditions. A value of 180s for the connection attempt steps and 120s for a disconnection attempt step is considered. Note, though, that in some cases (like a IPv4v6 setup attempt using QMI) we may have more than one such long step, so this doesn't mean that a connection attempt will always take less than 180s. Users of the connection/disconnection APIs should be able to handle the case where the attempt times out in their side (e.g. with a lower DBus request timeout), and which would not mean the actual request they did really failed. E.g. a connection attempt with a DBus timeout of 30s may fail in the user with a timeout error, but the attempt would still go on for as much as the plugin/protocol needs. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/270
2020-11-13core: stop monitoring the 'usb' subsystemAleksander Morgado
Back in Linux < 3.6 days, the cdc-wdm ports exposed by the QMI driver were flagged as owned by the 'usb' subsystem. That changed in 3.6 when the subsystem was renamed to 'usbmisc': https://mail.gnome.org/archives/networkmanager-list/2012-June/msg00125.html This patch removes all monitoring of the 'usb' subsystem completely, which is anyway a valid subsystem but for which we shouldn't need any special handling. Right now, with newer kernels, we were using that monitoring exclusively to get notified of full USB device remove events, which is really not required as we already process the port removals one by one. We simplify the logic everywhere that attempted to match either the 'usb' or 'usbmisc' subsystems, and we no longer require the explicit checks for the port name being named 'cdc-wdm[0-9]*' in the code, as that is already taken care of by the ID_MM_CANDIDATE udev tag rule.
2020-11-04cinterion: fix port reference leaksAleksander Morgado
The mm_base_modem_get_port_*() returns a full reference, we should use the mm_base_modem_peek_port_*() methods instead. Also, refactor a bit the logic because both ports are really configured in the same way, so just apply the same setup to both.
2020-11-04cinterion: source reorderAleksander Morgado
The class object definition should always be last in the file, following the interface definitions. The actual method implementations should be given before any other type system method (i.e. before even the _new() method).
2020-11-04cinterion: load initial EPS bearer cid only onceAleksander Morgado
There is no need to reload it on every settings update attempt; just load it once when the 3GPP interface is initialized, and re-use the loaded value on every new update attempt.
2020-11-04cinterion: fallback to RF on on error right awayAleksander Morgado
Don't go to next step and then check if we need to jump to the RF on step, jump right away.
2020-11-04cinterion: failure to set low power in initial EPS setting is fatalAleksander Morgado
Attempting to change the initial EPS bearer settings while in full functionality mode shouldn't happen, so make sure we don't attempt to do that if going into low power mode fails.