Commit Graph

2375 Commits

Author SHA1 Message Date
Dan Williams
7a0373afee qcdm: add serial port subclass skeleton 2010-02-23 11:41:40 -08:00
Dan Williams
f5d1a9b400 serial: allow file descriptor configuration to be handled by subclasses 2010-02-21 11:22:16 -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
a431455059 core: fix memory leak on startup 2010-02-20 14:53:43 -08:00
Dan Williams
d8ea5ea003 gsm: fix initial PIN checking for devices that echo by default
If the modem echoed commands by	default (since we may not have
initialized the modem yet), the echoed command would confuse
the PIN check reply parser.
2010-02-09 23:44:23 -08:00
Dan Williams
95dd4b5be1 gsm: try initial PIN check a few times in case SIM is busy 2010-02-09 22:58:44 -08:00
Dan Williams
7fdacfc89b test: add SE K600i COPS response testcase 2010-02-08 11:45:50 -08:00
Martin Pitt
a9918d5942 core: ignore VTs
Even just walking sysfs for driver and parent devices takes
time for ports we know we'll never use, so take a short-cut
and save some startup time.  This reduces the startup
overhead to some 15%.
2010-02-02 10:02:53 -08:00
Dan Williams
469e54c364 gsm: update UnlockRequired status on PIN/PUK entry result 2010-01-31 22:33:38 -08:00
Dan Williams
c85e617530 serial: handle string CME error codes too
Some devices won't get to the initialization stage where we send
CMEE=1 (for numeric error codes) before they return some errors,
so handle the string representation of CME error codes too.
2010-01-31 22:32:33 -08:00
Dan Williams
27d1c8f936 errors: rework error conversion
Use the same error structure for parsing numeric and string-based errors.
2010-01-31 21:52:29 -08:00
Dan Williams
ba9634ae4f serial: add mm_serial_port_is_open() 2010-01-31 12:04:53 -08:00
Dan Williams
7659208037 core: log when unlock state changes 2010-01-31 12:00:26 -08:00
Dan Williams
42a20ab187 core: whitespace fixup 2010-01-31 11:57:05 -08:00
Norbert Frese
1561436788 core: check modem PIN state before exporting it (bgo #604551)
And set UnlockRequired accordingly.  Large cleanups and rework by
dcbw.
2010-01-31 11:43:52 -08:00
Norbert Frese
3d0f2ecf12 core: add an UnlockRequired property that provides lock status (bgo #604551)
Clients can check the property to determine lock/unlock status and thus
unlock the modem before trying to connect if required.

Bits of the patch by dcbw (see the bug).
2010-01-31 11:06:55 -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
c6694a06b5 core: fix mm_modem_check_removed() to return errors correctly
Make sure all errors actually get returned, not just removal errors.
2010-01-19 14:23:05 -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
28eca600f7 Merge commit 'origin/probe-cpin' 2010-01-19 00:21:10 -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
b1992f903b probe: add note about Onda MT503HS (rh #551376) 2010-01-18 23:22:02 -08:00
Dan Williams
0cc9c1731c probe: add CPIN request during the probing process (bgo #604369)
Some devices (ZTE MF628) respond to everything except CPIN? with
ERROR unless the PIN has been sent.  Since no known CDMA devices
support AT+CPIN, assume that devices that return a CPIN response
are GSM devices.
2010-01-17 17:37:41 -08:00
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