aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2011-11-16gsm: add new property to track which facility locks are enabledEric Shienbrood
The property EnabledFacilityLocks on the .Modem.Gsm.Card interface is a bit mask that indicates which of the various personalization codes from 3GPP TS 22.022, plus the SIM PIN lock and SIM PIN2 lock, are enabled. The set of facility locks supported by the modem is determined at the time the modem is initialized, and the state of each supported lock (enabled or disabled) is determined. When the state of a lock changes, a property-change signal is sent out. Note that ModemManager only supports enabling and disabling SIM-PIN, via the EnablePin method on Modem.Gsm.Card.
2011-11-16core: keep track of all PIN retry countsEric Shienbrood
Added a PinRetryCounts property on org.freedesktop.ModemManager.Modem. This is dictionary that records the number of PIN tries remaining for each of the possible PIN code types for which the modem is capable of reporting the count. Also, these counts are kept up to date across ChangePin and EnablePin operations, not just when an unlock is attempted.
2011-11-04serial: reject new commands when the port is closed.Nathan Williams
Otherwise, we can schedule a main loop call to mm_serial_port_queue_process() for an object that's about to disappear, leading to a crash. Change-Id: I433a76855c52536eb2b99a5ecf26ac71afe1f8bb
2011-11-03gsm: finish all disable commands before returningNathan Williams
Rearrange the primary and secondary-port disable operations so that there's a linear chain of callbacks rather than a second dangling callback chain for the secondary port; it's possible for the primary port operations to complete, and for the callback to finish and start tearing down the entire device, before the secondary port commands run. Change-Id: Ia95a7eae574737cdec38b14d39786127be1b3184
2011-11-02gsm: multipart SMS supportNathan Williams
Keep a local cache of SMS message fragments when we perform a List or Get command on the modem; use this cache to reassemble fragments into complete messages, which are then what is returned by the Get and List DBus commands. Similarly, cause Delete to delete all known parts of a multipart message. While here, remove some extra whitespace in the SMS commands we send to the modem.
2011-10-27gsm: fix parsing of unsolicited CREG/CGREG response with RACDan Williams
2011-10-27gsm: add regex for unsolicited CREG/CGREG response with RACDan Williams
2011-10-24serial: use g_value_set_schar() and g_value_get_schar() when glib >= 2.31Aleksander Morgado
2011-10-24core: don't include private headers from glibAleksander Morgado
The "glib/gtypes.h" is now considered private, and only "glib.h" should be included directly.
2011-10-18core: better handle NULL spew from serial ports during probingDan Williams
Observed on a generic ZTE device.
2011-10-17build: mm-modem-gsm.h no longer existsAleksander Morgado
2011-10-14serial: skip NUL bytes coming before real AT responsesAleksander Morgado
Some Cinterion modems send a NUL byte before the "CONNECTED" reply to "ATD" (only during the first ATD try anyway). This fix will ignore any NUL byte leading the real response.
2011-09-27core: ensure that GMatchInfo and GRegex objects are freed properlyNathan Williams
In particular, g_regex_match() and g_regex_match_full() allocate a match_info structure on both success and failure, so calling g_match_info_free() only in the success case is insufficient. BUG=None TEST=Inspection Change-Id: Iea76b5b5dc3ec48120e15601a5e2dd45322133d8
2011-09-27sms: sanitize 8-bit data so that it is UTF8-cleanNathan Williams
When receiving a SMS message with raw 8-bit data, sanitize it by replacing non-ASCII characters with \xNN escape sequences. This prevents a problem further down the line where the body of the message is passed into DBus as a string, and DBus requires strings to be UTF-8. BUG=chrome-os-partner:5953 TEST=Run network_ModemManagerSMS.py with the PDU from this bug. Change-Id: Ic33a365f9a065c49a325e047e4c3f5e81450fa1f Reviewed-on: http://gerrit.chromium.org/gerrit/8232 Reviewed-by: Eric Shienbrood <ers@chromium.org> Tested-by: Nathan J. Williams <njw@chromium.org> Commit-Ready: Nathan J. Williams <njw@chromium.org>
2011-09-08modem: add firmware interfaceThomas Tuttle
2011-08-30gsm/cdma: unsigned integers can't be < 0, so remove unnecessary conditionsAleksander Morgado
It fixes compilation with the llvm/clang compiler as well.
2011-08-21gsm: pass GSM registration errors up to callerEric Shienbrood
Register was appearing to succeed even when it failed.
2011-08-21sms: check for the correct return value from sscanf() in sms_get_done()Nathan J. Williams
Remove an unused variable so it's more obvious what the correct value is. Fixes live (vs. list) SMS reception on ToT. BUG=none TEST=Send SMS to device, see that it shows up in Chrome. Change-Id: I9c76fb15ef229fe83672e2eee8ae37d7e6ab7b9e Reviewed-on: http://gerrit.chromium.org/gerrit/3216 Reviewed-by: Nathan J. Williams <njw chromium org> Tested-by: Nathan J. Williams <njw chromium org>
2011-08-19api: use common ModemManager.h for API, core and pluginsAleksander Morgado
2011-08-14core: when probing mark ports as AT capable tooDan Williams
On a ZTE MF626, sometimes the aux port will respond only with "ERROR" to probing commands (while the SIM is starting up) and previously we'd lose the port because we were only looking for valid probe responses. But if the port returns ERROR or CME ERROR etc we know it's an AT port and that we can use it once we've gotten the type response (CDMA or GSM) from the main port.
2011-08-14gsm: check both CS and PS registration state during pollDan Williams
When connecting, and the modem isn't yet registered or denied, poll both CS and PS registration state instead of just CS state, because we're really more interested in PS state anyway. If at least one of the CS and PS state checks is successful then proceed with the connection.
2011-08-02core: log when serial port unexpectedly hangs upDan Williams
2011-08-02core: fix possible double-freeDan Williams
If there was data waiting, the task freed it, but then the port got closed, and the data callback might have freed the data again.
2011-08-02gsm: work around Motorola Android phone modem bugs (bgo #637327)Dan Williams
It seems the Motorola Flipout with Android 2.1 doesn't like to return configured PDP contexts via AT+CGDCONT?; it returns an error. It seems to accept the rest of the dial sequence though, so just ignore the error when reading existing PDP contexts.
2011-08-02core: fix serial port flashing after ↵Dan Williams
d3c2228f7b55465f4433bedb36d47744b8d791f1 (bgo #650740) Fix one more possible memory leak (left un-fixed by d3c2228 but not caused by it) and ensure that modems that do want flashing get it by default by adding the missing G_PARAM_CONSTRUCT so FLASH_OK defaults to TRUE.
2011-08-02core: allow ports to skip flash behavior (bgo #650740)Dan Williams
Flashing is a technique to break out of the data/PPP stream and re-enter command stream (like +++) and MM uses it in the generic paths in various cases. But devices that don't need it (ie, ones with at least one AT capable port that won't be used for data) now sometimes appear to have side-effects. The Ericsson F5521gw firmware R2A07 resets port attributes like echo and &C and such when the port is flashed, leading to confusion on the part of MM. Since the Ericsson devices will always have at least one free AT port they don't need flashing anyway.
2011-08-01gsm: allow SIM operations while connectedDan Williams
No point in requiring these to be done from the primary port.
2011-07-25cdma: don't blow away generic EVDO reg state if no specific state is availableDan Williams
Generic code (like the QCDM CM/HDR checks) would determine the EVDO registration state, which would then get blown away by the device-specific registration state query method. Modems that have a more specific check were fine, but generic devices that don't have more specific reg state checks can simply rely on the generic checks done earlier and don't need to update the EVDO state from real_query_registration_state().
2011-07-25core: allow getting the result from the MMCallbackInfoDan Williams
2011-07-25sms: calculate user-data bit padding correctlyNathan Williams
Fourth and final in a series. This fixes an off-by-one (septet) error in the calculation of the amount of data to skip in the presence of a user data header, and adds the test case from the wild that triggered it.
2011-07-25sms: recognize more text encodings from GSM 03.38Nathan Williams
Third in a series. This fixes the bug detected by the dcsf1 test in the just-added unit tests, by more thoroughly parsing the TP-DCS field.
2011-07-25sms: add unit testsNathan Williams
Second in a series. Builds on the previous by actually unit-testing the sms_parse_pdu() function. Note that the dcf1 test does not pass as the code is currently written.
2011-07-25sms: split SMS parsing out into a separate fileNathan Williams
In preparation for adding tests. Change-Id: If1ebd0fdd6e7470c21538042ab1735357649155c
2011-07-25gsm: don't clear operator name or number when at least one of PS or CS is ↵Dan Williams
registered The operator name/number isn't really tied to CS or PS registration, since we retrieve it using AT+COPS. But when one of CS or PS became unregistered the operator name and number would get cleared out. We only want to clear it out when *both* CS and PS are unregistered. Fixes an issue with the location API where location would not be reported when one of CS or PS became unregistered, because the location bits want an operator name before they return the location.
2011-07-21huawei: implement ussd encoding/decodingGuido Günther
Huawei wants the USSD as packed GSM.
2011-07-21ussd: Add mm_modem_gsm_ussd_{de,en}code to the MMModemGsmUssd interfaceGuido Günther
since some some modems need different quirks to encode/decode USSD messages.
2011-07-19cdma: set Rm interface protocol if required (bgo #641661)Dan Williams
Some providers (CDMA Ukraine) apparently require a specific Rm interface protocol, so add some Simple Connect dict settings for that and use them when dialing. Obviously requires the connection manager to also have support for sending the right bits down to MM.
2011-07-18core: add another CnS string to the immediate ignore listDan Williams
Newer Sierra devices have this (ie 306); it's the CnS port so ignore it immediately.
2011-07-06gsm: send init command twice to make the N900 happy (rh #583691) (lp:765516)Dan Williams
The N900 has some odd serial characteristics in that it appears to send pieces of the commands back for whatever reason, until you've sent a few commands down to it. Almost like it's training on whatever you send and needs a bit of input to figure out the characteristics. Whatever. Just send the init command twice instead of failing when the N900 barfs the first time.
2011-07-06core: update some serial port settingsDan Williams
1) use cfsetispeed/cfsetospeed like the TTY manpage suggests 2) ignore parity/framing errors since we're not using parity anyway 3) double-check that all our TTY settings were successfully set
2011-06-30gsm: set SMS storage location before enabling notificationsThomas Grenman
Fixes a firmware hang on Option GlobeTrotter Express (GE0201 with firmware 1.12.1Hd (Date: Feb 22 2007, Time: 09:20:28)) and makes sense in general too.
2011-06-30Merge remote-tracking branch 'lanedo/power-up-check-needed'Aleksander Morgado
2011-06-30Add a DBus interface for setting the log level.Nathan Williams
Lifted almost entirely from similar code in NetworkManager. BUG=chromium-os:15197 TEST='dbus-send --print-reply --system --dest=org.freedesktop.ModemManager /org/freedesktop/ModemManager org.freedesktop.ModemManager.SetLogging string:DEBUG' Also try valid log levels 'ERR', 'WARN', 'INFO', and an invalid log level, such as 'ABCDE'. Change-Id: I2bddcd0319f4966dd293b119f68e7cc1697949b7 Reviewed-on: http://gerrit.chromium.org/gerrit/3134 Tested-by: Nathan J. Williams <njw@chromium.org> Reviewed-by: Eric Shienbrood <ers@chromium.org>
2011-06-30gsm: handle case of entirely empty SPN correctlyNathan Williams
BUG=none TEST=Insert a SIM with a present but empty (all 0xFF) SPN and check the system log for a (lack of) assertion errors from mm_charset_gsm_unpacked_to_utf8(). Change-Id: I1250494b9757c9bfdce56402a4471c598f41223f Reviewed-on: http://gerrit.chromium.org/gerrit/3139 Reviewed-by: Eric Shienbrood <ers@chromium.org> Tested-by: Nathan J. Williams <njw@chromium.org>
2011-06-22serial: new property to enable RTS/CTS flow controlAleksander Morgado
2011-06-22gsm: allow plugins to check if they need to issue the power-up commandAleksander Morgado
Some modems only like the power-up command if not already in full functionality mode. If the power-up is sent while already in full functionality mode, they get rebooted and reseted. With this changes, plugins can check whether they need the power-up and ask the generic gsm code base to skip the command or not. By default, power-up command (if any given) is never skipped.
2011-06-15ussd: fix reception, network notifications, and network requestsDan Williams
Because the code was sending the USSD request with a "notify me via unsolicited result code" tag, the response could come from any port, and in was coming from other ports on various devices. But the code expected the response on the main port, thus it got lost. So turn the USSD response processing into an unsolicited command handler instead, which allows us to process the response no matter where it comes from. This patch also enables network-initiated USSD notifications and requests since that's easy to add once the first thing here is done.
2011-06-15serial: warn when open/close take longer than 7 secondsDan Williams
Due to kernel bugs and such.
2011-06-09core: trivial whitespace cleanupDan Williams
Tabs -> spaces
2011-06-09core: handle udev 'change' eventsNathan Williams
That's what the udev replay gives us these days (as of udev-152).