Commit Graph

864 Commits

Author SHA1 Message Date
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
Dan Williams
f7d55a688a broadband-modem-novatel: fix signal strength processing for older devices
mm_get_int_from_str() does not allow anything in the string after the
number, eg "-91  asdfasdf" returns an error.  So we have to chop off
anything after the number we're interested in.
2013-01-14 13:50:26 -06:00
Aleksander Morgado
2bd4c63716 hso: remove duplicated code 2013-01-14 20:09:47 +01:00
Aleksander Morgado
9a07688524 huawei: check with next port if the first one is not AT 2013-01-11 16:13:55 +01: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
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
Aleksander Morgado
5d02361501 iridium: ignore initial power state loading
No need to initially power-up the modem.
2013-01-11 10:05:45 +01:00
Aleksander Morgado
923d4dd8bd motorola: ignore initial power state loading
No need to initially power-up the modem.
2013-01-11 10:05:45 +01:00
Aleksander Morgado
f79f3b8770 nokia: ignore initial power state loading
No need to initially power-up the modem.
2013-01-11 10:05:45 +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
e3db373be4 wavecom: no need to check if already powered up before powering up
This logic is now implemented by the parent broadband modem object.
2013-01-11 10:05:45 +01:00
Ben Chan
e939221975 iface-modem, novatel-lte: disable network scan in LTE mode 2013-01-04 12:10:51 +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
Aleksander Morgado
4ffa871228 zte: ignore net ports in non-Icera based modems
Plain non-Icera ZTE modems will use ATD calls and PPP to establish the
connection, so ignore 'net' ports that may be found in the way (e.g. when the
modem is a QMI modem and we're not using QMI support).
2012-12-27 08:48:10 +01:00
Aleksander Morgado
ded8bfe965 hso: new helper code to debug GPS related issues
Disabled in normal compilation, can be enabled to debug issues.
2012-12-24 19:06:26 +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
Aleksander Morgado
dc9bbefbc0 icera,hso: don't wait to get connected if the primary port is removed
If the primary port is gone (e.g. when going to sleep) and we are just in the
middle of a connection attempt, we won't be able to receive any unsolicited
message regarding the status of the attempt. So, if we detect that the port is
forced to get closed, we'll just treat it as a connection failure.

http://code.google.com/p/chromium-os/issues/detail?id=35391
2012-12-12 12:56:47 +01: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
4b23fd00a0 icera: implement Time interface support check 2012-12-05 14:38:50 -06:00
Dan Williams
8c1f80a9a4 huawei: implement Time interface for CDMA modems 2012-12-05 13:49:21 -06:00
Dan Williams
4e980d1739 icera: report 4-digit year as required by ISO-8601
Assume 2000 + year.
2012-12-05 12:15:51 -06:00
Dan Williams
e3a71711bf huawei: handle CDMA allowed modes 2012-12-05 11:27:54 -06:00
Dan Williams
c3984d3982 huawei: fix crash disabling CDMA unsolicited response handlers
Parent MMBroadbandModem may not implement these functions so we
shouldn't call them unless it does.
2012-12-05 11:27:54 -06:00
Dan Williams
f0ba40f3a1 huawei: implement Huawei-specific CDMA signal quality checks
Many Huawei CDMA modems implement vendor commands for 1x and EVDO
signal quality, so use them since they are more accurate than the
generic signal checking.

(port of a similar patch for MM_06 by heiher <admin@heiher.info>)
2012-12-05 11:27:54 -06:00
Dan Williams
8fdcfd5b97 huawei: consolidate MODE parsing
Both CDMA and 3GPP modems emit this, but using slightly different
formats.
2012-12-05 10:49:21 -06:00
Dan Williams
56e5ecdc1b huawei: consolidate SYSINFO parsing
Both CDMA and 3GPP modems use SYSINFO, so consolidate the parsing of
its response.
2012-12-05 10:49:21 -06:00
Dan Williams
1e23fe62fe sierra: USB 306 modems support PPP on the APPx ports 2012-11-29 11:42:03 -06:00
Aleksander Morgado
b0746c591f huawei: don't assume g_regex_match_full() sets error when not matching 2012-11-27 22:04:04 +01:00
Dan Williams
2f28193cd4 broadband-modem-huawei: don't call non-existent MMBroadbandModem CDMA functions 2012-11-27 14:50:14 -06:00
Dan Williams
ef644fba84 hso: DIAG ports aren't always DIAG
The 'hso' driver tags Icera-based modems' proprietary protocol port
as a DIAG port, but since they aren't Qualcomm-based, it's not
a DIAG port.  Just turn off AT probing and let QCDM probing
fail the port instead of assuming it's a DIAG port.
2012-11-27 09:56:25 -06:00
Aleksander Morgado
e6052a4abf icera,hso: don't disconnect() cancellable in the cancellation callback
The logic gets completely stuck when this happens:

Stack trace below:
#0  0x77661424 in __kernel_vsyscall ()
#1  0x77337c3c in pthread_cond_wait ()
#2  0x773cebaa in g_cond_wait () from /usr/lib/libglib-2.0.so.0
#3  0x774c03cc in g_cancellable_disconnect () from /usr/lib/libgio-2.0.so.0
#4  0x76955d36 in connect_cancelled_cb (cancellable=0x78e055a0, self=0x78e0b590)
#5  0x77460982 in g_cclosure_marshal_VOID__VOIDv () from /usr/lib/libgobject-2.0.so.0
#6  0x7745ed8a in ?? () from /usr/lib/libgobject-2.0.so.0
#7  0x77478435 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#8  0x77478eb3 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#9  0x774c01eb in g_cancellable_cancel () from /usr/lib/libgio-2.0.so.0
#10 0x776a0eab in mm_bearer_disconnect (self=0x78e0b590, callback=0x776c5980 <disconnect_ready>,
#11 0x776c57de in disconnect_next_bearer (ctx=0x78e12870) at mm-iface-modem-simple.c:898
#12 0x776c58d2 in disconnect_auth_ready (self=0x78df3048, res=0x78e06210, ctx=0x78e12870)
#13 0x774fed25 in g_simple_async_result_complete () from /usr/lib/libgio-2.0.so.0
#14 0x776a8c4e in authorize_ready (authp=0x78db68d0, res=0x76801638, simple=0x78e06210)
#15 0x774fed25 in g_simple_async_result_complete () from /usr/lib/libgio-2.0.so.0
#16 0x774fee3e in ?? () from /usr/lib/libgio-2.0.so.0
#17 0x7738a7a2 in ?? () from /usr/lib/libglib-2.0.so.0
#18 0x7738ce83 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#19 0x7738d248 in ?? () from /usr/lib/libglib-2.0.so.0
#20 0x7738d6eb in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#21 0x77696a7d in main (argc=2, argv=0x7fbb1f04) at main.c:158

http://code.google.com/p/chromium-os/issues/detail?id=36448
2012-11-27 11:26:51 +01:00
Aleksander Morgado
c2db8abe52 huawei: better detection of data port on some modems
Some devices (e173) appear to lie about NDIS support; GETPORTMODE reports NDIS
is enabled, but that port is actually the MDM port and responds to AT commands.
So, if we get a port reported as NDIS and none reported as MDM, use the one
reported as NDIS for PPP.

https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/1057186
2012-11-12 09:49:48 +01:00
Aleksander Morgado
8c4a836a2d option,hso: early check of port type hints to avoid probings
Instead of getting the port type hints while grabbing each probed port, we now
run a custom init operation in the probing which already gives us the port type,
and therefore allows us to completely skip port probings.

Also now added hints for 'Diag' (QCDM) ports and AT/'Modem' ports (I guess it's
the one for PPP if we don't have a net port, which is unlikely anyway in HSO).

This makes the probing of an Option/HSO modem almost instant.
2012-11-09 12:05:03 +01: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
Ben Chan
5a16f2aff1 novatel-lte: use $NWMDN to read own number when +CNUM fails
+CNUM may return ERROR when the modem fails to read the own numbers from
the SIM card or when the SIM card hasn't been activated. Use $NWMDN to
read the MDN as a fallback, which distinguishes these two cases.
2012-11-05 16:10:19 +01:00
Aleksander Morgado
9ec90d9a11 core,plugins: don't assume 'CS' supported when '2G' supported
We will not report 'CS' as a supported mode every time '2G' is supported. This
actually was forcing all plugins to handle a 'CS' fallback when they didn't have
CS-specific mode setup. So, to simplify things, we will only report 'CS' as
supported for those plugins which actually allow to select 'CS' mode (e.g. the
'wavecom' plugin).
2012-11-02 09:52:31 +01:00
Aleksander Morgado
96305bb5c1 iridium: report only 'CS' mode supported
Iridium modems only support circuit-switched connections, so just report that
one as supported.
2012-11-02 09:48:56 +01:00
Ben Chan
15f7a370d2 novatel-lte: increase the wait after SIM unlock to 3 seconds
After repeated stress tests on a few Novatel E362 modems and SIM cards,
it is revealed that a 3-second wait after SIM unlock is necessary for
reliably reading ICCID and IMSI through the SIM interface.
2012-11-02 08:19:47 +01: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