Commit Graph

183 Commits

Author SHA1 Message Date
Aleksander Morgado
50c1550c9f cinterion: fix missing GError initialization 2020-10-14 14:41:19 +02:00
Jessy Diamond Exum
7f39c16c8c cinterion: Add SIM hot swap to AT broadband modems (PLS8 & PLAS9).
Enable the SCKS Unsolicited Result Code (URC) to detect SIM hot
swap, and trigger SIM redetection.
2020-09-15 07:35:04 +00:00
Jessy Diamond Exum
b1679b5893 cinterion: Configure the PLAS9 to correctly send Unsolicited Result Codes.
The PLS8 and PLAS9 modems (and likely many others modems supported by
this driver) have two AT capable serial ports: The 'MODEM' AT port
(default for PPP) and the 'APPLICATION' AT port (used for general
control).

The PLS8 modem sends URCs to the APPLICATION port by default, while he
PLAS9 defaults sending URCs to the MODEM port. To get URCs to behave
on both modems, it is necessary to explicitly set the URC reporting
port to APPLICATION.
2020-09-15 07:35:04 +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
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
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
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
Giacinto Cifelli
df36f8d2d3 cinterion: fix syntax error for setting radio/bands/[23]g 2020-05-28 05:30:08 +02:00
Giacinto Cifelli
0cc5a6ce4f cinterion: skip sim ready check for modules that don't support it 2020-05-27 05:33:12 +00:00
Giacinto Cifelli
84ec3d2fcf cinterion: simplify check
no longer need to check the charset because of the fix in charsets,
that now accepts GSM and UCS2.
2020-05-26 14:26:14 +00:00
Aleksander Morgado
87b8c9b295 cinterion: minor coding style fixes in new band management 2020-05-26 15:05:52 +02:00
Giacinto Cifelli
793132d56d cinterion: radio/band handling for LTE modems 2020-05-26 15:05:52 +02:00
Aleksander Morgado
0926031119 Revert "charsets: don't warn in unlikely case of needing to convert to HEX from UTF-8"
This reverts commit 6a7dd87f30.

Reverting because the merge request was set to squash all together....
2020-05-26 15:04:20 +02:00
Giacinto Cifelli
6a7dd87f30 charsets: don't warn in unlikely case of needing to convert to HEX from UTF-8
This would really be an implementation detail, not a real use
case. Just don't warn in this case, as in the conversion in the
opposite direction.
2020-05-26 12:45:40 +00:00
Aleksander Morgado
98fa83a693 cinterion,tests: avoid cast-align errors
We can safely cast the data in a GArray to gpointer first, and then
to the pointer type we require.

  cinterion/tests/test-modem-helpers-cinterion.c: In function 'common_test_scfg':
  cinterion/tests/test-modem-helpers-cinterion.c:56:56: error: cast increases required alignment of target type [-Werror=cast-align]
       expected_bands_str = mm_common_build_bands_string ((const MMModemBand *)expected_bands->data,
                                                          ^
  cinterion/tests/test-modem-helpers-cinterion.c:58:47: error: cast increases required alignment of target type [-Werror=cast-align]
       bands_str = mm_common_build_bands_string ((const MMModemBand *)bands->data,
                                                 ^
  cinterion/tests/test-modem-helpers-cinterion.c: In function 'common_test_scfg_response':
  cinterion/tests/test-modem-helpers-cinterion.c:209:56: error: cast increases required alignment of target type [-Werror=cast-align]
       expected_bands_str = mm_common_build_bands_string ((const MMModemBand *)expected_bands->data,
                                                          ^
  cinterion/tests/test-modem-helpers-cinterion.c:211:47: error: cast increases required alignment of target type [-Werror=cast-align]
       bands_str = mm_common_build_bands_string ((const MMModemBand *)bands->data,
                                                 ^
2020-05-19 13:49:53 +02:00
Aleksander Morgado
58ae8f4c24 cinterion,helpers: minor coding style fix 2020-05-19 13:44:23 +02:00
Aleksander Morgado
76d06ce697 cinterion,helpers: avoid cast-align errors
We can safely cast the data in a GArray to gpointer first, and then
to the pointer type we require.

  cinterion/mm-modem-helpers-cinterion.c: In function 'mm_cinterion_build_band':
  cinterion/mm-modem-helpers-cinterion.c:409:54: error: cast increases required alignment of target type [-Werror=cast-align]
           bands_string = mm_common_build_bands_string ((MMModemBand *)bands->data, bands->len);
                                                        ^
2020-05-19 13:44:23 +02:00
Giacinto Cifelli
fae614becf udev rules for the PLS62 in 005b enumeration 2020-05-16 09:37:46 +02:00
Giacinto Cifelli
f109b528d3 plugins/cinterion: added Signal interface
Not all Cinterion modems support AT+CESQ.
However a much larger group of them support AT^SMONI
This commit uses the latter instead of the default former.
2020-05-15 13:49:18 +02:00
Aleksander Morgado
4b058872a0 plugins: don't add plugin name in log message explicitly 2020-04-08 17:53:42 +02:00
Aleksander Morgado
8722215f7e plugins: use logging module name as plugin name 2020-04-08 17:53:42 +02:00
Aleksander Morgado
e956bac47b log: common logging method definition for all testers and helpers 2020-04-08 17:53:42 +02:00
Aleksander Morgado
261ba90d08 cinterion: port to use object logging 2020-04-08 16:35:09 +02:00
Aleksander Morgado
0f708daf0b modem-helpers: port supported modes filtering to use object logging 2020-04-08 16:35:09 +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
Aleksander Morgado
00dc961cad iface-modem-location: common helper code to test raw gps 2020-02-07 14:42:16 +00:00
Aleksander Morgado
497398158f cinterion: fix warnings with -Wimplicit-fallthrough
cinterion/mm-broadband-bearer-cinterion.c: In function ‘dial_3gpp_context_step’:
  cinterion/mm-broadband-bearer-cinterion.c:393:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    393 |         ctx->step++;
        |         ~~~~~~~~~^~
  cinterion/mm-broadband-bearer-cinterion.c:396:5: note: here
    396 |     case DIAL_3GPP_CONTEXT_STEP_AUTH: {
        |     ^~~~
  cinterion/mm-broadband-bearer-cinterion.c:419:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    419 |         ctx->step++;
        |         ~~~~~~~~~^~
  cinterion/mm-broadband-bearer-cinterion.c:422:5: note: here
    422 |     case DIAL_3GPP_CONTEXT_STEP_START_SWWAN: {
        |     ^~~~
  cinterion/mm-broadband-bearer-cinterion.c: In function ‘disconnect_3gpp_context_step’:
  cinterion/mm-broadband-bearer-cinterion.c:613:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    613 |         ctx->step++;
        |         ~~~~~~~~~^~
  cinterion/mm-broadband-bearer-cinterion.c:615:5: note: here
    615 |     case DISCONNECT_3GPP_CONTEXT_STEP_STOP_SWWAN: {
        |     ^~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
eff4ca989d cinterion: fix warnings with -Wswitch-default
cinterion/mm-broadband-bearer-cinterion.c: In function ‘dial_3gpp_context_step’:
  cinterion/mm-broadband-bearer-cinterion.c:370:5: error: switch missing default case [-Werror=switch-default]
    370 |     switch (ctx->step) {
        |     ^~~~~~
  cinterion/mm-broadband-bearer-cinterion.c: In function ‘disconnect_3gpp_context_step’:
  cinterion/mm-broadband-bearer-cinterion.c:610:5: error: switch missing default case [-Werror=switch-default]
    610 |     switch (ctx->step) {
        |     ^~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
546715490d cinterion: fix warnings with -Wswitch-enum
cinterion/mm-broadband-modem-cinterion.c: In function ‘common_create_bearer’:
  cinterion/mm-broadband-modem-cinterion.c:1699:5: error: enumeration value ‘FEATURE_SUPPORT_UNKNOWN’ not handled in switch [-Werror=switch-enum]
   1699 |     switch (self->priv->swwan_support) {
        |     ^~~~~~
  ...
2020-01-31 15:18:35 +01:00
Aleksander Morgado
63d21151e2 cinterion: fix warnings with -Wimplicit-fallthrough
cinterion/mm-shared-cinterion.c: In function ‘disable_location_gathering_context_gps_step’:
  cinterion/mm-shared-cinterion.c:414:22: error: this statement may fall through [-Werror=implicit-fallthrough=]
    414 |         ctx->gps_step++;
        |         ~~~~~~~~~~~~~^~
  cinterion/mm-shared-cinterion.c:417:5: note: here
    417 |     case DISABLE_LOCATION_GATHERING_GPS_STEP_SGPSS:
        |     ^~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
198529495a cinterion: fix warnings with -Wswitch-default
cinterion/mm-shared-cinterion.c: In function ‘disable_location_gathering_context_gps_step’:
  cinterion/mm-shared-cinterion.c:412:5: error: switch missing default case [-Werror=switch-default]
    412 |     switch (ctx->gps_step) {
        |     ^~~~~~
  cinterion/mm-shared-cinterion.c: In function ‘enable_location_gathering_context_gps_step’:
  cinterion/mm-shared-cinterion.c:665:5: error: switch missing default case [-Werror=switch-default]
    665 |     switch (ctx->gps_step) {
        |     ^~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
52e4a6744c cinterion,helpers: fix warnings with -Wdiscarded-qualifiers
CC       cinterion/tests/test_modem_helpers_cinterion-test-modem-helpers-cinterion.o
  cinterion/tests/test-modem-helpers-cinterion.c: In function ‘test_slcc_urc_single’:
  cinterion/tests/test-modem-helpers-cinterion.c:749:64: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    749 |         { 1, MM_CALL_DIRECTION_INCOMING, MM_CALL_STATE_ACTIVE, "123456789" }
        |                                                                ^~~~~~~~~~~
  cinterion/tests/test-modem-helpers-cinterion.c: In function ‘test_slcc_urc_multiple’:
  cinterion/tests/test-modem-helpers-cinterion.c:764:65: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    764 |         { 2, MM_CALL_DIRECTION_INCOMING, MM_CALL_STATE_ACTIVE,  "123456789" },
        |                                                                 ^~~~~~~~~~~
  cinterion/tests/test-modem-helpers-cinterion.c:765:65: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    765 |         { 3, MM_CALL_DIRECTION_INCOMING, MM_CALL_STATE_ACTIVE,  "987654321" },
        |                                                                 ^~~~~~~~~~~
  cinterion/tests/test-modem-helpers-cinterion.c: In function ‘test_slcc_urc_complex’:
  cinterion/tests/test-modem-helpers-cinterion.c:781:65: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    781 |         { 1, MM_CALL_DIRECTION_INCOMING, MM_CALL_STATE_ACTIVE,  "123456789" },
        |                                                                 ^~~~~~~~~~~
  cinterion/tests/test-modem-helpers-cinterion.c:782:65: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    782 |         { 2, MM_CALL_DIRECTION_INCOMING, MM_CALL_STATE_WAITING, "987654321" },
        |
2020-01-31 14:52:49 +01:00
Aleksander Morgado
88983fd157 cinterion: use common re-registration logic when needed
If the modem requires +COPS re-registration after setting modes,
use the common logic provided by the 3GPP interface, which
already knows e.g. whether the registration was automatic or the
actual requested operator id in case of being manual.
2020-01-06 20:17:08 +00: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
45cf1ba20a cinterion: don't cache voice support check AT commands
The result of these commands may be different before and after SIM-PIN
unlock, so never cache them.
2019-10-17 08:31:46 +00:00
Aleksander Morgado
d5d0ed0b24 tests: print MM logs only on verbose test mode
Therefore, avoid needing ENABLE_TEST_MESSAGE_TRACES build symbol.
2019-10-14 15:30:27 +02:00