Commit Graph

2065 Commits

Author SHA1 Message Date
Teijo Kinnunen
e52ad1cc88 iface-modem: add an optional iccid parameter to check_for_sim_swap
If the new iccid is already available, reading the iccid from the
card can be skipped.
2020-09-07 15:18:52 +03:00
Aleksander Morgado
49b4e6a6ff quectel: prefer +CTZU=3 to +CTZU=1 if supported
Some quectel modems, like the EC25, require +CTZU=3 in order to have
CCLK? report localtime instead of UTC time.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/233
2020-09-04 08:32:30 +00:00
Aleksander Morgado
e65175234b quectel: new custom +CTZU=? parser
Some quectel devices, like the EC25 have a non-standard additional '3'
mode value:

  0: Disable automatic time zone update via NITZ
  1: Enable automatic time zone update via NITZ
  3: Enable automatic time zone update via NITZ and update LOCAL time to RTC
2020-09-04 08:32:30 +00:00
Aleksander Morgado
42288fc2a1 simtech: add SIM7070/SIM7080/SIM7090 port type hints
These modules have 2 different USB layouts:

The default layout with PID 0x9205 (AT+CUSBSELNV=1) exposes 4 TTYs and
an ECM interface:

  T:  Bus=02 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#=  6 Spd=480 MxCh= 0
  D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
  P:  Vendor=1e0e ProdID=9205 Rev=00.00
  S:  Manufacturer=SimTech, Incorporated
  S:  Product=SimTech SIM7080
  S:  SerialNumber=1234567890ABCDEF
  C:  #Ifs= 6 Cfg#= 1 Atr=e0 MxPwr=500mA
  I:  If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
  I:  If#=0x1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
  I:  If#=0x2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
  I:  If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
  I:  If#=0x4 Alt= 0 #EPs= 1 Cls=02(commc) Sub=06 Prot=00 Driver=cdc_ether
  I:  If#=0x5 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether

The purpose of each TTY is as follows:
 * ttyUSB0: DIAG/QCDM port.
 * ttyUSB1: GNSS data.
 * ttyUSB2: AT-capable port (control).
 * ttyUSB3: AT-capable port (data).

In the secondary layout with PID=0x9206 (AT+CUSBSELNV=86) the module
exposes 6 TTY ports:

  T:  Bus=02 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#=  8 Spd=480 MxCh= 0
  D:  Ver= 2.00 Cls=02(commc) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
  P:  Vendor=1e0e ProdID=9206 Rev=00.00
  S:  Manufacturer=SimTech, Incorporated
  S:  Product=SimTech SIM7080
  S:  SerialNumber=1234567890ABCDEF
  C:  #Ifs= 6 Cfg#= 1 Atr=e0 MxPwr=500mA
  I:  If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
  I:  If#=0x1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
  I:  If#=0x2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
  I:  If#=0x3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
  I:  If#=0x4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
  I:  If#=0x5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option

The purpose of each TTY is as follows:
 * ttyUSB0: DIAG/QCDM port.
 * ttyUSB1: GNSS data.
 * ttyUSB2: AT-capable port (control).
 * ttyUSB3: QFLOG interface.
 * ttyUSB4: DAM interface.
 * ttyUSB5: AT-capable port (data).
2020-08-29 11:07:44 +02:00
Aleksander Morgado
86a183778b api,sim: new 'Active' property
In preparation for the multi-SIM setup, we need a way to tell whether
a given SIM card is active or not in the system.

On systems with one single SIM slot, the available SIM card will
always be active.

On Multi-SIM Single-Standby setups we may have multiple SIM slots with
multiple SIM cards, but only one of them will be active at any given
time.

On Multi-SIM Multi-Standby setups we may have multiple SIM slots with
multiple SIM cards that may be active at the same time. E.g. the QMI
protocol allows up to 5 different active SIM cards (primary,
secondary, tertiary...).
2020-08-28 14:59:06 +00:00
carlyin
5346d3c55c quectel: add port type hints for the Quectel 5G RM500 2020-08-16 12:24:37 +00:00
Aleksander Morgado
55ae47a3bb quectel: add udev rules unit tester 2020-08-16 14:17:41 +02:00
root
d9a64c74ff quectel: allow MBIM devices 2020-08-15 16:21:30 +00:00
Giacinto Cifelli
2f684ce92e cinterion: remove limitation to IPv4 only PDP contexts
There was a limitation in the past in the plugin, because one of the steps
during the dial (CONNECT_3GPP_CONTEXT_STEP_PDP_CTX) was to reconfigure a
specific CID hardcoding the IP type to IPv4.

That logic was removed in commit af2d6c1c4b,
but we didn't remove the IPv4 limitation at that point.
2020-08-11 15:52:45 +00:00
Giacinto Cifelli
a36beb0a95 cinterion: clarify role of the AT ports for the ELS61/PLS62 family 2020-08-11 15:33:57 +00:00
Giacinto Cifelli
e2ab49db0f cinterion: setup initial LTE parameters 2020-08-11 07:17:07 +00:00
Aleksander Morgado
28ad994e37 sierra: XMM-specific features in XMM based modems (e.g. EM7345)
We create XMM-based modems like the EM7345 with XMM-specific features
like the AT+XLCSLSR based GNSS support. E.g.:

  $ mmcli -m a --location-status
    ------------------------
    Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea, agps-msa, agps-msb
             |      enabled: 3gpp-lac-ci
             |      signals: no
    ------------------------
    GPS      | refresh rate: 30 seconds

  $ sudo mmcli -m a --location-enable-gps-nmea
  successfully setup location gathering

  $ sudo mmcli -m a --location-get
    --------------------------
    3GPP |      operator code: 214
         |      operator name: 7
         | location area code: 0000
         | tracking area code: 6FFE
         |            cell id: 0465CD20
    --------------------------
    GPS  |               nmea: $GPGSA,A,1,,,,,,,,,,,,,,,*1E
         |                     $GNGSA,A,1,,,,,,,,,,,,,,,,1*1D
         |                     $GNRMC,235951.000,V,,,,,,,,,,N,V*20
         |                     $GNVTG,,T,,M,,N,,K,N*32
         |                     $GNGGA,235951.000,,,,,0,0,,,M,,M,,*5F

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/25
2020-08-10 19:38:38 +02:00
Giacinto Cifelli
422a9070c4 cinterion: fixed cast from wrong object
MM_BROADBAND_MODEM_CINTERION shall be applied to a *MMBaseModem
    (ctx->modem here)
and not to a *MMBaseBearer (self here)
2020-08-04 11:04:17 +02:00
Aleksander Morgado
74dd28c4e3 broadband-modem: minor method rename 2020-08-01 10:02:02 +02:00
Giacinto Cifelli
4f1da87972 cinterion: IMT family SGAUTH
some ITM family modems require full parameters:
	AT^SGAUTH=cid,type,user,pwd
even when type is AUTH_NONE.
Fortunately, all modules of the IMT family tolerate this syntax,
so it can be adopted for the entire family.
2020-07-27 11:34:16 +00:00
Giacinto Cifelli
07ac85e2f7 cinterion: ignore ^SYSSTART urc 2020-07-27 12:24:17 +02:00
Giacinto Cifelli
408ec530e0 cinterion: extend SGAUTH syntax
AT^SGAUTH syntax depends on the modem family:
  AT^SGAUTH=cid,type,user,pwd   for the IMT family
  AT^SGAUTH=cid,type,pwd,user   for the rest
2020-07-27 09:42:03 +02:00
Giacinto Cifelli
cec6fe9cce cinterion: radio/band single scfg line: no variance
the AT^SCFG="Radio/Band" command does not return a different answer
for different charsets.
This code was working previously because the charset was left to default (GSM)
at the time of this operation, and therefore the string was unchanged anyway.
2020-07-26 13:33:05 +00:00
Giacinto Cifelli
4d58278d7f changed default authentication algorithm to CHAP
CHAP is almost universal nowadays, and so it is a better default
than PAP

Not changed for uBlox, that prefers an error if not specified,
and for Huawei, which uses NONE with user/pwd and has 2 CHAP choices
2020-07-24 16:34:40 +02:00
Aleksander Morgado
a131c6953a cinterion: quote user/password strings in AT^SGAUTH calls
The ELS61 doesn't like authentication given without quotes:
  [modem3/ttyACM1/at] --> 'AT^SGAUTH=8,1,tm,t-mobile<CR>'
  [modem3/ttyACM1/at] <-- '<CR><LF>+CME ERROR: 4<CR><LF>'

Only when user/pass strings are quoted it works:
  [modem6/ttyACM1/at] --> 'AT^SGAUTH=8,1,"t-mobile","tm"<CR>'
  [modem6/ttyACM1/at] <-- '<CR><LF>OK<CR><LF>'
2020-07-06 16:54:07 +02:00
Aleksander Morgado
0a89a9ae4e cinterion: if user OR password given, don't set the other as (null)
[modem2/ttyACM1/at] --> 'AT^SGAUTH=8,1,t-d1,(null)<CR>'
  [modem2/ttyACM1/at] <-- '<CR><LF>+CME ERROR: 4<CR><LF>'

We should use an empty string instead.
2020-07-06 16:23:57 +02:00
Aleksander Morgado
e933fe1413 cinterion: increase SWWAN connection attempt timeout
It's critical not to timeout early on devices with AT ports, or we may
end up flagging the modem as invalid.

  ModemManager[26829]: <debug> [1593097973.552712] [modem1/ttyACM0/at] --> 'AT^SWWAN=1,2,1<CR>'
  ....
  ModemManager[26829]: <debug> [1593098064.195217] [modem1] couldn't connect bearer: Serial command timed out
  ....
  ModemManager[26829]: <error> [1593098091.167987] [modem1] port ttyACM0 timed out 10 consecutive times, marking modem as invalid
2020-07-06 16:23:36 +02:00
Aleksander Morgado
c79dcf7940 cinterion,signal: ^SMONI=? support check may be cached 2020-07-04 06:37:07 +02:00
Aleksander Morgado
ee262a473d cinterion,signal: report error from parent signal support check 2020-07-04 06:37:07 +02:00
Aleksander Morgado
2cb8e5ef5d cinterion,signal: minor coding style fixes 2020-07-04 06:37:07 +02:00
Walter Hagstrom
88923ffe39 iface-modem-signal: added 5G signal information
Extended the ModemManager Signal interface to include 5G signal
information for RSRP, RSRQ and SINR via libqmi.  Also extended mmci
to print 5G signal info.
2020-07-04 05:50:41 +02:00
Daniele Palmas
fff47478cc telit: added port type hints for default MEx10G1 composition
While at this change also the previous generic reference to ME910
in order to differentiate between ME910C1 (based on MDM9206) and
MEx10G1 (based on MDM9205).
2020-07-02 13:09:19 +02:00
Aleksander Morgado
23f8b580c3 quectel,shared: implement custom time support check
We require CTZU=3 during the time support check, instead of CTZU=1, so
that the Quectel modem reports localtime instead of UTC time in +CCLK.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/233
2020-06-30 13:12:25 +02:00
Aleksander Morgado
ffca45d9cc quectel,shared: add GPS trace handler 2020-06-29 08:53:00 +00:00
Aleksander Morgado
70b7218b7b huawei: only flag GPS source as enabled if it was successful 2020-06-29 08:53:00 +00:00
Aleksander Morgado
af8afcc6c9 quectel,shared: only flag GPS source as enabled if it was successful 2020-06-29 08:53:00 +00:00
Aleksander Morgado
60211b51b1 quectel,shared: use QGPS=? test to check capabilities 2020-06-29 08:53:00 +00:00
Aleksander Morgado
58dbb68fa0 quectel,qmi: add QGPS based fallback support 2020-06-29 08:53:00 +00:00
Aleksander Morgado
78d19c10ba quectel,shared: port GPS enabling to use AT sequence 2020-06-29 08:53:00 +00:00
Aleksander Morgado
41ba7d667a huawei: simplify GPS stop logic
The NMEA data port is closed right before stopping the engine.
2020-06-29 08:53:00 +00:00
Aleksander Morgado
aa4851ed03 huawei: port GPS enabling to use AT sequence 2020-06-29 08:53:00 +00:00
Aleksander Morgado
bbca65d682 quectel,shared: skip QGPS? check after enabling/disabling failures
If any enabling/disabling command fails, we consider the operation
failed, regardless of the QGPS status. This is because e.g. enabling
involves more operations than just QGPS=1, and so we should treat a
failure in the command sequence as a failure in the whole operation.
2020-06-29 08:53:00 +00:00
Aleksander Morgado
bbfc10d7c5 huawei: minor refactor in GPS enabling/disabling logic 2020-06-29 08:53:00 +00:00
Aleksander Morgado
538ed3f24e quectel,shared: don't report GPS capabilities if no GPS port found
The QGPS based implementation needs the existence of a port flagged as
GPS data; if there is no such port, we cannot provide GPS support.
2020-06-29 08:53:00 +00:00
Aleksander Morgado
77f6637750 quectel,shared: fix reporting supported location capabilities
The method that reports what location capabilities are supported must
report the capabilities provided by the parent interface plus the
additional capabilities supported by the shared implementation.

Also, simplify the logic a bit reducing the amount of implemented
methods.
2020-06-29 08:53:00 +00:00
Aleksander Morgado
0f9d69fd35 quectel,shared: private context at beginning of source file 2020-06-29 08:53:00 +00:00
Aleksander Morgado
234ba4544b quectel: coding style fixes in the QGPS logic 2020-06-29 08:53:00 +00:00
Aleksander Morgado
5a9d321346 quectel,shared: fix parent location disabling
The GTask must be passed as user_data.
2020-06-29 08:53:00 +00:00
ArenM
df393df147 quectel: implement GPS support with +QGPS
Quectel modems allow provide location information via AT commands.
Add this as a location source.
2020-06-29 08:53:00 +00:00
Aleksander Morgado
4b37b7d3cf base-modem,at: response processors return a more specific enum
Instead of using the FALSE return of the method to indicate either a
fatal error (if result_error was set) or the continuation request (if
result_error wasn't set), provide a enum that has explicit states for
all three possible values (failure, success or continue).
2020-06-28 15:07:34 +02:00
Aleksander Morgado
71d65bbe7e u-blox: always ignore M8 and M9 GPS modules 2020-06-22 14:10:28 +02:00
Aleksander Morgado
ecf54efc67 cinterion: added port type hints for the mPLS62-w in MBIM mode
T:  Bus=01 Lev=02 Prnt=04 Port=01 Cnt=01 Dev#= 40 Spd=480 MxCh= 0
  D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
  P:  Vendor=1e2d ProdID=005d Rev=17.30
  S:  Manufacturer=Cinterion Wireless Modules
  S:  Product=PLSx
  C:  #Ifs=12 Cfg#= 1 Atr=e0 MxPwr=100mA
  I:  If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=01 Driver=cdc_acm
  I:  If#=0x1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm
  I:  If#=0xa Alt= 1 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim
  I:  If#=0xb Alt= 2 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
  I:  If#=0x2 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=00 Driver=cdc_acm
  I:  If#=0x3 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm
  I:  If#=0x4 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=00 Driver=cdc_acm
  I:  If#=0x5 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm
  I:  If#=0x6 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=00 Driver=cdc_acm
  I:  If#=0x7 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm
  I:  If#=0x8 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=00 Driver=cdc_acm
  I:  If#=0x9 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm
2020-06-19 12:28:57 +00:00
Aleksander Morgado
c2ee73173e cinterion: allow MBIM-powered devices
Like the mPLS62-w when setup to be controlled in MBIM mode instead of
plain AT commands.
2020-06-19 12:28:57 +00:00
Brendan Peter
cb8d810583 quectel: add port type hints for EG95 2020-06-16 09:16:28 +02:00
Aleksander Morgado
bbeca60113 ublox: fully ignore GPS devices with plugin-installed rules
Instead of setting up the ID_MM_TTY_BLACKLIST tag used in 'legacy'
filter mode, tag all known u-blox GPS devices with the broader
ID_MM_DEVICE_IGNORE tag that applies under all filter modes.

Also, make this rules be installed by the plugin itself, because at
the end, it is the u-blox plugin the one attempting to probe all
devices with vid 0x1546.
2020-06-04 11:34:43 +02:00