Commit Graph
96 Commits
Author SHA1 Message Date
Dan Williams 794353ebcc cdma: update reg state to HOME based on SPERI response
If the SPERI response indicates the home network, then set
CDMA registration to HOME if it was REGISTERED (which is
less specific).
2011-01-05 11:15:11 -06:00
Dan Williams 6c56db07fc cdma: fix segfault by handling MEID property
Also, MEID->Meid to follow standard D-Bus property semantics.
2011-01-04 17:21:41 -06:00
Dan Williams b0cd9288c2 cdma: fix CDMA registration state retrieval on single AT port devices
If the device only has one AT port that's being used for data and
thus we can't do more specific registration checking in MMGenericCdma
using AT commands, but generic registration checking was successful,
just use the less specific state.

Previously, an error would be returned when no AT port was available
even though less specific QCDM registration checking worked.  That
was just stupid.
2011-01-04 14:06:03 -06:00
Dan Williams 7ae8ffe21b core: use hardware IDs as part of DeviceIdentifier
Pass the device's hardware IDs through modem creation and use them
when calculating the device's identifier.  Add a bunch of testcases
for real hardware to ensure we don't break the device ID in the
future unless we really want to.
2010-10-22 11:06:48 -05:00
Dan Williams 328d2369a9 core: add DeviceIdentifier property
This is computed before any PIN is entered, and thus before we can
usually get IMEI or MEID/ESN out of the device in many cases. It's
therefore not the same as EquipmentIdentifier.

This is intended to be used by UI programs for matching devices with
PIN numbers for automatic unlocking.  While the PIN number is actually
*SIM* specific, no modems allow access to the IMSI before the PIN is
entered, and thus we cannot actually match the PIN with the SIM.  The
device ID is the next best thing we can use and should allow auto
unlocking in most cases.
2010-10-21 16:57:37 -05:00
Dan Williams 4cdaba3161 cdma: clear error when getting state if no AT port is available
We don't care about the error if we have a QCDM port.
2010-10-14 14:00:42 -05:00
Dan Williams 85ce544675 cdma: consolidate some code by ignoring +CMEE result
Most modems don't support it and we're ignoring the error message
anyway, so don't bother with a callback for its result.
2010-09-01 17:31:49 -05:00
Dan Williams ed9e056987 cdma: determine EVDO registration even when in 1X mode
Sometimes the primary mode will be 1X (and thus the Call Manager
will report 1X system mode) but the HDR subsystem will be registered
and idle.  Figure that out and report that EVDO is registered too
in that case, since the modem will just flip over to EVDO when
the data call starts.
2010-08-06 01:32:03 -05:00
Dan Williams 6f40ecbed5 novatel: detect CDMA home/roaming status 2010-07-02 16:57:28 -07:00
Dan Williams 88c538314a core: EquipmentIdentity -> EquipmentIdentifier 2010-06-22 17:14:13 -07:00
Dan Williams e442b3b7f1 cdma: implement EquipmentIdentity for CDMA devices 2010-06-22 14:37:20 -07:00
Dan Williams 9cbd68e96c cdma: return numeric ERI too 2010-05-18 13:04:43 -07:00
Dan Williams 533ffaddc4 cdma: make ERI parsing generic 2010-05-18 12:24:42 -07:00
Dan Williams 885bc90be9 gsm/cdma: fix data port assignment (rh #587400)
QCDM ports should never be the data port; 'net' ports take precedence
over AT ports too.  Clarify that.
2010-05-04 17:34:11 -07:00
Dan Williams bfe3dd49ed core: refcount serial port open/close
This specifically fixes a regression with Novatel GSM secondary
AT port enablement, where the inital pin check closed the port
before the Novatel plugin could send the command to flip secondary
ports to AT mode.

But it's useful elsewhere too, and simplifies a bunch of the PIN
checking code which had to use various ugly methods to track whether
to close the port or not after checking the PIN.
2010-04-29 21:15:17 -07:00
Dan Williams b9bb12a01e core: flash failure on disconnect shouldn't be a hard error (rh #578280) 2010-04-24 23:40:24 -07:00
Dan Williams 01cb6360f8 cdma: prevent crash on modem removal (rh #571921) 2010-04-24 23:12:16 -07:00
Dan Williams f3dd034aad cdma: fix subclass registration state checking in error paths (rh #569067)
The generic CDMA superclass already checks minimal registration state,
and when some of the additional query_registration_state() subclass checks
were being performed, if the device returned an error (if it didn't support
the subclass' specific registration command like *STATE or ^SYSINFO) the
superclass' registration state checks would be thrown away.

Fix that by specifying the behavior of the subclass'
query_registration_state() methods to ignore most errors and leave the
superclass' registration state intact if a non-critical error occurs.
2010-04-05 18:46:53 -07:00
Dan Williams 7da2b5cb6a cdma: clean up periodic poll start/stop
And fix a small bug where polling wasn't started for the ENABLED state.
2010-04-05 10:38:39 -07:00
Dan Williams 9112180f8a cdma: periodically poll registration state and quality 2010-04-05 09:58:12 -07:00
Dan Williams d2e12742c4 cdma: use best active pilot EC/IO for signal strength when connected
If the modem doesn't have two AT ports (so one can be used for AT+CSQ
while connected) get the 1x active pilot's EC/IO and use that for
signal strength.
2010-03-30 17:28:13 -07:00
Dan Williams 39326f2491 cdma: use DM for serving system if possible 2010-03-30 01:01:53 -07:00
Dan Williams e7d1e4adb9 cdma: use DM Call Manager for registration status if available
This should solve problems with users who's providers are EVDO
only and thus the device isn't in 1X mode, but who's modems
don't set anything meaningful for CAD or CSS when the 1X radio
isn't registered.  Previously, MM would just spin thinking it
wasn't registered when trying to connect.

This was mostly found with AnyDATA, Huawei, and some ZTE devices
from Russia and India.
2010-03-23 02:10:58 -07:00
Dan Williams bcfb75d88d core: grab probed QCDM ports for plugins where they are useful 2010-03-23 01:36:00 -07:00
Dan Williams 7fbe4d8383 cdma: check SPSERVICE and SPERI when getting registration state 2010-03-22 00:28:21 -07:00
Dan Williams 3b32e2a679 cdma: check for +SPSERVICE and $SPERI
Which are Sprint-specific commands which appear to be implemented by
various phones for getting access technology and roaming status.
2010-03-21 17:50:45 -07:00
Dan Williams 85fc71818e core: have modem base class handle card information 2010-03-19 11:01:19 -07:00
Dan Williams 79bca53f21 cdma: simplify finding the right serial port for commands 2010-03-16 17:03:55 -07:00
Dan Williams 936533cfcc Merge remote branch 'origin/master' into qcdm 2010-03-12 12:40:00 -08:00
Dan Williams 3e760488b6 cdma: make previous state tag private 2010-03-12 12:38:53 -08:00
Dan Williams 9d91501330 Merge remote branch 'origin/master' into qcdm 2010-03-12 12:21:29 -08:00
Dan Williams cda38d390a cdma: fix Simple.GetStatus to actually work 2010-03-12 12:07:08 -08:00
Dan Williams 7a0c503036 cdma: use E1 parser to ignore re-echoed commands
Some modems turn E1 on and off random (Huawei EC168C) and sometimes
the echoed command confuses things.  We have a parser just for that,
so let's use it.  It should be safe to use with devices that repect
E0 too.
2010-03-12 10:16:24 -08:00
Dan Williams 1979512d8d Merge remote branch 'origin/master' into qcdm 2010-03-10 14:50:41 -08:00
Dan Williams d01a3ae328 cdma: tell the modem we're using XON/XOFF too 2010-03-09 11:47:13 -08:00
Dan Williams a8c7bba19e serial: refactor MMSerialPort into a base class and an AT-capable serial port
For QCDM devices we want most of what MMSerialPort does, but not
the AT command handling stuff since the commands and responses
aren't AT commands nor are they even strings.  So convert everything
that MMSerialPort does into a GByteArray, and let MMAtSerialPort
handle the conversion to strings when necessary.
2010-02-20 14:55:10 -08:00
Dan Williams ed885b7595 Merge commit 'origin/anydata' 2010-01-19 15:07:03 -08:00
Dan Williams 564d054e8e cdma: increase data call initiation timeout
Some cards (Novatel S720 for example) can take a long time to start
a data call if the device isn't activated on the network or the
signal strength is low.
2010-01-19 14:35:48 -08:00
Dan Williams f6a09050af cdma: allow plugins to override AT+CSS? during registration checking (rh #547294)
Some modems key the AT+CSS? response off their 1X state, so if the
modem has EVDO service but no 1X service, AT+CSS? will provide incorrect
registration state information and the registration checking will
end too early.  Allow modems that can handle more specific registration
checking to skip the AT+CSS? part.
2010-01-19 13:46:07 -08:00
Dan Williams 50ad39b28e core: protect against modem removal in critical callbacks (rh #553953)
There are more places to handle, but these are the most critical.  If
the modem is removed while a command is in-progress, the mm-callback-info
code will set info->modem to NULL.  Make sure we check for that in
callbacks and return a reasonable error.  Previous code would just
blindly forge ahead and die on a null dereference.
2010-01-19 03:18:10 -08:00
Dan Williams 73e10c77d3 cdma: prefer primary port unless it's connected 2010-01-18 23:59:54 -08:00
Dan Williams 3ad172d150 cdma: fix quality parsing if modem doesn't prepend +CSQ:
Which some Huawei modems (EC168C) don't do.
2009-12-16 14:34:29 -08:00
Dan Williams 30a2a20207 sierra: use at!pcstate on CDMA modems for power control
at!pcstate is what Sierra CDMA modems use instead of AT+CFUN for
powering the radio on and off.  It doesn't turn the modem off completely
like AT+CFUN=0 does for many GSM devices though, so it's quite a lot nicer.
2009-12-16 14:20:24 -08:00
Dan Williams 41ea9a0e4b cdma: try +CSQ? if CSQ fails
Some modems want one, some modems want the other.  Try both.
2009-12-11 10:48:23 -08:00
Dan Williams 3d852435c6 cdma: accept SID 0 in some cases
Most AT command references allow modems to report SID 0, even though
SID 0 is not a valid SID and is not assigned to any CDMA network.
Some Sierra 5725 cards have been seen to report valid class and band
from the +CSS response but a SID 0.  Accept SID 0 when at least one
other element of the +CSS response indicates that the modem has service.
Otherwise, report "no service" as before.
2009-12-11 09:30:51 -08:00
Dan Williams bf13b4698f cdma: reset previous state if disconnect failed 2009-12-01 16:33:44 -08:00
Dan Williams c169396c1b cdma: correctly handle state update after disconnection
We only want to ignore connected/connecting/disconnecting states
and update the state based on registration for unsolicited
registration changes.  Basically, when disconnecting, the modem
will be in DISCONNECTING state, but after the disconnect has finished
we want to update the modem's state based on the current
registration status.  But the previous check for >= DISCONNECTING
would prevent that from happening, so we need a slightly more specific
check in update_enabled_state().
2009-12-01 16:19:27 -08:00
Dan Williams d438012f63 cdma: s/GSM/CDMA
Oops.
2009-12-01 16:01:20 -08:00
Dan Williams 02c7db7fcf cdma: handle interim enabling/disabling states better
Have to fall back to the previous state if the enable/disable
operation fails since we cannot assume anything about the new
modem state when a failure occurs.
2009-12-01 15:58:11 -08:00
Dan Williams a295afdd2d cdma: update for new modem states and make connect actually work 2009-12-01 15:39:06 -08:00