aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2020-12-21broadband-modem-qmi: implement initial EPS bearer info loadingAleksander Morgado
2020-12-21broadband-modem-qmi: allocate a generic WDS clientAleksander Morgado
For generic WDS operations not tied to any connection attempt.
2020-12-19broadband-modem-mbim: plug memleak when processing USSD in GSM7Aleksander Morgado
2020-12-13broadband-modem-mbim: ignore MS SAR notifications explicitlyAleksander Morgado
SAR service will be introduced in the stable libmbim 1.26.0, but it's been flagged in the dev 1.25.1 version already.
2020-12-03broadband-modem-mbim: Add MM_BROADBAND_MODEM_MBIM_QMI_UNSUPPORTEDTorsten Hilbrich
This property (initially set to FALSE) controls whether QMI over MBIM should never be considered. This property is set to TRUE for XMM-based MBIM devices as they don't support QMI. This fixes a probing delay of 15s on a Fibocom L850-GL device (2cb7:0007) found in the Lenovo T14 Gen 1. The establishing of a QMI connection was refused multiple time with MBIM error OperationNotAllowed. Only the timeout of 15s for this connection resumed the probing. The properties in the MMBroadbandModemMbim are only installed when WITH_QMI and QMI_MBIM_QMUX_SUPPORTED are set. Actually, this should only disable the PROP_QMI_UNSUPPORTED but as this is the only property this avoids the "unused variable 'self'" warnings/errors when trying to compile set_property and get_property without QMI support. This can be changed once other properties are needed. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/284
2020-12-01broadband-modem-qmi: fix reporting of signal strength indicationsAleksander Morgado
We had all the logic in place... but we were never actually enabling the signal strength indications because the `enable` flag in the context was never set. The bug was introduced back in May 2018, and released with 1.10.0. Fixes baefe53ab9c0ea0612d2bf7da64b6f6cf9753bcd
2020-12-01tests: added parse ERROR response testDylan Van Assche
2020-12-01serial-parsers: also match ERROR responses that are not at end of lineDylan Van Assche
Do not fail to detect an error response with a call or text incoming. This happens during port probing when there's no URC parsers installed in the serial port. This probably will not happen when the serial port was managed by the modem object.w
2020-12-01tests: added parse OK response testDylan Van Assche
2020-12-01serial-parsers: also match OK responses that are not at end of lineDylan Van Assche
Do not fail to detect a valid response with a call or text incoming. This happens also during port probing when there's no URC parsers installed in the serial port. This probably will not happen when the serial port was managed by the modem object.
2020-11-26base-sim: Reprobe modem if puk lock is discovered after sending pin1Pavan Holla
Enabling/Disabling/Changing/Sending the PIN1 lock is usually limited to 3 retries. If these attempts are exhausted, the modem is puk_locked. We reprobe the modem to get rid of any unwanted interfaces and move to a locked state.
2020-11-26base-sim: Reprobe modem if lock status cannot be read after sending pukPavan Holla
If the lock status cannot be read during a puk unblock attempt, reprobe the modem. It is likely that the SIM was permanently blocked if the lock status cannot be read.
2020-11-20base-modem: order ports by name by defaultAleksander Morgado
When there are multiple ports with the same purpose (e.g. multiple net data ports, or multiple QMI control ports), sort them by name by default. The port order does not make any difference for ports that have flagged with a specific purpose (e.g. AT primary). The sorting is done both in the internal lists and when looking up ports with find_ports().
2020-11-20core: new 'rpmsg' subsystemAleksander Morgado
Most older Qualcomm SoCs (e.g. MSM8916, MSM8974, ...) communicate with the integrated modem via shared memory (SMD channels). This is similar to QRTR on newer SoCs, but without the "network" layer. In fact, the older SoCs also have QRTR, but the modem QMI services are not exposed there. The mainline Linux kernel exposes SMD channels via the "remote processor messaging bus" (rpmsg). Through special IOCTL calls it is possible to create a char device for a rpmsg/SMD channel. We can then use these to send QMI/AT messages to the modem, much like the ordinary serial char devices when using a Qualcomm modem through USB. This commit introduces support for the new 'rpmsg' subsystem, which allows exporting QMI-capable and AT-capable ports. By default NO rpmsg port is flagged as candidate, it is assumed that the plugin adding support for the rpmsg subsystem will add specific rules to do so (e.g. so that non-modem ports are explicitly not flagged as candidate). All rpmsg ports will be probed for AT or QMI capabilities, unless explicit port type hints (e.g. ID_MM_PORT_TYPE_QMI or ID_MM_PORT_TYPE_AT_PRIMARY) are set. These changes are highly based on the initial integration work done by Stephan Gerhold <stephan@gerhold.net> in postmarketOS, see: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/363
2020-11-20kerneldevice: allow loading port attributesAleksander Morgado
In addition to loading port and device properties, we now also allow loading sysfs properties that are assumed to be static (i.e. their values won't change since loaded the first time).
2020-11-20bearer-qmi: support binding to data portAleksander Morgado
Allow plugins to specify a QmiSioPort value to bind to. This is used e.g. in the RPMSG+BAM-DMUX setup in order to allow any RPMSG port to control all the available net ports.
2020-11-20tests,cdma: test CDMA SMS with different text lengthsAleksander Morgado
2020-11-20sms: fix 7-bit ASCII SMS decodingDavid Leonard
Fixes an issue where (5+8n)-character long SMS messages received on a CDMA network would be dropped with a "cannot read user data" error, while other length SMS messages would be delivered fine. Fix thanks to Peter Hunt
2020-11-19base-manager: never create kernel device objects for remove eventsAleksander Morgado
There is no point in creating a new kernel device object just to process a remove event; instead, do any matching with existing kernel device objects by subsystem and name, which is what the generic backend already did anyway. This avoids unnecessary lookup of information in sysfs during removal events, because the port is anyway already gone when we try to look those up.
2020-11-16iface-modem-firmware: allow plugins to ignore carrier infoAleksander Morgado
Skip building the firmware version information with carrier config information if the plugin already knows that the firmware upgrade method doesn't implement carrier-specific upgrade paths.
2020-11-16iface-modem-firmware: report generic IDs for both USB and PCI devicesAleksander Morgado
Instead of assuming that all modules supporting firmware upgrade are USB based.
2020-11-15mm-plugin-manager: Fix typosAndrew Lassalle
Change-Id: I662061384cf48abd0975e15a91b090aa6b33ac34
2020-11-14base-manager: allow forcing the testing without udevAleksander Morgado
Even if udev support is really built and available. This is extremely useful to test the udev-less setup without fully recompiling the whole daemon. E.g.: the daemon can be run like this: $ sudo /usr/sbin/ModemManager --debug --test-no-udev And then, the kernel events may be reported using mmcli like this: $ sudo mmcli --report-kernel-event-auto-scan
2020-11-14kerneldevice,generic: use regex to implement string matchingAleksander Morgado
Instead of the custom simple implementation which only supported the '*' modifier in the pattern. This allows us to support e.g. attribute value matches like e.g. 'DATA[0-9]*_CNTL'.
2020-11-14kerneldevice,generic: implement ATTRS matching for any attributeAleksander Morgado
Until now we did not support ATTRS{} matches against attributes we don't support in the core codebase. Implement now a simple lookup mechanism which traverses the tree of sysfs path from the port sysfs path to the physical device sysfs path, looking up the attribute requested. This is not completely equivalent to what udev does, because the udev rules matching ATTRS would usually also include an additional previous matching e.g. SUBSYSTEMS and such, so that the ATTRS is looked up exactly in the device that also matches the additional previous rules. In our case, we just simplify the logic and return the first one found.
2020-11-14kerneldevice,generic: fix DRIVERS and SUBSYSTEMS checksAleksander Morgado
We were applying the DRIVERS check looking only at the single port driver. Instead, we now lookup and cache all drivers found in the device tree, and apply the loose DRIVERS check properly looking at all of them. We were applying the SUBSYSTEMS and SUBSYSTEM check looking at the sysfs path and just hoping the subsystem we're looking for is included in the path itself. Instead, we now lookup and cache all susystems found in the device tree, and apply the loose SUBSYSTEMS check properly looking at all of them. E.g. we can now match SUBSYSTEMS="mhi_q" in the following device tree, without needing it to be found in the sysfs path: looking at device '/devices/pci0000:00/0000:00:1b.0/0000:01:00.0/1001_00.01.00_MBIM/mhi_uci_q/mhi_MBIM': SUBSYSTEM=="mhi_uci_q" looking at parent device '/devices/pci0000:00/0000:00:1b.0/0000:01:00.0/1001_00.01.00_MBIM': SUBSYSTEMS=="mhi_q" looking at parent device '/devices/pci0000:00/0000:00:1b.0/0000:01:00.0': SUBSYSTEMS=="pci"
2020-11-14kerneldevice,generic: support PCI device common attribute namesAleksander Morgado
The vendor and product IDs stored for the MMKernelDevice object in the PCI subsystem are mapped to the "vendor" and "device" attributes.
2020-11-14kerneldevice,generic: preload port info based on the system busAleksander Morgado
The generic backend implementation was really based on detecting USB devices, not so much devices in other subsystems. This patch puts the generic backend at the same level as the udev backend to support non-USB modems.
2020-11-14kerneldevice,udev: preload port info based on the system busAleksander Morgado
USB, PCI, PCMCIA... all these different system buses expose modems in different ways. Instead of having single methods to attempt to load different things for all these device types, detect first which is the system bus in use, and then perform a bus-specific operation to preload the different things.
2020-11-14kerneldevice: no need to subclass the type gettersAleksander Morgado
We can just subclass the methods to check whether a given property exists and to get it as a string, and then implement in the generic class the actual boolean/int/hex type getters common for all.
2020-11-14kerneldevice: remove all unneeded g_return_if_fail() checksAleksander Morgado
These kind of checks are only useful on public APIs really, there should be no need to have them in internal code.
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-13plugin: build probing needs based on subsystemAleksander Morgado
Don't rely on the QMI or MBIM ports named cdc-wdm, use the device subsystem instead.
2020-11-13base-manager: automatic required subsystem detectionAleksander Morgado
Instead of assuming we require a fixed set of subsystems to monitor, compile the full list based on what the plugins have requested themselves.
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-09base-manager: log kernel event handling failuresAleksander Morgado
Don't just return the error to the client, we want this info in the daemon log as well.
2020-11-09kerneldevice,generic: plug cached string leaksAleksander Morgado
Both 'physdev_subsystem' and 'interface_description' were leaking.
2020-11-09port-qmi: expected kernel data format is qmi_wwan specificAleksander Morgado
The qmi_wwan driver is the only one that allows switching between 802.3 and raw-ip during runtime, and therefore we must not assume that every QMI port managed allows to do so, we'll limit that feature only to QMI ports in the 'usbmisc' subsystem. For every other port, we assume the kernel expects raw-ip by default, and so we include logic to switch the modem to raw-ip both using WDA and CTL (WDA preferred over CTL). This assumption may not be perfect, but it's probably a good guess, as raw-ip is the preferred and sometimes the only format supported by new devices.
2020-11-09port-qmi: allow specifying input subsystemAleksander Morgado
We have assumed until now that all QMI ports are based on the qmi_wwan driver, exposed in the 'usbmisc' subsystem by the cdc-wdm driver. This may no longer be true, so allow creating QMI ports with an explicit subsystem instead of defaulting always to USBMISC.
2020-11-09port-mbim: allow specifying input subsystemAleksander Morgado
We have assumed until now that all MBIM ports are based on the cdc_mbim driver, exposed in the 'usbmisc' subsystem by the cdc-wdm driver. This may no longer be true, so allow creating MBIM ports with an explicit subsystem instead of defaulting always to USBMISC.
2020-11-09port-serial-qcdm: allow specifying input subsystemAleksander Morgado
We have assumed until now that all QCDM ports are based on TTY drivers, e.g. exposed via USB. This may no longer be true, so allow creating QCDM ports with an explicit subsystem instead of defaulting always to TTY.
2020-11-09base-modem: refactor port grabbing logicAleksander Morgado
Split in its own method the per-subsystem port creation mechanism, and apply all common AT port settings (e.g. response parser, flags) in a single place.
2020-11-09port-serial-at: skip validating input subsystem argumentAleksander Morgado
This check is pointless given that we're not implementing API, if anything it should be an assert. Anyway, just get rid of it, so that we don't need to update it on every new subsystem we add as supported.
2020-11-09port: rename subsystem from 'usb' to 'usbmisc'Aleksander 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 So, rename the port subsystem type enumn to 'usbmisc'.
2020-11-09api: new ID_MM_PORT_TYPE_QMI and ID_MM_PORT_TYPE_MBIM udev hintsAleksander Morgado
It is no longer true that all QMI ports are exposed by the qmi_wwan driver and that all MBIM ports are exposed by the cdc_mbim driver. There are other generic setups that allow exposing these types of ports using different drivers, and usually we can also know the type of port in advance via other means. Therefore, allow adding udev port type hints for QMI and MBIM ports as well.
2020-11-09broadband-modem-qmi: peek QMI port from any subsystemAleksander Morgado
No longer has to be bound to the USB subsystem.
2020-11-09broadband-modem-qmi: allow subclassing the match of control vs net portsAleksander Morgado
By default we provide the implementation for the qmi_wwan driver, where both control and net ports share the same USB interface.
2020-11-09broadband-modem-qmi: peeking QMI port only in QMI modemsAleksander Morgado
Move the logic out of the base modem, and make it applicable only for QMI modems.
2020-11-09broadband-modem-mbim: peek MBIM port from any subsystemAleksander Morgado
No longer has to be bound to the USB subsystem.
2020-11-09broadband-modem-mbim: allow subclassing the match of control vs net portsAleksander Morgado
By default we provide the implementation for the cdc_mbim driver, where both control and net ports share the same USB interface.