aboutsummaryrefslogtreecommitdiff
path: root/plugins
AgeCommit message (Collapse)Author
2017-06-30telit: minor coding style fixesAleksander Morgado
Always name 'self' the object being implemented.
2017-06-30telit: port mm-broadband-modem-telit to use GTaskDaniele Palmas
2017-06-29telit: port mm-common-telit to use GTaskDaniele Palmas
2017-06-28enums: replace Roman numeral suffixes in MM_MODEM_BAND_EUTRAN_*Ben Chan
3GPP TS 36.101 Table 5.5-1 refers the E-UTRA operating bands as 1, 2, 3, ..., etc.
2017-06-16telit: fix #PSNT values interpretation for HSDPA and LTE modemsDaniele Palmas
Telit LTE modems use #PSNT: 4 for LTE access technology, and #PSNT: 5 for unknown access technology, while HSDPA modems use #PSNT: 4 for unknown access technology. This patch fixes those #PSNT values interpretation according to the modem capabilities.
2017-06-06cinterion: use ^SIND unsolicited messages for access tech reportingAleksander Morgado
If the modem supports ^SIND psinfo reporting, we enable the URC and flag the access technology polling unsupported, so that we only update access technology via the +CIEV URCs. E.g.: (ttyACM1): --> 'AT^SIND="psinfo",1<CR>' (ttyACM1): <-- '<CR><LF>^SIND: psinfo,1,10<CR><LF><CR><LF>OK<CR><LF>' Reporting initial access technologies... Modem /org/freedesktop/ModemManager1/Modem/0: access technology changed (unknown -> hsdpa, hsupa) ... (ttyACM1): <-- '<CR><LF>+CIEV: psinfo,4<CR><LF>' Modem /org/freedesktop/ModemManager1/Modem/0: access technology changed (hsdpa, hsupa -> edge) ...
2017-06-06iface-modem: if bands, capabilities or modes change, refresh signalAleksander Morgado
We also remove the explicit refresh request from the Cinterion plugin, as this is a generic action applicable to all modems that require polling for signal quality and/or access technology.
2017-06-06iface-modem: consolidate signal quality and access tech pollingAleksander Morgado
Plugins have two ways to update signal quality and access technology values: via unsolicited messages or via polling periodically. Instead of keeping separate contexts for polling signal quality and access technology values, we setup a common timeout to trigger both. This allows us to simplify in which case the explicit update is required, whenever one is needed to be explicitly updated, the other one should also be. The logic now also allows plugins to return an UNSUPPORTED error in either load_signal_quality() and/or load_access_technologies() to tell the interface logic that the polling of the specific item shouldn't be performed (e.g. if the updates are expected via unsolicited messages). If both signal quality and access technology polling is flagged as disabled, we totally disable the polling logic internally. The new SignalCheckContext is bound to the lifetime of the object so that we can keep the value of the supported flags until the object is destroyed.
2017-06-05build,dell: reorder rules lastAleksander Morgado
Dell plugin is a compilation of other plugins, move last.
2017-06-05build,telit: fix distcheckAleksander Morgado
2017-06-05telit: rework QSS unsolicited handler enabling logicAleksander Morgado
When the async method starts we store already the primary and the optional secondary port objects in the method context, keeping a full reference for each. When we parse the response for the enabling command, we just reuse the stored port objects, instead of re-querying the modem to get them, and this makes sure that the port objects where we want to set the unsolicited message handlers are still valid. If the ports are gone in the middle of the enabling operation, the handlers will be set without errors, even if the ports may likely get completely disposed when this async method context is disposed. Additionally, we make sure that we return an error also for the case where there is no secondary port and the enabling on the primary port failed. This patch also fixes the use of the at_command_full_finish() method to complete the at_command_full() async operation, to keep consistency.
2017-06-05telit: make sure QSS status values read are always knownAleksander Morgado
Given that the MMTelitQssStatus enums are mapped directly to the values read from the #QSS response, we need to make sure that we never return a value for which we don't have an enum defined. Also, use set_error() instead of the propagate_error() + error_new() combo.
2017-06-05telit: manage QSS transitionsCarlo Lobrano
Currently, Telit's SIM swap implementation is stateless and based on #QSS unsolicited messages 0/1 (SIM_REMOVED/SIM_INSERTED). However, the user might have configured the modem in order to provide a more detailed information, with #QSS values 2/3 (SIM UNLOCKED/SIM READY). In this case and with current implementation, even receiving "#QSS: 3" will trigger the "SIM swap" logic. The same issue might occur in other use cases too, i.e. with SIM locked or when the message is received from both USB ports. This patch makes SIM swap implementation stateful, and it considers as an actual SIM swap, only transitions from #QSS: 0 to #QSS: 1/2/3 and vice versa.
2017-06-02huawei: let the E3372 run NDISDUP via TTYAleksander Morgado
This modem ends up exposing a cdc-wdm port and a WWAN network interface, but the cdc-wdm port is totally unusable, it won't reply to any AT command or anything. Instead this modem can do NDISDUP via TTY, which is what the Windows drivers are also doing.
2017-05-30cinterion: retry GPS Engine activation up to 3 timesAleksander Morgado
The default setup with 100ms between GPS commands doesn't seem to be always enough for the Engine activation step: [1495016625.392972] (ttyACM1): --> 'AT^SGPSC="NMEA/Output","on"<CR>' [1495016625.503885] (ttyACM1): <-- '<CR><LF>^SGPSC: "Nmea/Output","on"<CR><LF><CR><LF><CR><LF>OK<CR><LF>' [1495016625.607650] (ttyACM1): --> 'AT^SGPSC="Power/Antenna","on"<CR>' [1495016625.697862] (ttyACM1): <-- '<CR><LF>^SGPSC: "Power/Antenna","on"<CR><LF><CR><LF>OK<CR><LF>' [1495016625.809393] (ttyACM1): --> 'AT^SGPSC="Engine","1"<CR>' [1495016625.895970] (ttyACM1): <-- '<CR><LF>+CME ERROR: 767<CR><LF>' We now setup up to 3 retries for the Engine activation step before returning an error, and we also update to 2000ms the wait time before the Engine activation command is run.
2017-05-30cinterion: support AT^SGPSC capable modemsAleksander Morgado
The AT^SGPSS command provides an easy way to just start/stop GPS, but unfortunately it isn't supported by all Cinterion modems. The AT^SGPSC command instead is more widely available but it requires several steps to start and stop the different elements of the GPS receiver. Implement support for both, preferring AT^SGPSSS if available and falling back to AT^SGPSC otherwise.
2017-05-30cinterion: setup GPS port only if GPS support detectedAleksander Morgado
i.e. if AT^SGPSS not supported, we don't even add traces handler to the GPS data port.
2017-05-30cinterion: flag PLS8 GPS data portAleksander Morgado
2017-05-30cinterion,location: refactor enable/disable and capabilities checksAleksander Morgado
When checking for location capabilities, we will make sure AT^SGPSS is supported and if it isn't we won't report GPS capabilities. The location enable and disable paths are refactored to make it easier to add possible new GPS commands to use instead of AT^SGPSS, if this isn't supported (e.g. in the PLS8 devices).
2017-05-30plugins: use G_N_ELEMENTS when iterating ports arrayAleksander Morgado
2017-05-30ublox: use send-delay=0 by defaultAleksander Morgado
Looks like the u-blox SARA-U260 requires this, see: https://lists.freedesktop.org/archives/modemmanager-devel/2017-May/004670.html
2017-05-30altair,hso,samsung: setup send-delay=0 for probingAleksander Morgado
The Altair, Option HSO and Samsung plugins all use the send-delay=0 setting once the modem object has been created. For consistency, use the same setting during port probing.
2017-05-29telit: remove custom +CMER enablingAleksander Morgado
This is now managed directly in the generic plugin.
2017-05-29cinterion: remove custom +CMER enablingAleksander Morgado
This is now managed directly in the generic plugin.
2017-05-29cinterion: support changing modes in LTE capable devicesAleksander Morgado
2017-05-29dell: speed probing time up and reduce udev dependencyCarlo Lobrano
Currently Dell plugin implements a retry logic of three commands (AT+GMI, AT+CGMI, ATI1I2I3) to detect modem's vendor string. Moreover, since Telit modems always reply to the first command, to speed the probing time up, those modem are tagged with an Udev rule so that we can avoid sending the other two commands at all. However, the retry logic is in case a port needs some time to reply, so it makes sense to apply it only to the first command. Then if the port still does not respond with any kind of reply, that probably means that it is not AT capable and we can skip the other AT commands as well. Then, this patch: - sets a maximum number of timeouts for AT+GMI to 3. After this timeouts, the port is considered not AT-capable. - sets AT+CGMI and ATI1I2I3 to be sent only once. - removes Dell udev rule for tagging Telit Modems.
2017-05-29telit: removed ID_MM_TELIT_PORTS_TAGGED dependencyCarlo Lobrano
Currently, Telit plugin depends on ID_MM_TELIT_PORTS_TAGGED environment variable, set by udev, for tagging modems that support dynamic port config (#PORTCFG) To remove this dependency from udev, Telit plugin now relies only on the error management of the command AT#PORTCFG? itself in order to see whether the modem supports it or not.
2017-05-21cinterion: don't enable simstatus URCsAleksander Morgado
When polling for the SIM status, we want to read the value (mode 2) without enabling indications (mode 1).
2017-05-21mbm: fix async method completion enabling unsolicited eventsAleksander Morgado
2017-05-10ublox: align property values in g_object_new()Aleksander Morgado
2017-05-10ublox: support modems connected to serial portJavier Viguera
Add the vendor string, so it can be probed via AT commands. This allows to support modems that are connected to a serial port. Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2017-04-19telit: give load lock retries steps a descriptive nameCarlo Lobrano
In order to make debug logging more clear, I replaced the step ID with a descriptive step name.
2017-04-19telit: use mm_get_uint_from_hex_str() to parse CSIM hex responseAleksander Morgado
The regex is already limiting the string to 4 hex chars, so we can definitely fit the number in a guint, no need a guint64.
2017-04-19telit: add error_code recognition to +CSIM parserCarlo Lobrano
- Refactored mm_telit_parse_csim_response in order to correctly recognize the following +CSIM error codes: * 6300 - Verification failed * 6983 - Authentication method blocked * 6984 - Reference data invalidated * 6A86 - Incorrect parameters * 6A88 - Reference data not found - Updated correspondent tests. - Finally, some minor changes in other files for better error logging Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=100374
2017-04-18core: prefer g_task_return_error_if_cancelled() than custom errorsAleksander Morgado
When the GCancellable is added to the GTask, we can use a single method call to check for the task being cancelled, and complete it right away if so. This patch also clears up the logic in the Novatel plugin, where the code was trying to return "TRUE" when the task was cancelled, but wouldn't work as the check-cancellable flag in the GTask is TRUE by default (i.e. when completing the GTask, if it was cancelled, a G_IO_ERROR_CANCELLED would be returned by default, regardless of any other return value set). This patch also introduces a small variation of the logic in the Cinterion plugin: instead of running SWWAN=0 before completing the async action, the command is now sent just after completion of the async action. This shouldn't be an issue, as the SWWAN result itself is ignored.
2017-04-18telit: ignore custom flow control handlingAleksander Morgado
The generic modem object already supports querying for the supported methods and setting the best one found.
2017-04-18wavecom: ignore custom flow control handlingAleksander Morgado
The generic modem object already supports querying for the supported methods and setting the best one found.
2017-04-17broadband-modem-novatel: $NWRSSI can report lower values than -115Dan Williams
My E725 reported 125 once; that's a valid dBm and MM shouldn't report an error when parsing it.
2017-04-17broadband-modem-novatel: clean up detailed registration state handlingDan Williams
Allocate the results instead of passing them back on the stack, which removes the "can't complete in idle" restriction. Also always open the QCDM port since we can't assume it will be open already at this point.
2017-04-17broadband-modem-novatel: clean up access technology reportingDan Williams
Instead of mixing the QCDM Novatel Snapshot code directly into the access technology checking code, split it out with its own async result. At the same time, make sure to open the QCDM port when it's needed, instead of assuming its already open. Since it won't always be.
2017-04-15telit: unsupported CSIM lock should not skip loading unlock retriesCarlo Lobrano
Some modems do not support CSIM lock/unlock, but they do support querying SIM unlock retries through +CSIM command. If CSIM lock returns with "unsupported command" do not propagate the error and continue with the other CSIM queries instead, moreover the CSIM lock feature is signed as FEATURE_UNSUPPORTED in Telit modem private structure to prevent being sent again (e.g. calling CSIM unlock AT command).
2017-04-07novatel: obtain MMPortProbe from GTask source objectBen Chan
The MMPortProbe object is already referenced by the GTask object for custom init. Instead of keeping another reference of MMPortProbe in the CustomInitContext, this patch changes the code to simply obtain it from the source object of GTask. See https://lists.freedesktop.org/archives/modemmanager-devel/2017-April/004420.html
2017-04-06telit: fix AT+SERVICE 3GPP2 access technology reportingDan Williams
Looks like a C&P error from the AT#PSNT codepath; all the docs I can find indicate that AT+SERVICE returns only an integer and no commas: <debug> (ttyUSB2): --> 'AT+SERVICE?<CR>' <debug> (ttyUSB2): <-- '<CR><LF>+SERVICE: 3<CR><LF><CR><LF>OK<CR><LF>' <debug> Couldn't refresh access technologies: 'Failed to parse +SERVICE response: '+SERVICE: 3''
2017-04-06novatel: port IMSI loading to use GTaskBen Chan
2017-04-06novatel: port custom init to use GTaskBen Chan
2017-04-06novatel-lte: revert to original plugin library nameBen Chan
Commit f9c63bfa0 "build,plugins: update build rules" accidentally changed the Novatel LTE plugin from 'libmm-plugins-novatel-lte.so' to 'libmm-plugins-novatel_lte.so'. The name becomes inconsistent with other plugin names.
2017-04-02broadband-modem: normalize also operator codeAleksander Morgado
The operator code (MCCMNC) may also be given encoded in the current charset (e.g. UCS2). Based on a patch from Colin Helliwell <colin.helliwell@ln-systems.com>
2017-04-02modem-helpers: if operator not in UCS2, see if already valid UTF-8Aleksander Morgado
The method doing the operator name normalization takes as input the current configured modem charset. If this is UCS2, we will now just assume this is a hint: the string may or may not come in hex/UCS2. This logic makes the custom operator name loading in Huawei unneeded, if the modem is configured in UCS2, we still properly process operator names coming in plain ASCII.
2017-03-29plugins: remove explicit GDestroyNotify cast on g_free / g_object_unrefBen Chan
g_free and g_object_unref are in form of `void (*)(gpointer)`, which matches the GDestroyNotify signature. An explicit GDestroyNotify cast on g_free and g_object_unref is thus not needed.
2017-03-28telit: support QMI and MBIM modemsDaniele Palmas
Vendor specific plugins that support QMI or MBIM based devices need to handle the creation of these modems themselves. https://bugs.freedesktop.org/show_bug.cgi?id=100372 Original patch by Aleksander Morgado.