aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-06-23libmm-glib,modem: port mm_modem_get_sim to use GTaskBen Chan
2017-06-23libmm-glib: use g_list_copy_deep for deep copying a GListBen Chan
2017-06-23core: use g_list_copy_deep for deep copying a GListBen Chan
2017-06-23libmm-glib,manager: port mm_manager_scan_devices to use GTaskBen Chan
2017-06-23libmm-glib,manager: port mm_manager_set_logging to use GTaskBen Chan
2017-06-23libmm-glib,simple: port mm_modem_simple_connect to use GTaskBen Chan
2017-06-23libmm-glib,voice: fix object unref in list_call_context_complete_and_freeBen Chan
2017-06-23libmm-glib,modem: fix object unref in list_bearers_context_complete_and_freeBen Chan
2017-06-23libmm-glib,messaging: fix object unref in list_sms_context_complete_and_freeBen Chan
2017-06-22build: rename --with-suspend-resume to --with-systemd-suspend-resumeAleksander Morgado
And only define WITH_SYSTEMD_SUSPEND_RESUME when enabled. We already have other systemd specific features under the --with-systemd-* name scheme, so consolidate that, given that we don't have any other method to support suspend/resume notifications.
2017-06-22build: WITH_UDEV is only defined when enabledAleksander Morgado
Looks like the preprocessor doesn't choke when using #if WITH_UDEV and it isn't defined to any value, but anyway, better explicitly say that we're checking if it's defined or not.
2017-06-22build: only define WITH_SYSTEMD_JOURNAL if enabledAleksander Morgado
2017-06-22build: only define WITH_POLKIT if enabledAleksander Morgado
2017-06-21log: Add support for journal loggingTorsten Hilbrich
This logging is available if the software was build with the configure option --with-systemd-journal. It will be enabled by default if libsystemd is found. The runtime parameter --log-journal enables to output of log messages to the systemd journal. Please note that the journal priority field has the same value as the syslog level so no conversion is required here.
2017-06-21log: Introduce function pointer to handle different log backendsTorsten Hilbrich
This allows for easier additions of other logging mechanism. Using the syslog loglevel as parameter because we need to be able to map the MMLogLevel and the GLogLevelFlags to a common representation when using the log_backend in _mm_log and log_handler. The syslog level is more suitable because it supports more values than the MMLogLevel.
2017-06-21log: Add mapping from glib loglevel to syslog priorityTorsten Hilbrich
Improves readability of log_handler function.
2017-06-21log: Refactor log level text outputTorsten Hilbrich
Adding a helper function to turn the log level into the text. Also add an internal flag to disable this output. This flag will become useful when adding systemd journal support.
2017-06-21log: Refactor evaluation of log levelTorsten Hilbrich
Starting with adding a typed enum type for the log level named MMLogLevel. Suggested-By: Aleksander Morgado <aleksander@aleksander.es> The level was checked twice in _mm_log. Once at the beginning and again when turning the level into both the syslog priority and some descriptive text which was added to the log level. Removing the check at the second location as it was redundant. Also adding a helper function to turn the MMLogLevel into the syslog equivalent. This will become handy when adding support for systemd journal.
2017-06-18systemd: drop After=syslog.target ruleAleksander Morgado
syslog implementations are using socket activation nowadays, so an explicit ordering is not necessary anymore. Plus, syslog.target was already dropped from systemd in v198. Reported-by: Michael Biebl <biebl@debian.org>
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-16helpers: extend +WS46=? response parser to support rangesDaniele Palmas
Telit LTE modems could reply to +WS46=? with: +WS46: (12,22,25,28-31) This patch extends +WS46=? response parser to support ranges.
2017-06-14broadband-modem-qmi: allow prefix match for Modem images ending with '?'Dan Williams
Assume that a modem image build_id "02.08.02.00_?" matches a pri build_id of "02.08.02.00_ATT" or "02.08.02.00_GENERIC".
2017-06-07helpers: remove unnecessary `>= 0' checks on guint valueBen Chan
This CL removes the unnecessary `>= 0' check on `mode_val' and `ind_val', which are both guint values extracted from a GArray with guint values, in mm_3gpp_parse_cmer_test_response to address the following compiler warnings: mm-modem-helpers.c:2933:22: error: comparison of unsigned expression >= 0 is always true [-Werror,-Wtautological-compare] if (mode_val >= 0 && mode_val <= 3) ~~~~~~~~ ^ ~ mm-modem-helpers.c:2943:21: error: comparison of unsigned expression >= 0 is always true [-Werror,-Wtautological-compare] if (ind_val >= 0 && ind_val <= 2) ~~~~~~~ ^ ~
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-06port-serial-at: always prepend unsolicited message handlersAleksander Morgado
The generic modem has several URC handlers for generic messages, like +CIEV. But, there may be cases where the plugins themselves want to provide their own URC handlers to be run before the generic one. This patch enables this setup by always prepending the new URC handlers, so that the last ones added are processed before the ones already in the list. So if a plugin does its own unsolicited messages setup, they can run first the parent setup and then their own. The only thing to consider is that the regex provided by the plugin must be specific enough not to match the specific messages required by the parent implementation.
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-05base-bearer: use an initial longer timeout for connectivity checkAleksander Morgado
If we ask too quick for the PDP context status after a successful connection attempt reported by the modem, we may find it still flagged as inactive if the modem is still busy setting up the PPP session. Do an explicit longer initial timeout before we run the first check, and after that one setup the additional checks at a higher rate. Reported-by: Colin Helliwell <colin.helliwell@ln-systems.com>
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-29broadband-modem: query +CMER format before enabling/disablingAleksander Morgado
Don't blindly try '+CMER=3,0,0,1' to enable and '+CMER=0' to disable Mobile Equipment Event Reporting. We now query the device for the supported formats and use that info to build commands that will work.
2017-05-29helpers: new 'AT+CMER=?' parserAleksander Morgado
2017-05-29cinterion: support changing modes in LTE capable devicesAleksander Morgado
2017-05-29udev: remove default ID_MM_PLATFORM_DRIVER_PROBE whitelistAleksander Morgado
The whitelist made all platform TTYs managed by the 'atmel_usart' kernel driver probed by ModemManager, which isn't something we want, as most of these aren't broadband modems. We leave the logic supporting the ID_MM_PLATFORM_DRIVER_PROBE udev tag as there may be a case where the user does need ModemManager to probe a given platform TTY.
2017-05-29log: remove func loc info unless MM_LOG_FUNC_LOC is definedAleksander Morgado
The user can build the project passing custom CFLAGS to enable the function location information, e.g.: $ ./configure --prefix=/usr CFLAGS="-DMM_LOG_FUNC_LOC"
2017-05-29context: rework application options and help outputAleksander Morgado
Group together all options that allow configuring the logging output, and make them have the same --log-[XXX] prefix. Also rework the --help output so that all option groups are printed by default (i.e. there is no longer a --help-all option).