Commit Graph
200 Commits
Author SHA1 Message Date
Dan Williams eeb7807044 test: add Gobi COPS response testcase 2010-01-05 23:24:59 -06:00
Dan Williams d3b5688d43 test: add Nokia 2720 COPS response testcase 2010-01-05 21:54:05 -06:00
Dan Williams 008c7e322d test: add Novatel XU870 and Option GT Ultra Express COPS response testcases 2010-01-05 21:47:40 -06:00
Dan Williams f444533a74 test: add +COPS response testcases for E1550, MF622, and E226 2010-01-05 18:07:29 -06:00
Dan Williams c30f23e02c gsm: add testcase for invalid +COPS response 2010-01-05 15:03:06 -06:00
Dan Williams 3988f53d2e gsm: correctly parse Nokia N80 +COPS response 2010-01-05 14:57:30 -06:00
Dan Williams 216e49f8d8 gsm: split out +COPS response parsing and add testcases 2010-01-05 14:29:19 -06:00
Dan Williams a06b3f20ca serial: prevent "hangs" by limiting EAGAIN retries on serial writes
MM would appear to hang sometimes when writing to serial devices but
in reality was just retrying the write too many times.  Make the
retry limit time-based so MM doesn't hang but times the attempt out
instead.
2010-01-01 20:52:15 -06:00
Dan Williams 5eed83cd75 gsm: ensure registration state is reset when disabling the modem 2009-12-23 02:19:26 -08:00
Dan Williams b94627572f core: implement a PropertiesChanged signal for the MMModem class
At the moment only the Enabled property is exported.
2009-12-22 16:58:23 -08:00
Dan Williams 710986bd4b core: add Enabled property to org.freedesktop.ModemManager.Modem interface 2009-12-21 11:37:36 -08:00
Dan Williams 8d42094608 zte: handle unsolicited messages during probe
This implements the same fixes that NetworkManager's 0.7 branch
implemented in commits f38ad328acfdc6ce29dd1380602c546b064161ae and
1235f71b20c92cded4abd976ccc5010649aae1a0.  Many ZTE devices will
spam the port with messages about waiting voicemail/SMS which buffer
up and cause the device to eventually crash if not suppressed.
2009-12-16 15:26:05 -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 a9e0624426 gsm: handle different +COPS response behavior
Some modems delay the +COPS response until registration is complete,
others return right away.  Make sure that both behaviors work
correctly.
2009-12-07 18:40:04 -08:00
Dan Williams 5a4a9a6239 core: add refcounts to MMCallbackInfo 2009-12-07 18:39:18 -08:00
Dan Williams 1157b59a18 core: pretty-print state changes 2009-12-02 14:59:26 -08:00
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