Commit Graph

7059 Commits

Author SHA1 Message Date
Aleksander Morgado
248cd55f0e examples: new network-scan-python example
This is currently not working completely ok because python doesn't
know how to free the GList of MMModem3gppNetwork elements.

  /org/freedesktop/ModemManager1/Modem/1: starting network scan...
  21403: Orange - Orange (unknown, forbidden)
  21401: vodafone ES - vodafone ES (unknown, forbidden)
  21403: Orange - Orange (unknown, forbidden)
  21403: Orange - Orange (unknown, forbidden)
  21401: vodafone ES - vodafone ES (unknown, forbidden)
  21404: Yoigo - Yoigo (unknown, forbidden)
  21401: vodafone ES - vodafone ES (unknown, forbidden)
  21404: Yoigo - Yoigo (unknown, forbidden)
  21407: Movistar - Movistar (unknown, available)
  21407: Movistar - Movistar (unknown, available)
  21407: Movistar - Movistar (unknown, current)
  free(): invalid pointer
  Aborted
2019-12-13 17:36:06 +01:00
Aleksander Morgado
f9e26fb54b Revert "build: fix order of linked libs in test apps"
This reverts commit 3eb623e73b.

This change is plain wrong. The correct order was already fixed in
commit 42dab8e8.
2019-12-12 14:53:44 +01:00
Aleksander Morgado
3eb623e73b build: fix order of linked libs in test apps
Solving build issues with truly strict linkers, as in:
http://lists.busybox.net/pipermail/buildroot/2019-December/268817.html
2019-12-11 16:11:44 +01:00
Aleksander Morgado
42aa9cc2f6 ublox: implement support to enable and detect +UUDTMF URCs
Also, make sure we enable/disable the voice related unsolicited events
in both primary and secondary ports, because it may happen that the
primary port is connected with PPP and we're using the secondary port
for control.
2019-12-05 15:48:55 +01:00
Aleksander Morgado
8d96d1d660 cinterion: fix using correct finish() method in AT command
When using mm_base_modem_at_command_full(), the corresponding
mm_base_modem_at_command_full_finish() should be used.
2019-12-05 15:45:38 +01:00
Aleksander Morgado
5f0f2cb9d9 base-call: do not require primary port to start a call
If the modem is connected using the primary port, we can just rely on
the secondary port.

    # mmcli --call 0 --start
    error: couldn't start the call: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Connected: Cannot run sequence: port is connected'
2019-12-05 15:45:38 +01:00
Aleksander Morgado
0660b6b162 broadband-modem: trivial fix in logging +CLIP setting 2019-12-04 10:10:39 +01:00
Aleksander Morgado
28869463a1 iface-modem: allow Command() while in Failed state
Allow the generic command API while in FAILED state, in case the modem
integrator has some special commands to recover the device.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/163
2019-12-03 09:20:24 +00:00
Aleksander Morgado
03e6375a95 bearer-qmi: current settings are mandatory when using 'static' addressing
If for any reason getting current settings fails and we require static
IP addressing (when using raw-ip), then that must be a hard error,
otherwise we'll end up with the modem reported as connected but
without any IP settings to use:

 <info>  error: couldn't get current settings: QMI protocol error (15): 'OutOfCall'
 <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (registered -> connected)
 <info>  Simple connect state (8/8): All done
 <warn>  Reloading stats failed: Couldn't get packet statistics: QMI protocol error (15): 'OutOfCall'

  # mmcli -b 0
  Bearer '/org/freedesktop/ModemManager1/Bearer/0'
    -------------------------
    Status             |   connected: 'yes'
                       |   suspended: 'no'
                       |   interface: 'wwan1'
                       |  IP timeout: '20'
    -------------------------
    Properties         |         apn: 'm2minternet'
                       |     roaming: 'allowed'
                       |     IP type: 'none'
                       |        user: 'none'
                       |    password: 'none'
                       |      number: 'none'
                       | Rm protocol: 'unknown'
    -------------------------
    IPv4 configuration |   method: 'unknown'
    -------------------------
    IPv6 configuration |   method: 'unknown'
    -------------------------
    Stats              |          Duration: '0'
                       |    Bytes received: 'N/A'
                       | Bytes transmitted: 'N/A'

  # mmcli -m 0

  /org/freedesktop/ModemManager1/Modem/0 (device id '48f6c35f3d0376aa261a91c0cf7e6340d5a91601')
    ...
    Status   |           lock: 'sim-pin2'
             | unlock retries: 'sim-pin (3), sim-pin2 (3), sim-puk (10), sim-puk2 (10)'
             |          state: 'connected'
             |    power state: 'on'
             |    access tech: 'lte'
             | signal quality: '96' (recent)
2019-12-03 08:56:47 +00:00
Aleksander Morgado
76cafbb603 bearer: avoid reporting disconnection error if already disconnected
When we try to disconnect a bearer and the bearer is already
disconnected (e.g. after a cancelled connection attempt), avoid reporting
that as an error:

  <warn>  [1575287560.433398] Error disconnecting bearer '/org/freedesktop/ModemManager1/Bearer/0': 'Couldn't disconnect QMI bearer: this bearer is not connected'. Will assume disconnected anyway.
2019-12-03 08:56:47 +00:00
Aleksander Morgado
991e615736 bearer-qmi: handle disconnection indications during connection attempts
If a WDS indication is received telling us that the modem is no longer
connected, abort the ongoing connection attempt right away with an
error and cleanup all allocated clients (implicitly disconnecting them
if required)..

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/155
2019-12-03 08:56:47 +00:00
Aleksander Morgado
ae53b0458b bearer-qmi: common complete method for the connection attempt
Refactor the logic and setup a common complete_connect() method that
helps us complete the GTask associated to the connection attempt.
2019-12-03 08:56:47 +00:00
Aleksander Morgado
2790074c7e bearer-qmi: close QMI port if it was open during connection
If the bearer is using a QMI port that is not the primary one, we need
to explicitly open it during the connection attempt. Keep track of
that, and make sure we close it during normal disconnection or if the
connection attempt fails.
2019-12-03 08:56:47 +00:00
Aleksander Morgado
32d1f1deda sierra: implement manual CDMA activation 2019-12-03 08:43:40 +00:00
Aleksander Morgado
af08492209 sierra: implement automatic CDMA activation 2019-12-03 08:43:39 +00:00
Aleksander Morgado
8fa622ddbb novatel: implement manual CDMA activation
Including IOTA-based update, e.g. for Sprint.
2019-12-03 08:43:39 +00:00
Aleksander Morgado
5712c71593 novatel: implement automatic CDMA activation 2019-12-03 08:43:39 +00:00
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
e60132284b libmm-glib: SID value '0' is actually a good one 2019-12-03 08:43:39 +00:00
Aleksander Morgado
f7418da3bc huawei: avoid using the QCDM port during a voice call 2019-12-02 22:15:53 +00:00
Aleksander Morgado
09619e8cc4 data: added valgrind suppressions file imported from NM 2019-12-02 13:40:32 +01:00
Aleksander Morgado
9e785e145f mmcli,output: skip printing empty value lists
E.g. we shouldn't print emergency numbers field if there is none available:

  $ mmcli -i 0
    -------------------------------
    General    |         dbus path: /org/freedesktop/ModemManager1/SIM/0
    -------------------------------
    Properties |              imsi: 901700000026890
               |             iccid: 8988211000000268907
               |       operator id: 90170
               |     operator name: 901 70
               | emergency numbers:
2019-12-02 11:29:26 +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
792f15648c ci: redefine when jobs are run
* single-plugin builds only on schedules
 * with/without qmi/mbim builds on master and merge requests
 * default build always, including on branches and when git pushing
2019-11-27 10:11:43 +00:00
Aleksander Morgado
c4991165c2 ci: new job to build all single-plugin configurations 2019-11-27 10:11:43 +00:00
Aleksander Morgado
09080073ff build: setup plugin selection logic 2019-11-27 10:11:43 +00:00
Aleksander Morgado
1d1f597b55 telit: setup as loadable 'shared' utils 2019-11-27 10:11:43 +00:00
Aleksander Morgado
7bcb8c9515 foxconn: setup as loadable 'shared' utils 2019-11-27 10:11:43 +00:00
Aleksander Morgado
fce7892058 xmm: setup as loadable 'shared' utils 2019-11-27 10:11:43 +00:00
Aleksander Morgado
b765e88e57 novatel: setup as loadable 'shared' utils 2019-11-27 10:11:43 +00:00
Aleksander Morgado
2d779b97c4 option: setup as loadable 'shared' utils 2019-11-27 10:11:43 +00:00
Aleksander Morgado
23df25f25c sierra: setup as loadable 'shared' utils 2019-11-27 10:11:43 +00:00
Aleksander Morgado
9907407fd1 mbm: skip setting up as common utils library
The Ericsson MBM modem management is only used by the MBM plugin.
2019-11-27 10:11:43 +00:00
Aleksander Morgado
a6d76cfceb icera: setup as loadable 'shared' utils 2019-11-27 10:11:43 +00: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
1bd6980510 plugins: add README explaining plugin relationships 2019-11-27 10:11:43 +00:00
Rafael Fontenelle
95dd8aaf90 po: update Brazilian Portuguese translation 2019-11-27 10:59:13 +01: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
913f0d638d ci: require autoconf-archive 2019-11-22 11:06:26 +01:00
Amol Lad
8f4b5b52ee sierra: add port hints for EM7565 modem 2019-11-19 16:01:41 +05:30