Commit Graph

66 Commits

Author SHA1 Message Date
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
Dan Williams
11db2ea380 sierra: fix CFUN power up delay handling
All Sierra devices appear to require short delay after powering up,
otherwise subsequent commands may return errors. Older devices need
longer so ensure new devices are penalized just for being new.

This is the port to git master of the following commit, for which we
don't need to do #2:

commit 814febe1fd9baacdb33c79f11c140187df36c4f1
Author: Dan Williams <dcbw@redhat.com>
Date:   Tue Oct 30 16:16:25 2012 -0500

    sierra: fix CFUN power up delay handling

    1) all Sierra devices appear to require short delay after powering up,
    otherwise subsequent commands may return errors.  Older devices need
    longer so ensure new devices are penalized just for being new.

    2) When the modem is already in full functionality status and no power
    up command was sent, there's no need to delay, which was happening
    regardless of what state the modem was already in.  Detect whether
    the power up was actually executed (response and error will be NULL)
    and only delay if it was executed.
2012-11-05 16:30:33 -06:00
Dan Williams
189726de11 sierra: allow more time for PDP context activation
3 seconds isn't always enough to set up the context with the network.
2012-10-30 18:40:30 -05:00
Marius B. Kotsbak
26956924b0 sierra: avoid reset when setting cfun=1
Some Sierra modems trigger a reset of the modem when sending +cfun=1.
All sierra modems supports a second parameter to indicate that no
reset is to be done: "+cfun=1,0".
2012-10-30 12:53:25 -05:00
Aleksander Morgado
de96243cd4 sierra: use user-specified allowed authentication methods
If none of the specified methods is supported, an error is returned.

Also quote user and password using `mm_at_serial_port_quote_string()'.
2012-10-07 21:12:00 +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
54f476fe10 sierra: run power-down during init 2012-10-01 16:40:52 +02:00
Marius B. Kotsbak
d2353e01ff sierra: use +CFUN=4 for powering down GSM modems 2012-09-18 16:27:09 -05: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
Aleksander Morgado
4804c37604 build: new `--without-qmi' configure option
For those who don't care about the QMI support through libqmi-glib, or if you're
stuck with glib 2.30 (libqmi-glib requires 2.32), this configure switch allows
disabling the QMI support completely.

The logic to detect cdc-wdm ports is still in place, but the QMI probing is
never launched at them. Also, all QMI-related objects won't be compiled.
2012-09-05 20:02:31 +02:00
Marius B. Kotsbak
9c2a6320a8 sierra: add support for new !SELRAT values in newer Sierra LTE modems
AT!SELRAT=?
!SELRAT: Index, Name
00, Automatic
01, UMTS 3G Only
02, GSM 2G Only
03, Automatic
04, Automatic
05, GSM and UMTS Only
06, LTE Only
07, GSM, UMTS, LTE
2012-09-03 18:33:44 +02:00
Aleksander Morgado
80fa4cb312 sierra: use generic current capabilities loading
The generic current capabilities loading already has the required extra
AT+WS46=? query to see if LTE capabilities are available.
2012-09-02 16:20:12 +02:00
Aleksander Morgado
fa0ccc593e sierra: fix finding LTE capabilities 2012-08-31 16:41:38 +02:00
Dan Williams
63ef0990b6 sierra: allow users to help debug APP1 PPP capability
Most Sierra PPP-based devices are supposed to allow PPP on the
APP1 port, which has a dumb AT parser, leaving the main port
(with the intelligent AT parser) free for status and signal strength.
But out of all the devices I've tested it with (8775, 8781, AC881,
and C885), only the C885 actually works.  The rest (including three
different firmware versions for the 8775) either crash or disconnect
shortly after PPP starts.

To help figure out which devices actually support this, when
running MM in debug mode, users can set the MM_SIERRA_APP1_PPP_OK
environment variable and assume the APP1 port allows PPP.  This
is only for debugging purposes.
2012-08-31 15:11:30 +02:00
Aleksander Morgado
b4e0fa3d89 sierra: skip echo removal in the secondary port
This is the port to git master of the following commit:

commit d1be19d231a395339b1f452d1a30b73ea77ad528
Author: Dan Williams <dcbw@redhat.com>
Date:   Tue Aug 28 21:58:43 2012 -0500

    sierra: fix CSQ handling on APP1 port

    The APP1 port doesn't always prefix its replies with <CR><LF> which
    runs afoul of the built-in echo removal.  Since Sierra modems are on
    the whole well-behaved WRT echo removal, just disable it on the
    secondary ports.  Only changes behavior for PPP-based devices since
    they are the only ones that use the APP1 ports.
2012-08-31 15:11:30 +02:00
Aleksander Morgado
061e184d39 sierra: use DHCP for the USB 305 (AT&T Lightning)
This is the port to git master of the following commit:

commit 44f70121f75d59dbf31a4a9a1a4e87293e509e7a
Author: Dan Williams <dcbw@redhat.com>
Date:   Tue Aug 28 20:18:40 2012 -0500

    sierra: use DHCP for the USB 305 (AT&T Lightning)

    For some reason, my AT&T Lightning just doesn't work with static
    IP (AT%IPDPADDR) any more.  No traffic passes even though everything
    is set up the way it was before.  No idea what happened.  Using
    latest firmware 2.0.0.11.

    But what's interesting is on Windows the generic Sierra Watcher
    app uses DHCP.  But on Linux, when using AT%IPDPACT, DHCP doesn't
    work.  That's odd.  But it turns out the modem supports the
    "standard" Sierra proprietary AT!SCACT commands, and that
    *does* make DHCP work.  Crazy no?  So since the Windows app
    uses DHCP, it's likely that the non-DHCP case (AT%IPDPACT/AT%IPDPADDR)
    either isn't well tested or isn't well supported.  With that
    in mind, let's just use DHCP for this device in Linux too.
2012-08-31 15:11:30 +02:00
Aleksander Morgado
c6a1d91cd5 sierra: use an additional AT+WS46=? to detect LTE capabilities
Some Sierra modems (e.g. MC7710) will report LTE-specific supported modes in the
AT+WS46=? reply, but not +CLTE capability in the AT+GCAP reply:

AT+GCAP
 +GCAP: +CGSM
 OK

AT+WS46=?
 +WS46: (12,22,25,28,29)
 OK
2012-08-31 13:05:51 +02:00
Aleksander Morgado
a2c7cacb69 sierra: fix detection of APP1 port
This is the port to git master of the following commit:

commit e0242b4db7fb1556e79f6829d22edf411f9f6ba4
Author: Dan Williams <dcbw@redhat.com>
Date:   Thu Aug 23 21:14:38 2012 -0500

    sierra: fix detection of APP1 port

    The APP1 port (which has a limited AT parser) doesn't prefix
    its replies with <CR><LF> like nice modems do, and that means
    it runs afoul of the echo removal bits of the AT serial port
    code.  We need to parse the whole string even though it's not
    prefixed properly to find the APP1 string in the response.
2012-08-31 09:22:45 +02:00
Aleksander Morgado
6c94741e04 sierra: fix dialling context deallocation
We were using the slice allocator, not plain g_malloc().
2012-08-31 00:05:21 +02:00
Aleksander Morgado
ff1a175035 sierra: detect stupid secondary ports
Some sierra modems (e.g. MC7710) have a secondary port that likes to reply OK
to any AT command passed. Detect that as soon as possible, and don't consider
the Icera port probing result from that secondary port.
2012-08-30 22:46:56 +02:00
Aleksander Morgado
35bece0af3 sierra: enable QMI-powered Sierra modems 2012-08-30 14:17:51 +02:00
Aleksander Morgado
1ca46bb4a7 port-probe: easier check for Icera support over a list of port probes 2012-08-30 13:57:56 +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
d9ea4a304c at-serial-port: allow sending 'raw' commands
Commands treated as 'raw' won't get the 'AT' prefix and will also not get the
trailing carriage return.
2012-08-24 12:32:28 +02:00
Aleksander Morgado
6b1ee4e3cb sierra: both AT and QCDM expected 2012-08-23 18:56:22 +02:00
Aleksander Morgado
896e0469f0 sierra: implement custom CDMA detailed registration checks 2012-08-23 18:56:22 +02:00
Aleksander Morgado
86e7b0e8c6 sierra: custom power-down command for CDMA modems 2012-08-23 18:56:22 +02:00