Commit Graph
1781 Commits
Author SHA1 Message Date
Dan Williams 5bdabaabec gsm: implement enable/connecting/disconnecting state handling
And consolidate generic port enable code in one place since pretty
much every modem needs that.
2009-12-02 14:43:09 -08:00
Dan Williams bb6f997fb8 gsm: update for new states and state flow fixes 2009-12-01 16:46:23 -08:00
Dan Williams 7f1951fec8 core: fix ordering of DISABLING and DISABLED states 2009-12-01 16:44:07 -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
Dan Williams e9964231e9 core: use modem states to protect against double operations 2009-12-01 15:38:11 -08:00
Dan Williams 0f19bbff0f core: add a few more interim modem states 2009-12-01 15:37:37 -08:00
Dan Williams 015da49d06 core: set modem state before potentially destroying the modem 2009-12-01 14:19:25 -08:00
Dan Williams d269a9a278 core: state should always be reset to DISABLED when validity changes
When the modem becomes valid, it should initially be in disabled state,
and when it becomes invalid, it should also go to disabled.
2009-12-01 12:58:57 -08:00
Dan Williams 231d2ca90b core: schedule enabled/disabled callbacks to avoid infinite recursion 2009-12-01 12:57:39 -08:00
Dan Williams 3350a3aeea cdma: set correct modem state on connect failure 2009-12-01 12:57:18 -08:00
Dan Williams 881a725ea4 Merge commit 'origin/master' into states 2009-12-01 11:22:00 -08:00
Dan Williams 35daaff983 gsm: more complete parsing of PIN responses
Need to handle ex PH-NET PIN from a subsidy-locked device for
example.
2009-11-30 20:17:43 -08:00
Dan Williams 909b8b7c8d Merge commit 'origin/master' into states 2009-11-30 15:44:20 -08:00
Dan Williams 0f595adb7f gsm: fix unsolicited registration segfaults
By decoupling the solicited registration callback from unsolicited
replies, we can be sure of the call flow and avoid issues where
unsolicited registration will be processed when an explicit
registration request is no longer in progress.

Also ups the timeout on CREG=0,, to 120 seconds because that
appears to trigger an internal scan on some of the 'hso' devices
that I have, and can take up to 60 or more seconds to complete
or fail.
2009-11-30 15:41:09 -08:00
Dan Williams d06f8f46c6 serial: don't run commands when there's already one in-progress
If there's already a command in-progress don't try to send
another until the previous one has timed out.  Also use
g_timeout_add_seconds() since precision doesn't really matter for
command timeouts.
2009-11-29 22:46:48 -08:00
Dan Williams 9dbf8f22c0 gsm: allow unsolicted registration updates to actually update reg state 2009-11-29 18:58:21 -08:00
Dan Williams aea0be5b9a nozomi: fix detection (lp:425312)
Nozomi devices aren't quite ready when the ports show up, so
we have to keep trying to open the port for a few seconds and
eventually it'll succeed.  Should really be fixed in the driver
(ie, don't create the ttys until they can actually be used) but
whatever.
2009-11-26 13:54:47 -08:00
Dan Williams 15595b33dc gsm: CGDCONT parsing fixes (bgo #602552)
Ignore spaces and account for random parentheses in the CGDCONT
response.  Also fixes parsing CGDCONT=? on nozomi.
2009-11-26 13:52:50 -08:00
Dan Williams 8dd2421e9c core: don't allow double-scheduled callbacks
If the modem becomes invalid (it crashes and resets, for example)
the callback-info's modem_destroyed_cb() function will handle
cleanup.  Buf if the callback-info's callback does more work than
just returning the result (like simple_state_machine) it could
double-schedule the callback.  Don't let that happen.

We need better modem-removal handling, but this fixes a crash for
now.
2009-11-26 13:40:32 -08:00
Jeroen Elebaut 19e9c0cb48 serial: handle arbitrary amounts of <CR><LF> padding in responses
Firmware on some Option devices (iCON 505) likes to spray newlines
all over the place.  Some fixes and boundary checks by me (dcbw).
2009-11-24 15:36:32 -08:00
Dan Williams 3218b94376 cdma: handle 1x and EVDO quality separately 2009-11-24 12:57:44 -08:00
Jeroen Elebaut 5175c2accb gsm: some modems dislike spaces in AT+CGDCONT
0.7 hasn't used spaces for over a year, so this is a pretty safe
change.  Some modems just don't like it.

0.7 commit to remove spaces:

commit 0265bfe52dcc93372aff6064e849044ccb72aa1e
Author: Dan Williams <dcbw@redhat.com>
Date:   Fri Oct 24 15:15:06 2008 +0000

    2008-10-24  Dan Williams  <dcbw@redhat.com>

        * src/nm-gsm-device.c
                - (set_apn): remove erroneous spaces in AT+CGDCONT command (Jerone Young)
2009-11-24 11:31:22 -08:00
Jeroen Elebaut 5ceb3a2106 gsm: allow longer timeout for registration
Often modems will scan before registering with +COPS.
2009-11-24 00:43:20 -08:00
Dan Williams 3be4a15189 Merge commit 'origin/master' into states 2009-11-23 23:48:26 -08:00
Dan Williams d8ff5f74e0 core: state -> DISABLED when the modem becomes invalid 2009-11-23 23:30:30 -08:00
Dan Williams 500fb5f29a gsm: don't regress states on registration change if still registered 2009-11-23 23:30:04 -08:00
Dan Williams 3193e97bb8 probe: fix probing on PPC due to missing cast
gcc will interpret the constant value as a uint32 but
the port's set_property() was taking it as a uint64.  Thus
the top 32 bits were probably garbage, and messed up
on big-endian architectures leading to random large
probe delays.
2009-11-17 14:16:24 -08:00
Dan Williams 3c6e4056e7 Merge commit 'origin/master' into states 2009-11-06 15:11:01 -08:00
Dan Williams 107f950a9e gsm: tighter signal strength validation
The standard dictates CSQ response strength value to be [0 - 31]
inclusive, and 99 means "unknown" or "no service".  Make that
apparent and don't treat 99 as 99% which it clearly isn't.  Also,
allow spaces in the CSQ response.
2009-10-30 17:11:31 -07:00
Dan Williams 122aa62afa trivial: spacing fix 2009-10-30 17:11:22 -07:00
Dan Williams 07cf870937 gsm: give a network scan 2 minutes instead of 1
On many modems that support 7 or more bands (quad-band 2G, tri-band
or more for 3G) scans take quite a while.
2009-10-30 16:55:56 -07:00
Dan Williams 54901933fe gsm: make "X4 &C1" init arguments optional (lp:455031)
At least don't error out of the fail since they aren't really
necessary, just nice to have.
2009-10-30 16:55:04 -07:00
Dan Williams 9bbc6ab53b core: initial implementation of modem states
Needs more work for GSM, but should be reasonably complete for CDMA.
2009-10-27 15:01:00 -07:00
Dan Williams 4e74953b91 cdma: return registration state, not error, when unregistered 2009-10-26 17:59:33 -07:00
Dan Williams 49b5ffd076 core: use G_DEFINE_TYPE_* instead of rolling our own
Use the macro; save some trees.
2009-10-26 17:56:48 -07:00
Dan Williams 2887a50b23 gsm: ignore errors from power-on command
Phones especially don't seem to consistently implement this.  For now,
we'll hack it out, but later, we'll want to have a class method for
power-on instead of just a property so that subclasses can decided for
themselves (since they know their hardware better) whether failure
of the power-on command is fatal or not.
2009-10-26 15:39:34 -07:00
Alexander Sack 16f3e00f34 gsm: fix unsolicited registration by calling the statemachine callback info - lp:416893 2009-10-15 01:32:08 +02:00
Dan Williams 3d86a3e89a gsm: don't issue CFUN=0 by default
Let plugins do it when they know it's OK.
2009-10-14 13:47:21 -07:00
Dan Williams c77dbb7a94 cdma: give cards more time to register
5 was left-over from debugging unplug-while-registering issues,
was meant to be 15 (ie, 60 seconds) anyway.
2009-10-13 16:05:02 -07:00
Dan Williams f4ada20709 cdma: implement registration in Simple.Connect path
Wait a bit for the modem to register before trying to dial.
2009-10-12 22:44:03 -07:00
Dan Williams c0253c7c29 core: convert MMCallbackInfo modem refs to weak refs
Full references prevented destruction of the modem object if
it was unplugged or somehow removed.  To fix that using full
references on the modems would require that all usage of
MMCallbackInfo to be aware of the validity of the modem and to
ensure the callback was called whenever the modem became invalid.
That, needless to say, would suck.  Since any in-progress calls
can't complete when the modem is invalid anyway, just have the
MMCallbackInfo object return a generic error when the modem goes
away and the call is still in-progress.
2009-10-12 19:51:10 -07:00
Dan Williams 958b9048a3 cdma: split 1x and EVDO registration states
Like UMTS vs. GSM, EVDO and 1x are separate networks and technologies
and have separate registration state.  You can even be roaming on
EVDO while in your home 1x network.  Handle that.
2009-10-12 10:06:53 -07:00
Dan Williams bdd60a4941 cdma: fix memory leak parsing serving system results 2009-10-11 11:31:23 -07:00
Dan Williams 0c5c94b691 cdma: add signal quality update helper for subclasses 2009-10-11 11:25:43 -07:00
Dan Williams 19b7c8fef1 cdma: use consistent terminology for registration 2009-10-11 11:24:41 -07:00
Dan Williams 665d1847a8 cdma: add port accessors for subclasses 2009-10-11 11:23:50 -07:00