Commit Graph

6641 Commits

Author SHA1 Message Date
Aleksander Morgado
c8c31f0613 iface-modem-time: port to use object logging 2020-04-08 16:35:08 +02:00
Aleksander Morgado
91de19e3ae iface-modem-simple: port to use object logging 2020-04-08 16:35:08 +02:00
Aleksander Morgado
695a1003a1 iface-modem-signal: port to use object logging 2020-04-08 16:35:08 +02:00
Aleksander Morgado
84851cc616 iface-modem-oma: port to use object logging 2020-04-08 16:35:08 +02:00
Aleksander Morgado
135b5c8065 iface-modem-messaging: port to use object logging 2020-04-08 16:35:08 +02:00
Aleksander Morgado
7d5871c59c iface-modem-location: port to use object logging 2020-04-08 16:35:08 +02:00
Aleksander Morgado
6314e5f1d2 iface-modem-firmware: port to use object logging 2020-04-08 16:35:08 +02:00
Aleksander Morgado
0592bcfdec iface-modem-cdma: port to use object logging 2020-04-08 16:35:08 +02:00
Aleksander Morgado
301c984a87 iface-modem-3gpp-ussd: port to use object logging 2020-04-08 16:35:08 +02:00
Aleksander Morgado
89a0adb962 iface-modem-3gpp: port to use object logging 2020-04-08 16:35:08 +02:00
Aleksander Morgado
aa5a77ce05 iface-modem: port to use object logging 2020-04-08 16:35:08 +02:00
Aleksander Morgado
6dff5ba673 shared-qmi: port to use object logging 2020-04-08 16:35:08 +02:00
Aleksander Morgado
46405afdf3 broadband-modem-mbim: port to use object logging 2020-04-08 16:35:08 +02:00
Aleksander Morgado
40a542be49 broadband-modem-qmi: port to use object logging 2020-04-08 16:35:08 +02:00
Aleksander Morgado
ee45464329 broadband-modem: port to use object logging 2020-04-08 16:35:08 +02:00
Aleksander Morgado
875ef11a57 base-modem: port to use object logging
Also link all grabbed ports as owned by the modem.
2020-04-08 16:35:08 +02:00
Aleksander Morgado
9e50dda400 base-modem: set dbus id as soon as object is created 2020-04-08 16:35:08 +02:00
Aleksander Morgado
850d302d24 ports: port to object logging 2020-04-08 16:35:08 +02:00
Aleksander Morgado
3a2466a363 port-serial: assert on totally unexpected serial settings
The bits/parity/stopbits serial settings are set by the daemon, so if
any of them are not expected, assert, not just warn.
2020-04-08 16:35:08 +02:00
Aleksander Morgado
b7d7286963 kerneldevice: port to object logging 2020-04-08 16:35:08 +02:00
Aleksander Morgado
9bcadea172 log: new object logging support
So that we can provide the specific object id in every log associated
to a given object.
2020-04-08 16:35:08 +02:00
Артемий Судаков
faccb3b2b4 po: add Russian translation 2020-04-05 09:48:13 +02:00
Andika Triwidada
d22523ff09 po: updated Indonesian translation 2020-04-01 08:27:23 +02:00
mozzwald
a309b089c9 quectel: add port type hints for EC25/EG25 #194 2020-03-25 12:35:41 -05:00
Aleksander Morgado
3643c15133 cli: remove empty whiteline in --version
This also fixes the Copyright section in the troffit generated HTML
output.
2020-03-21 15:49:31 +01:00
Aleksander Morgado
e9d7a9acde context: remove empty whiteline in --version
This also fixes the Copyright section in the troffit generated HTML
output.
2020-03-21 15:48:49 +01:00
Aleksander Morgado
f1e77cdbe6 cli: context: add ':' to the section titles
So that --help-all print all sections in the same way as the Help and
Application option groups.
2020-03-21 15:40:13 +01:00
Aleksander Morgado
02f638d8d6 context: add ':' to the section titles
So that --help-all print all sections in the same way as the Help and
Application option groups.
2020-03-21 15:37:58 +01:00
Aleksander Morgado
38f6e4eec9 broadband-modem-mbim: fix segfault when loading capabilities
If loading capabilities using QMI over MBIM returns NONE without an
explicit error, the process would crash. Fix that by making the error
optional when NONE is received.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/185
2020-03-16 09:58:08 +01:00
Milo Casagrande
a6a721f3a8 l10n: Update Italian translation
Signed-off-by: Milo Casagrande <milo@milo.name>
2020-03-10 20:16:15 +01:00
Aleksander Morgado
b9e6f30ba8 kerneldevice,udev: don't assume interface is the direct parent object
E.g. it may be one more layer up:

  looking at device '/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8.4/1-8.4:1.1/ttyUSB1/tty/ttyUSB1':
    KERNEL=="ttyUSB1"
    SUBSYSTEM=="tty"
    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8.4/1-8.4:1.1/ttyUSB1':
    KERNELS=="ttyUSB1"
    SUBSYSTEMS=="usb-serial"
    DRIVERS=="option1"
    ATTRS{port_number}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8.4/1-8.4:1.1':
    KERNELS=="1-8.4:1.1"
    SUBSYSTEMS=="usb"
    DRIVERS=="option"
    ATTRS{bNumEndpoints}=="02"
    ATTRS{supports_autosuspend}=="1"
    ATTRS{bInterfaceNumber}=="01"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bInterfaceSubClass}=="06"
    ATTRS{bInterfaceProtocol}=="13"
    ATTRS{interface}=="Huawei Mobile Connect - Application"
    ATTRS{bInterfaceClass}=="ff"
    ATTRS{authorized}=="1"
2020-03-03 17:23:07 +00:00
Aleksander Morgado
6eabfd27bf huawei: only tag GETPORTMODE supported if it was really used
E.g. do nothing if the response is empty:

 <debug> (ttyUSB1): -->'AT^GETPORTMODE<CR>'
 <debug> (ttyUSB1): <--'<CR><LF>^GETPORTMODE: TYPE: WCDMA: Huawei Technologies Co.,Ltd.,<CR><LF><CR><LF>OK<CR><LF>'
2020-03-03 17:23:07 +00:00
Aleksander Morgado
353e27065d huawei: try to read port type hints from interface descriptions
So far, we're really only interested in the "modem" and "pcui" ports.

  root@9d52738:/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4# find . -name interface|sort
  ./1-1.4:2.0/interface
  ./1-1.4:2.1/interface
  ./1-1.4:2.2/interface
  ./1-1.4:2.3/interface
  ./1-1.4:2.4/interface
  ./1-1.4:2.5/interface
  ./1-1.4:2.6/interface

  root@9d52738:/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4# find . -name interface|sort|xargs cat
  CDC Ethernet Control Model (ECM)
  CDC Ethernet Data
  Huawei Mobile Connect - Modem
  Huawei Mobile Connect - Application
  Huawei Mobile Connect - Pcui
  Huawei Mobile Connect - Ctrl
  Huawei Mobile Connect - Serial B

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/170
2020-03-03 17:23:07 +00:00
Aleksander Morgado
9ef84d2cff kerneldevice: support reading interface 'description' 2020-03-03 17:23:07 +00:00
Aleksander Morgado
5da33df35b huawei: avoid attempting to complete GTask twice 2020-02-26 13:12:20 +01:00
Aleksander Morgado
fd052c8e58 base-sim: don't allow sending PIN/PUK if not required
This avoids issues when e.g. sending SIM-PIN while the modem is
already unlocked or when SIM-PIN is not enabled.

Under those conditions, the needlessly sent SIM-PIN unlock attempt may
fail while libmm-glib/mmcli reports a successful operation. E.g.:

  # mmcli --sim=/org/freedesktop/ModemManager1/SIM/0 --pin=3497
  successfully sent PIN code to the SIM

But in reality...

  Wed Nov 20 14:38:52 2019 daemon.debug [4254]: <debug> [1574260732.489513] Verifying PIN...
  Wed Nov 20 14:38:52 2019 daemon.debug [4254]: [/dev/cdc-wdm0] sent message...
  <<<<<< RAW:
  <<<<<<   length = 27
  <<<<<<   data   = 01:1A:00:00:0B:02:00:09:00:26:00:0E:00:02:06:00:01:04:33:34:39:37:01:02:00:06:00
  Wed Nov 20 14:38:52 2019 daemon.debug [4254]: [/dev/cdc-wdm0] sent generic request (translated)...
  <<<<<< QMUX:
  <<<<<<   length  = 26
  <<<<<<   flags   = 0x00
  <<<<<<   service = "uim"
  <<<<<<   client  = 2
  <<<<<< QMI:
  <<<<<<   flags       = "none"
  <<<<<<   transaction = 9
  <<<<<<   tlv_length  = 14
  <<<<<<   message     = "Verify PIN" (0x0026)
  <<<<<< TLV:
  <<<<<<   type       = "Info" (0x02)
  <<<<<<   length     = 6
  <<<<<<   value      = 01:04:33:34:39:37
  <<<<<<   translated = [ pin_id = 'pin1' pin_value = '3497' ]
  Wed Nov 20 14:38:52 2019 daemon.debug [4254]: [/dev/cdc-wdm0] received message...
  <<<<<< RAW:
  <<<<<<   length = 30
  <<<<<<   data   = 01:1D:00:80:0B:02:02:09:00:26:00:11:00:02:04:00:01:00:52:00:13:02:00:69:84:10:02:00:03:0A
  Wed Nov 20 14:38:52 2019 daemon.debug [4254]: [/dev/cdc-wdm0] received generic response (translated)...
  <<<<<< QMUX:
  <<<<<<   length  = 29
  <<<<<<   flags   = 0x80
  <<<<<<   service = "uim"
  <<<<<<   client  = 2
  <<<<<< QMI:
  <<<<<<   flags       = "response"
  <<<<<<   transaction = 9
  <<<<<<   tlv_length  = 17
  <<<<<<   message     = "Verify PIN" (0x0026)
  <<<<<< TLV:
  <<<<<<   type       = "Result" (0x02)
  <<<<<<   length     = 4
  <<<<<<   value      = 01:00:52:00
  <<<<<<   translated = FAILURE: AccessDenied

As we already know what the current lock status is, just abort the
user operation if the unlock operation isn't required.
2020-02-12 09:41:10 +00:00
Aleksander Morgado
9f192be632 iface-modem: allow loading current required lock info 2020-02-12 09:41:10 +00:00
Aleksander Morgado
634bb1caac base-sim: avoid using 'self' to refer to the modem 2020-02-12 09:41:10 +00:00
Aleksander Morgado
b6add18157 iface-modem-simple: don't abort connection attempt if SIM-PUK2 locked 2020-02-12 09:41:10 +00:00
Aleksander Morgado
94025aad6c base-sim: refactor common PIN/PUK unlock operations
Keep the saved GError directly as GTask context, instead of allocating
the SendPinPukContext unconditionally.
2020-02-12 09:41:10 +00:00
Aleksander Morgado
00dc961cad iface-modem-location: common helper code to test raw gps 2020-02-07 14:42:16 +00:00
Aleksander Morgado
a61caff747 iface-modem-location: plug memleaks when updating gps raw variant
The helper method returning a variant from a MMLocationGpsRaw would
return already a full variant reference instead of a floating one, so
we were really increasing the refcount when doing g_variant_ref_sink()
in the location interface.

Fix this by consolidating all helper methods in libmm-glib that return
variants from the different MMLocationXX objects, so that they all
return full variants instead of floating ones.
2020-02-07 14:42:16 +00:00
Bob Ham
a7a8fc909a broadband-modem: add optional extra carriage return to in-call URC regex
The BroadMobi BM818 has inconsitent line endings and the in-call URC
regex can miss events, particularly NO CARRIER, because the regex
doesn't match.  To fix this we add an optional carriage return to the
regex.  This will match for the BM818's output.
2020-02-06 15:16:46 +00:00
Bob Ham
38d7cc6683 broadband-modem: add secondary AT port to in-call port context
The BroadMobi BM818 sends URCs on the secondary port which are
currently missed.  To fix this, we include the secondary port in the
port context.
2020-02-06 15:16:46 +00:00
Bob Ham
e128210a27 iface-modem-voice: report calls only if +CLCC was successful
The BroadMobi BM818 can time out with +CLCC calls.  When this happens,
active calls are terminated due to reporting an empty list.  To fix
this, we only report the call list if the +CLCC didn't result in an
error.
2020-02-06 15:16:46 +00:00
Bob Ham
2c9760af66 iface-modem-voice: log details when ending call missing from call list
If a call is missing from the +CLCC call list and terminated because
of that, add a debugging statement to log the call details.
2020-02-06 15:16:30 +00:00
Bob Ham
b5d4f045d8 iface-modem-voice: match calls in call list by number
Outgoing calls which ring before the first +CLCC response cannot match
on the direction/state and are terminated, at least on the BroadMobi
BM818.  For example:

<debug> 1 calls being established: call list polling required
<debug> (ttyUSB1) device open count is 3 (open)
<debug> (ttyUSB1): --> 'AT+CLCC<CR>'
<debug> (ttyUSB1): <-- '<CR><LF>+CLCC: 1,1,0,1,0,"",128<CR><LF>+CLCC: 2,0,3,0,0,"07763578094",129<CR><LF><CR><LF>OK<CR><LF>'
<debug> Reported 2 ongoing calls
<debug> call at index 1: direction incoming, state active, number n/a
<debug> call at index 2: direction outgoing, state ringing-out, number 07763578094
<info>  Call state changed: dialing -> terminated (unknown)
<warn>  unexpected incoming call to number 'n/a' reported in call list: state active
<warn>  unexpected outgoing call to number '07763578094' reported in call list: state ringing-out

To fix this, we match calls in a +CLCC call list by number as
well.
2020-02-06 15:16:00 +00:00
Aleksander Morgado
bdd1874f17 tests,keyfiles: add dummy test to avoid -Wunused-function warnings
If none of the plugins enabled in the build has custom keyfiles, the
common_test() method would be unused. Avoid this just by adding a new
dummy test which is always available in the keyfiles tester.
2020-02-03 16:08:40 +01:00
Aleksander Morgado
55d344ab96 tests,udev-rules: add dummy test to avoid -Wunused-function warnings
If none of the plugins enabled in the build has custom udev rules, the
common_test() method would be unused. Avoid this just by adding a new
dummy test which is always available in the udev rules tester.
2020-02-02 11:33:13 +01:00
Aleksander Morgado
a8fd33ebaa port-qmi: fallback to raw-ip if WDA Get Data Format requests arguments
New devices return a "Missing Argument" error in WDA Get Data Format,
requiring the use of the "Endpoint info" TLV. Given that all these new
devices are raw-ip only anyway, let's use this error to right away
fallback to require raw-ip in the interface.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/177
2020-02-01 12:52:30 +01:00