Commit Graph

64 Commits

Author SHA1 Message Date
Aleksander Morgado
0ebf6d5da5 mbm: query supported modes to the modem with +CFUN=?
We were trying to load the generic modes supported reported by either *CNTI=2 or
AT+WS46=?, so that then we could filter out the MBM-specific modes unsupported.

But, this may not be ideal, as both these two commands may fail:

    [mm-broadband-modem.c:1612] modem_load_supported_modes(): loading supported modes...
    [mm-port-serial.c:1237] mm_port_serial_open(): (ttyACM1) device open count is 3 (open)
    [mm-port-serial.c:1294] _close_internal(): (ttyACM1) device open count is 2 (close)
    [mm-port-serial-at.c:440] debug_log(): (ttyACM1): --> 'AT*CNTI=2<CR>'
    [mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- '<CR><LF>ERROR<CR><LF>'
    [mm-serial-parsers.c:364] mm_serial_parser_v1_parse(): Got failure code 100: Unknown error
    [mm-broadband-modem.c:1546] supported_modes_cnti_ready(): Generic query of supported 3GPP networks with *CNTI failed: 'Unknown error'
    [mm-port-serial.c:1237] mm_port_serial_open(): (ttyACM1) device open count is 3 (open)
    [mm-port-serial.c:1294] _close_internal(): (ttyACM1) device open count is 2 (close)
    [mm-port-serial-at.c:440] debug_log(): (ttyACM1): --> 'AT+WS46=?<CR>'
    [mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- '<CR><LF>ERROR<CR><LF>'
    [mm-serial-parsers.c:364] mm_serial_parser_v1_parse(): Got failure code 100: Unknown error
    [mm-broadband-modem.c:1494] supported_modes_ws46_test_ready(): Generic query of supported 3GPP networks with WS46=? failed: 'Unknown error'
    [mm-iface-modem.c:3974] load_supported_modes_ready(): couldn't load Supported Modes: 'Couldn't retrieve supported modes'

Instead, we'll ask the modem for the list of modes supported, and return that
directly.
2016-01-10 17:46:12 +01:00
Aleksander Morgado
ffde429843 core: use G_SOURCE_REMOVE and G_SOURCE_CONTINUE in GSourceFuncs 2015-12-02 17:07:39 +01:00
Aleksander Morgado
f60b055142 mbm: enable GPS port for HS2350
https://bugs.freedesktop.org/show_bug.cgi?id=85008

As reported by Dan Williams <dcbw@redhat.com>.
2015-04-10 08:29:57 +02:00
Aleksander Morgado
5fb8e87abd mbm: enable GPS port for H5321gw
https://bugs.freedesktop.org/show_bug.cgi?id=85008

As reported by Sven Arvidsson <sa@whiz.se>.
2015-04-10 08:29:57 +02:00
Fabrice Bellet
534eea345d mbm: add GPS location gathering support
The udev rules file is updated according to the list of devices
supporting gps features provided by the udev rules file from the
mbm-gpsd project.

https://bugs.freedesktop.org/show_bug.cgi?id=85008
2015-04-10 08:29:49 +02:00
Yunlian Jiang
977cf658a6 tests: fix memory leaks 2015-03-27 20:31:24 +01:00
Aleksander Morgado
5358d6fea0 sim: rename 'MMSim' to 'MMBaseSim'
Just so that we don't have same header names in src/ and /libmm-glib.
2014-07-06 16:55:29 +02:00
Aleksander Morgado
3ca267b01f bearer: rename 'MMBearer' to 'MMBaseBearer'
Just so that we don't have same header names in src/ and /libmm-glib.
2014-07-06 16:55:29 +02:00
Dan Williams
02f9b926cd broadband-bearer-mbm: support IPv6 DNS and use static IPv4 configuration 2014-06-13 11:30:49 -05:00
Ben Chan
551197b4e5 plugins: remove unnecessary MM_BASE_MODEM() casts 2014-05-21 11:59:49 +02:00
Ben Chan
7c656cce47 mbm: minor coding style fixes 2014-05-20 09:31:42 +02:00
Aleksander Morgado
6f235b9948 ports: rename 'MMAtSerialPort' to 'MMPortSerialAt' 2014-02-13 13:40:01 +01:00
Aleksander Morgado
9cde02111b ports: rename 'MMSerialPort' to 'MMPortSerial' 2014-02-13 13:39:51 +01:00
Arnd Hannemann
bd5cecb577 mbm: add lenovo branded ericsson ID (Lenovo N5321gw)
This device ID is used in a Lenovo Thinkpad T440s.

Link: http://forums.debian.net/viewtopic.php?f=7&t=107986&sid=4f81b9c1a8f4563f26fec24f7b65aaea&start=15

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
2014-02-11 10:10:35 +01:00
Aleksander Morgado
48585c250b udev: apply udev rules upon 'move' events as well
Otherwise, we may end up losing the tags we expect if the device gets a 'move'
event just after the initial 'add'.
2014-01-26 19:33:45 +01: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
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
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
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
Aleksander Morgado
1c67d050cb api,introspection: merge 'AllowedModes' and 'SupportedMode' into 'CurrentModes'
We now have a single 'CurrentModes' property which contains both values in a
tuple with signature "(uu)".

Also, rename 'SetAllowedModes()' to 'SetCurrentModes()', and update the list of
arguments expected to have a single "(uu)" tuple.
2013-06-05 19:15:14 +02:00
Aleksander Morgado
45ceba7692 api,introspection: 'SupportedModes' is now a list of possible combinations
Instead of just a mask of MMModemMode values, we now provide a list of the
allowed and preferred mode combinations supported by the modem. E.g.:

$> sudo mmcli -m 0
  -------------------------
  Modes    |      supported: 'allowed: 2g; preferred: none
           |                  allowed: 3g; preferred: none
           |                  allowed: 2g, 3g; preferred: none
           |                  allowed: 2g, 3g; preferred: 2g
           |                  allowed: 2g, 3g; preferred: 3g
           |                  allowed: 4g; preferred: none
           |                  allowed: 2g, 3g, 4g; preferred: none'
2013-06-05 19:15:14 +02:00
Dan Williams
68a7d1a3ac broadband-modem-mbm: *EPIN response often needs a lot of time
If the modem was locked, it'll delay responding until the SIM is ready,
which can take a long time.
2013-05-31 13:13:57 -05:00
Aleksander Morgado
b95dc3f2f5 mbm: allow MBIM devices 2013-04-17 19:15:24 +02:00
Aleksander Morgado
a2d2f83910 mbm: plug memleaks 2013-04-05 10:27:43 +02:00
Aleksander Morgado
30e2a0f4d0 mbm: don't pass (null) as string when either user or password is empty
E.g. instead of:
  (ttyACM1): --> 'AT*EIAAUW=2,1,"(null)","vodafone"<CR>'
  (ttyACM1): <-- '<CR><LF>OK<CR><LF>'

Better pass:
  (ttyACM1): --> 'AT*EIAAUW=2,1,"","vodafone"<CR>'
  (ttyACM1): <-- '<CR><LF>OK<CR><LF>'
2013-04-05 10:27:43 +02:00
Aleksander Morgado
e60ad8d8dc mbm: ignore *ESTKSMS unsolicited messages
https://bugzilla.gnome.org/show_bug.cgi?id=697280
2013-04-04 18:32:55 +02:00
Aleksander Morgado
a066cc84cf mbm: fix udev rule tagging logic 2013-04-01 17:53:13 +02:00
Aleksander Morgado
5ffad1f51f mbm: don't tag only tty ports, and also grab cdc-wdm ports
We also need to tag cdc-wdm ports, so that they get grabbed but ignored and
not QMI-probed.

https://bugzilla.gnome.org/show_bug.cgi?id=696701
2013-04-01 14:02:51 +02:00
Aleksander Morgado
b9b5ca39df mbm: wait for unlock reporting READY after PIN/PUK unlock
MBM modems will lie about the unlock status just after having sent a
correct PIN or PUK. So, explicitly wait to get in READY state after having
sent the PIN or PUK, before keeping on.

https://bugzilla.gnome.org/show_bug.cgi?id=696702
2013-03-29 20:17:59 +01:00
Aleksander Morgado
14c03f98ad mbm: fix 3gpp dialling sequence when result comes through polling 2013-03-05 20:47:58 +01:00
Aleksander Morgado
144cc7011e mbm: tag the ttys instead of the parent usb device
We can just tag the ttys instead of the parent usb device, so that the core
logic which looks in the plugin-specified port tags works properly. There is no
need to explicitly tag the net port, as the probing for this port ends when a
plugin suggestion comes from another port probing on the same device.
2013-03-05 20:32:03 +01:00
Aleksander Morgado
ca49af0c5d mbm: fix CFUN result parsing 2013-02-22 17:54:16 +01:00
Aleksander Morgado
50ecf2a7d9 mbm: implement custom modem_power_down()
Cache last valid allowed mode always, so that we re-use it when powering up
again.
2013-02-22 17:33:49 +01:00
Aleksander Morgado
c0ce165d09 mbm: implement custom load_power_state()
We need to handle modems which appear in low-power mode (e.g. CFUN=4), so
implement a custom check of the power state. We cannot use the default check
as MBM modems use CFUN also for allowed mode handling.
2013-02-22 16:35:56 +01:00
Aleksander Morgado
b6402a4e21 bearer,3gpp: dial operation specifies which data port to use
Instead of deciding in advance which data port to use, we let the dialling
operation gather it. For the generic dialling logic, ATD-based, always an
'AT' port will be used as data port, even if we grabbed a 'net' port. Those
plugins that can work with 'net' ports will grab the specific 'net' port
themselves.
2013-02-18 15:41:26 +01:00
Aleksander Morgado
1746949277 ports: add port initialization sequences instead of iface-modem's modem_init()
Instead of a custom modem_init() step in the 'Modem' interface, just add a
sequence of port initialization commands in each port.

While enabling for the first time a non-hotplugged modem, we will issue the
port initialization commands only after having run the enabling_modem_init()
step (i.e. after ATZ usually).
2013-02-18 13:47:35 +01:00
Aleksander Morgado
30639606d3 broadband-modem: new step during 'enabling_started' to initialize the modem
We previously had the modem initialization command merged with some other port
setup commands in the 'modem_init' step of the 'Modem' interface. Instead of
doing this, we now split the logic into two separate steps:

A first 'enabling_modem_init' modem initialization step is to be run just after
the ports have been opened, but only during the first enabling operation, and
only if the modem was not hotplugged. A hotplugged modem is assumed to be
properly initialized already, so no need to ATZ-it. Also, we will now wait 500ms
by default after the modem initialization command has been sent, to let it
settle down.

The second 'modem_init' step will be run during the 'Modem' interface
initialization, and it currently only holds specific setup of the primary and
secondary serial ports. We'll be modifying this logic a bit in the next commits,
so no big deal to have that step name unchanged.
2013-02-18 13:47:34 +01:00
Dan Williams
cd2545c2b6 broadband-modem-mbm: handle HSPA access technology in ERINFO response
HSUPA/HSPA capable devices (ex F5521gw) can report '3' here, which
we'll decide to interpret as HSPA.  It might actually be HSDPA + HSUPA,
but whatever...
2013-02-07 12:49:55 -06:00
Aleksander Morgado
7c87555bf8 mbm: force initial power-up during first enabling
When both load_power_state() and modem_power_down() are not implemented, the
logic will launch the power-up command during (only the first) enabling of the
modem.

In this kind of modems, CFUN is directly related to allowed/preferred modes, so
during the initial power-up we'll just assume we want ANY mode.
2013-01-11 10:05:46 +01:00
David Härdeman
529b031a01 Add udev rules for HP (Ericsson) hs2350 Mobile Broadband Module
This WWAN module came installed in my new HP EliteBook 8570p Laptop.
The patch is generated against the master branch but the same udev
rule should be useful in the 0.5 and 0.6 branches as well.

Signed-off-by: David Härdeman <david@hardeman.nu>
2012-10-14 17:03:38 +02:00
Aleksander Morgado
c250fa3797 libmm-glib: remove the `libmm-common.h' header
Both the ModemManager daemon and the mmcli will now include `libmm-glib.h' only.

We also handle two new special `_LIBMM_INSIDE_MM' and `LIBMM_INSIDE_MMCLI'
symbols, which if included before the `libmm-glib.h' library allow us to:

 * Don't include the libmm-glib high level API in the ModemManager daemon, as
   the object names would clash with those in the core.

 * Define some of the methods of helper objects to be included only if compiling
   ModemManager daemon or the mmcli.
2012-10-04 10:17:12 +02:00
Aleksander Morgado
a66f971a7c libmm-common: added common utils from core
Moved the utils to play with binary to hex strings into libmm-common.
2012-09-14 07:05:26 +02:00
Dan Williams
9d2a046754 mbm: add Ericsson H5321gw (often found in Thinkpad X230) 2012-08-31 10:11:05 +02:00
Aleksander Morgado
0436b3e457 api,introspection: report list of drivers, not just one
Different ports of the same modem may get handled by different drivers. We
therefore need to provide a list of drivers (new `Modem.Drivers' property with
signature 'as') instead of just one (removed `Modem.Driver' property with
signature 's').

$ sudo mmcli -m 0 | grep drivers
           |        drivers: 'qcserial, qmi_wwan'
2012-08-24 13:34:51 +02:00
Aleksander Morgado
d18dbb869a base-modem-at: add 'raw' handling to `mm_base_modem_at_command_full()' 2012-08-24 12:32:29 +02:00
Aleksander Morgado
2d0cb24af8 mbm: implement custom 3GPP disconnection sequence 2012-08-23 18:56:23 +02:00
Aleksander Morgado
3ddb57d816 mbm: implement custom 3GPP dialling sequence 2012-08-23 18:56:23 +02:00
Aleksander Morgado
2f20fc64c2 mbm: new `MMBroadbandBearerMbm' object 2012-08-23 18:56:23 +02:00
Aleksander Morgado
3753184eb1 mbm: implement custom PIN retry count loading 2012-08-23 18:56:23 +02:00
Aleksander Morgado
3cdfa93c73 mbm: implement custom modem factory reset 2012-08-23 18:56:23 +02:00