summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* bearer-mbim: fine-tune bearer IP method reportingDan Williams2016-05-031-23/+43
| | | | | | | | | | | | | | v4: modems/providers may not return DNS servers and not all modems support DHCP, so lack of DNS servers should not indicate a bearer IP method of "DHCP". IP config daemon/scripts already have to handle missing DNS anyway. v6: IPv6 requires SLAAC or DHCPv6 as part of the specification, so for now we assume modems will support it. Provide all the info the modem sent, but if there is any missing information use an IP method of "DHCP" to indicate that info should be obtained via SLAAC/DHCPv6. Only use an IP method of "STATIC" when all basic properties are given by the modem.
* bearer-qmi: listen for Packet Service Status indication and handle disconnectionDan Williams2016-04-151-0/+139
| | | | | Hook up to the WDS Packet Service Status indication, listen for disconnection events, and disconnect the bearer when we get one.
* port-probe: fix missing task disposalsAleksander Morgado2016-04-131-0/+2
|
* port-probe: make sure stored task pointer is set to NULL before completingAleksander Morgado2016-04-081-84/+100
| | | | | | | | | | | | | | | | | | | | When we were completing tasks in idle, the logic was like this: * Schedule task completion in idle * self->priv->task = NULL * (idle) Task completion callback called This meant that the self->priv->task was always set to NULL before the completion callback was called, which is what we wanted as a new task may be scheduled in the callback itself. Now, without completing in idle, we were wrongly doing: * Task completion callback called * self->priv->task = NULL This commit fixes the logic by making sure self->priv->task = NULL before any task completion.
* device: port probe may be in the ignored listAleksander Morgado2016-03-271-2/+7
|
* context: use G_OPTION_ARG_FILENAME when a file path is expectedAleksander Morgado2016-03-271-2/+2
|
* context: fix --help outputAleksander Morgado2016-03-271-2/+2
| | | | | | | | | | | | The options that require an argument should explicitly specify so. Before: --log-level=INFO Log level: one of [ERR, WARN, INFO, DEBUG] --log-file Path to log file After: --log-level=[LEVEL] Log level: one of ERR, WARN, INFO, DEBUG --log-file=[PATH] Path to log file
* base-modem: remove unused 'mm_base_modem_get_port()' methodAleksander Morgado2016-03-272-27/+0
|
* base-modem: remove unused 'mm_base_modem_owns_port()' methodAleksander Morgado2016-03-272-11/+0
|
* base-modem: remove unused 'mm_base_modem_release_port()' methodAleksander Morgado2016-03-272-85/+0
|
* serial: do not restore termios on port closeTomas Jura2016-03-261-10/+0
|
* port-probe: unlink the task from probe before completing itLubomir Rintel2016-03-221-2/+5
| | | | | | | | | The task completion may try to enqueue a next probe task and in mm_port_probe_run() it asserts there's no task linked. https://bugs.freedesktop.org/show_bug.cgi?id=94664 Fixes: 1939c5ace50240127276efacec5c7f166483bb79
* build: rename sleep monitor source file, only one implementation availableAleksander Morgado2016-03-212-1/+1
|
* UPower signaling obsolescencepoma2016-03-212-155/+0
| | | | | | | | | | | | "Newer upower versions no longer emit that signal since this handled by systemd." by Michael Biebl <mbiebl@gmail.org> https://lists.freedesktop.org/archives/devkit-devel/2014-March/001575.html See also "Plans for UPower 1.0" by Richard Hughes <hughsient@gmail.com> https://lists.freedesktop.org/archives/devkit-devel/2013-January/001339.html Signed-off-by: poma <pomidorabelisima@gmail.com>
* build: end all multiline list variables with $(NULL)Aleksander Morgado2016-03-151-10/+20
| | | | | So that appending a new item in the list only inserts one new line (i.e. the last $(NULL) is the last item always).
* build,core: update build rulesAleksander Morgado2016-03-152-262/+152
| | | | | | | | | We try to combine in common envvars the compiler and linker flags shared by the different components, and where possible, also re-using the implicit AM_CFLAGS and AM_LDFLAGS variables that automake provides, and which apply to all objects being built in the same Makefile.am. The internal libmodem-helpers.la library is also renamed to libhelpers.la
* modem-helpers: fix handling split PDP context ID reporting in CGDCONT=? responseDan Williams2016-03-152-1/+17
| | | | | Cinterion PHS8-US devices send split PDP context ID like "(1-17,101-112)" and that caused the modem-helpers to choke.
* port-probe: simplify task completionAleksander Morgado2016-03-111-149/+81
| | | | | We no longer need to complete in idle, because the limitation imposed by the serial port methods no longer exists.
* port-serial: allow completions not in idleAleksander Morgado2016-03-111-50/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Port serial command completions may be performed in several different places: * When a cached response is set during command sending. * When errors happen during command sending. * When we process a response (i.e. common_input_available()) * When we process a timeout (i.e. port_serial_timed_out()) * When cancelled (i.e. port_serial_response_wait_cancelled()) We're currently safe with the previous logic only because the users of the serial port explicitly complete operations in idle, which means that whenever we're processing in a internal callback (e.g. during response or timeout processing) the serial port object is valid for as long as the callback runs. But, if we ever end up using the serial port with a not-in-idle completion, it may happen that if the command is completed within a internal signal callback the serial port object may get fully closed and unref-ed before exiting the callback. We could force a valid port reference to exist as long as the internal signal is scheduled, but then we may lose the ability to automatically close the port during a full unref(), as the internal signals are set as long as the port is open. So, to cope with this possibility of not-in-idle completion, we instead force references to be valid whenever we see that a command completion may happen, which is basically whenever port_serial_got_response() is called; but we only do that if we're going to use the port object after that, otherwise, we ignore the problem. In addition to the problems with the references, we also update the common_input_available() method so that the source isn't kept if the last response buffer processing ended up closing the port.
* plugin-manager: allow early cancel of port tasks when they haven't been run yetAleksander Morgado2016-03-091-11/+48
|
* port-probe: allow cancellationAleksander Morgado2016-03-093-476/+533
|
* plugin: allow cancellation of the port probe operationAleksander Morgado2016-03-093-130/+117
|
* plugin-manager: refactor device/port support checks and allow cancellationsAleksander Morgado2016-03-093-587/+1222
|
* plugin-manager: improve logging when loading pluginsAleksander Morgado2016-03-091-17/+17
|
* broadband-modem: fix +CPMS empty parameter supportCarlo Lobrano2016-03-096-1/+256
| | | | | | | | | | | | | | * Add new async virtual method init_current_storages to MMIfaceModemMessaging * Add logic of init_current_storages to MMBroadbandModem * Add step "INIT_CURRENT_STORAGES" in MMIfaceModemMessaging initialization in order to load and store current SMS storages for mem1 and mem2. * Add usage of current sms storage value for mem1 in place of an empty string parameter when the command AT+CPMS is used. https://bugs.freedesktop.org/show_bug.cgi?id=93135
* helpers: fix check for pid when creating device identifierAleksander Morgado2016-03-021-1/+1
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=94364
* proxmark3 is not a modem, blacklist it.Michael Farrell2016-02-201-0/+3
| | | | | | | | | | | | | | | ModemManager locks the proxmark3 when it is connected. As it is not a modem, ModemManager shouldn't be talking to it. At present, the recommended action in the proxmark3 documentation is to purge ModemManager to fix this issue. Note that this vendor uses an unregistered USB device ID, so it is instead matched by the manufacturer string. References: - http://store.ryscc.com/blogs/news/45802433 - http://www.proxmark.org/forum/viewtopic.php?id=1759
* modem-helpers: regex creation should never failAleksander Morgado2016-02-131-4/+3
| | | | | We should really consider errors if we expect that the regex string may not compile; but in this case the pattern is fixed, so should never happen.
* helpers: move +CRSM parsing to mm_3gpp_parse_crsm_responseThomas Sailer2016-02-134-79/+151
| | | | | | Also added test cases. Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
* helpers: allow optional quotes in +CREG: <stat>,"<lac>","<ci>"Thomas Sailer2016-02-132-3/+34
| | | | | | | | GSM 07.07 CREG=2 unsolicited pattern. Added testcase for Thuraya XT. Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
* broadband-modem-qmi: fix compile errors with newest QMI commands enabledDan Williams2016-02-111-8/+16
|
* broadband-bearer: don't send disconnect CGACT on data port for multi-port modemsDan Williams2016-02-111-3/+11
| | | | | | | | | | | | | | | A Huawei E173 (with FW 11.126.15.00.445) seems to stop responding on the primary port (ttyUSB2) when the CGACT is resent on the data port (ttyUSB0). The CGACT-on-data-port was originally added as a fallback attempt to get single-port modems to disconnect when all other methods failed. For single-port modems, the primary port is also the data port so this patch will have no effect. For multi-port modems, this patch will retry the CGACT on the primary port which has a higher chance of success because we already know the primary port is talking to us, while the data port may still be stuck in PPP mode.
* modem-helpers: allow optional whitespace in +CGDCONT responseThomas Sailer2016-02-112-2/+16
| | | | | | Add testcase for Thuraya XT. Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
* qmi: just one InvalidCommand error is enough to avoid all DMS UIM commandsAleksander Morgado2016-02-113-63/+77
| | | | | | | The MMBroadbandModemQmi will not create a MMSimQmi until the unlock status has been checked, and therefore this means that when the SIM object is being created we already know whether the modem supports DMS UIM commands or not, so avoid further fallbacks in the SIM object.
* sim-qmi: implement SIM verify/unblock/change/enable with UIM serviceAleksander Morgado2016-02-112-55/+499
| | | | | | | | | | | Newer modems like the MC7455 don't implement the "DMS UIM" commands in the DMS service, and therefore these modems need to use the UIM service directly. We include a new flag to detect whether any of the DMS UIM commands is flagged as invalid, and if so, we'll fallback to the UIM specific implementations for all. libqmi version bump to 1.13.7, which includes the new required methods.
* broadband-modem-qmi: implement unlock retries loading with UIM serviceAleksander Morgado2016-02-111-121/+236
| | | | | Newer modems like the MC7455 don't implement the "DMS UIM" commands in the DMS service, and therefore these modems need to use the UIM service directly.
* serial: remove duplicated ECHO & ECHOETomas Jura2016-02-111-1/+0
|
* sim-qmi: port to GTaskAleksander Morgado2016-01-301-275/+176
|
* broadband-modem-qmi: plug memleak when listing SMS messagesAleksander Morgado2016-01-301-0/+1
|
* broadband-modem-qmi: locked states also indicate readiness of the SIM cardAleksander Morgado2016-01-301-2/+7
| | | | | When the card application is flagged as needing PIN or PUK, then the card can be considered as being ready.
* broadband-modem-qmi: use "UIM Get Card Status" if "DMS UIM" command unavailableAleksander Morgado2016-01-241-62/+390
| | | | | The newer modules like the MC7455 which support multiple SIM cards won't implement the legacy "DMS UIM" commands.
* bearer-qmi: use static IP if LLP is raw-ipAleksander Morgado2016-01-243-5/+31
| | | | | When using raw-ip we'll default to request static IP setup for now, so that we don't rely on the DHCP client supporting raw-ip interfaces.
* port-qmi: support new Qualcomm chipsets working always in raw-ipAleksander Morgado2016-01-241-57/+294
| | | | | | | | | | | | | | | | The port opening logic is changed completely. Before this change, the logic would only try 802.3 setting via CTL when the QmiDevice was being open. With this new change, instead, we'll use WDA and the new libqmi APIs to query the link layer protocol expected by both the device and the kernel. If the LLP matches in both, we assume we're done; if they differ we'll try to update the LLP expected by the kernel to the one setup in WDA. This change will allow us to run with the modem using raw-ip if that is what WDA reports by default. Also bumped the libqmi version to 1.13.6, which has support for the new required APIs.
* port-serial: rework response parsingAleksander Morgado2016-01-235-148/+194
| | | | | | | | | | | | | | | | | | Response parsing was being done in different places for AT and QCDM subclasses; in the case of AT it was being done early, before returning the byte array in the mm_serial_port_command_finish() response. In the case of QCDM, it was being done after mm_serial_port_command_finish(), and that was forcing every caller to cleanup the response buffer once the response was processed. With the new logic in this patch, the response is always parsed (i.e. looked for a valid response or an error detected) before mm_serial_port_command_finish() returns, and actually this method now returns a totally different GByteArray, not the internal response buffer GByteArray, so there's no longer any need for the caller to explicitly clean it up. The one doing the cleanup is the parser method itself in every case. This change also allows us to return serial port responses in idle, but that's not changed for now as there's no immediate need.
* port-serial: remove response buffer when an error is returnedAleksander Morgado2016-01-231-4/+16
| | | | | | | | | | | | | | | | | | | | | When valid responses were returned to the caller of the serial command, the caller itself was responsible for removing from the GByteArray the data that it was successfully processed (all the data in AT, just 1 message in QCDM). But, the same logic was missing for the case of errors; we were not explicitly removing the response and therefore in some cases we would see it propagated into the next command response. It was common to see this issue when the echo removal was disabled in the serial port, as in Option/HSO modems: <debug> (ttyHS3): --> 'AT+CNUM<CR>' <debug> (ttyHS3): <-- '<CR><LF>+CME ERROR: 14<CR><LF>' <debug> Got failure code 14: SIM busy <debug> (ttyHS3) device open count is 1 (close) <warn> couldn't load list of Own Numbers: 'Failed to parse NV MDN command result: -17' <debug> (ttyHS3) device open count is 2 (open) <debug> (ttyHS3): --> 'AT_OPSYS?<CR>' <debug> (ttyHS3): <-- '<CR><LF>_OPSYS: 1,2<CR><LF><CR><LF>OK<CR><LF>' <warn> couldn't load current allowed/preferred modes: 'Couldn't parse OPSYS response: '+CME ERROR: 14 _OPSYS: 1,2''
* bearer-qmi: print IP details at 'info' log levelDan Williams2016-01-191-21/+21
|
* broadband-modem: plug memleaks when processing QCDM responsesAleksander Morgado2016-01-171-0/+2
|
* broadband-modem,time: make sure that error is set when operation failsAleksander Morgado2016-01-161-5/+9
|
* broadband-modem,voice: fix regex leakAleksander Morgado2016-01-121-0/+1
|
* mbm: query supported modes to the modem with +CFUN=?Aleksander Morgado2016-01-102-62/+66
| | | | | | | | | | | | | | | | | | | | | | | | | We were trying to load the generic modes supported reported by either *CNTI=2 or AT+WS46=?, so that then we could filter out the MBM-specific modes unsupported. But, this may not be ideal, as both these two commands may fail: [mm-broadband-modem.c:1612] modem_load_supported_modes(): loading supported modes... [mm-port-serial.c:1237] mm_port_serial_open(): (ttyACM1) device open count is 3 (open) [mm-port-serial.c:1294] _close_internal(): (ttyACM1) device open count is 2 (close) [mm-port-serial-at.c:440] debug_log(): (ttyACM1): --> 'AT*CNTI=2<CR>' [mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- '<CR><LF>ERROR<CR><LF>' [mm-serial-parsers.c:364] mm_serial_parser_v1_parse(): Got failure code 100: Unknown error [mm-broadband-modem.c:1546] supported_modes_cnti_ready(): Generic query of supported 3GPP networks with *CNTI failed: 'Unknown error' [mm-port-serial.c:1237] mm_port_serial_open(): (ttyACM1) device open count is 3 (open) [mm-port-serial.c:1294] _close_internal(): (ttyACM1) device open count is 2 (close) [mm-port-serial-at.c:440] debug_log(): (ttyACM1): --> 'AT+WS46=?<CR>' [mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- '<CR><LF>ERROR<CR><LF>' [mm-serial-parsers.c:364] mm_serial_parser_v1_parse(): Got failure code 100: Unknown error [mm-broadband-modem.c:1494] supported_modes_ws46_test_ready(): Generic query of supported 3GPP networks with WS46=? failed: 'Unknown error' [mm-iface-modem.c:3974] load_supported_modes_ready(): couldn't load Supported Modes: 'Couldn't retrieve supported modes' Instead, we'll ask the modem for the list of modes supported, and return that directly.