Commit Graph

7059 Commits

Author SHA1 Message Date
Aleksander Morgado
353e27065d huawei: try to read port type hints from interface descriptions
So far, we're really only interested in the "modem" and "pcui" ports.

  root@9d52738:/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4# find . -name interface|sort
  ./1-1.4:2.0/interface
  ./1-1.4:2.1/interface
  ./1-1.4:2.2/interface
  ./1-1.4:2.3/interface
  ./1-1.4:2.4/interface
  ./1-1.4:2.5/interface
  ./1-1.4:2.6/interface

  root@9d52738:/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4# find . -name interface|sort|xargs cat
  CDC Ethernet Control Model (ECM)
  CDC Ethernet Data
  Huawei Mobile Connect - Modem
  Huawei Mobile Connect - Application
  Huawei Mobile Connect - Pcui
  Huawei Mobile Connect - Ctrl
  Huawei Mobile Connect - Serial B

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/170
2020-03-03 17:23:07 +00:00
Aleksander Morgado
9ef84d2cff kerneldevice: support reading interface 'description' 2020-03-03 17:23:07 +00:00
Aleksander Morgado
5da33df35b huawei: avoid attempting to complete GTask twice 2020-02-26 13:12:20 +01:00
Aleksander Morgado
fd052c8e58 base-sim: don't allow sending PIN/PUK if not required
This avoids issues when e.g. sending SIM-PIN while the modem is
already unlocked or when SIM-PIN is not enabled.

Under those conditions, the needlessly sent SIM-PIN unlock attempt may
fail while libmm-glib/mmcli reports a successful operation. E.g.:

  # mmcli --sim=/org/freedesktop/ModemManager1/SIM/0 --pin=3497
  successfully sent PIN code to the SIM

But in reality...

  Wed Nov 20 14:38:52 2019 daemon.debug [4254]: <debug> [1574260732.489513] Verifying PIN...
  Wed Nov 20 14:38:52 2019 daemon.debug [4254]: [/dev/cdc-wdm0] sent message...
  <<<<<< RAW:
  <<<<<<   length = 27
  <<<<<<   data   = 01:1A:00:00:0B:02:00:09:00:26:00:0E:00:02:06:00:01:04:33:34:39:37:01:02:00:06:00
  Wed Nov 20 14:38:52 2019 daemon.debug [4254]: [/dev/cdc-wdm0] sent generic request (translated)...
  <<<<<< QMUX:
  <<<<<<   length  = 26
  <<<<<<   flags   = 0x00
  <<<<<<   service = "uim"
  <<<<<<   client  = 2
  <<<<<< QMI:
  <<<<<<   flags       = "none"
  <<<<<<   transaction = 9
  <<<<<<   tlv_length  = 14
  <<<<<<   message     = "Verify PIN" (0x0026)
  <<<<<< TLV:
  <<<<<<   type       = "Info" (0x02)
  <<<<<<   length     = 6
  <<<<<<   value      = 01:04:33:34:39:37
  <<<<<<   translated = [ pin_id = 'pin1' pin_value = '3497' ]
  Wed Nov 20 14:38:52 2019 daemon.debug [4254]: [/dev/cdc-wdm0] received message...
  <<<<<< RAW:
  <<<<<<   length = 30
  <<<<<<   data   = 01:1D:00:80:0B:02:02:09:00:26:00:11:00:02:04:00:01:00:52:00:13:02:00:69:84:10:02:00:03:0A
  Wed Nov 20 14:38:52 2019 daemon.debug [4254]: [/dev/cdc-wdm0] received generic response (translated)...
  <<<<<< QMUX:
  <<<<<<   length  = 29
  <<<<<<   flags   = 0x80
  <<<<<<   service = "uim"
  <<<<<<   client  = 2
  <<<<<< QMI:
  <<<<<<   flags       = "response"
  <<<<<<   transaction = 9
  <<<<<<   tlv_length  = 17
  <<<<<<   message     = "Verify PIN" (0x0026)
  <<<<<< TLV:
  <<<<<<   type       = "Result" (0x02)
  <<<<<<   length     = 4
  <<<<<<   value      = 01:00:52:00
  <<<<<<   translated = FAILURE: AccessDenied

As we already know what the current lock status is, just abort the
user operation if the unlock operation isn't required.
2020-02-12 09:41:10 +00:00
Aleksander Morgado
9f192be632 iface-modem: allow loading current required lock info 2020-02-12 09:41:10 +00:00
Aleksander Morgado
634bb1caac base-sim: avoid using 'self' to refer to the modem 2020-02-12 09:41:10 +00:00
Aleksander Morgado
b6add18157 iface-modem-simple: don't abort connection attempt if SIM-PUK2 locked 2020-02-12 09:41:10 +00:00
Aleksander Morgado
94025aad6c base-sim: refactor common PIN/PUK unlock operations
Keep the saved GError directly as GTask context, instead of allocating
the SendPinPukContext unconditionally.
2020-02-12 09:41:10 +00:00
Aleksander Morgado
00dc961cad iface-modem-location: common helper code to test raw gps 2020-02-07 14:42:16 +00:00
Aleksander Morgado
a61caff747 iface-modem-location: plug memleaks when updating gps raw variant
The helper method returning a variant from a MMLocationGpsRaw would
return already a full variant reference instead of a floating one, so
we were really increasing the refcount when doing g_variant_ref_sink()
in the location interface.

Fix this by consolidating all helper methods in libmm-glib that return
variants from the different MMLocationXX objects, so that they all
return full variants instead of floating ones.
2020-02-07 14:42:16 +00:00
Bob Ham
a7a8fc909a broadband-modem: add optional extra carriage return to in-call URC regex
The BroadMobi BM818 has inconsitent line endings and the in-call URC
regex can miss events, particularly NO CARRIER, because the regex
doesn't match.  To fix this we add an optional carriage return to the
regex.  This will match for the BM818's output.
2020-02-06 15:16:46 +00:00
Bob Ham
38d7cc6683 broadband-modem: add secondary AT port to in-call port context
The BroadMobi BM818 sends URCs on the secondary port which are
currently missed.  To fix this, we include the secondary port in the
port context.
2020-02-06 15:16:46 +00:00
Bob Ham
e128210a27 iface-modem-voice: report calls only if +CLCC was successful
The BroadMobi BM818 can time out with +CLCC calls.  When this happens,
active calls are terminated due to reporting an empty list.  To fix
this, we only report the call list if the +CLCC didn't result in an
error.
2020-02-06 15:16:46 +00:00
Bob Ham
2c9760af66 iface-modem-voice: log details when ending call missing from call list
If a call is missing from the +CLCC call list and terminated because
of that, add a debugging statement to log the call details.
2020-02-06 15:16:30 +00:00
Bob Ham
b5d4f045d8 iface-modem-voice: match calls in call list by number
Outgoing calls which ring before the first +CLCC response cannot match
on the direction/state and are terminated, at least on the BroadMobi
BM818.  For example:

<debug> 1 calls being established: call list polling required
<debug> (ttyUSB1) device open count is 3 (open)
<debug> (ttyUSB1): --> 'AT+CLCC<CR>'
<debug> (ttyUSB1): <-- '<CR><LF>+CLCC: 1,1,0,1,0,"",128<CR><LF>+CLCC: 2,0,3,0,0,"07763578094",129<CR><LF><CR><LF>OK<CR><LF>'
<debug> Reported 2 ongoing calls
<debug> call at index 1: direction incoming, state active, number n/a
<debug> call at index 2: direction outgoing, state ringing-out, number 07763578094
<info>  Call state changed: dialing -> terminated (unknown)
<warn>  unexpected incoming call to number 'n/a' reported in call list: state active
<warn>  unexpected outgoing call to number '07763578094' reported in call list: state ringing-out

To fix this, we match calls in a +CLCC call list by number as
well.
2020-02-06 15:16:00 +00:00
Aleksander Morgado
bdd1874f17 tests,keyfiles: add dummy test to avoid -Wunused-function warnings
If none of the plugins enabled in the build has custom keyfiles, the
common_test() method would be unused. Avoid this just by adding a new
dummy test which is always available in the keyfiles tester.
2020-02-03 16:08:40 +01:00
Aleksander Morgado
55d344ab96 tests,udev-rules: add dummy test to avoid -Wunused-function warnings
If none of the plugins enabled in the build has custom udev rules, the
common_test() method would be unused. Avoid this just by adding a new
dummy test which is always available in the udev rules tester.
2020-02-02 11:33:13 +01:00
Aleksander Morgado
a8fd33ebaa port-qmi: fallback to raw-ip if WDA Get Data Format requests arguments
New devices return a "Missing Argument" error in WDA Get Data Format,
requiring the use of the "Endpoint info" TLV. Given that all these new
devices are raw-ip only anyway, let's use this error to right away
fallback to require raw-ip in the interface.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/177
2020-02-01 12:52:30 +01:00
Aleksander Morgado
280363e0d6 libmm-glib,helpers: allow \r\n in string to number conversions
It's not uncommon that we may want to parse a simple AT response that
contains a single number by doing mm_strip_tag() followed by
mm_get_uint_from_str(). In order to do this, we need to have the
helper methods that convert strings to numbers support \r\n characters
at the end of the string, as we would have in AT responses.
2020-01-31 15:48:16 +01:00
Aleksander Morgado
2020f1f2e7 port-serial-qcdm: rewrite condition to make it more readable
The logic is the same.
2020-01-31 15:18:35 +01:00
Aleksander Morgado
11f04851ce libmm-glib,location-gps-nmea: avoid using deprecated build_full() method
mm-location-gps-nmea.c: In function ‘mm_location_gps_nmea_get_string_variant’:
  mm-location-gps-nmea.c:245:5: warning: ‘mm_location_gps_nmea_build_full’ is deprecated: Use 'mm_location_gps_nmea_get_traces' instead [-Wdeprecated-declarations]
    245 |     built = mm_location_gps_nmea_build_full (self);
        |     ^~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
02eafb5821 libmm-glib,test: avoid using deprecated mm_pco_list_free()
test-pco.c: In function ‘test_pco_list_add’:
  test-pco.c:82:5: warning: ‘mm_pco_list_free’ is deprecated [-Wdeprecated-declarations]
     82 |     mm_pco_list_free (list);
        |     ^~~~~~~~~~~~~~~~
  In file included from ../../libmm-glib/libmm-glib.h:82,
                   from test-pco.c:17:
  ../../libmm-glib/mm-pco.h:67:6: note: declared here
     67 | void mm_pco_list_free (GList *pco_list);
        |      ^~~~~~~~~~~~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
9e24226364 port-probe: MMPortProbeAtCommand always has constant command strings 2020-01-31 15:18:35 +01:00
Aleksander Morgado
accd1a5841 base-modem: define new helper MMBaseModemAtCommandAlloc
It has the same exact format as MMBaseModemAtCommand, but its contents
are assumed heap allocated.

The only real purpose of this type is to allow defining static
constant MMBaseModemAtCommand variables without warnings when using
-Wdiscarded-qualifiers.
2020-01-31 15:18:35 +01:00
Aleksander Morgado
f77deb75a5 test,mmsmspdu: fix warnings with -Wswitch-enum
mmsmspdu.c: In function ‘show_part_info’:
  mmsmspdu.c:86:5: error: enumeration value ‘MM_SMS_ENCODING_UNKNOWN’ not handled in switch [-Werror=switch-enum]
     86 |     switch (encoding) {
        |     ^~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
dce5dbeb9a test,mmrules: fix warnings with -Wswitch-default
mmrules.c: In function ‘print_rule’:
  mmrules.c:97:13: error: switch missing default case [-Werror=switch-default]
     97 |             switch (rule_match->type) {
        |             ^~~~~~
  mmrules.c:113:5: error: switch missing default case [-Werror=switch-default]
    113 |     switch (rule->result.type) {
        |     ^~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
6f433074e2 test,lsudev: fix warnings with -Wsign-compare
lsudev.c: In function ‘println’:
  lsudev.c:64:19: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
     64 |     for (i = 0; i < indent; i++)
        |                   ^
2020-01-31 15:18:35 +01:00
Aleksander Morgado
1fa7e1260d cli: fix warnings with -Wshadow
mmcli-manager.c: In function ‘context_free’:
  mmcli-manager.c:167:24: error: declaration of ‘ctx’ shadows a global declaration [-Werror=shadow]
    167 | context_free (Context *ctx)
        |               ~~~~~~~~~^~~
  mmcli-manager.c:51:17: note: shadowed declaration is here
     51 | static Context *ctx;
        |                 ^~~
  ...
2020-01-31 15:18:35 +01:00
Aleksander Morgado
1216e88716 cli: fix warnings with -Wswitch-default
mmcli-output.c: In function ‘output_item_free’:
  mmcli-output.c:321:5: error: switch missing default case [-Werror=switch-default]
    321 |     switch (item->type) {
        |     ^~~~~~
  mmcli-output.c: In function ‘mmcli_output_dump’:
  mmcli-output.c:1208:5: error: switch missing default case [-Werror=switch-default]
   1208 |     switch (selected_type) {
        |     ^~~~~~
  mmcli-output.c: In function ‘mmcli_output_list_dump’:
  mmcli-output.c:1231:5: error: switch missing default case [-Werror=switch-default]
   1231 |     switch (selected_type) {
        |     ^~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
c32fdcefef cli: fix warnings with -Wswitch-enum
mmcli.c: In function ‘log_handler’:
  mmcli.c:118:5: error: enumeration value ‘G_LOG_FLAG_RECURSION’ not handled in switch [-Werror=switch-enum]
    118 |     switch (log_level) {
        |     ^~~~~~
  mmcli.c:118:5: error: enumeration value ‘G_LOG_LEVEL_MESSAGE’ not handled in switch [-Werror=switch-enum]
  mmcli.c:118:5: error: enumeration value ‘G_LOG_LEVEL_INFO’ not handled in switch [-Werror=switch-enum]
  mmcli.c:118:5: error: enumeration value ‘G_LOG_LEVEL_MASK’ not handled in switch [-Werror=switch-enum]
2020-01-31 15:18:35 +01:00
Aleksander Morgado
1bf9937cd5 via: fix warnings with -Wdiscarded-qualifiers
via/mm-plugin-via.c: In function ‘mm_plugin_create’:
  via/mm-plugin-via.c:59:54: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     59 |     static const mm_str_pair product_strings[] = { { "via",    "cbp7" },
        |                                                      ^~~~~
  via/mm-plugin-via.c:59:64: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     59 |     static const mm_str_pair product_strings[] = { { "via",    "cbp7" },
        |                                                                ^~~~~~
  via/mm-plugin-via.c:60:54: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     60 |                                                    { "fusion", "2770p" },
        |                                                      ^~~~~~~~
  via/mm-plugin-via.c:60:64: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     60 |                                                    { "fusion", "2770p" },
        |                                                                ^~~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
4a609e564a ublox: fix disabling of unsolicited events
The incorrect ready() method was being used while disabling, which
ended up making the parent disable not being run at all.

  ublox/mm-broadband-modem-ublox.c:1178:1: error: ‘voice_disable_unsolicited_events_ready’ defined but not used [-Werror=unused-function]
   1178 | voice_disable_unsolicited_events_ready (MMBroadbandModemUblox *self,
        | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
72a124a121 ublox: fix warnings with -Wimplicit-fallthrough
ublox/mm-broadband-modem-ublox.c:458:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    458 |         ctx->step++;
        |         ~~~~~~~~~^~
  ublox/mm-broadband-modem-ublox.c:461:5: note: here
    461 |     case SET_CURRENT_MODES_BANDS_STEP_ACQUIRE:
        |     ^~~~
  ublox/mm-broadband-modem-ublox.c:468:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    468 |         ctx->step++;
        |         ~~~~~~~~~^~
  ublox/mm-broadband-modem-ublox.c:471:5: note: here
    471 |     case SET_CURRENT_MODES_BANDS_STEP_CURRENT_POWER:
        |     ^~~~
  ...
2020-01-31 15:18:35 +01:00
Aleksander Morgado
3197a52c58 ublox: fix warnings with -Wswitch-enum
ublox/mm-broadband-modem-ublox.c:1246:5: error: enumeration value ‘MM_CALL_STATE_UNKNOWN’ not handled in switch [-Werror=switch-enum]
   1246 |     switch (call_info.state) {
        |     ^~~~~~
  ublox/mm-broadband-modem-ublox.c:1246:5: error: enumeration value ‘MM_CALL_STATE_ACTIVE’ not handled in switch [-Werror=switch-enum]
  ublox/mm-broadband-modem-ublox.c:1246:5: error: enumeration value ‘MM_CALL_STATE_HELD’ not handled in switch [-Werror=switch-enum]
  ublox/mm-broadband-modem-ublox.c:1246:5: error: enumeration value ‘MM_CALL_STATE_TERMINATED’ not handled in switch [-Werror=switch-enum]
2020-01-31 15:18:35 +01:00
Aleksander Morgado
d6ec29c49e ublox: fix warnings with -Wswitch-default
ublox/mm-broadband-modem-ublox.c: In function ‘preload_support_config’:
  ublox/mm-broadband-modem-ublox.c💯5: error: switch missing default case [-Werror=switch-default]
    100 |     switch (self->priv->support_config.method) {
        |     ^~~~~~
  ublox/mm-broadband-modem-ublox.c:112:5: error: switch missing default case [-Werror=switch-default]
    112 |     switch (self->priv->support_config.uact) {
        |     ^~~~~~
  ublox/mm-broadband-modem-ublox.c:123:5: error: switch missing default case [-Werror=switch-default]
    123 |     switch (self->priv->support_config.ubandsel) {
        |     ^~~~~~
  ublox/mm-broadband-modem-ublox.c: In function ‘set_current_modes_bands_step’:
  ublox/mm-broadband-modem-ublox.c:452:5: error: switch missing default case [-Werror=switch-default]
    452 |     switch (ctx->step) {
        |     ^~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
f66f7458b7 simtech: fix warnings with -Wimplicit-fallthrough
simtech/mm-broadband-modem-simtech.c: In function ‘enable_unsolicited_events_context_step’:
  simtech/mm-broadband-modem-simtech.c:442:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    442 |         ctx->step++;
        |         ~~~~~~~~~^~
  simtech/mm-broadband-modem-simtech.c:444:5: note: here
    444 |     case ENABLE_UNSOLICITED_EVENTS_STEP_LAST:
        |     ^~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
f6a103ef13 simtech: fix warnings with -Wswitch-default
simtech/mm-broadband-modem-simtech.c: In function ‘enable_unsolicited_events_context_step’:
  simtech/mm-broadband-modem-simtech.c:378:5: error: switch missing default case [-Werror=switch-default]
    378 |     switch (ctx->step) {
        |     ^~~~~~
  simtech/mm-broadband-modem-simtech.c: In function ‘disable_unsolicited_events_context_step’:
  simtech/mm-broadband-modem-simtech.c:563:5: error: switch missing default case [-Werror=switch-default]
    563 |     switch (ctx->step) {
        |     ^~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
7873ef00e9 simtech: fix warnings with -Wsign-compare
simtech/mm-broadband-modem-simtech.c: In function ‘simtech_act_to_mm_act’:
  simtech/mm-broadband-modem-simtech.c:89:19: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare]
     89 |     return (nsmod < G_N_ELEMENTS (simtech_act_to_mm_act_map) ? simtech_act_to_mm_act_map[nsmod] : MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN);
        |                   ^
2020-01-31 15:18:35 +01:00
Aleksander Morgado
68f3eeeaa7 option,hso: fix warnings with -Wsign-compare
option/mm-broadband-bearer-hso.c: In function ‘ip_config_ready’:
  option/mm-broadband-bearer-hso.c:128:21: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
    128 |                 num != ctx->cid) {
        |                     ^~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
fc581c50bd pantech: fix warnings with -Wdiscarded-qualifiers
pantech/mm-plugin-pantech.c:69:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
      69 |     { "ATE0", 3, port_probe_response_processor_is_pantech_at },
         |       ^~~~~~
   pantech/mm-plugin-pantech.c:70:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
      70 |     { "ATE0", 3, port_probe_response_processor_is_pantech_at },
         |       ^~~~~~
   pantech/mm-plugin-pantech.c:71:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
      71 |     { "ATE0", 3, port_probe_response_processor_is_pantech_at },
         |       ^~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
f661179310 novatel-lte: fix warnings with -Wdiscarded-qualifiers
novatel/mm-broadband-modem-novatel-lte.c:249:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    249 |     { "+CNUM",  3, TRUE, response_processor_cnum_ignore_at_errors },
        |       ^~~~~~~
  novatel/mm-broadband-modem-novatel-lte.c:250:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    250 |     { "$NWMDN", 3, TRUE, response_processor_nwmdn_ignore_at_errors },
        |       ^~~~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
f3acdcaa1b mtk: fix warnings with -Wdiscarded-qualifiers
mtk/mm-broadband-modem-mtk.c:727:6: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    727 |     {"+ECSQ=2", 5, FALSE, NULL},
        |      ^~~~~~~~~
  mtk/mm-broadband-modem-mtk.c:733:6: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    733 |     {"+ECSQ=0", 5, FALSE, NULL},
        |      ^~~~~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
1f2018d524 nokia: fix warnings with -Wdiscarded-qualifiers
nokia/mm-plugin-nokia.c:37:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     37 |     { "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
        |       ^~~~~~~~~
  nokia/mm-plugin-nokia.c:38:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     38 |     { "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
        |       ^~~~~~~~~
  nokia/mm-plugin-nokia.c:39:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     39 |     { "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
        |       ^~~~~~~~~
  nokia/mm-plugin-nokia-icera.c:36:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     36 |     { "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
        |       ^~~~~~~~~
  nokia/mm-plugin-nokia-icera.c:37:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     37 |     { "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
        |       ^~~~~~~~~
  nokia/mm-plugin-nokia-icera.c:38:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     38 |     { "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
        |       ^~~~~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
b5c08a47be mbm: fix warnings with -Wdiscarded-qualifiers
mbm/mm-broadband-modem-mbm.c:409:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    409 |     { "&F", 3, FALSE, NULL },
        |       ^~~~
  mbm/mm-broadband-modem-mbm.c:411:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    411 |     { "*ENAP=0", 3, FALSE, NULL },
        |       ^~~~~~~~~
  ...
2020-01-31 15:18:35 +01:00
Aleksander Morgado
40497a3904 iridium: fix warnings with -Wdiscarded-qualifiers
iridium/mm-plugin-iridium.c: In function ‘mm_plugin_create’:
  iridium/mm-plugin-iridium.c:64:52: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     64 |     static const mm_str_pair product_strings[] = {{"motorola", "satellite" },
        |                                                    ^~~~~~~~~~
  iridium/mm-plugin-iridium.c:64:64: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     64 |     static const mm_str_pair product_strings[] = {{"motorola", "satellite" },
        |                                                                ^~~~~~~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
db8c1b9c12 huawei: fix warnings with -Wimplicit-fallthrough
huawei/mm-broadband-bearer-huawei.c: In function ‘connect_3gpp_context_step’:
  huawei/mm-broadband-bearer-huawei.c:378:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    378 |         ctx->step++;
        |         ~~~~~~~~~^~
  huawei/mm-broadband-bearer-huawei.c:382:5: note: here
    382 |     case CONNECT_3GPP_CONTEXT_STEP_NDISDUP: {
        |     ^~~~
  huawei/mm-broadband-bearer-huawei.c: In function ‘disconnect_3gpp_context_step’:
  huawei/mm-broadband-bearer-huawei.c:708:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    708 |         ctx->step++;
        |         ~~~~~~~~~^~
  huawei/mm-broadband-bearer-huawei.c:711:5: note: here
    711 |     case DISCONNECT_3GPP_CONTEXT_STEP_NDISDUP:
        |     ^~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
de360bd620 huawei: fix warnings with -Wswitch-default 2020-01-31 15:18:35 +01:00
Aleksander Morgado
50e6ead7e2 huawei: fix warnings with -Wdiscarded-qualifiers
huawei/mm-broadband-modem-huawei.c: At top level:
  huawei/mm-broadband-modem-huawei.c:2011:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   2011 |     { "^PORTSEL=0", 5, FALSE, NULL },
        |       ^~~~~~~~~~~~
  huawei/mm-broadband-modem-huawei.c:2012:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   2012 |     { "^CURC=1",    3, FALSE, NULL },
        |       ^~~~~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
23f17ce766 huawei: fix warnings with -Wswitch-enum
huawei/mm-broadband-modem-huawei.c: In function ‘huawei_hcsq_changed’:
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN’ not handled in switch [-Werror=switch-enum]
   1816 |     switch (act) {
        |     ^~~~~~
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_POTS’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_GSM_COMPACT’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_GPRS’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_EDGE’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_HSDPA’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_HSUPA’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_HSPA’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_HSPA_PLUS’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_1XRTT’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_EVDO0’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_EVDOA’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_EVDOB’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_ANY’ not handled in switch [-Werror=switch-enum]
2020-01-31 15:18:35 +01:00
Aleksander Morgado
2753afb73c huawei: fix warnings with -Wsign-compare
huawei/mm-plugin-huawei.c: In function ‘try_next_usbif’:
  huawei/mm-plugin-huawei.c:234:30: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘gint’ {aka ‘int’} [-Werror=sign-compare]
    234 |                        usbif < closest) {
        |                              ^
  huawei/mm-plugin-huawei.c: In function ‘propagate_port_mode_results’:
  huawei/mm-plugin-huawei.c:439:27: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
    439 |             if (usbif + 1 == GPOINTER_TO_INT (g_object_get_data (G_OBJECT (device), TAG_HUAWEI_PCUI_PORT))) {
        |                           ^~
  huawei/mm-plugin-huawei.c:442:34: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
    442 |             } else if (usbif + 1 == GPOINTER_TO_INT (g_object_get_data (G_OBJECT (device), TAG_HUAWEI_MODEM_PORT)))
        |                                  ^~
  huawei/mm-plugin-huawei.c:445:32: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
    445 |                      usbif + 1 == GPOINTER_TO_INT (g_object_get_data (G_OBJECT (device), TAG_HUAWEI_NDIS_PORT)))
        |                                ^~
2020-01-31 15:18:35 +01:00