Commit Graph
3396 Commits
Author SHA1 Message Date
Aleksander Morgado 2bcd1e4271 iface-modem-cdma: don't allow multiple concurrent activation attempts 2019-12-03 08:43:39 +00:00
Aleksander Morgado bfa5fd660c iface-modem-cdma: disallow empty carrier code in automatic activation 2019-12-03 08:43:39 +00:00
Aleksander Morgado a28f88b684 broadband-modem-mbim: implement reset in Intel-based devices 2019-11-28 22:25:36 +01:00
Aleksander Morgado 9ef658f697 iface-modem-voice: plug task memleaks when returning error if cancelled 2019-11-28 17:17:21 +01:00
Aleksander Morgado dc3bd91b53 broadband-modem-mbim: plug task leak when completing USSD operation 2019-11-28 14:58:31 +01:00
Aleksander Morgado d27b108efb iface-modem-signal: avoid logging about signal refresh context if not enabled 2019-11-28 14:47:21 +01:00
Aleksander Morgado 551f0e0250 port-mbim: before attempting to use QMI over MBIM, check device services
If we blindly try to use QMI over MBIM on devices that don't support
it, the logic works ok but it's very slow, given that the QMI device
open operation has several internal retries, and all those end up
timing out.

Avoid that lost time by checking the list of services supported by the
MBIM modem, and if the QMI over MBIM service is not listed, we'll
avoid trying to open the QMI device right away.
2019-11-27 17:30:07 +01:00
Aleksander Morgado 8fcc470a5c plugin-manager: always make sure all needed symbols are available
Never do lazy loading, we'll always make sure that a plugin will only
be fully loaded if all the symbols it requires are already available.
2019-11-27 10:11:43 +00:00
Aleksander Morgado b1c3f1eb1c plugin-manager: dynamically load 'shared' util libraries 2019-11-27 10:11:43 +00:00
Aleksander Morgado b4dcb76d5a plugin-manager: allow new ports up to 1500ms since last port added
Until now we had only a 2500ms timeout initialized since the first
port was exposed until we decided we were ready to consider all ports
notified by the kernel.

With this new logic, we add an additional condition: even if the
2500ms initial timeout has elapsed already, we leave an additional
1500ms since the last port addition for new ports to appear.

This new logic is useful when relying on the ReportKernelEvent() DBus
method, as it is the user the one responsible for reporting the kernel
events instead of udev. Now, the user is not forced to make sure all
ports are exposed in 2500ms; instead, we also allow ports to be
reported in more than 2500ms as long as the time between port
additions reported is less than 1500ms.

Note that this does not mean that the whole probing time will now
always be 4000ms. On well behaved systems (like when based on udev)
this new 'extra' probing timeout may expire long before the 'min'
probing timeout we already had as well.

E.g. in this setup, the reporting of the NET port was done 1100ms
later than the last ttyUSB3, and that was already too late as the
original 2500ms threshold had already expired.

 [1573536994.593874] (tty/ttyUSB0): first port in device /sys/devices/platform/ehci-platform/usb1/1-1
 [1573536994.596659] [plugin manager] task 1: port grabbed: ttyUSB0
 [1573536995.093579] (tty/ttyUSB1): additional port in device /sys/devices/platform/ehci-platform/usb1/1-1
 [1573536995.094172] [plugin manager] task 1: port grabbed: ttyUSB1
 [1573536995.603206] (tty/ttyUSB2): additional port in device /sys/devices/platform/ehci-platform/usb1/1-1
 [1573536995.603822] [plugin manager] task 1: port grabbed: ttyUSB2
 [1573536996.111564] (tty/ttyUSB3): additional port in device /sys/devices/platform/ehci-platform/usb1/1-1
 [1573536996.112257] [plugin manager] task 1: port grabbed: ttyUSB3
 [1573536996.814816] [device /sys/devices/platform/ehci-platform/usb1/1-1] creating modem with plugin 'Quectel' and '4' ports
 [1573536997.265820] (net/wwan0): additional port in device /sys/devices/platform/ehci-platform/usb1/1-1
 [1573536997.296935] (usbmisc/cdc-wdm0): additional port in device /sys/devices/platform/ehci-platform/usb1/1-1
2019-11-27 08:29:37 +00:00
Aleksander Morgado 8f21f40674 broadband-modem-mbim: avoid LTE attach config/status if unsupported
If we know that the LTE attach status/configuration CIDs in the Basic
Connect Extensions service are unsupported, don't even try to use
them, so that we avoid timeouts in the requests.
2019-11-27 09:03:22 +01:00
Aleksander Morgado c523d5bdc3 bearer-qmi: plug memleaks when connection attempt fails early
The data and qmi objects were not being correctly disposed on several
error conditions.
2019-11-25 15:08:20 +01:00
Aleksander Morgado 260d34be76 bearer-qmi: plug memleaks during network disconnection 2019-11-25 12:29:33 +01:00
Amol Lad 7297b3fc90 mbim: release all allocated CIDs during shutdown 2019-11-23 14:57:48 +05:30
Aleksander Morgado 5e8c64d092 iface-modem-simple: don't assert ongoing connect cancellable
[11642]: <debug> [1573665255.321490] Couldn't reload current power state: QMI operation failed: Transaction timed out
    [11642]: <debug> [1573665255.321697] No need to change power state: already in 'on' power state
    [11642]: <debug> [1573665255.330864] Modem (Quectel) '/sys/devices/platform/ehci-platform/usb1/1-1' completely disposed
    **
    ERROR:mm-iface-modem-simple.c:44:private_free: assertion failed: (!priv->ongoing_connect)

If the modem goes away in the middle of a connection attempt, there's
no explicit connection cancellation performed, we just cleanup the
modem object. In this case, the ongoing attempt cancellable will still
exist, so just clean it up as well.
2019-11-13 18:23:21 +01:00
Aleksander Morgado 3da82d1050 plugin-manager: cancel timeouts when device probing is cancelled
There is no need to wait for the minimum wait/probing time before we
can cancel the device probing.
2019-11-13 15:43:11 +01:00
Aleksander Morgado 76e862597c plugin-manager: fix waiting the minimum probing time
The device port probings were being finished before the minimum
probing time, making this timeout effectively useless.
2019-11-13 15:38:45 +01:00
Aleksander Morgado 4a0de586db base-call: if start() fails, always terminated 2019-10-17 10:51:50 +02:00
Aleksander Morgado 2c0281aac9 call: disallow non-emergency calls when in emergency-only state 2019-10-17 10:51:50 +02:00
Aleksander Morgado d6f9d5e9ec sim: load emergency numbers from EF_ECC 2019-10-17 10:51:50 +02:00
Aleksander Morgado 1f6c006976 api,sim: new 'Emergency Numbers' property 2019-10-17 08:31:46 +00:00
Aleksander Morgado 57e7841308 iface-modem-voice: always completely reinitialize the interface
The supported voice features may be different before and after SIM-PIN
unlock, so do not cache the result of the support check operation.
2019-10-17 08:31:46 +00:00
Aleksander Morgado 98066d24b7 broadband-modem: don't cache voice support check AT commands
The result of these commands may be different before and after SIM-PIN
unlock, so never cache them.
2019-10-17 08:31:46 +00:00
Aleksander Morgado 5fef14176a broadband-modem: ignore SIM-related errors in voice support check 2019-10-17 08:31:46 +00:00
Aleksander Morgado 6347a7d783 base-call: catch terminated errors before ATD replies
If we get one of the in-call termination errors before ATD replies OK,
we need to cancel the start() operation right away and return an
error to the caller.

Otherwise, the Call will be reported as "terminated" right away, but
the caller would not get an error back until 90s later:

    $ sudo mmcli --call 0 --start
    error: couldn't start the call: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Serial.ResponseTimeout: Serial command timed out'
2019-10-17 08:31:46 +00:00
Aleksander Morgado eaf6654750 broadband-modem: keep ports context open while in-call
This is so that we can receive and process URCs even if the modem is
not fully enabled yet.
2019-10-17 08:31:46 +00:00
Aleksander Morgado c99f767f04 broadband-modem: reorder generic port context logic in sources 2019-10-17 08:31:46 +00:00
Aleksander Morgado ba1f3af342 broadband-modem: new generic ports_context_open()
Used during initialization, enabling and sim hotswap context setup.
The secondary AT and QCDM ports will only be open during enabling.
2019-10-17 08:31:46 +00:00
Aleksander Morgado 7c8d0d1718 broadband-modem: skip redundant ATE0/AT+CMEE=1 settings
These are already given in the logic behind the
"MM_PORT_SERIAL_AT_INIT_SEQUENCE"  property:

    (ttyACM1): --> 'ATE0<CR>'
    (ttyACM1): <-- '<CR><LF>OK<CR><LF>'
    (ttyACM1): --> 'ATV1<CR>'
    (ttyACM1): <-- '<CR><LF>OK<CR><LF>'
    (ttyACM1): --> 'AT+CMEE=1<CR>'
    (ttyACM1): <-- '<CR><LF>OK<CR><LF>'
    (ttyACM1): --> 'ATX4<CR>'
    (ttyACM1): <-- '<CR><LF>OK<CR><LF>'
    (ttyACM1): --> 'AT&C1<CR>'
    (ttyACM1): <-- '<CR><LF>OK<CR><LF>'
    (ttyACM1): --> 'ATE0<CR>'               --> redundant
    (ttyACM1): <-- '<CR><LF>OK<CR><LF>'
    (ttyACM1): --> 'AT+CMEE=1<CR>'          --> redundant
    (ttyACM1): <-- '<CR><LF>OK<CR><LF>'
2019-10-17 08:31:46 +00:00
Aleksander Morgado 657833a400 voice,api: new 'EmergencyOnly' boolean flag
This new flag allows users of the API to know whether general purpose
voice calls are allowed or otherwise only voice calls to the
registered emergency numbers should be performed.

ModemManager won't really do any distinction between emergency and
non-emergency calls at this point, this flag is just an early
indication for the user of the API that no normal voice call should be
attempted.
2019-10-17 08:31:46 +00:00
Aleksander Morgado 7971844318 iface-modem-voice: all methods available even if not enabled 2019-10-17 08:31:46 +00:00
Aleksander Morgado ed3a1264af iface-modem-voice: call list setup during initialization
We're going to allow emergency calls at any point, so prepare the call
list handling logic during initialization, not when the modem is first
enabled.
2019-10-17 08:31:46 +00:00
Aleksander Morgado 00a39cd060 broadband-modem: voice interface available in failed/locked state 2019-10-17 08:31:46 +00:00
Aleksander Morgado 27405a44ca broadband-modem: new initialization step when failed/locked
Instead of using the firmware step as fallback when the modem goes
into failed or locked state, use an independent step in the
initialization state machine, just to make it clearer.
2019-10-17 08:31:46 +00:00
Aleksander Morgado d555c4c45c iface-modem-simple: allow single ongoing Connect() attempt
We only allow one single Simple.Connect() attempt at a time. If more
than one arrives, the second and next ones will be forbidden.

The ongoing connection attempt can now always be cancelled via
Simple.Disconnect(), not only *after* the bearer object connection has
started. i.e. if Simple.Disconnect() is called e.g. while waiting to
be registered, we would also be cancelled properly.
2019-10-17 08:07:10 +00:00
Aleksander Morgado f228d0dd6f base-bearer,iface-modem-simple: log user requests to connect/disconnect 2019-10-17 08:07:10 +00:00
Aleksander Morgado e3a1364ddc core: allow flagging ports as 'audio'
Instead of flagging them as 'ignored' so that they aren't probed, we
can also flag them as 'audio' now, so that the logic knows which port
to report as used for audio in the Call object.
2019-10-15 13:19:10 +02:00
Aleksander Morgado 1a17996ccb iface-modem-voice: ignore unknown calls reported as terminated
If the full list reporting includes calls in terminated state (e.g. on
modems managed by the Simtech plugin), then ignore those no longer
known to us, because it just means that they have already been
processed.

    <debug> [1571060859.227759] (ttyUSB2): <-- '<CR><LF>+CLCC: 1,0,6,0,0,"639335936",129<CR><LF>'
    <debug> [1571060859.227890] Reported 1 ongoing calls
    <debug> [1571060859.227913] call at index 1: direction outgoing, state terminated, number 639335936
    <debug> [1571060859.227946] call info matched (matched direction/state no, matched index yes, matched terminated no) with call at '/org/freedesktop/ModemManager1/Call/1'
    <debug> [1571060859.227963]   state updated: terminated
    <info>  [1571060859.227978] Call state changed: dialing -> terminated (unknown)
    <debug> [1571060859.228173] (ttyUSB3): <-- '<CR><LF>+CLCC: 1,0,6,0,0,"639335936",129<CR><LF>'
    <debug> [1571060859.228234] Reported 1 ongoing calls
    <debug> [1571060859.228251] call at index 1: direction outgoing, state terminated, number 639335936
    <warn>  [1571060859.228274] unexpected outgoing call to number '639335936' report2ed in call list: state terminated
2019-10-14 15:54:56 +02:00
Aleksander Morgado 089faef88c modem-helpers: support reporting 'terminated' call state in +CLCC 2019-10-14 15:45:18 +02:00
Aleksander Morgado d5d0ed0b24 tests: print MM logs only on verbose test mode
Therefore, avoid needing ENABLE_TEST_MESSAGE_TRACES build symbol.
2019-10-14 15:30:27 +02:00
Aleksander Morgado 03223fe786 tests,sms: print PDUs only on verbose test mode
Therefore, avoid needing TEST_SMS_PART_ENABLE_TRACE build symbol.
2019-10-14 15:30:03 +02:00
Aleksander Morgado 3b18d21ba5 tests: avoid g_print() and use g_debug() instead
The debug-level logs won't be printed e.g. during 'make check', but
will be included when running the tester manually.
2019-10-14 15:30:03 +02:00
Aleksander Morgado cc4e7f6cfd shared-qmi: fix NAS SSP support check during supported caps loading 2019-10-14 12:44:47 +02:00
Eric Caruso 33140e1fc3 mm-broadband-modem-mbim: fix incorrect log message
The log message would display a value based on combining the
notification flags with a CID, which doesn't make sense. Test
against the flag for this notification instead.
2019-10-12 04:23:26 +00:00
Aleksander Morgado 1277ebb4cc iface-modem: allow plugins to disable access technology polling
Same as with the signal quality polling, we may want to disable
explicitly the access technology polling if we can rely on plugin
specific URCs for this purpose.
2019-10-11 09:24:22 +00:00
Aleksander Morgado 45a238bca3 iface-modem: allow disabling signal quality polling during runtime
E.g. if we have a specific command to enable the signal quality URCs,
we should only disable polling if the command is supported by the
specific modem and the command succeeds. If unsupported or fails, we
shouldn't disable the polling.
2019-10-11 09:24:22 +00:00
Aleksander Morgado 765f26a40e iface-modem: don't log error if it's in progress
If we're loading signal quality or access technology, skip reporting
any error message if the specific error received is 'in-progress'.

Plugins will use this error when they cannot process the response to
the operation, e.g. if it was already consumed by a URC handler.
2019-10-11 09:24:22 +00:00
Aleksander Morgado c98a1a9dc8 simtech: disable CMER/CIND support explicitly
The logic to setup the generic +CIND indications in the SIM7600E seems
to end up breaking connectivity when in TTY+PPP mode. If we issue the
AT+CMER=3,0,0,1 command, this will end up in the modem not replying a
correct CONNECT response to the ATD command.

Let's disable these +CIND indications completely in the simtech
plugin, as there is even no AT command reference saying those are
supported.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/144
2019-10-11 09:24:22 +00:00
Aleksander Morgado feb6c8264a broadband-modem: allow disabling +CIND URC setup
Not all modems support correctly +CIND URCs and +CMER settings.
2019-10-11 09:24:22 +00:00
Aleksander Morgado 803c770551 broadband-modem-qmi: fix when >1 PRI images for the same modem image 2019-10-11 08:16:04 +00:00