Commit Graph

1032 Commits

Author SHA1 Message Date
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
Aleksander Morgado
0d96662a0a sim-huawei: fix refcount
g_async_result_get_source_object() returns a full reference, which needs to get
unref-ed when no longer used.
2013-09-10 09:47:50 +02:00
Dan Williams
73978cbe6f sim-huawei: add SIM class to handle ICCID request
Use AT^ICCID if possible to read the ICCID.
2013-09-10 09:42:37 +02:00
Dan Williams
11a7e3dfdf core: add helper for parsing and validating the ICCID 2013-09-10 09:42:36 +02:00
Dan Williams
b8e8c2a56d telit: install udev rules 2013-09-06 21:36:01 -05:00
Aleksander Morgado
2968859525 huawei: check NDISDUP support in the port once
Don't query udev for the tag every time we recreate a bearer, just do it once.
For some reason, re-querying the same tag after the first time doesn't always
return the proper result.
2013-09-05 07:37:27 +02:00
Ben Chan
5120290705 huawei: fix uninitialized variable issues
This patch fixes the following uninitialized variable issues, which was
introduced in the previous commit "huawei: retry connect/disconnect attempt
upon ^NDISSTATQRY? failures" (commit 57c657bd06).

huawei/mm-broadband-bearer-huawei.c:127:9: error: variable 'ipv4_available' is used uninitialized whenever '||' condition is true
      [-Werror,-Wsometimes-uninitialized]
    if (!response ||
        ^~~~~~~~~
huawei/mm-broadband-bearer-huawei.c:141:9: note: uninitialized use occurs here
    if (ipv4_available && ipv4_connected) {
        ^~~~~~~~~~~~~~
huawei/mm-broadband-bearer-huawei.c:127:9: note: remove the '||' if its condition is always false
    if (!response ||
        ^~~~~~~~~~~~
huawei/mm-broadband-bearer-huawei.c:115:28: note: initialize the variable 'ipv4_available' to silence this warning
    gboolean ipv4_available;
                           ^
                            = 0
huawei/mm-broadband-bearer-huawei.c:484:9: error: variable 'ipv4_available' is used uninitialized whenever '||' condition is true
      [-Werror,-Wsometimes-uninitialized]
    if (!response ||
        ^~~~~~~~~
huawei/mm-broadband-bearer-huawei.c:498:9: note: uninitialized use occurs here
    if (ipv4_available && !ipv4_connected) {
        ^~~~~~~~~~~~~~
huawei/mm-broadband-bearer-huawei.c:484:9: note: remove the '||' if its condition is always false
    if (!response ||
        ^~~~~~~~~~~~
huawei/mm-broadband-bearer-huawei.c:472:28: note: initialize the variable 'ipv4_available' to silence this warning
    gboolean ipv4_available;
                           ^
                            = 0
2013-09-05 07:34:39 +02:00
Prathmesh Prabhu
57c657bd06 huawei: retry connect/disconnect attempt upon ^NDISSTATQRY? failures
The Huawei MU736 modem sometimes responds to the ^NDISSTATQRY? query with a
'+CME ERROR: 100' error. This patch works around the issue by ignoring a few
of these error responses in a connect / disconnect attempt. The overall timeout
for the connect/disconnect operation is not affected by this change.
2013-09-04 09:05:19 +02:00
Bjørn Mork
c014bce554 mbm: add udev rule for Toshiba branded H5321gw module
Reported-by: Thomas Schäfer <tschaefer@t-online.de>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2013-09-02 11:35:39 +02:00
Ben Chan
0e64ba01d4 huawei: ignore ^DSDORMANT unsolicited messages 2013-09-02 09:10:32 +02:00
Ben Chan
387c97d81f novatel-lte: check if a connect operation has been cancelled 2013-08-27 09:57:14 -05:00
Aleksander Morgado
2b28b7acb6 at-serial-port: avoid 'enable_disable', use just 'enable' in method name 2013-08-26 16:21:27 +02:00
Ben Chan
82eb2158db huawei: ignore ^RFSWITCH unsolicited messages
This patch ignores the ^RFSWITCH unsolicited messages in order to avoid
them being mixed with other unsolicited messages. The modem power state
is explicitly determined by the ^RFSWITCH? command, if supported, so we
don't need to depend on the ^RFSWITCH unsolicited messages.
2013-08-26 16:00:20 +02:00
Ben Chan
3979939eaf huawei: ignore +CUSATP and +CUSATEND unsolicited messages 2013-08-26 15:58:21 +02:00
Ben Chan
3fcc908ed5 huawei: always parse operator name in +COPS responses as ASCII
Despite +CSCS? may claim supporting UCS2, Huawei modems always report
the oerator name in ASCII in a +COPS response. This patch addresses that
by always assuming the charset is IRA when parsing the operator name in a
+COPS response.
2013-08-26 15:57:04 +02:00
Ben Chan
f2fb2fe9fc altair-lte: increase timeout for %APNN, %DPDNACT, and %STATCM 2013-08-26 15:56:39 +02:00
Aleksander Morgado
b61827f474 huawei: ignore ^NDISEND unsolicited messages 2013-08-21 11:16:15 +02:00
Ben Chan
b83ef8b5e2 altair-lte: increase timeout for +CFUN=4 2013-08-15 13:26:13 -05:00
Aleksander Morgado
663d496968 huawei: improve ^NDISSTATQRY parser for newer firmware
Newer firmware for Huawei devices will not split the IPv4 and IPv6 info in
different lines for the ^NDISSTATQRY reply; instead they will be included in the
same line. E.g. instead of

     ^NDISSTATQRY: 1,,,IPV4
     ^NDISSTATQRY: 0,33,,IPV6
     OK

We may have:

     ^NDISSTATQRY:0,,,"IPV4",0,33,,"IPV6"

Also note the optional spaces after the ':', and that in the new version the
strings are enclosed in double quotes.

https://bugzilla.gnome.org/show_bug.cgi?id=705339
2013-08-15 19:09:51 +02:00
Ben Chan
34f6a2b63e huawei: implement modem reset via +CFUN=16 for MU736 2013-08-14 09:30:47 +02:00
Fangxiaozhi (Franko)
e778283f55 huawei: enlarge the checking times for ndisstatqry in disconnecting
In sometimes, the disconnection of NDISDUP will spend more time than 10s.
So it is better to enlarge the checking times, such as up to 60 times.
2013-08-12 09:04:43 +02:00
Ben Chan
a82acb34ec huawei: implement modem reset 2013-08-12 08:57:43 +02:00
Ben Chan
755c61a2ff huawei: ignore ^PDPDEACT unsolicited messages 2013-08-06 16:06:01 -05:00
Ben Chan
8ff3f6703a huawei: handle whitespace in RSSI responses
This patch modifies the regular expressions for parsing ^RSSI, ^RSSILVL,
and ^HRSSILVL responses to handle any whitespace that is inserted
between the colon and the RSSI value.

The issue is identified by Dan Williams <dcbw@redhat.com>
2013-08-06 16:05:37 -05:00
Ben Chan
f2fd4d8de0 huawei: implement modem power up and down
This patch is originally developed by:
  Franko Fang <fangxiaozhi@huawei.com>

And then reviewed and updated by:
  Ben Chan <benchan@chromium.org>
2013-08-05 22:51:22 -05:00
Ben Chan
48fbe1a242 huawei: reset disconnect_pending to NULL when ^NDISSTATQRY fails 2013-07-31 16:59:27 +02:00