Commit Graph

1157 Commits

Author SHA1 Message Date
Ben Chan
50f3f41c3a huawei: avoid creating Connect3gppContext when no data port is available
This patch modifies MMBroadbandBearerHuawei such that connect_3gpp
simply reports an error via g_simple_async_report_error_in_idle, without
creating a Connect3gppContext, if no data port is available.
2014-01-09 13:12:26 +01:00
Ben Chan
910a55a0f2 novatel-lte: remove unused macro definitions 2014-01-08 10:09:06 +01:00
Ben Chan
76d52c2df3 huawei: avoid calling g_object_unref on NULL
This patch prevents connect_3gpp_context_complete_and_free from calling
'g_object_unref (ctx->data)' when connect_3gpp finds no data port (i.e.
ctx->data is set to NULL).
2014-01-08 10:09:06 +01:00
Yegor Yefremov
84bdcb04ed trivial: resolve maybe-uninitialized warnings
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2014-01-07 09:40:05 -06:00
Ben Chan
1601069e50 novatel-lte: explicitly use primary port for connection/disconnection sequence
The Novatel LTE modem only uses its primary AT port for AT commands.
Instead of referencing any existing secondary port, this patch changes
MMBroadbandBearerNovatelLte to explicitly use the primary port during the
connection and disconnection sequence.
2014-01-07 08:53:59 +01:00
Ben Chan
6c1c0d5e2b altair-lte: explicitly use primary port for connection/disconnection sequence
The Altair LTE modem only uses its primary AT port for AT commands.
Instead of referencing any existing secondary port, this patch changes
MMBroadbandBearerAltairLte to explicitly use the primary port during the
connection and disconnection sequence.
2014-01-07 08:53:10 +01:00
Ben Chan
22b0de736b huawei: handle ^NDISSTAT disconnected notification only on a connected bearer
If the bearer is not actually connected and the modem (inappropriately)
indicates a disconnected status via a ^NDISSTAT unsolicited message, it
could potentially lead to the following assertion in
connect_3gpp_context_step. This patch addresses such an issue.

    g_assert (ctx->self->priv->network_disconnect_pending_id == 0);

0x7f940c2ecd95   [libc-2.15.so]            - raise.c:64                         raise
0x7f940c2ee217   [libc-2.15.so]            - abort.c:91                         abort
0x7f940c8e6086   [libglib-2.0.so.0.3400.3] - gtestutils.c:1877                  g_assertion_message
0x7f940c8e6553   [libglib-2.0.so.0.3400.3] - gtestutils.c:1888                  g_assertion_message_expr
0x7f940cba5710   [libmm-plugin-huawei.so]  - mm-broadband-bearer-huawei.c:240   connect_3gpp_context_step
0x7f940cd4a51e   [ModemManager]            - mm-broadband-bearer.c:1246         connect
0x7f940cd662b7   [ModemManager]            - mm-iface-modem-simple.c:588        connection_step
0x7f940cd66e6e   [ModemManager]            - mm-iface-modem-simple.c:267        register_in_3gpp_or_cdma_network_ready
0x7f940ca0e296   [libgio-2.0.so.0.3400.3]  - gsimpleasyncresult.c:775           g_simple_async_result_complete
0x7f940ca0e398   [libgio-2.0.so.0.3400.3]  - gsimpleasyncresult.c:787           complete_in_idle_cb
0x7f940c8c2ff4   [libglib-2.0.so.0.3400.3] - gmain.c:2715                       g_main_context_dispatch
0x7f940c8c3377   [libglib-2.0.so.0.3400.3] - gmain.c:3290                       g_main_context_iterate
0x7f940c8c37c9   [libglib-2.0.so.0.3400.3] - gmain.c:3484                       g_main_loop_run
0x7f940cd3b425   [ModemManager]            - main.c:142                         main
0x7f940c2d9464   [libc-2.15.so]            - libc-start.c:234                   __libc_start_main
0x7f940cd3afa8   [ModemManager]            + 0x0001efa8
2014-01-06 18:23:58 -06:00
Ben Chan
2a946bd72c novatel-lte: remove unnecessary MM_BASE_MODEM() casts 2014-01-06 18:06:09 -06:00
Jens Seidel
885a453dad mbm: add another C5621 ID
This device ID is used in a Lenovo Helix.
2014-01-03 11:31:58 -06:00
Ben Chan
496f298832 altair-lte: remove unnecessary MM_BASE_MODEM() casts 2014-01-03 12:30:02 +01:00
Ben Chan
dac652321b altair-lte: refactor code for handling 'data' in DetailedConnectContext 2014-01-03 12:30:00 +01:00
Ben Chan
cddc4af7bd huawei: report an error when ^PREFMODE reports no valid values
This patch fixes mm_huawei_parse_prefmode_test to always report an error when
returning NULL, which avoid a potential crash when the caller tries to access
the error.
2014-01-03 12:20:33 +01:00
Aleksander Morgado
fc42b2df8c huawei: handle empty response to AT^SYSCFG=?
Some Huawei modems (e.g. E220) may give an empty response for AT^SYSCFG=?, even
if they do support the command. Handle this case by prividing a default fallback
format string when this happens.
2013-12-09 23:07:19 +01:00
Aleksander Morgado
e81fdd07c3 huawei: new current mode setting based on the supported combinations 2013-12-09 23:07:19 +01:00
Aleksander Morgado
c337f52e30 huawei: new current mode loading based on the supported combinations 2013-12-09 23:07:19 +01:00
Aleksander Morgado
02839b2e44 huawei: new ^SYSCFGEX? response parser 2013-12-09 23:07:19 +01:00
Aleksander Morgado
9ac136028b huawei: new ^SYSCFG? response parser 2013-12-09 23:07:19 +01:00
Aleksander Morgado
4e5c35a69f huawei: new ^PREFMODE? response parser 2013-12-09 23:07:19 +01:00
Aleksander Morgado
8cc3eff661 huawei: load supported modes, not just assume them 2013-12-09 23:07:19 +01:00
Aleksander Morgado
ef526395df huawei: consolidate command support checks 2013-12-09 23:07:19 +01:00
Aleksander Morgado
47640a6507 huawei: new ^SYSCFGEX=? test parser 2013-12-09 23:07:19 +01:00
Aleksander Morgado
677dd7da91 huawei: new ^SYSCFG=? test parser 2013-12-09 23:07:19 +01:00
Aleksander Morgado
ceb578a824 huawei: new ^PREFMODE=? test parser 2013-12-09 23:07:18 +01:00
Aleksander Morgado
0dcf609dcc huawei,tests: enable log traces in the tests 2013-12-09 23:07:18 +01:00
Dan Williams
a1ffe805af broadband-modem-huawei: fix CDMA unsolicited response parsing
On at least the EC168C, various unsolicited responses like RSSILVL,
HRSSILVL, and MODE can include an extra Carriage Return:

^MODE: 2<CR><CR><LF><CR><CR><LF>
^RSSILVL:60<CR><CR><LF><CR><CR><LF>
2013-12-09 11:27:27 -06:00
Thieu Le
c21709b32e altair-lte: add SIMREFRESH support
Register for SIMREFRESH event and reload own numbers and reregister
modem with network when this happens.
2013-11-21 10:48:53 +01:00
Aleksander Morgado
85d5d96824 port: remove 'carrier-detect' property
It is no longer used since commit 736aa0d2d.
2013-11-15 17:25:33 +01:00
Prathmesh Prabhu
3d4c143b40 altair-lte: early fail connect/disconnect attempts when out of coverage
A firmware bug in Altair ALT3100 bricks the modem when
 - The modem is out of coverage (Registration state is unknown (CEREG: 4))
 - A disconnect attempt is made using the AT%DPDNACT command.

This patch prevents this situation by failing the connect/disconnect attempts in
the altair plugin when registration state is unknown, without attempting to
connect/disconnect the modem.
2013-11-08 08:48:58 +01:00
Aleksander Morgado
deaeeec367 x22x: handle QMI modems
With some bits and pieces developed by Dan Williams <dcbw@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=710439
2013-10-31 17:12:24 +01:00
Aleksander Morgado
fcc2b1be2c altair-lte: fix LDFLAGS in the helper tests 2013-10-31 11:33:26 +01:00
Aleksander Morgado
e9523a6abd huawei: clear only once the timeout to wait for the first interface
As soon as we get a match between the current interface being probed, and the
first expected interface to probe, clear the timeout. But this doesn't mean that
this interface being probed will be the correct one, so it may be the case that
we end up expecting a new first interface and probing another one.

With an example probably seen better...

Modem appears with interfaces 2, 3 and 4.

1. We first try to look for interface 0, which is not in the set:
  1.1. Probing interfaces 2, 3 and 4 get deferred.

2. First-interface timeout happens because interface 0 doesn't appear, so we
switch to wait for interface 1:
  2.1 Probing interfaces 2, 3 and 4 get deferred.

3. First-interface timeout happens because interface 1 doesn't appear, so we
switch to wait for interface 2:
  3.1. We get a match on interface 2, which exists. We now remove the
       first-interface timeout and start running the init sequence there.
  3.2. Probing interfaces 3 and 4 get deferred.

4. Init sequence in interface 2 fails, because it is not an AT port, so we
switch to wait for interface 3:
  3.1. We get a match on interface 3, which exists. We do *not* need to remove
now the first-interface timeout because this interface we are testing is
actually the second one which we tried.

So, just check whether the timeout exists or not, and if it exists remove it.
Yeah, this commit just fixes a warning at the end.
2013-10-30 20:18:11 +01:00
Aleksander Morgado
c65c01703b mtk: fix GOTO tag in udev rules 2013-10-28 17:51:02 +01:00
Ben Chan
686caef536 huawei: handle pending network-initiated disconnection in disconnect_3gpp
If a client-initiated disconnection attempt is issued while a
network-initiated disconnection is still pending, the latter may
interfere with the former. Also, when the client-initiated disconnection
attempt fails but the bearer status is reported as 'disconnected', the
pending network-initiated disconnection is not cleared and may result
in an assertion when a connection attempt is issued.

This patch addresses the issue by clearing any pending network-initiated
disconnection before proceeding with a client-initiated disconnection.
2013-10-24 16:44:05 +02:00
Ben Chan
18053540ea huawei: handle unquoted strings in ^SYSINFOEX response
The original sysinfoex_parse() in MMBroadbandModemHuawei does not handle
unquoted <sysmode_name> and <submode_name> fields in ^SYSINFOEX responses,
which are sen on some Huawei modems (e.g. E303). This patch moves the
^SYSINFOEX parsing code to mm-modem-helpers-huawei.c, fixes the regex for
handling unquoted strings in ^SYSINFOEX responses, and adds unit tests.
2013-10-20 17:01:59 +02:00
Ben Chan
49d4163a2b huawei: fix ^SYSINFO parsing
The original sysinfo_parse() in MMBroadbandModemHuawei incorrectly sets
'out_sys_submode_valid' to TRUE even when <sys_submode> is not present
in a ^SYSINFO response. This patch moves the code to
mm-modem-helpers-huawei.c, fixes the regex for parsing ^SYSINFO
responses, and adds unit tests.
2013-10-20 17:01:51 +02:00
Prathmesh Prabhu
09ea458f78 altair-lte: obtain subscription state of SIM from registration failure code
This patch uses the extended error code after a registration failure to
determine if the SIM in the relevant modem is associated with a non-provisioned
account. It uses the standard AT+CEER command, but the implementation is
restricted to the altair plugin.
2013-10-10 08:29:56 +02:00
Thieu Le
a006761c71 novatel-lte: abort connect request if call failed
Change-Id: Iae16ec87e12aaaf314b7e66b2f9c72a13251e352
2013-10-01 12:16:35 -05:00
Ben Chan
b5ef861d12 modem-helpers,sim: auto-detect if ICCID response is character swapped
This patch modifies mm_3gpp_parse_iccid() to auto-detect if an ICCID
response is character swapped or not by comparsing the major industry
identifier part of the ICCID response to the known value (89) for
telecommunication purposes. This addresses the issue where the same AT
command (e.g. AT^ICCID used by the huawei plugin) does not report ICCID
in a consistent format.
2013-09-26 20:23:51 +02:00
Aleksander Morgado
2a611c3856 cinterion: support QMI-based Cinterion PLXX and PHXX modules
E.g. with a Cinterion PLS8 LTE modem:

  $ sudo mmcli -m 0

  /org/freedesktop/ModemManager1/Modem/0 (device id '0042872f6597b3d772a3d9d3cd6f14f152af8a0b')
    -------------------------
    Hardware |   manufacturer: 'QUALCOMM INCORPORATED'
             |          model: '0'
             |       revision: 'M9615A-CETWMAZM-2.0.19015  1  [Jan 31 2013 00:00:00]'
             |      supported: 'gsm-umts
             |                  lte
             |                  gsm-umts, lte'
             |        current: 'gsm-umts, lte'
             |   equipment id: 'unknown'
    -------------------------
    System   |         device: '/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7'
             |        drivers: 'option1, qmi_wwan'
             |         plugin: 'Cinterion'
             |   primary port: 'cdc-wdm0'
             |          ports: 'ttyUSB2 (at), cdc-wdm0 (qmi), wwp0s29u1u7i4 (net)'
    -------------------------
    Numbers  |           own : 'unknown'
    -------------------------
    Status   |           lock: 'sim-pin'
             | unlock retries: 'sim-pin (3), sim-pin2 (2), sim-puk (10), sim-puk2 (10)'
             |          state: 'locked'
             |    power state: 'on'
             |    access tech: 'unknown'
             | signal quality: '0' (cached)
    -------------------------
    Modes    |      supported: 'allowed: 2g, 3g, 4g; preferred: none'
             |        current: 'allowed: 2g, 3g, 4g; preferred: none'
    -------------------------
    Bands    |      supported: 'cdma-bc15-aws, dcs, egsm, u2100, u1800, u900, eutran-i, eutran-iii, eutran-vii, eutran-viii, eutran-xx'
             |        current: 'cdma-bc15-aws, dcs, egsm, u2100, u1800, u900, eutran-i, eutran-iii, eutran-vii, eutran-viii, eutran-xx'
    -------------------------
    IP       |      supported: 'ipv4, ipv6, ipv4v6'
    -------------------------
    SIM      |           path: '/org/freedesktop/ModemManager1/SIM/0'
2013-09-25 17:46:31 +02:00
Aleksander Morgado
21a5aaf4fe huawei: delay processing of network-initiated disconnection
Originally developed by:
  Prathmesh Prabhu <pprabhu@chromium.org>
  Ben Chan <benchan@chromium.org>

Huawei MU736 prematurely fires a ^NDISSTAT unsolicited message upon a
network-initiated disconnection. The modem can go into a bad state if a
reconnect attempt happens before the disconnection completes. This patch works
around the issue by delaying the reporting of the disconnection.
2013-09-23 08:29:21 +02:00
Aleksander Morgado
d818d9fe06 bearer: consolidate unsolicited connection status reports
Originally developed by:
  Ben Chan <benchan@chromium.org>

This patch replaces mm_bearer_report_disconnection() with a more generic
mm_bearer_report_connection_status(), which allows reporting any
connection status of a bearer. This further allows getting rid of those
custom report_connection_status functions in plugic specific bearer
subclasses.

Note that while plugin-specific implementations can receive multiple
'MMBearerConnectionStatus' values, the generic implementation is only allowed
to receive DISCONNECTED. Plugins need to make sure that they process all the
other status values, and only report DISCONNECTED to the parent when required.

MBM:
  The MBM bearer implementation of report_connection_status() expects either
  CONNECTED or DISCONNECTED. If any of these is received and there is an ongoing
  connection attempt, the corresponding operation will be completed. If there is
  no connection attempt, we will just handle the DISCONNECTED state, calling the
  parent method to notify that the modem got network-disconnected.

Icera:
  The Icera bearer implementation of report_connection_status() expects either
  CONNECTED, CONNECT FAILED or DISCONNECTED. If any of these is received and
  there is an ongoing connection or disconnection attempt, the corresponding
  operation will be completed. If there is no connection or disconnection
  attempt, we will just handle the CONNECT FAILED and DISCONNECTED states,
  calling the parent method (always with DISCONNECTED) to notify that the modem
  got network-disconnected.

Option/HSO:
  The Option/HSO bearer implementation of report_connection_status() expects
  either CONNECTED, CONNECTION FAILED or DISCONNECTED. If any of these is
  received and there is an ongoing connection or disconnection attempt, the
  corresponding operation will be completed. If there is no connection or
  disconnection attempt, we will just handle the CONNECTION FAILED and
  DISCONNECTED states, calling the parent method (always with DISCONNECTED) to
  notify that the modem got network-disconnected.

Huawei:
  The Huawei bearer implementation of report_connection_status() expects either
  CONNECTED or DISCONNECTED. These messages are not used to process pending
  connection or disconnection attempts; so if they are received while one of
  these is on-going, it will just be ignored. CONNECTED reports are also
  ignored, so we will just handle the DISCONNECTED state, calling the parent
  method to notify that the modem got network-disconnected.

Altair-LTE:
  The Altair-LTE bearers will only report DISCONNECTED on network-disconnected
  cases. There is no custom report_connection_status().

Novatel-LTE:
  The Novatel-LTE bearers will only report DISCONNECTED on network-disconnected
  cases. There is no custom report_connection_status().
2013-09-23 08:29:15 +02:00
Lionel Landwerlin
43d1c904e6 plugins: fix linkage of huawei test program
https://bugzilla.gnome.org/show_bug.cgi?id=704481
2013-09-19 11:25:57 +02:00
Lionel Landwerlin
b330752432 plugins: add missing linker flags
https://bugzilla.gnome.org/show_bug.cgi?id=704481
2013-09-19 11:25:41 +02:00
Ben Chan
2b20264215 huawei: handle disconnection via ^NDISSTAT unsolicited message
This patch changes MMBroadbandModemHuawei to use ^NDISSTAT unsolicited
messages to handle network-initiated disconnection. As a ^NDISSTAT
unsolicited message is similar to a ^NDISSTATQRY response, the patch
extends the ^NDISSTATQRY parser code to handle both ^NDISSTAT and
^NDISSTATQRY responses.
2013-09-18 11:37:19 +02:00
Ben Chan
1eee8824fd altair-lte: use mm_base_modem_at_command_full{,_finish} correctly
This patch fixes own_enable_unsolicited_events_ready() to use
mm_base_modem_at_command_full_finish(), instead of
mm_base_modem_at_sequence_full_finish(), as the %STATCM=1 command is
issued via mm_base_modem_at_command_full().
2013-09-17 08:57:32 +02:00
Ben Chan
9aced8311b huawei: ignore ^CONNECT unsolicited messages 2013-09-17 08:55:50 +02:00
Dan Williams
0755beff07 mtk: update udev rules to always match both VID/PID together
See commit c79d266e62.

    If the rules to tag specific USB interface numbers only apply on the PID, we'll
    end up seeing that if the port has a parent with another PID, and that other
    PID also has a rule, port will get tagged multiple times.
2013-09-16 11:54:16 -05:00
Dan Williams
872bd3e837 mtk: add D-Link DWM-156 udev rules
For HW version A5 and possibly later, which are based on MediaTek
chipsets instead of Qualcomm ones.
2013-09-16 11:54:16 -05:00
Quentin.Li
c22eca999b mtk: add plugin for various MediaTek devices
Signed-off-by: Quentin.Li <snowmanli88@gmail.com>
2013-09-16 11:53:58 -05:00
Bjørn Mork
e446037aa7 mbm: add another H5321gw ID
This device ID is used in a Lenovo Thinkpad T430.

Link: http://bugs.debian.org/705942
Reported-by: Etienne Bagnoud <etienne.bagnoud@irovision.ch>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2013-09-11 22:16:42 +02:00