29 Commits
Author SHA1 Message Date
Sven Schwermer e96ea83f61 iface-modem-3gpp: Check before registering
If the modem is already registered when ModemManager probes the modem,
it will ignore the registration state since the modem is not enabled
yet. Always querying the registration state before starting the
registration procedure makes sure to catch such cases and not perform
unnecessary registration steps.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-12-06 14:03:47 +00:00
Sven Schwermer 1ef46a6886 fibocom: Don't disconnect initial EPS bearer
During profile setup, the profile manager normally disconnects a profile
before re-using it. We do not want to do this for the initial EPS bearer
because that would trigger de-registration.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-10-17 09:35:31 +00:00
Sven Schwermer 71a9739f1d fibocom: Set initial EPS bearer CID for MA510
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-10-17 09:35:31 +00:00
Sven Schwermer c509159dfe fibocom: Add initial EPS bearer support
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-10-17 09:35:31 +00:00
Sven Schwermer 855977c4c7 fibocom: Implement power down/off
Also bump the timeout for the +CFUN operations as they may take up to
10s according to the AT command manual (e.g. MA510).

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-10-17 09:35:30 +00:00
Sven Schwermer e5bb33a463 fibocom: Monitor connection status using +GTRNDIS?
In situations where the configured APN for the initial EPS bearer
(cid=1) does not match the APN for the actual connection, ModemManager
sets up a context (cid!=1) with the proper APN when connecting. If the
APN for the initial EPS bearer was not valid, the SIM may fall back to a
default one. If that default matches the APN for the proper connection,
the initial EPS bearer is re-used for the actual connection. In that
scenario, +CGACT? will report deactivated for the actual connection
context (cid!=1). ModemManager subsequently reports the connection as
disconnected.

+GTRNDIS? will always reflect the correct state for the context ID we
used to set up the ECM connection. Hence, it makes sense to use this
command to assess the connection status.

This has been tested with the MA510-GL modem module.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-10-17 09:35:30 +00:00
Sven Schwermer fcd393a6c2 quectel: Trigger reprobe upon RDY URC
Apparent self-resets without re-enumeration have been observed on
Quectel modems EC21 and EG91. See #285 and
https://lists.freedesktop.org/archives/modemmanager-devel/2022-September/009407.html

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/285

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-09-28 09:22:55 +00:00
Sven Schwermer bbf1b272e6 fibocom: Ignore +SIM READY URC
This URC is emitted when the SIM phonebook is initialized. We don't care
about that but don't want this URC to mess with the initialization
sequence either.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-07-11 11:50:00 +00:00
Sven Schwermer eebdbc45b5 fibocom: Add alternative MA510 USB config
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-07-08 08:26:33 +02:00
Sven Schwermer 38646bb68f fibocom: Add alternative L610 USB config
This is the factory-default setting. Make sure to support it as well as
the ECM/RNDIS settings. The L610 in GTUSBMODE=31 only enumerates with
serial USB interfaces using the option driver, so we need to allow that
driver too.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-07-08 08:25:40 +02:00
Sven Schwermer a2195babf2 fibocom: Fix GTRNDIS parsing function
This fixes a bug introduced in a2a0e2d754. Since the state pointer is
always non-NULL, the function will always fail if GTRNDIS is inactive,
i.e. the modem will return state=0 and no cid field.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-06-28 14:39:01 +02:00
Sven Schwermer a2a0e2d754 fibocom: ensure RNDIS disconnected before a new connection attempt
The ECM dialling guide requires to check whether RNDIS is already active
before attempting to establish an ECM/RNDIS connection.

If it is active (regardless of its settings), we will disconnect it
first, before attempting the new connection with the user-provided
settings.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-06-27 19:15:31 +00:00
Sven Schwermer 661a63b37b broadband-bearer: Save profile ID upon successful connection
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-06-19 15:11:10 +02:00
Sven Schwermer 210fa8bf35 qmi: Fall back to NAS SSP/NAS TP capabilities
If no DMS capabilities are reported, we fall back to the capabilities
reported by NAS SSP or NAS TP.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-03-30 10:19:09 +02:00
Sven Schwermer 95eef34d37 modem-helpers: Consider minimum ID when choosing best profile
+CGDCONT? may list profiles with IDs that are illegal to write, i.e.
+CGDCONT=? returns a minimum ID larger than some of the existing
profiles. E.g. for Fibocom L610-EU, +CGDCONT=? returns

+CGDCONT: (1-7),"IP",,,(0-3),(0-4)
+CGDCONT: (1-7),"IPV6",,,(0-3),(0-4)
+CGDCONT: (1-7),"IPV4V6",,,(0-3),(0-4)
+CGDCONT: (1-7),"PPP",,,(0-3),(0-4)
+CGDCONT: (1-7),"Non-IP",,,(0-3),(0-4)

while the default EPS bearer is established at profile 0:

+CGDCONT: 0,"IP","xxx","xxx.xxx.xxx.xxx",0,0
[...]

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-03-09 22:43:20 +00:00
Sven Schwermer 318bac1186 fibocom: Add reset functionality
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-03-09 09:23:15 +00:00
Sven Schwermer b64ffeee9c fcc-unlock: Make scripts POSIX shell compatible
This allows us to not rely on bash which may not be available on
constrained systems, e.g. Yocto-built embedded systems. The scripts now
pass shellcheck.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2022-02-25 21:51:36 +01:00
Sven Schwermer 300e1023ef fibocom: Double-check connection after dialing
Fibocom's documentation states that we must double-check the connection
is established when setting up an ECM connection. The possible replies -
according to the documentation - are:

  +GTRNDIS: <state>,<cid>,<ip>,<prim. dns>,<sec. dns>
  OK

or

  +GTRNDIS: 0

We just care about the state value which is 1 if everything worked.
2022-01-11 09:31:32 +00:00
Sven Schwermer 382a7c2425 fibocom: Use ECM bearer if +GTRNDIS is available
Some modems might have a net port but don't support +GTRNDIS which is
used by the ECM bearer. That case will be caught by this additional
check.
2022-01-11 09:31:32 +00:00
Sven Schwermer c174fd29dc fibocom: Add L610 support 2022-01-11 09:31:32 +00:00
Sven Schwermer 2830cb3273 fibocom: Add udev port rules for MA510-GL 2022-01-11 09:31:32 +00:00
Sven Schwermer c21bcb5526 fibocom: Add bearer for ECM-based connections 2022-01-11 09:31:32 +00:00
Sven Schwermer 6ad17fb22e fibocom: Subclass broadband modem
This is required in order to be able to use a custom bearer which in
turn is necessary for establishing ECM connections.
2022-01-11 09:31:32 +00:00
Sven Schwermer c70b355718 qmi: Network registration via SSSP if possible
Doing the network registration via Set System Selection Preference is
preferable because it doesn't override the currently set allowed mode,
i.e. access technology.

https://lists.freedesktop.org/archives/modemmanager-devel/2020-July/007972.html

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2020-07-16 08:13:10 +00:00
Sven Schwermer da729943b1 quectel: Add port type hints for BG96
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2019-10-30 11:22:19 +01:00
Sven Schwermer 9e63037c5a quectel: Fix port type hints for EG91
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2019-10-30 11:15:23 +01:00
Sven Schwermer c61bd846f3 quectel: Add port type hints for the Quectel EG91
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2019-08-01 16:23:36 +02:00
Sven Schwermer 7e4a8d9566 ublox: add LISA/SARA-U2 alternative port types
When configuring these modems with AT+UUSBCONF=2, i.e. CDC-ECM + 4x
CDC-ACM, they also enumerate with a different PID on the USB. We need to
adjust the udev rules for that case in order to ignore the non-AT ports.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2019-04-03 13:17:19 +02:00
Sven Schwermer 98fbc7a8b3 ublox: Add CDC-ECM support for SARA/LISA-U2xx
The SARA-U2xx and LISA-U20x require the PDP context to be activated via
+UCEDATA instead of +CGACT=1 when using the CDC-ECM USB profile.
Furthermore, they expect the DHCP discover packet from the TE while the
command is running, i.e. while the modem has not replied yet. In order
to achieve that, the bearer is marked as connected as soon as the
command is issued. This makes the NetworkManager start the DHCP process.
If the modem replies with an error, the bearer will be marked
disconnected later on.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2018-10-31 11:07:39 +01:00