Commit Graph

2134 Commits

Author SHA1 Message Date
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
Aleksander Morgado
d36df68226 wavecom: break loop matching 2G bands if exact combination found 2020-06-02 10:16:33 +02:00
Aleksander Morgado
a6607a5e7d wavecom: port to use g_autoptr() setup 2020-06-02 10:16:17 +02:00
Aleksander Morgado
08d40fe05d wavecom: fix GTask return handling when loading current caps 2020-06-02 10:01:43 +02:00
Aleksander Morgado
d8b70602c5 huawei: ignore NDISDUP disconnection errors
Running NDISDUP=1,0 on an already disconnected bearer/context will
report ERROR, so we can really ignore the result of the command,
because we're anyway going to get the correct bearer/context status
later on with the NDISSTATQRY checks.
2020-06-01 16:17:29 +00:00
Aleksander Morgado
472fb96bbe huawei: don't delay reporting network initiated disconnects
When a network-initiated event is received telling us that a
bearer/context is disconnected, we should handle and process it right
away, without thinking on whether there is going to be a
user-requested disconnect afterwards or not.

This effectively reverts the changes introduced in commit
21a5aaf4fe, which looks like was done to
handle synchronization issues with upper layers (e.g. with
NetworkManager or Shill).

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/205
2020-06-01 16:17:29 +00:00
Louis-Alexis Eyraud
3b35bbd47b huawei: fix memory leak when parsing HCSQ response
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/220
2020-05-29 15:47:54 +02: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
502c636516 zte: add MF667 port type hints
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/217
2020-05-26 15:05:52 +02: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
29a68c94b9 huawei: ignore ^CCALLSTATE URCs for now
We will want to support these to avoid needing to have CLCC call
polling, but for now, just ignore them so that they don't interfere
with the call management.

For context, see:
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/216
2020-05-22 10:58:29 +02: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
b71ae9ce72 wavecom: avoid cast-align errors
We can safely cast the data in a GArray to gpointer first, and then
to the pointer type we require.

  wavecom/mm-broadband-modem-wavecom.c: In function 'set_bands_3g':
  wavecom/mm-broadband-modem-wavecom.c:800:50: error: cast increases required alignment of target type [-Werror=cast-align]
       bands_string = mm_common_build_bands_string ((MMModemBand *)bands_array_final->data,
                                                    ^
  wavecom/mm-broadband-modem-wavecom.c: In function 'set_bands_2g':
  wavecom/mm-broadband-modem-wavecom.c:872:50: error: cast increases required alignment of target type [-Werror=cast-align]
       bands_string = mm_common_build_bands_string ((MMModemBand *)bands_array_final->data,
                                                    ^
2020-05-19 13:45:34 +02:00
Aleksander Morgado
58ae8f4c24 cinterion,helpers: minor coding style fix 2020-05-19 13:44:23 +02:00
Aleksander Morgado
9bfc8a7829 novatel-lte: use GPtrArray to build a GStrv
novatel/mm-broadband-modem-novatel-lte.c: In function 'response_processor_nwmdn_ignore_at_errors':
  novatel/mm-broadband-modem-novatel-lte.c:241:19: error: cast increases required alignment of target type [-Werror=cast-align]
       own_numbers = (GStrv) g_array_free (array, FALSE);
                     ^
2020-05-19 13:44:23 +02:00
Aleksander Morgado
a2b0cee935 huawei,helpers: fix warnings with -Wcast-align
huawei/mm-modem-helpers-huawei.c: In function 'match_info_to_ip4_addr':
  huawei/mm-modem-helpers-huawei.c:193:39: error: cast increases required alignment of target type [-Werror=cast-align]
       *out_addr = GUINT32_SWAP_LE_BE (*((guint32 *) bin));
                                         ^
  /usr/include/glib-2.0/glib/gtypes.h:184:77: note: in definition of macro 'GUINT32_SWAP_LE_BE'
   #    define GUINT32_SWAP_LE_BE(val) ((guint32) __builtin_bswap32 ((gint32) (val)))
                                                                               ^~~
2020-05-19 13:44:23 +02:00
Aleksander Morgado
bd2e6f5df4 huawei: avoid cast-align errors
We can safely cast the data in a GArray to gpointer first, and then
to the pointer type we require.

  huawei/mm-broadband-modem-huawei.c: In function 'set_current_bands':
  huawei/mm-broadband-modem-huawei.c:916:50: error: cast increases required alignment of target type [-Werror=cast-align]
       bands_string = mm_common_build_bands_string ((MMModemBand *)bands_array->data,
                                                    ^
2020-05-19 13:44:23 +02:00
Aleksander Morgado
175bedf920 xmm: avoid cast-align errors
We can safely cast the data in a GArray to gpointer first, and then
to the pointer type we require.

  xmm/mm-shared-xmm.c: In function 'validate_and_build_command_set_current_bands':
  xmm/mm-shared-xmm.c:512:45: error: cast increases required alignment of target type [-Werror=cast-align]
           str = mm_common_build_bands_string ((const MMModemBand *)unapplied_bands->data, unapplied_bands->len);
                                               ^
2020-05-19 13:44:23 +02:00
Aleksander Morgado
ccf16e00a7 ublox,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.

  ublox/mm-modem-helpers-ublox.c: In function 'parse_bands_from_string':
  ublox/mm-modem-helpers-ublox.c:1612:48: error: cast increases required alignment of target type [-Werror=cast-align]
           tmpstr = mm_common_build_bands_string ((MMModemBand *)(bands->data), bands->len);
                                                  ^
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
Aleksander Morgado
b0be4e895c telit,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.

  telit/mm-modem-helpers-telit.c: In function 'mm_telit_build_bnd_request':
  telit/mm-modem-helpers-telit.c:256:55: error: cast increases required alignment of target type [-Werror=cast-align]
               bands_str = mm_common_build_bands_string ((const MMModemBand *)(bands_array->data), bands_array->len);
                                                         ^
  telit/mm-modem-helpers-telit.c:275:55: error: cast increases required alignment of target type [-Werror=cast-align]
               bands_str = mm_common_build_bands_string ((const MMModemBand *)(bands_array->data), bands_array->len);
                                                         ^
2020-05-19 13:44:23 +02:00
Aleksander Morgado
301b6f0a64 plugins,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.

  tests/test-helpers.c: In function 'mm_test_helpers_compare_bands':
  tests/test-helpers.c:41:47: error: cast increases required alignment of target type [-Werror=cast-align]
       bands_str = mm_common_build_bands_string ((MMModemBand *)(bands->data), bands->len);
                                                 ^
  tests/test-helpers.c:46:56: error: cast increases required alignment of target type [-Werror=cast-align]
       expected_bands_str = mm_common_build_bands_string ((MMModemBand *)(expected_bands_array->data), expected_bands_array->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
Aleksander Morgado
6b36fe9f19 huawei: NDISDUP based devices may use plain TTYs for control
So don't warn if no associated cdc-wdm port is found.
2020-05-15 14:12:12 +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
8b7bdea7e0 telit: flag GPS port in the LE910C1 2020-05-14 15:34:47 +00:00
David Khouya
9c77fb8834 telit: add LE910C1 udev rule 2020-05-14 15:34:47 +00:00