Commit Graph

1329 Commits

Author SHA1 Message Date
Aleksander Morgado
11297bcc79 cinterion: implement connection status monitoring via ^SWWAN?
And consolidate the connection status checks done during connection and
disconnection so that we re-use the same logic.
2017-01-04 14:11:17 +01:00
Aleksander Morgado
9f725bc96a cinterion: default to PAP if no auth explicitly given
This is the same logic used in other implementations (e.g. QMI).
2017-01-04 14:11:17 +01:00
Aleksander Morgado
af2d6c1c4b cinterion: don't use predefined CIDs
The suggestion to use specific PDP context CIDs was given by Cinterion
for the special case of the Verizon operator, which 'reserves' specific
CIDs for specific purposes.

We don't want to impose that at the Cinterion plugin level, so remove
the PDP context mapping we had.

Therefore, simplify the connection procedure by just overriding the
'dialing' step of the default 3GPP connection sequence, instead of
overriding the whole connection sequence.

Also, we don't need to override the step to gather IP config because
this is already handled by the generic plugin (for DHCP over a network
interface).

We port to GTask for both 3GPP dial and 3GPP disconnect at the same time.
2017-01-04 14:11:17 +01:00
Aleksander Morgado
7d576a084c cinterion: fix typo in comment 2017-01-04 14:11:17 +01:00
Aleksander Morgado
1919138c68 cinterion: don't check for ^SWWAN support during enabling
Better check for ^SWWAN support during the first time a bearer is going
to be created.

The enabling phase isn't the correct one because this logic is only run
whenever a modem is detected but not hotplugged (i.e. this step is to
'reset' the modem to generic runtime settings).
2017-01-04 14:11:17 +01:00
Aleksander Morgado
9ca3fde06b cinterion: minor coding style fixes 2017-01-04 14:11:17 +01:00
Aleksander Morgado
37521ed2b6 cinterion: simplify ^SWWAN response parsing
We get as input the ^SWWAN index we're interested in, and we loop
through the list of ^SWWAN lines looking for the one we need.

This updated helper method allows working with multi-line ^SWWAN
responses, e.g. given when more than one PDP context is active.
2017-01-04 14:11:17 +01:00
Aleksander Morgado
dc96829bb5 cinterion: no need for private struct
The only member in the private network isn't even used.
2017-01-04 14:11:17 +01:00
Aleksander Morgado
f7ca0124b0 cinterion: rework 3GPP connection sequence
Group together all connection related logic (e.g. context) and define
the context steps directly within the connection sequence processing.

Also, don't initially run a disconnection before the connection; if that
logic is ever needed we should likely have it in the generic modem, not
done per plugin.

And error out early if not asking for IPv4.
2017-01-04 14:11:17 +01:00
Aleksander Morgado
955b46daf9 cinterion: rework 3GPP disconnection sequence
Group together all disconnection related logic (e.g. context) and define
the context steps directly within the disconnection sequence processing.
2017-01-04 14:11:17 +01:00
Aleksander Morgado
6721c83d07 cinterion: use BearerCinterionAuthType when possible 2017-01-04 14:11:17 +01:00
Aleksander Morgado
d50059ead4 cinterion: setup per-interface configuration settings
Define the relationship between PDP context, SWWAN index and USB
interface number in one single place.
2017-01-04 14:11:17 +01:00
Aleksander Morgado
938a53e7c6 cinterion: fix coding style for enum values
The enum values are given in UPPER_CASE format, not in CamelCase.
2017-01-04 14:11:17 +01:00
Aleksander Morgado
ef50c085f9 base-modem,cinterion: no need for a peek_current_data_port() method
We already get the data port given as input parameter in
disconnect_3gpp(), so there is no point in trying to find out which the
data port is.
2017-01-04 14:11:17 +01:00
Matthew Stanger
1ffcb16349 cinterion: implement support for the new SWWAN interface 2017-01-04 14:11:17 +01:00
Carlo Lobrano
61dc32a72c telit: wrong port peek in telit_qss_toggle_ready
qss unsolicited handler should be assigned to primary port first,
while secondary port was peeked.
2017-01-04 13:35:36 +01:00
Aleksander Morgado
944e34ecdb tests,dbus: append pid to abstract socket name
So that different concurrent runs of this same test don't clash with
each other:

    TEST: test-service-generic... (pid=11124)
      /MM/Service/Generic/enable-disable:                                  Activating service name='org.freedesktop.ModemManager1'
    Successfully activated service 'org.freedesktop.ModemManager1'
    ** (plugins/.libs/lt-test-service-generic>:11124): ERROR **: Cannot bind socket: Error binding to address: Address already in use
    cleaning up pid 11144
    FAIL
2016-11-23 11:02:18 +01:00
Aleksander Morgado
20074c5574 tests,dbus: check if we're asked to use an abstract socket 2016-11-23 11:02:18 +01:00
Aleksander Morgado
820ab01ddf kernel-device: ID_USB_INTERFACE_NUM should be read as an hex string
The original g_udev_device_get_property_as_int() uses strtol() without
an explicit base (i.e. 0) so that the base is autodetected from the
string whenever possible (e.g. if prefixes with '0x' it is treated as a
hexadecimal string).

But, for ID_USB_INTERFACE_NUM, we explicitly require reading the number
as an hex string, even if we don't have any '0x' prefix.

Reported-by: Matthew Stanger <stangerm2@gmail.com>
2016-11-07 19:41:05 +01:00
Aleksander Morgado
2c5af4f0bc core: use a default timeout of 300s for the scan networks operation
This is the value which we actually suggest in the manpage for the mmcli
operation, so just use the same one.

   Scanning for 3GPP networks may really take a long time, so a specific timeout must be given:
       $ mmcli -m 0 --3gpp-scan --timeout=300

       Found 4 networks:
       21404 - Yoigo (umts, available)
       21407 - Movistar (umts, current)
       21401 - vodafone ES (umts, forbidden)
       21403 - Orange (umts, forbidden)

https://bugs.freedesktop.org/show_bug.cgi?id=98235
2016-10-24 13:34:27 +02:00
Carlo Lobrano
7078587f58 telit: optimized supported and current band code
In place of two slightly different regexes for 2g/3g and 2g/3g/4g modems
we now use only one regex with conditional patterns for both supported
and current Bands detection.

Adding also minor fix in test code
2016-10-20 12:40:04 +02:00
Aleksander Morgado
33e563fe48 ublox: fix VPATH builds and distcheck
https://bugs.freedesktop.org/show_bug.cgi?id=98216
2016-10-13 11:49:44 +02:00
Aleksander Morgado
e3e803998c ublox: add README explaining all details of the plugin 2016-10-12 13:24:10 +02:00
Aleksander Morgado
38bf567536 ublox: longer timeout needed for AT probing
When the device is reset, it needs some time before the newly exposed TTYs are
able to reply to our AT commands. We increase the default timeout of the AT
probing commands in order to cope with that, or we'll end up with TTYs of
'unknown' type that aren't used for anything.
2016-10-12 13:24:09 +02:00
Aleksander Morgado
e64b964e8e ublox: implement connection statistics loading
The implementation uses +UGCNTRD=? to query whether the per-PDP context
statistics are supported by the device, and if they are, +UGCNTRD is used to
query them.

We only process the statistics for the specific CID we're using.
2016-10-12 13:24:09 +02:00
Aleksander Morgado
e6e53467ee ublox: new +UGCNTRD? response parser
The parser returns only the results for the CID being specified as input. This
is so that we can just query the statistics of the CID currently in use by the
bearer.
2016-10-12 13:24:09 +02:00
Aleksander Morgado
79aebb9ba4 ublox: implement current bands setting
Reuse the logic and context used to update current modes, as we need the same
steps (check current power state, go into low power, config update, and recover
previous power state).
2016-10-12 13:24:09 +02:00
Aleksander Morgado
1c69a847ae ublox: new +UBANDSEL=X command builder 2016-10-12 13:24:09 +02:00
Aleksander Morgado
c165f24514 ublox: implement current bands loading 2016-10-12 13:24:09 +02:00
Aleksander Morgado
09c9ca5749 ublox: new +UBANDSEL? response parser 2016-10-12 13:24:09 +02:00
Aleksander Morgado
4632836d40 ublox: implement supported bands loading 2016-10-12 13:24:09 +02:00
Aleksander Morgado
ca1b9cb686 ublox: use +UAUTHREQ to setup PDP context authentication 2016-10-12 13:24:08 +02:00
Aleksander Morgado
4c02fba819 ublox: implement PIN retry count loading 2016-10-12 13:24:08 +02:00
Aleksander Morgado
29517c99ba ublox: new +UPINCNT response parser 2016-10-12 13:24:08 +02:00
Aleksander Morgado
a561f6edf0 ublox: use +CEREG if LTE supported 2016-10-12 11:29:52 +02:00
Aleksander Morgado
7cb11f72cd ublox: implement current modes setting and modem power up/down/off/reset
Changing current allowed/preferred modes requires the device to be in low-power
mode, so we will make sure we return an error if any power operation is already
ongoing when a new one is requested.
2016-10-12 11:29:52 +02:00
Aleksander Morgado
9d78f05cbd ublox: new +URAT=X command builder 2016-10-12 11:29:52 +02:00
Aleksander Morgado
5d2e89e712 ublox: implement power state loading 2016-10-12 11:29:52 +02:00
Aleksander Morgado
151d608eec ublox: new u-blox specific +CFUN? response parser 2016-10-12 11:29:52 +02:00
Aleksander Morgado
d7fdda2247 linktop: new Linktop specific +CFUN? response parser
We handle all known CFUN? response values in the new parser, and report an error
if an unknown value is found.
2016-10-12 11:29:52 +02:00
Aleksander Morgado
74fd7da774 mbm: new MBM specific +CFUN? response parsers 2016-10-12 11:29:52 +02:00
Aleksander Morgado
b34f147ba2 ublox: implement current modes loading 2016-10-12 11:29:52 +02:00
Aleksander Morgado
bde9c4795a ublox: new +URAT? response parser 2016-10-12 11:29:52 +02:00
Aleksander Morgado
29ace8b120 ublox: implement supported modes loading
AT+URAT=? provides the format expected, but looks like it isn't implemented
differently for the different u-blox devices seen, so we need an additional
level of filtering which currently is applied per device model string.
2016-10-12 11:29:52 +02:00
Aleksander Morgado
a4466e83b7 ublox: new +URAT=? response parser 2016-10-12 11:29:52 +02:00
Aleksander Morgado
37bd614212 broadband-modem: implement default connection monitoring logic
A default implementation to monitor the ongoing connection is provided in the
generic MMBroadbandModem, based on AT+CGACT? to check whether the PDP context
of the connection (identified by the cached cid) is active or not.

This commit also disables the connection monitoring logic in those plugins that
have custom connection methods.
2016-10-12 11:29:52 +02:00
Aleksander Morgado
f2c2a6a05f novatel: subclass the connection monitoring logic
Instead of setting up a custom timeout source to poll the connection status, use
the generic logic in the base bearer object, and just re-implement the command
used to check the status.
2016-10-12 11:29:52 +02:00
Aleksander Morgado
467b3c57f0 modem-helpers: new COPS? response parser
Split into two different actions the actual COPS? response parsing and the
operator name normalization process.

Also, allow parsing not only the operator string, but also the format, mode
and the optional access technology value.
2016-10-12 11:29:52 +02:00
Aleksander Morgado
30772ffc26 ublox: implement connection using the 2G/3G logic in router or bridge mode 2016-10-12 11:29:52 +02:00
Aleksander Morgado
81715ee591 ublox: new +UIPADDR=N response parser 2016-10-12 11:29:52 +02:00