Commit Graph
3379 Commits
Author SHA1 Message Date
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
Aleksander Morgado 6977b41adb broadband-modem-qmi: prefer ASCII unique IDs
If the manufacturer uses QMI unique IDs in ASCII, use the same format
in our APIs, instead of blindly converting them to a 16-byte HEX
string.

This makes user operations much nicer, e.g. instead of:

    $ sudo mmcli -m 0 --firmware-list
      ----------------
      Firmware | list: 02.20.03.00_GENERIC
               |        current: yes
               |        gobi pri unique id: 3030322E3031375F3030300000000000
               |        gobi modem unique id: 3F5F3F00000000000000000000000000
               |       02.14.03.02_SPRINT
               |        current: no
               |        gobi pri unique id: 3030322E3031325F3030310000000000
               |        gobi modem unique id: 3F5F3F00000000000000000000000000
               |       02.20.03.22_VERIZON
               |        current: no
               |        gobi pri unique id: 3030322E3032365F3030300000000000
               |        gobi modem unique id: 3F5F3F00000000000000000000000000
               |       02.14.03.00_VODAFONE
               |        current: no
               |        gobi pri unique id: 3030302E3030385F3030300000000000
               |        gobi modem unique id: 3F5F3F00000000000000000000000000

We will have:

    $ sudo mmcli -m 1 --firmware-list
      ----------------
      Firmware | list: 02.20.03.00_GENERIC
               |        current: no
               |        gobi pri unique id: 002.017_000
               |        gobi modem unique id: ?_?
               |       02.14.03.02_SPRINT
               |        current: no
               |        gobi pri unique id: 002.012_001
               |        gobi modem unique id: ?_?
               |       02.20.03.22_VERIZON
               |        current: yes
               |        gobi pri unique id: 002.026_000
               |        gobi modem unique id: ?_?
               |       02.14.03.00_VODAFONE
               |        current: no
               |        gobi pri unique id: 000.008_000
               |        gobi modem unique id: ?_?
2019-10-11 08:16:04 +00:00
Aleksander Morgado a55543d11e broadband-modem-qmi: fix listing images when 'Get Stored Image Info' is unsupported 2019-10-11 08:16:04 +00:00
Aleksander Morgado 1b29f7524c broadband-modem-qmi: move pri/modem pair list building to separate method 2019-10-11 08:16:04 +00:00
Aleksander Morgado 7986b2737d broadband-modem-qmi: move pri/modem list index lookup to separate method 2019-10-11 08:16:04 +00:00
Aleksander Morgado 5b8da2e1b9 broadband-modem-qmi: add note about index_of_running_image known issue
Since 02.20.xx.xx, the 'index_of_running_image' reported for MODEM
images is wrong.

https://forum.sierrawireless.com/t/mc74xx-wrong-running-image-in-qmi-get-stored-images/8998
2019-10-11 08:16:04 +00:00
Aleksander Morgado 66192288f9 broadband-modem-qmi: fix minor typo in comment 2019-10-11 08:16:04 +00:00
Aleksander Morgado 3f15293a0b daemon: register G_IO_ERROR_CANCELLED as "Cancelled" in DBus
We have deprecated the use of MM_CORE_ERROR_CANCELLED inside the
daemon in favor of using G_IO_ERROR_CANCELLED right away, and so, we
will now register G_IO_ERROR_CANCELLED as the error mapped to the
"Cancelled" error in the ModemManager error domain in DBus.

We therefore avoid sending unknown/unmapped errors via DBus, as in
this case:

    $ sudo ./test.sh
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    successfully disconnected all bearers in the modem
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    error: couldn't connect the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Cancelled: Connection attempt cancelled'
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    successfully disconnected all bearers in the modem
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    error: couldn't connect the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Cancelled: Connection attempt cancelled'
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    successfully disconnected all bearers in the modem
2019-10-11 07:27:59 +00:00
Aleksander Morgado cf0d3f36fd iface-modem: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado 651bfd62b4 port-serial: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado fa453a17a5 iface-modem-voice: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado cff3be23c0 broadband-modem: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado 7974933de8 broadband-modem-mbim: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado c0e1bde03e base-modem-at: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado 6de9c8cb29 base-bearer: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado 15b8156061 iface-modem-simple: fix Simple.Disconnect() when bearer path given
The Simple.Disconnect() method handler was totally broken when a
specific bearer path was given, because the user-provided bearer path
was never being stored in the DisconnectionContext struct...

This is an extremely bad error, but it also gives us an indication
that no one is really using this method to disconnect one single
bearer, mainly because we also have the Bearer.Disconnect() method,
which makes more sense. mmcli didn't even allow passing a bearer path
to --simple-disconnect.
2019-10-09 12:23:33 +02:00
Aleksander Morgado 1cd24a3106 iface-modem-firmware: use the explicit Firmware policy
The Firmware policy is always 'auth_admin'.
2019-09-25 13:08:32 +02:00
Aleksander Morgado 7a7b3aa5cb polkit,time: protect GetNetworkTime() with a new 'Time' policy rule 2019-09-25 13:08:32 +02:00