Commit Graph

93 Commits

Author SHA1 Message Date
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
Aleksander Morgado
7c347aa3ec port: store parent sysfs path in each MMPort 2014-06-23 18:12:27 +02:00
Dan Williams
6e5d013eb1 broadband-bearer-sierra: use Icera authentication for Icera devices
Devices with Icera chipsets (USB305) don't support the Qualcomm
proprietary $QCPDPP command, and we must use the Icera command
instead.  Otherwise authenticated bearer creation will fail.
2014-06-13 11:30:49 -05:00
Dan Williams
502a5dbaf5 broadband-bearer-sierra: use correct modem type when creating bearer
MMBroadbandModemSierraIcera is not a subclass of
MMBroadbandModemSierra, so we cannot cast it to that type when
passing it to bearer creation.  Luckily the bearer doesn't
care, so just downgrade the type to MMBroadbandModem.
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
Aleksander Morgado
0126eb6311 sierra: PCSTATE=0 needs to be treated as low-power mode
OFF only applies to a real shutdown, where the modem no longer replies.
2014-05-05 20:30:45 +02:00
Aleksander Morgado
d4dfd661b9 port-serial-at: use GIO Async API like methods 2014-02-13 13:40:21 +01:00
Aleksander Morgado
6f235b9948 ports: rename 'MMAtSerialPort' to 'MMPortSerialAt' 2014-02-13 13:40:01 +01:00
Aleksander Morgado
95249239a2 sierra: fix leaked 'GStrv' with CDMA modems 2014-01-25 20:01:32 +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
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
Dan Williams
11a7e3dfdf core: add helper for parsing and validating the ICCID 2013-09-10 09:42:36 +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
Ben Chan
2eee2e48ba sierra: remove comparison of unsigned expression >= 0
This patch removes an unnecessary check of unsigned expression >= 0,
which also fixes the following clang warnings:

sierra/mm-broadband-modem-sierra.c:570:18: error: comparison of
unsigned expression >= 0 is always true
[-Werror,-Wtautological-compare]
            mode >= 0 &&
            ~~~~ ^  ~

Bug reported on https://code.google.com/p/chromium/issues/detail?id=235989
Patched by Yunlian Jiang <yunlian@chromium.org>
2013-05-06 09:36:53 +02:00
Dan Williams
2e8866c8b7 time: normalize GetNetworkTime() response to local time + timezone info (bgo #697372)
The GetNetworkTime() response is defined to be an ISO8601 string, which
is in turn defined to be in local time.  Make sure that's reflected in
the documentation, and append the timezone offset to UTC where we have
it.

Oddly, Icera devices return their time info in UTC with an offset to
the local timezone, so we have to jump through some hoops there to
convert the response to localtime based on the reported offset.

Some additional fixes by Aleksander Morgado <aleksander@lanedo.com>.

https://bugzilla.gnome.org/show_bug.cgi?id=697372
2013-04-25 15:14:14 -05:00
Dan Williams
cabf53179e sierra: handle probing ERROR response better
The USB305 (Icera-based) apparently has a port that replies to everything
with ERROR, and that port is unusable.  Make sure it's ignored, otherwise
MM may claim it as the primary AT port since it technically speaks AT.
2013-04-25 09:18:53 -05:00
Aleksander Morgado
77d096bdac sierra: ensure error is set when !SELRAT response parser doesn't match 2013-04-25 09:36:51 +02:00
Aleksander Morgado
56387bb79c sierra: allow MBIM modems handled by the plugin 2013-04-17 15:19:50 +02:00
Aleksander Morgado
8c39f2c551 sierra: implement PIN/PUK retry count loading
Not all Sierra modems support it, but those which do reply like this:

    AT+CPINC=?
    OK

    AT+CPINC?
    +CPINC: 3,3,10,10
2013-04-04 19:26:51 +02:00
Aleksander Morgado
464f33f77f sierra: early detect non-AT ports
Detect the parser filter errors during our custom_init(), and set the port as
not being AT if the error found.
2013-04-04 19:26:51 +02:00
Aleksander Morgado
4ea827a3a1 sierra: too many timeout errors during custom init means non-AT port
Reduces probing time of the modem in ~10s.
2013-04-04 19:26:51 +02:00
Aleksander Morgado
d2b4ab9d9c sierra: 'data' may be NULL if the parent dialling fails 2013-04-04 17:22:45 +02:00
Aleksander Morgado
a62624aa22 sierra: plug memleak 2013-04-04 17:18:23 +02:00
Aleksander Morgado
a7b8cbb71d port-probe: don't reschedule next probing step when serial port buffer full
When the serial port buffer gets full of non-AT garbage during port probing,
we were re-scheduling the next probing step, which is completely wrong, as we
then would be processing the same probing task twice. If we get a buffer full,
just cancel the AT probing cancellable, which would cancel not only the possible
AT probings, but also the custom init if there is any.

Also, make sure that the custom_init() of the plugins out there don't return an
error if the GCancellable is cancelled. Cancelling the GCancellable means we
should just stop the custom_init(), and actually sending an error in
custom_init() means that the port should be set as unsupported by the plugin, so
completely different things.

Should fix https://bugzilla.gnome.org/show_bug.cgi?id=696695
2013-03-29 12:33:20 +01:00
Aleksander Morgado
d6ac6508d9 plugin: explicitly request QMI probing
Plugins which may support QMI ports need to explicitly request QMI probing
in cdc-wdm devices. This should also avoid probing cdc-wdm ports when we know
that the plugin doesn't support them (e.g. with Ericsson MBM devices).

https://bugzilla.gnome.org/show_bug.cgi?id=696701
2013-03-28 17:33:08 +01:00
Dan Williams
ca97f0e79f broadband-modem-sierra: fix trivial copy & paste error 2013-03-27 18:02:50 -05:00
Dan Williams
95b46c16f1 broadband-modem-sierra: add after-sim-unlock delay
Older devices may crash if asked to connect right after sending the
PIN and unlocking the SIM; they simply stop responding to AT commands
around the first request for access technology and then reboot.  A
delay seems prevents this behavior.

Since it's not uncommon to require a delay after SIM unlock, add one
for newer sierra_net devices as well, even though we're not quite
sure if they need one or not.  It doesn't hurt, at least.
2013-03-25 15:49:08 -05:00
Dan Williams
8ebce66f96 sierra: fix time check warnings for modems that don't support time
'result' may be NULL even if no error is set.  Errors aren't set
because we want to continue the !TIME/!SYSTIME sequence regardless
of errors, so we can figure out which command the modem supports.

Trying to get a uint32 out of a NULL GVariant makes glib complain,
and it's wrong, so don't do that.
2013-03-25 15:08:31 -05:00
Gerald Richter
113916beb5 sierra: add MC8790 to APP1 PPP whitelist 2013-03-04 08:32:23 -06: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
5860de182d sierra: fix access tech reporting logic 2013-02-08 12:08:44 +01:00
Dan Williams
fc4034a72f broadband-modem-sierra: implement access technology reporting for CDMA devices
Use AT!STATUS to grab current access technology.
2013-01-14 13:50:26 -06:00
Dan Williams
56bdf4a37b broadband-modem-sierra: make CDMA AT!STATUS parsing code generic
We'll use it for access technology reporting too.
2013-01-14 13:50:26 -06:00
Dan Williams
b68a487e15 broadband-modem-sierra: don't check +CAD and +CSS for CDMA devices
We have !STATUS for that, which is much more detailed.  Use it.
2013-01-14 13:50:26 -06:00
Dan Williams
48b36b1afa broadband-modem-sierra: load own numbers via ~NAMVAL?0 for CDMA
Sierra CDMA devices don't always have QCDM ports, or if they do,
they aren't always usable.  Try Sierra-proprietary commands for
loading the modem's MDN and fall back to QCDM if that fails.
2013-01-14 13:50:26 -06:00
Aleksander Morgado
0f9873c23a sierra: load power state with !pcstate? in cdma-only modems 2013-01-11 11:21:08 +01:00
Aleksander Morgado
eec5d00a97 core,plugins: remove initial power down sequence
We no longer power down the modem during initialization, so remove that
implementation.
2013-01-11 10:05:46 +01:00
Aleksander Morgado
9f5cfefb00 sierra: in 3GPP, no need to check if already powered up before powering up
This logic is now implemented by the parent broadband modem object.

Also, implement a custom initial power state loading, so that CDMA-only modems
get marked as 'offline', in order to launch !pcstate=1 to power them up during
the first enabling. The custom initial power state loading will run the parent's
implementation in non-CDMA-only modems.
2013-01-11 10:05:45 +01:00
Aleksander Morgado
d40ef83898 sierra: implement modem reset 2012-12-28 11:47:32 +01:00
Aleksander Morgado
eae28e9be4 sierra: wait up to 10s for the power up command reply
Specially the first time that CFUN=1,0 is issued after the initial power up, we
really need to wait more than 3s for the AT command reply. Otherwise, the modem
won't like it and it will reset itself :-/
2012-12-28 10:34:43 +01:00
Aleksander Morgado
35775e3634 sierra: ignore all +PACSP messages
Not only +PACSP0, but also +PACSP1.
2012-12-28 08:49:35 +01:00
Aleksander Morgado
b5257491b0 sierra: fix 3GPP dialling sequence
There was a missing step++ when falling down to the next step in the switch(),
which was preventing a proper connection.
2012-12-28 08:13:40 +01:00
Aleksander Morgado
95598e2e37 sierra: pass data port to parent's 3GPP dialling sequence 2012-12-28 08:01:05 +01:00
Aleksander Morgado
7da2a65b43 plugins: fix generic GObject related macros 2012-12-27 08:48:11 +01:00
Dan Williams
c08b03f6fd sierra: fix APP1 PPP functionality
Unfortunately, Sierra secondary APP ports reply to +GCAP with
only "OK", and not their APP port number or model number.  So instead
of using +GCAP, we have to use ATI to get secondary port information.
This allows us to detect which port is the APP1 port that we can
potentially use for PPP, leaving the primary port available for
control and status.

Also, some modems have up to 3 or 4 APP secondary ports, which we
need to ensure aren't used as primary.  The previous check for +GCAP
handled that, but let's make it more explicit.

AT+GCAP reply:
OK

ATI reply:
Sierra Wireless, Inc.
C885
APP1
OK

See also: 3f3987e09ee762e48c1d53cb42a1288ce9f332cb (MM_06)
2012-12-17 14:23:00 -06:00
Dan Williams
9d5e2c608d sierra: implement the Time interface for 3GPP and CDMA devices 2012-12-11 12:48:38 -06:00
Dan Williams
5427f0d356 sierra: restore longer CFUN=1 timeout for older devices
Turns out older devices (like the C885/AT&T Mercury) crash often
when we don't wait for them to settle from CFUN=1.  5 seconds is
too short, but the crashes go away when we wait for 10 seconds.
Newer modems like the USB306 don't have this problem, so we just
check to see if the modem is a DirectIP device (using sierra_net)
and only use the shorter timeout for those newer devices.

This is a separate problem from some older modems returning ERROR
to valid commands that are sent too soon after CFUN=1, which was
observed on really old devices like the PCMCIA 860.
2012-12-10 16:33:05 -06:00
Dan Williams
1e23fe62fe sierra: USB 306 modems support PPP on the APPx ports 2012-11-29 11:42:03 -06:00