aboutsummaryrefslogtreecommitdiff
path: root/src/mm-port-probe.c
AgeCommit message (Collapse)Author
2016-03-11port-probe: simplify task completionAleksander Morgado
We no longer need to complete in idle, because the limitation imposed by the serial port methods no longer exists.
2016-03-09port-probe: allow cancellationAleksander Morgado
2015-12-02core: use G_SOURCE_REMOVE and G_SOURCE_CONTINUE in GSourceFuncsAleksander Morgado
2014-12-03port-probe: retry icera probing up to 3 times, with some time in between cmdsAleksander Morgado
Icera-based modems need to return a correct response to the AT%IPSYS? command, so that they are properly detected as being Icera-based. Now, some modems, like the Nokia 21M-02, don't seem to return a correct response to AT%IPSYS just after being plugged in. So, setup a retry mechanism (3 retries, with 2 seconds between retries) to try to cope with this issue. https://bugs.freedesktop.org/show_bug.cgi?id=85012 Logs from the error situation: [mm-port-serial-at.c:440] debug_log(): (ttyACM0): --> 'ATE1 E0<CR>' [mm-port-serial-at.c:440] debug_log(): (ttyACM2): --> 'ATE1 E0<CR>' [mm-port-serial-at.c:440] debug_log(): (ttyACM1): --> 'ATE1 E0<CR>' [mm-port-serial-at.c:440] debug_log(): (ttyACM0): <-- 'E0' [mm-port-serial-at.c:440] debug_log(): (ttyACM0): <-- '<CR><CR><LF>ERROR<CR><LF>' [mm-serial-parsers.c:364] mm_serial_parser_v1_parse(): Got failure code 100: Unknown error [mm-port-probe-at.c:43] mm_port_probe_response_processor_is_at(): Parsing AT got: 'Unknown error' [mm-port-probe.c:155] mm_port_probe_set_result_at(): (tty/ttyACM0) port is AT-capable [mm-port-serial-at.c:440] debug_log(): (ttyACM2): <-- 'ATE1 E0' [mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- ' E0' [mm-port-serial-at.c:440] debug_log(): (ttyACM2): <-- '<CR>' [mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- '<CR><CR><LF>ERROR<CR><LF>' [mm-serial-parsers.c:364] mm_serial_parser_v1_parse(): Got failure code 100: Unknown error [mm-port-probe-at.c:43] mm_port_probe_response_processor_is_at(): Parsing AT got: 'Unknown error' [mm-port-probe.c:155] mm_port_probe_set_result_at(): (tty/ttyACM1) port is AT-capable [mm-port-serial-at.c:440] debug_log(): (ttyACM2): <-- '<CR><LF>OK<CR><LF>' [mm-port-probe.c:155] mm_port_probe_set_result_at(): (tty/ttyACM2) port is AT-capable [mm-port-serial-at.c:440] debug_log(): (ttyACM0): --> 'AT%IPSYS?<CR>' [mm-port-serial-at.c:440] debug_log(): (ttyACM1): --> 'AT%IPSYS?<CR>' [mm-port-serial-at.c:440] debug_log(): (ttyACM2): --> 'AT%IPSYS?<CR>' [mm-port-serial-at.c:440] debug_log(): (ttyACM0): <-- 'AT%IPSYS?' [mm-port-serial-at.c:440] debug_log(): (ttyACM0): <-- '<CR>' [mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- 'AT%IPSYS?' [mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- '<CR><CR><LF>ERROR<CR><LF>'
2014-10-15qcdm: don't retry probing if QCDM unescaping failsAleksander Morgado
But keep the retries when the frame marker isn't found. https://bugzilla.gnome.org/show_bug.cgi?id=708861
2014-09-05plugin: allow to explicitly ignore any kind of port via udevAleksander Morgado
The new 'ID_MM_PORT_IGNORE' tag will tell ModemManager to fully avoid using a given port. Note that it is key to not only flag the port probe as ignored, but also to fully ignore the ports in e.g. mm_port_probe_list_has_qmi_port() as those methods will be used to decide which kind of modem object to create. We don't want to create a QMI-based modem which may have all QMI ports blacklisted.
2014-06-23port: store parent sysfs path in each MMPortAleksander Morgado
2014-05-20core: minor coding style fixesBen Chan
2014-04-03port-probe: remove the 3s wait before opening a MBIM portBen Chan
The 3s wait before opening a MBIM port is not necessary for handling a delayed response to the MBIM OPEN messages. mbim_device_open() already retries the MBIM OPEN message when the MBIM device does not respond.
2014-02-13plugin: allow probing non-tty AT portsAleksander Morgado
2014-02-13port-serial-at: allow specifying subsystem when creating a 'MMPortSerialAt'Aleksander Morgado
Don't just assume that all AT ports are TTYs.
2014-02-13port-serial-qcdm: commands are never cachedAleksander Morgado
The QCDM port commands are never cached, so remove the option from the command() method. Will also simplify command caching afterwards as it will be an AT-only thing.
2014-02-13port-serial: use GIO Async API like method for flash()Aleksander Morgado
2014-02-13port-serial-at: use GIO Async API like methodsAleksander Morgado
2014-02-13port-serial-qcdm: use GIO Async API like methodsAleksander Morgado
2014-02-13ports: rename 'MMMbimPort' to 'MMPortMbim'Aleksander Morgado
2014-02-13ports: rename 'MMQmiPort' to 'MMPortQmi'Aleksander Morgado
2014-02-13ports: rename 'MMAtSerialPort' to 'MMPortSerialAt'Aleksander Morgado
2014-02-13ports: rename 'MMQcdmSerialPort' to 'MMPortSerialQcdm'Aleksander Morgado
2014-02-13ports: rename 'MMSerialPort' to 'MMPortSerial'Aleksander Morgado
2014-01-26port-probe: the 'buffer-full' signal is only used during AT probingAleksander Morgado
Make sure we cleanup the 'buffer-full' signal handler when moving from AT probing to QCDM probing, so that we don't try to remove a signal handler from a QCDM port in which we haven't set it. E.g. avoids: ModemManager[1493]: <debug> [1390731359.108502] [mm-port-probe.c:239] mm_port_probe_set_result_qcdm(): (tty/ttyHS2) port is QCDM-capable (ModemManager:1493): GLib-GObject-WARNING **: gsignal.c:2585: instance '0x7431b0' has no handler with id '16'
2014-01-25port-probe: buffer_full_id is a signal handler, not a GSourceAleksander Morgado
2013-11-15port: remove 'carrier-detect' propertyAleksander Morgado
It is no longer used since commit 736aa0d2d.
2013-06-26plugin-manager: handle modems where only some ports report being IceraAleksander Morgado
Icera-based Nokia modems may reply correctly to the Icera probing only in some AT ports, not in all. In order to handle this situation we override the final plugin selected to be the Icera-based one if we find that the mismatched plugins have the 'icera-allowed' and 'icera-forbidden' filters. https://bugzilla.gnome.org/show_bug.cgi?id=703022
2013-04-17mbim-port: make port closing async alwaysAleksander Morgado
Don't just close the port and forget, really wait to get the CLOSE response before going on.
2013-04-17port-probe: delay 3s MBIM probingAleksander Morgado
2013-04-17port-probe: include MBIM port probing logicAleksander Morgado
2013-04-09port-probe: fix source_remove() vs signal_handler_disconnect()Aleksander Morgado
2013-04-04port-probe: remove non-AT port hint, as it may come in ATI repliesAleksander Morgado
We remove "/SRC/AMSS" as a hint of non-AT port, as it really comes in ATI replies, see: [mm-at-serial-port.c:408] debug_log(): (ttyUSB6): <-- '<CR><LF>Manufacturer: Sierra Wireless, Incorporated<CR><LF>Model: USB 306<CR><LF>Revision: M3_0_10_1AP C:/WS/FW/M3_0_10_1AP/MDM8200/SRC/AMSS 2010/03/29 17:52:11<CR><LF>IMEI: xxxxxxxx<CR><LF>IMEI SV: 11<CR><LF>FSN: xxxxxxxxxx<CR><LF>3GPP Release 7<CR><LF>+GCAP: +CGSM,+DS,+ES<CR><LF><CR><LF><CR><LF>OK<CR><LF>' [mm-serial-parsers.c:188] mm_serial_parser_v1_parse(): Got response filtered in serial port: Not an AT response [mm-port-probe.c:148] mm_port_probe_set_result_at(): (tty/ttyUSB6) port is not AT-capable
2013-04-04port-probe: remove no longer needed filterAleksander Morgado
Remove the additional check for AT responses done *after* having parsed the response. This check only worked whenever the response string ended up matching one of the regular expressions in the parser, which of course wasn't always.
2013-04-04port-probe: add a new serial parser filter to detect non-AT stringsAleksander Morgado
We will check each string with our custom filter before even trying to parse them. A MM_SERIAL_ERROR_PARSE_FAILED error will be issued whenever the string doesn't match the filter.
2013-04-04port-probe: don't assume the NULL bytes will be at the beginning of the responseAleksander Morgado
Also report as non-AT responses if the NUL bytes are embedded within a stream of bytes which doesn't start with NUL. This e.g. applies to CnS ports from Sierra modems, which show streams like: ~\0\245y\0}^T1_0_4_0BT R372 CNSZXD00000061 2011/05/12 15:25:25\0\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0T1_0_4_0AP R372 CNSZXD00000061 2011/05 /12 15:25:25\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 03\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0~~ \0Tb\0T1_0_4_0AP R372 CNSZXD
2013-03-29port-probe: don't reschedule next probing step when serial port buffer fullAleksander Morgado
When the serial port buffer gets full of non-AT garbage during port probing, we were re-scheduling the next probing step, which is completely wrong, as we then would be processing the same probing task twice. If we get a buffer full, just cancel the AT probing cancellable, which would cancel not only the possible AT probings, but also the custom init if there is any. Also, make sure that the custom_init() of the plugins out there don't return an error if the GCancellable is cancelled. Cancelling the GCancellable means we should just stop the custom_init(), and actually sending an error in custom_init() means that the port should be set as unsupported by the plugin, so completely different things. Should fix https://bugzilla.gnome.org/show_bug.cgi?id=696695
2013-03-28serial: add support to optionally send line-feed at the end of AT commands.ori inbar
2013-02-19core: update logging levels of several messagesAleksander Morgado
'info' log level, the default if none specified, included too many logs which aren't that useful, to try to minimize the noise we produce by default.
2012-11-27port-probe: early-exit if port is certainly not AT capableDan Williams
If we read a response that indicates the port is definitely not an AT capable port, stop AT probing. Certain ports that use proprietary protocols or other non-AT protocols tend to spew data at us, so when this happens we can cut probing short.
2012-11-27port-probe: fix crash in buffer-full processingDan Williams
Signal was attached with user_data as MMPortProbe*, but serial_buffer_full() treated user_data as a PortProbeRunTask*. Hillarity ensued.
2012-11-27port-probe: fix checking of Icera capability on some devicesDan Williams
Sierra devices often have limited AT parsers on their APP ports which reply with OK to any command they don't understand, and thus we need to actually check for a valid IPSYS reply instead of just checking whether the IPSYS request completed without error. Previously MM would detect Icera capability on devices that didn't actually have it.
2012-09-08broadband-modem-qmi: set network port to 802.3/no-QoS modeDan Williams
The kernel drivers expect this mode, so make sure we set it.
2012-09-05build: new `--without-qmi' configure optionAleksander Morgado
For those who don't care about the QMI support through libqmi-glib, or if you're stuck with glib 2.30 (libqmi-glib requires 2.32), this configure switch allows disabling the QMI support completely. The logic to detect cdc-wdm ports is still in place, but the QMI probing is never launched at them. Also, all QMI-related objects won't be compiled.
2012-08-31port-probe: speed up QCDM probing a bitAleksander Morgado
This is the port to git master of the following commit: commit 01201860de5565a78823913423c6b2a762e3731f Author: Dan Williams <dcbw@redhat.com> Date: Tue Aug 28 21:12:14 2012 -0500 core: speed up QCDM probing a bit The point of sending two "version info" commands was to ensure that the terminating 0x7E of the first one was processed as a QCDM frame boundary and that any random data in the buffer (like AT commands from probing) got cleared out. The second command would always get processed as a valid QCDM command if the device supported QCDM, since there was no garbage before it. Instead of that dance, just prepend the version info message with an extra 0x7E to ensure a clean QCDM frame which the device hopefully responds to immediately. Second, actually process that response instead of throwing it away. Should save about 3 seconds when probing QCDM ports.
2012-08-31plugin: let plugins decide if they want echo removal during AT probingAleksander Morgado
This is the port to git master of the following patch: commit 21e66dfa1774ac2ee037ac8b6e8bb4d71a6f7931 Author: Dan Williams <dcbw@redhat.com> Date: Thu Aug 23 21:13:35 2012 -0500 core: add function to open probe ports without removing echo Some devices (Sierra GSM ones) return stuff we need but don't bother to prefix it with <CR><LF>, so we need to optionally turn off the echo removal at probe time.
2012-08-30port-probe: fix generic icera support check during probingAleksander Morgado
2012-08-30port-probe: easier check for Icera support over a list of port probesAleksander Morgado
2012-08-29core: handle the 'usb'->'usbmisc' subsystem rename in the kernelAleksander Morgado
We'll try to cope with getting devices being reported in either 'usb' or 'usbmisc', trying to avoid the need of checking kernel version during runtime.
2012-08-29port-probe: new helper to check if a QMI port was found in a list of probesAleksander Morgado
2012-08-29port-probe: launch QMI probing on cdc-wdm portsAleksander Morgado
Some devices may export cdc-wdm ports talking AT. We need to explicitly check for QMI protocol support on the cdc-wdm ports before assuming they are QMI.
2012-08-29core: allow grabbing QMI portsAleksander Morgado
2012-08-24at-serial-port: allow sending 'raw' commandsAleksander Morgado
Commands treated as 'raw' won't get the 'AT' prefix and will also not get the trailing carriage return.
2012-08-06port-probe: include Icera support check in the probing sequenceAleksander Morgado