chromiumos/platform/gobi-cromo-plugin.git
15 months agoSend SIGTERM when exiting to allow for proper cleanup. 05/57005/4 factory-4290.B factory-4455.B factory-pit-4280.B factory-pit-4390.B factory-pit-4471.B factory-spring-4262.B firmware-falco_peppy-4389.B firmware-leon-4389.26.B firmware-pit-4482.B firmware-wolf-4389.24.B master release-R29-4319.B release-R30-4537.B stabilize-4255.B stabilize-4287.B stabilize-4443.B stabilize-4512.B
Thieu Le [Wed, 29 May 2013 17:53:40 +0000 (10:53 -0700)]
Send SIGTERM when exiting to allow for proper cleanup.

BUG=chromium:217162
TEST=Sanity check by start/stop cromo, connect/disconnect modem

Change-Id: I60c85bab1fbd41e28be21e99da26ee2c6140f13e
Reviewed-on: https://gerrit.chromium.org/gerrit/57005
Commit-Queue: Thieu Le <thieule@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
16 months agoAdd support for PRL update after OMA-DM activation. 76/50376/5 factory-4128.B factory-spring-4131.B
Thieu Le [Tue, 7 May 2013 22:32:42 +0000 (15:32 -0700)]
Add support for PRL update after OMA-DM activation.

BUG=chrome-os-partner:18300
TEST=1. modem factory-reset
     2. modem get-prl  # Note current PRL version
     3. modem activate
     4. Wait until modem fully activated
     5. modem get-prl  # Verify new version

Change-Id: I52e371b5c8073a2aa212c8102df1741b182d36b5
Reviewed-on: https://gerrit.chromium.org/gerrit/50376
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
Commit-Queue: Thieu Le <thieule@chromium.org>

17 months agoFix error from syntax checking 82/47482/4 release-R28-4100.B stabilize-4008.0.B stabilize-4035.0.B stabilize-4068.0.B stabilize-4100.38.B stabilize-spring-4100.53.B toolchainB
Yunlian Jiang [Fri, 5 Apr 2013 22:30:55 +0000 (15:30 -0700)]
Fix error from syntax checking

This fixes the confict of decalaration and definition between class
and struct. It also fixes the virtual function overloading.

BUG=chromium:218316
TEST=USE="chrome_internal" CFLAGS="-clang -print-cmdline"
     CXXFLAGS="-clang -print-cmdline" emerge-x86-alex
     gobi-cromo-plugin
     passes.

Change-Id: I5109af3aff4052477b2e255b45ab06537e306527
Reviewed-on: https://gerrit.chromium.org/gerrit/47482
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
Commit-Queue: Yunlian Jiang <yunlian@chromium.org>

17 months agoUse the metrics library mock rather than inventing one ourselves. 08/47208/2
Chris Sosa [Wed, 3 Apr 2013 01:20:26 +0000 (18:20 -0700)]
Use the metrics library mock rather than inventing one ourselves.

BUG=None
TEST=Ran on x86-alex-paladin trybot.

Change-Id: I85aafefb369f4651331afeae9e2ec21a0df7fcbe
Reviewed-on: https://gerrit.chromium.org/gerrit/47208
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Queue: Chris Sosa <sosa@chromium.org>

18 months agoAllow PRL update via OMA-DM. 46/45246/2 factory-spring-3842.B release-R27-3912.B stabilize-3881.0.B stabilize-3912.79.B toolchainA
Thieu Le [Tue, 12 Mar 2013 20:27:04 +0000 (13:27 -0700)]
Allow PRL update via OMA-DM.

BUG=chrome-os-partner:16216
TEST=Sprint sent commands to device and verified new PRL

Change-Id: I8bcf352ae95367ef5f57b51b1e9abdb5e917315d
Reviewed-on: https://gerrit.chromium.org/gerrit/45246
Reviewed-by: Arman Uguray <armansito@chromium.org>
Commit-Queue: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
19 months agoUpdate gobi-cromo-plugin to build against libchrome-180609 39/43339/2 firmware-spring-3824.4.B firmware-spring-3824.55.B firmware-spring-3824.84.B firmware-spring-3824.B firmware-spring-3833.B
Chris Masone [Thu, 14 Feb 2013 23:08:25 +0000 (15:08 -0800)]
Update gobi-cromo-plugin to build against libchrome-180609

CQ-DEPEND=I3ef7d6d0c0247ff8fd7471403b00f239f1c8ecc2

Literally just a version number change in the makefile.

BUG=chromium-os:38939
TEST=emerge-x86-mario gobi-cromo-plugin
STATUS=Fixed

Change-Id: I27848af055c40f60999be7924e2f5a74f95c49c8
Reviewed-on: https://gerrit.chromium.org/gerrit/43339
Commit-Queue: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
19 months agoAdd Sierra Gobi 3000 MC8355 modem to ModemManager blacklist. 50/42150/2 stabilize-3658.0.0 stabilize-3701.30.0 stabilize-3701.30.0b stabilize-3701.46.B stabilize-bluetooth-smart toolchain-3701.42.B
Shawn Nematbakhsh [Mon, 28 Jan 2013 21:37:58 +0000 (13:37 -0800)]
Add Sierra Gobi 3000 MC8355 modem to ModemManager blacklist.

BUG=chrome-os-partner:17480.
TEST=Verify that ModemManager does not handle an MC8355 modem.

Change-Id: I73867dd612f0ba90160ea5e131cb864c9afcee57
Reviewed-on: https://gerrit.chromium.org/gerrit/42150
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org>

20 months agoRemove suspend-related code from GobiModem. 27/41027/2
Daniel Erat [Wed, 9 Jan 2013 22:51:30 +0000 (14:51 -0800)]
Remove suspend-related code from GobiModem.

cromo no longer registers for suspend delays, since the
corresponding functionality has been moved into shill.  This
change removes code from GobiModem that attempts to avoid
connecting when the system is about to suspend -- this code
looks like it's never triggered due to cromo's suspend-delay
code being disabled.

BUG=chromium-os:30587,chromium-os:36980
TEST=manual: modem still works after suspending and resuming
CQ-DEPEND=I2b9edfd46124dcd5386f96dd67cea43478ee2a1b

Change-Id: I65e01df5b9e2b9234098e98315e5eb6f583d0169
Reviewed-on: https://gerrit.chromium.org/gerrit/41027
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Queue: Daniel Erat <derat@chromium.org>

20 months agoAdd Novatel Gobi 3000 E396U modem to ModemManager blacklist. 08/40408/2 factory-3536.B
Ben Chan [Thu, 3 Jan 2013 23:54:23 +0000 (15:54 -0800)]
Add Novatel Gobi 3000 E396U modem to ModemManager blacklist.

BUG=chrome-os-partner:17083
TEST=Verify that ModemManager does not handle a E396U modem.

Change-Id: I68c8ebe671072ccafc362ec3d7aa80f729970cc2
Reviewed-on: https://gerrit.chromium.org/gerrit/40408
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
21 months agocellular: Expose DBus method to force a modem into activated state. 09/39509/3 toolchain-3428.65.B
Thieu Le [Mon, 10 Dec 2012 21:32:27 +0000 (13:32 -0800)]
cellular: Expose DBus method to force a modem into activated state.

BUG=chromium-os:36950
TEST=cellular_ModemControl (--technology=EVDO_1X)

Change-Id: I3c8756e3dbd4c33a61cbbcb561e0238470876f59
Reviewed-on: https://gerrit.chromium.org/gerrit/39509
Reviewed-by: Arman Uguray <armansito@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
21 months agocromo: Expose DBus method to set network registration preference. 74/39274/4 stabilize2
Thieu Le [Wed, 5 Dec 2012 23:21:08 +0000 (15:21 -0800)]
cromo: Expose DBus method to set network registration preference.

The Gobi modem attempts to register with CDMA 1x RTT first before trying
EVDO.  If CDMA 1x RTT is not available, it will hang the registration
process.  Since the call box can only emulate one technology, this
method can be used to force the modem to go directly to EVDO.

BUG=chromium-os:36951
TEST=cellular_Smoke (--technology=EVDO)

Change-Id: I62ff1e1d969961b79680250d3a41ca1902df409f
Reviewed-on: https://gerrit.chromium.org/gerrit/39274
Reviewed-by: Arman Uguray <armansito@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
21 months agocromo: Ignore loss of registration when starting a data session. 66/38466/3
Thieu Le [Thu, 15 Nov 2012 19:22:37 +0000 (11:22 -0800)]
cromo: Ignore loss of registration when starting a data session.

The Gobi modem sometimes re-registers itself when starting a data
session.  The re-registration causes shill to recreate the cellular
service which breaks various tests that expect the cellular service
to remain the same during a connect request.

BUG=chromium-os:36171
TEST=cellular_ModemControl, network_3GModemControl

Change-Id: Ic813d9d3e25b2789f50395389a8fb2fafd255af0
Reviewed-on: https://gerrit.chromium.org/gerrit/38466
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
22 months agocromo: Make sure the modem is registered before connecting. 86/37786/6
Thieu Le [Sat, 10 Nov 2012 02:23:53 +0000 (18:23 -0800)]
cromo: Make sure the modem is registered before connecting.

Also assume StartDataSession succeeds when it returns
kOperationHasNoEffect.

BUG=chromium-os:36171
TEST=cellular_3GModemControl

Change-Id: Ibb7204c4e48b2aca1349890e8a8db558e0ef47cc
Reviewed-on: https://gerrit.chromium.org/gerrit/37786
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
Commit-Ready: Thieu Le <thieule@chromium.org>

22 months agoRetry powering down modem if SetPower times out. 45/37845/3
Thieu Le [Mon, 12 Nov 2012 22:06:20 +0000 (14:06 -0800)]
Retry powering down modem if SetPower times out.

BUG=chromium-os:30895
TEST=cellular_ModemControl

Change-Id: Ie82b1f3ed51066fcc6953b6465ee632056cd7a37
Reviewed-on: https://gerrit.chromium.org/gerrit/37845
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
Commit-Ready: Thieu Le <thieule@chromium.org>

22 months agoupdate OWNERS
Mike Frysinger [Wed, 31 Oct 2012 21:16:06 +0000 (17:16 -0400)]
update OWNERS

None of these people work on CrOS anymore :/

BUG=None
TEST=None

Change-Id: Ie31d8e301107c7bf665c2cfa12e8453e78aa868b
Reviewed-on: https://gerrit.chromium.org/gerrit/37056
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
23 months agocromo: Fix race condition on gobi sdk callbacks
Arman Uguray [Mon, 8 Oct 2012 17:50:15 +0000 (10:50 -0700)]
cromo: Fix race condition on gobi sdk callbacks

gobi_modem.cc registers a bunch of callbacks through the Gobi SDK during
GobiModem::ApiConnect. These callbacks are unregistered during
GobiModem::ApiDisconnect. Although the GobiModem destructor calls
ApiDisconnect, there is a race condition between some of the threads
that process the callbacks and the GobiModem deallocation which causes the
callbacks to get called on garbage, causing invalid reads and writes.

This CL addresses this issue in two ways:

 - Added a flag that gets set to true by the GobiModem destructor that
   prevents any new callbacks from getting registered once the modem is
   set for deletion. This flag is mutex protected.

 - The GobiModem handler now explicitly removes all callbacks related to
   the GobiModem instance (via glib) and adds an idle callback that
   deletes GobiModem only after all sdk callbacks are scheduled to be
   deleted by glib.

BUG=chromium-os:35064
TEST=Ran custom script that runs suspend_stress_test and runs cromo via
valgrind repeatedly and logs valgrind output when valgrind exits. Ran
this script over the weekend. No invalid accesses occurred.

Change-Id: I34d8dcf7bacd62947b64c656e0d9e2343b080ffc
Reviewed-on: https://gerrit.chromium.org/gerrit/34898
Commit-Ready: Arman Uguray <armansito@chromium.org>
Reviewed-by: Arman Uguray <armansito@chromium.org>
Tested-by: Arman Uguray <armansito@chromium.org>
23 months agocromo: Crash during suspend_stress_test due to invalid access in factory-3004.B
Arman Uguray [Thu, 4 Oct 2012 22:49:04 +0000 (15:49 -0700)]
cromo: Crash during suspend_stress_test due to invalid access in
GobiModem::OnResumed

The GobiModem destructor did not unregister certain callbacks from the
CromoServer, which caused an OnResumed callback to get called on a
dealloc'd GobiModem instance. This CL adds code to unregister all of the
callbacks that were registered with CromoServer during GobiModem::Init.

BUG=chromium-os:35046
TEST=Ran cromo with valgrind along with /usr/bin/suspend_stress_test
repeatedly overnight for two days. Crash occurred many times during the
first run, but did not occur again after the patch.

Change-Id: Id24c963eff60729436ef21fa740f835dd1d458d3
Reviewed-on: https://gerrit.chromium.org/gerrit/34701
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Arman Uguray <armansito@chromium.org>
Tested-by: Arman Uguray <armansito@chromium.org>
23 months agoAvoid continuously polling devices due to certain udev event patterns. factory-2985.B
Ben Chan [Tue, 2 Oct 2012 04:16:52 +0000 (21:16 -0700)]
Avoid continuously polling devices due to certain udev event patterns.

BUG=chrome-os-partner:12868
TEST=Run suspend_stress_test and verify from syslog that cromo stops
the device polling shortly after starting it.

Change-Id: I8fcfc821f31e2cabf053ebeb702985b42197679e
Reviewed-on: https://gerrit.chromium.org/gerrit/34402
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>

23 months agoAvoid setting the Driver property with NULL.
Ben Chan [Mon, 24 Sep 2012 19:08:49 +0000 (12:08 -0700)]
Avoid setting the Driver property with NULL.

udev_device_get_driver() could potentially return NULL if there is no
driver attached to a device.

BUG=chromium-os:34693
TEST=Run suspend_stress_test with a Gobi modem.

Change-Id: I969c71bff19392aa669d37d340be29033002e243
Reviewed-on: https://gerrit.chromium.org/gerrit/33910
Commit-Ready: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2 years agoReject connect requests when the system is suspending. factory-2846.B factory-2848.B factory-2914.B firmware-stout-2817.B
Ben Chan [Thu, 23 Aug 2012 18:49:40 +0000 (11:49 -0700)]
Reject connect requests when the system is suspending.

BUG=chromium-os:33839
TEST=Tested the following:
1. Connect to a cellular network.
2. Suspend the system.
3. Observe from syslog that cromo disconnects the network and rejects
   connect requests from shill.
4. Resume the system.
5. Observe from syslog that cromo accepts connect requests from shill.
CQ-DEPEND=Ia73a02bce4d8bb690cc7d8835ea5d6d7fff127dc

Change-Id: I155baf2926195e17de2f2b97cde4fd0fa422c82c
Reviewed-on: https://gerrit.chromium.org/gerrit/31385
Reviewed-by: Thieu Le <thieule@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2 years agoSet DBus error message for invalid carrier. firmware-butterfly-2788.B
Thieu Le [Mon, 13 Aug 2012 20:49:50 +0000 (13:49 -0700)]
Set DBus error message for invalid carrier.

The current code sets the error message to what is returned by
gobifw_lasterror() but gobifw_bycarrier() doesn't set the last error.
This CL sets the error message to be consistent with gobi2k.

BUG=chromium-os:33397
TEST=network_SwitchCarrier

Change-Id: I83e98f95f7a64fa8df9fba490619279d62890c34
Reviewed-on: https://gerrit.chromium.org/gerrit/30042
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
2 years agoAdd Option GTM681W and GTM689W Gobi modem support via cromo. 62/27762/2 factory-2717.B firmware-link-2695.2.B firmware-link-2695.B firmware-parrot-2685.B firmware-snow-2695.90.B firmware-snow-2695.B
Ben Chan [Sun, 8 Jul 2012 22:20:32 +0000 (15:20 -0700)]
Add Option GTM681W and GTM689W Gobi modem support via cromo.

BUG=chrome-os-partner:11513
TEST=Verified that Option GTM681W and GTM689W modems are managed by cromo instead of ModemManager.

Change-Id: I53d061caa6d72f5a86f24ef3dd9fbb1e3a34463b

2 years agogobi-cromo-plugin: Send property changed signal for Enabled property. 45/22245/3 factory-2305.B factory-2338.B factory-2368.B factory-2394.B factory-2460.B factory-2475.B factory-2569.B firmware-link-2348.B release-R21-2465.B
Thieu Le [Wed, 9 May 2012 17:34:59 +0000 (10:34 -0700)]
gobi-cromo-plugin: Send property changed signal for Enabled property.

BUG=chromium-os:30714
TEST=Run network_3GModemControl on device

Change-Id: Ic83e888f19a4928ef57fc4ea1f523b5b6cb44d40

2 years agoReplace glog/logging with base/logging 70/20770/1 factory-2268.16.B release-R20-2268.B
Sameer Nanda [Fri, 20 Apr 2012 21:28:24 +0000 (14:28 -0700)]
Replace glog/logging with base/logging

glog/logging causes data to be written out to the backing store every
time a log message is sent to it.  This causes increased power draw
since the disk wakes up more frequently than it would if the data were
to be written out lazily.

Replacing glog/logging with base/logging since the latter doesn't have
this issue.

BUG=chromium-os:29643
TEST="start cromo" on DUT and make sure it comes up fine

Change-Id: I2862ad9da70754112dc3c2fbe0714bd964127872

2 years agogobi-cromo-plugin: Remove the deprecated modem_set_carrier script. 17/20417/1
Ben Chan [Tue, 17 Apr 2012 22:34:01 +0000 (15:34 -0700)]
gobi-cromo-plugin: Remove the deprecated modem_set_carrier script.

BUG=chromium-os:29601
TEST=emerge-x86-mario gobi-cromo-plugin

Change-Id: Ibe3170bba74e936853fc059913eda87d819d9e70

2 years agoupdate to newer libbase 03/19903/1
Mike Frysinger [Tue, 10 Apr 2012 18:30:56 +0000 (14:30 -0400)]
update to newer libbase

BUG=chromium-os:25872
TEST=`emerge-x86-alex gobi-cromo-plugin` works
TEST=`cros_run_unit_tests --board=x86-alex -p gobi-cromo-plugin` passed

Change-Id: Ia4cc47b14179ba77b601a5789c6af28904747cc4

2 years ago[gobi-cromo-plugin] add OWNERS 55/19755/1
Elly Jones [Fri, 6 Apr 2012 17:34:10 +0000 (13:34 -0400)]
[gobi-cromo-plugin] add OWNERS

TEST=None
BUG=chromium-os:22007

Change-Id: I2a7383ffbb8caafeb2d149ed364c92940d9859c3
Signed-off-by: Elly Jones <ellyjones@chromium.org>
2 years agoMerge "Catch up to changes made in cromo for njw's readability review." release-R19-2046.B
Gerrit [Mon, 19 Mar 2012 18:52:33 +0000 (11:52 -0700)]
Merge "Catch up to changes made in cromo for njw's readability review."

2 years agoCatch up to changes made in cromo for njw's readability review. 63/18463/5
Nathan Williams [Wed, 14 Mar 2012 15:23:56 +0000 (11:23 -0400)]
Catch up to changes made in cromo for njw's readability review.

BUG=None
TEST=Still receives SMS on a device with a Gobi
CQ-DEPEND: Ide2b9a21cb82d5dfc56ff5267a2eb6aba1744b04

Change-Id: I1de8880093bc1c21eec8db2537809bbae891519a

2 years agogobi-cromo-plugin: remove -O0 from Makefile 05/18405/1
Jason Glasgow [Fri, 16 Mar 2012 21:47:43 +0000 (17:47 -0400)]
gobi-cromo-plugin: remove -O0 from Makefile

remove -O0 from Makefile

BUG=chromium-os:27633
TEST=build

Change-Id: I525a91765c717c06ae0186cee936eea44d47ab41

2 years agogobi_cromo_plugin: handle reported capability changes correctly 53/18253/1 factory-1987.B
Jason Glasgow [Thu, 15 Mar 2012 18:20:39 +0000 (14:20 -0400)]
gobi_cromo_plugin: handle reported capability changes correctly

Network data capability changes were not being handled correctly
because the constructor parameter names were hiding the member
variables of the DataCapabilitiesArgs struct.  Rename the member
variables so that this hiding does not occur.

BUG=chrome-os-partner:4660
TEST=run cellular_Signal, grep for Cap: in /var/log/messages
TEST=notice that there are no longer illegal values

Change-Id: Ic9ea63e82bd2a4e84b18c8c5b0bd4cd776b0e69f

2 years agogsm: do not allow registration unknown to mark modem enabled 25/17825/3
Jason Glasgow [Fri, 27 Jan 2012 17:41:15 +0000 (12:41 -0500)]
gsm: do not allow registration unknown to mark modem enabled

Do not allow registration unknown to mark modem enabled.  The modem
sometimes reports the registartion state as UNKNOWN in the process of
disabling a modem -- reporting this back as registered is confusing
and incorrect.

BUG=chromium-os:25566
TEST=run cellular_ModemControl

Change-Id: I703d15aad1850660ded00b2452e10bc8beea0219

2 years agoMerge "gobi-cromo-plugin: fix compiler warnings and errors"
Gerrit [Mon, 12 Mar 2012 20:35:33 +0000 (13:35 -0700)]
Merge "gobi-cromo-plugin: fix compiler warnings and errors"

2 years agogobi-cromo-plugin: fix compiler warnings and errors 24/17824/1
Jason Glasgow [Mon, 12 Mar 2012 12:30:55 +0000 (08:30 -0400)]
gobi-cromo-plugin: fix compiler warnings and errors

Fix compiler warnings and errors by ensuring that all paths are
handled and local variables are *always* initialized.

Fix logic bug in gobi_handle_test when trying to open the qmidevice
file directly.

BUG=chromium-os:27633
TEST=build with -O2, errors are gone. Run network_3g suite

Change-Id: Icfd7c14dd63ea57b778382fffee300ccde2c3d6b

2 years agoconvert to SLOT-ed libbase 99/17799/1
Mike Frysinger [Sun, 11 Mar 2012 05:18:25 +0000 (00:18 -0500)]
convert to SLOT-ed libbase

BUG=chromium-os:16623
TEST=`emerge-x86-alex gobi-cromo-plugin` still works

Change-Id: I4484ec8a6380623395e453011dd8318428fa82ae

2 years agogobi_modem: recognize registered modems at cromo start 82/16482/2
Jason Glasgow [Thu, 23 Feb 2012 16:21:13 +0000 (11:21 -0500)]
gobi_modem: recognize registered modems at cromo start

When cromo starts it checks the power state of the modem to see if the
modem is already enabled.  If it is already enabled it sets the
internal state to indicate this.   It also needs to check to see if
the modem is already registered on the cellular network, and if so,
put the modem into the "registered" state.

BUG=chromium-os:26791
TEST=start and start cromo without flimfliam running.  Observe modem
     State with the modem status command

Change-Id: I590325524eb6ddbedf0a2ee6f51358ff4af04e78

2 years agoMerge "GobiGsmModem::GetSms(): Set error when returning NULL."
Gerrit [Fri, 10 Feb 2012 17:55:18 +0000 (09:55 -0800)]
Merge "GobiGsmModem::GetSms(): Set error when returning NULL."

2 years agoGobiGsmModem::GetSms(): Set error when returning NULL. 19/15619/1
Nathan Williams [Thu, 9 Feb 2012 22:30:50 +0000 (17:30 -0500)]
GobiGsmModem::GetSms(): Set error when returning NULL.

When SmsMessageFragment::CreateFragment() fails (by returning NULL),
set the DBus::Error argument so that the caller knows that something
is wrong and can pass the error upstream

BUG=chromium-os:25589
TEST=Use a cell network simulator (Agilent 8960) to generate a message
with, say, an invalud SMSC number format; confirm that cromo does not
crash on message receipt (See cellular_SmsReception autotest).

Change-Id: Iee9d98763b8e859460e7a472d87edd2f36252009

2 years agogobi_modem: handling pending enables before destructing GobiModem 55/15355/1
Jason Glasgow [Mon, 6 Feb 2012 16:36:33 +0000 (11:36 -0500)]
gobi_modem: handling pending enables before destructing GobiModem

Handle any pending enables to clean up state before destructing a
GobiModem object.  Send back success for the operation.  The modem is
going to disappear momentarily, so it is inconsequential whether we
report success or failure.

BUG=chromium-os:25925
TEST=run network_3g test suite

Change-Id: Idcb6499167b081221bc41f3512fc00046881b6da

2 years agoMerge "Connect to modem to factory reset if needed" release-R18-1660.B
Gerrit [Thu, 22 Dec 2011 14:56:03 +0000 (06:56 -0800)]
Merge "Connect to modem to factory reset if needed"

2 years agoMerge "gobi_cdma_modem: initialize return values in GetCdmaRegistrationState"
Gerrit [Thu, 22 Dec 2011 14:28:00 +0000 (06:28 -0800)]
Merge "gobi_cdma_modem: initialize return values in GetCdmaRegistrationState"

2 years agoConnect to modem to factory reset if needed 10/13410/1
ttuttle [Tue, 20 Dec 2011 21:49:03 +0000 (16:49 -0500)]
Connect to modem to factory reset if needed

Use a ScopedApiConnection to connect to the modem in FactoryReset if
we're not already connected.

BUG=chromium-os:23289
TEST=modem factory-reset works after disabling modem

Change-Id: Ib09285c38d68ec9078bd69688839ebaf8f01b14c

2 years agogobi_cdma_modem: initialize return values in GetCdmaRegistrationState 48/13348/1
Jason Glasgow [Wed, 21 Dec 2011 19:20:36 +0000 (14:20 -0500)]
gobi_cdma_modem: initialize return values in GetCdmaRegistrationState

Initialize return values in GetCdmaRegistrationState because otherwise
they are not guaranteed to be set.

BUG=chromium-os:24484
TEST=sudo stop cromo ; sudo valgrind /usr/sbin/cromo

Change-Id: I2bb2803371945c3e44bedf519bf39623aa82f5a3

2 years agoadd LICENSE file 35/13335/1
Jason Glasgow [Wed, 21 Dec 2011 14:55:44 +0000 (09:55 -0500)]
add LICENSE file

BUG=none
TEST=none

Change-Id: Ib756352e701ba4ade2d9f2e631dfd453de786a49

2 years agogobi-modem: Handle modem state changes based on RF Enable pin properly
Jason Glasgow [Thu, 15 Dec 2011 17:02:54 +0000 (12:02 -0500)]
gobi-modem: Handle modem state changes based on RF Enable pin properly

Handle modem state changes based on RF Enable pin properly.  Whenever
enabling the modem, check the power state of the modem in immediately
after connecting via ApiConnect in case the modem state changed while
the plugin was not connected to the SDK.

BUG=chrome-os-partner:7235
TEST=use lumpy with old firmware, boot, try mm-enable, flip gpio198 (see bug), mm-enable

Change-Id: I2b14deaefb3465654fefac0da24f84c09878396e
Reviewed-on: https://gerrit-int.chromium.org/9177
Commit-Ready: Jason Glasgow <jglasgow@google.com>
Reviewed-by: Jason Glasgow <jglasgow@google.com>
Tested-by: Jason Glasgow <jglasgow@google.com>
2 years agomodem: refactor to use a common StopDataSession function which starts timers
Jason Glasgow [Tue, 6 Dec 2011 14:10:00 +0000 (09:10 -0500)]
modem: refactor to use a common StopDataSession function which starts timers

Refactor to use a common StopDataSession function which starts timers.
This will avoid "Bad metric" messages in the logs.

BUG=chromium-os:17212
TEST=connect cellular; /usr/local/lib/flimflam/test/mm-disable; examine logs

Change-Id: I2baff3a86f8339f86481b8db70de04670b8ccef9
Reviewed-on: https://gerrit-int.chromium.org/8638
Commit-Ready: Jason Glasgow <jglasgow@google.com>
Tested-by: Jason Glasgow <jglasgow@google.com>
Reviewed-by: Eric Shienbrood <ers@google.com>
2 years agomove libdir into a variable
Mike Frysinger [Wed, 2 Nov 2011 19:42:53 +0000 (15:42 -0400)]
move libdir into a variable

Some ABI's want to use diff paths than /usr/lib, so move this hardcoded
path into a variable so the build system can override it as need be.

BUG=chromium-os:22378
TEST=`emerge-amd64-generic gobi-cromo-plugin` now installs into /usr/lib64
TEST=`emerge-x86-generic gobi-cromo-plugin` still installs into /usr/lib

Change-Id: I642dbb86b1acfcc382dc37f75fa37500b51e3e04
Reviewed-on: https://gerrit-int.chromium.org/7159
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Eric Shienbrood <ers@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
2 years agoMultipart SMS support on Gobi, using cromo's cache.
Nathan Williams [Tue, 11 Oct 2011 21:19:16 +0000 (17:19 -0400)]
Multipart SMS support on Gobi, using cromo's cache.

BUG=chromium-os:19162
TEST=Manual: Send single and multipart messages from phone

Change-Id: Ic7af4cf1c00f223a1edfb87743a1257d22781881
Reviewed-on: https://gerrit-int.chromium.org/6482
Reviewed-by: Nathan J. Williams <njw@google.com>
Tested-by: Nathan J. Williams <njw@google.com>
2 years agogobi_cdma_modem: reject connect requests while activating
Jason Glasgow [Wed, 19 Oct 2011 00:23:51 +0000 (20:23 -0400)]
gobi_cdma_modem: reject connect requests while activating

Reject connect requests while the modem is activating.  It is a bad
idea to try to connect while the modem is in the middle of doing
OTA-SP.

BUG=chromium-os:20204
TEST=run through activation process

Change-Id: If22cdcdfd51cb47a1348513d6ff16f5f294268dd
Reviewed-on: https://gerrit-int.chromium.org/6547
Reviewed-by: Jason Glasgow <jglasgow@google.com>
Tested-by: Jason Glasgow <jglasgow@google.com>
2 years agoRemove dead code for activation timeout
Jason Glasgow [Tue, 18 Oct 2011 21:30:45 +0000 (17:30 -0400)]
Remove dead code for activation timeout

The activation timeout code has not run since nov 2010 at best, and
perhaps never because the timer was added in code that was never
reached.  This CL removes the dead code associated with activation.

BUG=chromium-os:20204
TEST=adhoc, run network_3GSmokeTest

Change-Id: I181bbe178373cbf48b135818f405a6dbd73c5735
Reviewed-on: https://gerrit-int.chromium.org/6546
Tested-by: Jason Glasgow <jglasgow@google.com>
Reviewed-by: Eric Shienbrood <ers@google.com>
2 years agoFix logging in gobi_gsm_modem.cc.
Nathan Williams [Tue, 11 Oct 2011 21:35:31 +0000 (17:35 -0400)]
Fix logging in gobi_gsm_modem.cc.

Implement a version of TrimWhitespaceASCII() and pull in a prototype
for sscanf() directly from stdio.h, so that we can avoid including
<base/string_util.h>. That header pulls in <base/string_util_posix.h>,
which pulls in <base/logging.h> (for DCHECK). The presence of the
LOG() macros from <base/logging.h> prevents the <glog/logging.h> LOG()
macros from functioning properly, and thus log output from
gobi_gsm_modem.cc was disappearing (going to stderr rather than
syslog, I think).

TEST=Run cromo on a modem set to 'Generic UMTS' and search /var/log/messages for gobi_gsm_modem.cc
BUG=None

Change-Id: Ib1779c1118117b9753fc037d34f33f5ce977a876
Reviewed-on: https://gerrit-int.chromium.org/6304
Reviewed-by: Jason Glasgow <jglasgow@google.com>
Tested-by: Nathan J. Williams <njw@google.com>
2 years agoSupport the new EnabledFacilityLocks modem manager property.
Eric Shienbrood [Wed, 5 Oct 2011 19:55:04 +0000 (15:55 -0400)]
Support the new EnabledFacilityLocks modem manager property.

BUG=chromium-os:14253
TEST=Open the Security tab of the network options panel, and observe
that the checkbox is in the expected state. Toggle the checkbox
back and forth while running dbus-monitor, and observe expected property
changes. Confirm with mm-status and list-devices.

Change-Id: If0bac25dd30f001b15e56d135681b389193cd03d
Reviewed-on: https://gerrit-int.chromium.org/6064
Reviewed-by: Jason Glasgow <jglasgow@google.com>
Tested-by: Eric Shienbrood <ers@google.com>
2 years agoadd payment_url_{method,postdata} to activation signal
Jason Glasgow [Fri, 23 Sep 2011 07:16:24 +0000 (03:16 -0400)]
add payment_url_{method,postdata} to activation signal

add payment_url_{method,postdata} to activation signal because they
may change after activation.

BUG=chrome-os-partner:5981
TEST=run though verizon activation and then top up using new portal

Change-Id: I491380d558b7bf54d2930bbbf0fcf6d922dd100a
Reviewed-on: https://gerrit-int.chromium.org/5666
Reviewed-by: David Rochberg(internal) <rochberg@google.com>
Reviewed-by: Eric Shienbrood <ers@google.com>
Tested-by: Jason Glasgow <jglasgow@google.com>
2 years agomodem: API connect so that the MEID is returned on disabled modem
Jason Glasgow [Wed, 31 Aug 2011 18:05:11 +0000 (14:05 -0400)]
modem: API connect so that the MEID is returned on disabled modem

Connect to the QCWWAN API, if necessary, so that the MEID, IMEI, MDN
and other identifiers can be returned for a GetStatus command, even if
the modem is disabled.

BUG=chrome-os-partner:5395
TEST=disable Mobile Data, issue modem status command in crosh, look for MEID

Change-Id: I95032015f89e0bceed646ea67a9363b876ee5366
Reviewed-on: https://gerrit-int.chromium.org/4844
Tested-by: Jason Glasgow <jglasgow@google.com>
Reviewed-by: Eric Shienbrood <ers@google.com>
2 years agoEliminate one cause of "Reentrant SDK access detected" warnings.
Eric Shienbrood [Tue, 30 Aug 2011 16:09:19 +0000 (12:09 -0400)]
Eliminate one cause of "Reentrant SDK access detected" warnings.

Whenever a call to GetSignalStrengthDbm is made, it calls
GetSessionState to determine whether the modem is connected,
and if so, reports the signal strength for the actual data
bearer in use. However, if this happens while a connection
is being attempted, the call to GetSessionState fails because
it is in the same SDK "service" as StartDataSession. The
solution is to instead check the session_id_ member variable
to determine whether the modem is connected.

BUG=chromium-os:14100
TEST=In the UI, press the connect button, and in a terminal
window, immediately run "mm-status" (or "modem status" in crosh).
With the fix, there should *not* be a log message that says "Reentrant
SDK access detected: Called GetSessionState while already in call to
StartDataSession".

Change-Id: I4f73d7128c8afa702dc55945aecc88a09bb9fb1c
Reviewed-on: https://gerrit-int.chromium.org/4799
Tested-by: Eric Shienbrood <ers@google.com>
Reviewed-by: Eric Shienbrood <ers@google.com>
2 years agoHandle disable while connecting races
Jason Glasgow [Mon, 15 Aug 2011 22:33:03 +0000 (18:33 -0400)]
Handle disable while connecting races

Handle disable while conneting races better not powering off the modem
when a data session is in progress.

Added fault injecting to test this.  Use the command:

sudo dbus-send --system --print-reply --fixed \
--dest=org.chromium.ModemManager /org/chromium/ModemManager/Gobi/0
org.chromium.ModemManager.Modem.Gobi.InjectFault
string:DisableSleepMs int32:5000

to help reproduce the race conditions that cause this.

BUG=chromium-os:18358
TEST=click on disable while connecting.  Use dbus-send to alter timeout.

Change-Id: Ib64c714b43db4804fd8d4a4ebc75662ec1650de8
Reviewed-on: https://gerrit-int.chromium.org/4296
Tested-by: Jason Glasgow <jglasgow@google.com>
Reviewed-by: David Rochberg(internal) <rochberg@google.com>
Reviewed-by: Eric Shienbrood <ers@google.com>
2 years agoSessionStarter: fix leak
Jason Glasgow [Mon, 15 Aug 2011 16:04:51 +0000 (12:04 -0400)]
SessionStarter: fix leak

fix leak of session starter object if the modem disappears while connecting

BUG=chromium-os:1916
TEST=none

Change-Id: Ibbb7206583fd3252f7c181eb6e708e9d2afa9a26
Reviewed-on: https://gerrit-int.chromium.org/4284
Reviewed-by: Jason Glasgow <jglasgow@google.com>
Tested-by: Jason Glasgow <jglasgow@google.com>
2 years agoudev: Do not let upstart wait for cromo to start after emitting gobi_modem signal
Jason Glasgow [Tue, 9 Aug 2011 21:21:57 +0000 (17:21 -0400)]
udev: Do not let upstart wait for cromo to start after emitting gobi_modem signal

udev: Do not let upstart wait for cromo to start after emitting
gobi_modem signal because this causes initctl to hang waiting for
system services to start, even though that pseudo job is already
started.

BUG=chromium-os:18906
TEST=suspend and resume machine, grep for 'emit' in /var/log/messages

Change-Id: Id0e0191b5c847fcae6c7c9c617a19fbd3bfe0a8d
Reviewed-on: https://gerrit-int.chromium.org/4112
Reviewed-by: Scott James Remnant <keybuk@google.com>
Tested-by: Jason Glasgow <jglasgow@google.com>
2 years agoAdd logging to help diagnose chromium-os:17539.
Eric Shienbrood [Mon, 25 Jul 2011 21:39:43 +0000 (17:39 -0400)]
Add logging to help diagnose chromium-os:17539.

BUG=chromium-os:17539
TEST=Make sure gobi still works.

Change-Id: Iaffc8b2dc426661683d2959613577f65080c9956
Reviewed-on: https://gerrit-int.chromium.org/3503
Reviewed-by: Eric Shienbrood <ers@google.com>
Tested-by: Eric Shienbrood <ers@google.com>
2 years agoPass the command-line arguments down to /usr/bin/modem as a single argument
Nathan Williams [Fri, 22 Jul 2011 18:04:59 +0000 (14:04 -0400)]
Pass the command-line arguments down to /usr/bin/modem as a single argument

Pass the command-line arguments down to /usr/bin/modem as a single
argument, so that "modem_set_carrier Generic UMTS" works like it used
to. This should be considered backwards-compatibility; users of the
functionality in /usr/bin/modem should use quoting as they would for
any other command-line argument with spaces in it.

BUG=chrome-os-partner:5030
TEST=Run "modem_set_carrier Generic UMTS" from crosh or a terminal.

Change-Id: I7038ce36e85f811a3c93399f1e3a075176b60764
Reviewed-on: https://gerrit-int.chromium.org/3458
Tested-by: Nathan J. Williams <njw@google.com>
Reviewed-by: Jason Glasgow <jglasgow@google.com>
2 years agoHandle CancelStasrtDataSession properly
Jason Glasgow [Wed, 20 Jul 2011 22:06:20 +0000 (18:06 -0400)]
Handle CancelStasrtDataSession properly

If QCWWANCancel fails there is no reason to call CancelDataSession.
That call will also fail, but it is will take 60 seconds to do so.
During those 60 seconds cromo is entirely non-responsive.

BUG=chrome-os-partner:4823
TEST=connect, if it fails, try to connect again, after it fails again,
disable cellular.

Change-Id: I1bcaa79148a9c9388209a72b500ef696f6f63114
Reviewed-on: https://gerrit-int.chromium.org/3379
Reviewed-by: Eric Shienbrood <ers@google.com>
Tested-by: Jason Glasgow <jglasgow@google.com>
2 years agoHandle ForceDisconnect failures gracefully.
Jason Glasgow [Wed, 20 Jul 2011 19:55:35 +0000 (15:55 -0400)]
Handle ForceDisconnect failures gracefully.

Handle ForceDisconnect failures gracefully by immediately disabling
the modem instead of waiting for what may be 5 minutes for the
StartDataSession command to finally timeout.

BUG=chrome-os-partner:4823

TEST=Ensure that Autoconnect is True.  Suspend machine. Resume
machine, and quickly suspend.  Timing matters.  The ideal amount of
time to wait before suspending for the second time is 5 - 15 seconds.
Certainly you want to suspend before the 3G connection is established,
but you need to wait long enough for the modem firmware to download
and for flimflam to start the connect.

Change-Id: I26f6e92f11c917de2fdd46193db2d6618b9fcd5a
Reviewed-on: https://gerrit-int.chromium.org/3373
Reviewed-by: Jason Glasgow <jglasgow@google.com>
Tested-by: Jason Glasgow <jglasgow@google.com>
2 years agoHandle disable while connected the same way modem-manager does.
Eric Shienbrood [Wed, 20 Jul 2011 15:58:05 +0000 (11:58 -0400)]
Handle disable while connected the same way modem-manager does.

Changed the disable operation to first do a disconnect, matching the
behavior of modem-manager. Previously, Disable would cancel an
in-progress connection attempt, but it wouldn't stop an existing
data session. As a result of this change, the gobi cromo state
machine comes closer to matching modem-manager's state machine.

With this change, it should be possible to remove the code from
flimflam that does a disconnect before carrying out a disable
request.

BUG=chromium-os:12572
TEST=While connected, ran mm-disable in a shell, and observed that
the Power property shown in list-devices changed to 'false', and
that in the UI on the settings page, the cellular network disappeared
and the "Disable Mobile Data" button changed to "Enable Mobile Data".

Change-Id: Id16179827dd5249d02a7c19293082a2e0d835730
Reviewed-on: https://gerrit-int.chromium.org/3364
Reviewed-by: Jason Glasgow <jglasgow@google.com>
Tested-by: Eric Shienbrood <ers@google.com>
2 years agoStop inflight session start when suspending or exiting
Jason Glasgow [Mon, 18 Jul 2011 23:16:08 +0000 (19:16 -0400)]
Stop inflight session start when suspending or exiting

Stop both inflight session start calls as well as existing session
when suspending and exiting

BUG=chromium-os:17556
TEST=run the network_3GSuspendResume test

Change-Id: I164054abe404cee204e21a7f7d846e6e428befd8
Reviewed-on: https://gerrit-int.chromium.org/3295
Reviewed-by: Eric Shienbrood <ers@google.com>
Tested-by: Jason Glasgow <jglasgow@google.com>
2 years agoSend out a registration state change signal when the state becomes Searching.
Eric Shienbrood [Mon, 18 Jul 2011 17:15:57 +0000 (13:15 -0400)]
Send out a registration state change signal when the state becomes Searching.

Back in commit 4363907e51d1f956229792c9a987a19825bea299, a change was
made to have the DataCapabilities handler check the registration status,
and to send out a state change signal if the state became Idle. This
was based on the observation that loss of registration doesn't always
result in a RegistrationStateChange callback as one would expect, but
that loss of registration does result in a DataCapabilities callback.
That change was incomplete, because a loss of registration will usually
result in a transition to the Searching state, rather than going
directly to idle.

For good measure, we also check for Denied and Unknown registration
status, although I don't expect we'd see those in this context.

BUG=none
TEST=This is most easily tested using a SIM for which PIN locking is
enabled. Start out with the SIM unlocked, and with the modem registered
on a network. Then, try to change the PIN, or to disable PIN locking,
but give an incorrect PIN. After the third incorrect PIN entry, the
SIM will be blocked and will require the PUK to unblock it. At that point,
the device will become unregistered from the network (and enter the
Searching state). The flimflam service representing the network should
disappear. Note that because of a separate bug in Chrome, the UI will
not update to reflect the fact that the service has disappeared, but
list-services on the command line will show that it's gone. When you
enter the correct PUK, the device should re-register, and the service
should reappear.

Change-Id: Id4bc3b074c98dfb3b1c366cd1448a0e1cb1883d2
Reviewed-on: https://gerrit-int.chromium.org/3275
Tested-by: Eric Shienbrood <ers@google.com>
Reviewed-by: Eric Shienbrood <ers@google.com>
2 years agoFix regression in enabling PIN-locked Gobi modems.
Eric Shienbrood [Wed, 13 Jul 2011 15:02:03 +0000 (11:02 -0400)]
Fix regression in enabling PIN-locked Gobi modems.

An earlier change to the way the Gobi cromo plugin handles the initial
power state caused the UI to fail to bring up the SIM unlock dialog
for a locked modem.

BUG=chromium-os:17543
TEST=Test various enable/disable sequences for locked and unlocked SIMs,
after power cycling and without power cycling.

Change-Id: Ia3c03efe29e2ae263922c843a96de84d25632035
Reviewed-on: https://gerrit-int.chromium.org/3136
Tested-by: Eric Shienbrood <ers@google.com>
Reviewed-by: Jason Glasgow <jglasgow@google.com>
2 years agoOutsource set-carrier command to /usr/bin/modem.
Nathan Williams [Mon, 11 Jul 2011 22:10:48 +0000 (18:10 -0400)]
Outsource set-carrier command to /usr/bin/modem.

BUG=chromium-os:15089
TEST="modem_set_carrier 'Generic UMTS'"

Change-Id: Id01a785e9961ee25498058aabc935c7da95ee58e
Reviewed-on: https://gerrit-int.chromium.org/3066
Tested-by: Nathan J. Williams <njw@google.com>
Reviewed-by: Jason Glasgow <jglasgow@google.com>
Reviewed-by: Eric Shienbrood <ers@google.com>
2 years agoTreat Enable() as a async call because it now is
Jason Glasgow [Fri, 8 Jul 2011 21:59:30 +0000 (17:59 -0400)]
Treat Enable() as a async call because it now is

Treat Enable() as a async call because it now is, and ensure that
connect fails if it is called while the modem is in the process of
either enabling or disabling.

The background to this is that previously the DBus call to Disable
would succeed even though the call was in progress.  This allowed to
flimflam to immediately call Enable to re-enable the modem.  That call
to Enable would find that the modem was still enabled (because the
disable was not yet complete).  Enable would return successfully, and
milliseconds later the disable would complete and the modem would be
disabled.  Flimflam state was then inconsistent with cromo state.
Tests would fail and 3G was unusable.

BUG=chromium-os:17397
TEST=./run_remote_tests.sh --remote=jgcros1.cam --build network_3GSmoke

Change-Id: I03b91d7130c07c9192e28d0e30562e9b26c9e336
Reviewed-on: https://gerrit-int.chromium.org/3019
Reviewed-by: Jason Glasgow <jglasgow@google.com>
Tested-by: Jason Glasgow <jglasgow@google.com>
Reviewed-by: ttuttle <ttuttle@chromium.org>
2 years agoMake GetSpn call GetPLMNName instead of GetHomeNetwork
ttuttle [Wed, 6 Jul 2011 19:22:33 +0000 (15:22 -0400)]
Make GetSpn call GetPLMNName instead of GetHomeNetwork

BUG=chromium-os:16723
TEST=Adhoc; GetSpn is called and returns a reasonable value

Change-Id: Iaa8a88701d67c389d3cd7ea914f80fb93b3cb376
Reviewed-on: https://gerrit-int.chromium.org/2904
Reviewed-by: ttuttle <ttuttle@chromium.org>
Tested-by: ttuttle <ttuttle@chromium.org>
Reviewed-by: Eric Shienbrood <ers@google.com>
2 years agoAdd PRESUBMIT.cfg to disable license check.
ttuttle [Wed, 6 Jul 2011 19:45:44 +0000 (15:45 -0400)]
Add PRESUBMIT.cfg to disable license check.

BUG=chromium-os:16723
TEST=Adhoc; repo no longer complains about changes to gobi_sdk_wrapper.cc.

Change-Id: I067d940f58561ba4762556c65801f0921f1d24bc
Reviewed-on: https://gerrit-int.chromium.org/2902
Reviewed-by: David Rochberg(internal) <rochberg@google.com>
Tested-by: ttuttle <ttuttle@chromium.org>
2 years agoAdd SDK wrapper for GetPLMNName
ttuttle [Fri, 1 Jul 2011 15:05:16 +0000 (11:05 -0400)]
Add SDK wrapper for GetPLMNName

BUG=chromium-os:16723
TEST=None; will be tested with next CL that uses the wrapper

Change-Id: Ie2a62e5f2989a57296770c5fdf40f8d399396b59
Reviewed-on: https://gerrit-int.chromium.org/2903
Reviewed-by: Jason Glasgow <jglasgow@google.com>
Reviewed-by: Nathan J. Williams <njw@google.com>
Tested-by: ttuttle <ttuttle@chromium.org>
2 years agoCall StopIfStarted when stopping timer on registration
David Rochberg [Thu, 30 Jun 2011 20:42:45 +0000 (16:42 -0400)]
Call StopIfStarted when stopping timer on registration

StopIfStarted was designed for exactly this purpose.  Why didn't I
call it before?

BUG=chromium-os:17212
TEST=manually disconnect/connect

Change-Id: I14cc8256afd9850a218cc88deaf5b8d8ea66e3a8
Reviewed-on: https://gerrit-int.chromium.org/2799
Reviewed-by: Elly Jones <ellyjones@google.com>
Tested-by: David Rochberg(internal) <rochberg@google.com>
2 years agoSupport the ModemManager State property, and send StateChanged signals for more state...
Eric Shienbrood [Wed, 8 Jun 2011 14:52:43 +0000 (10:52 -0400)]
Support the ModemManager State property, and send StateChanged signals for more state transitions.

A while ago, ModemManager introduced a State property on the Modem
interface. Until now, we were not assigning values to this property.
Instead, we were reporting state using a "state" entry in the
dictionary returned by the GetStatus method. This change eliminates
that non-standard behavior, and uses the State property instead.
It also sends the StateChange signal in more instances to better
emulate the behavior of ModemManager.

To support the Disabled -> Enabling -> Enabled transition and
the Enabled -> Disabling -> Disabled transition, we use a
PowerCallback handler to defer marking the modem as Enabled
or Disabled until the change has taken place and the callback
has been invoked.

BUG=none
TEST=The only real use we make in flimflam of the State property
(or the "state" item from GetStatus) is to detect a pre-existing
connection when flimflam starts up. I tested that this functionality
still works. Also, there are a limited number of connection state
transitions that flimflam acts on, and I tested that it still
reacts properly when those transitions occur.

Change-Id: I2721ab1dd10dd1b7531334bc72abc06f13b14c5f
Reviewed-on: https://gerrit-int.chromium.org/2579
Reviewed-by: Eric Shienbrood <ers@google.com>
Tested-by: Eric Shienbrood <ers@google.com>
2 years agoMake Enable fail if unable to get PIN status.
Eric Shienbrood [Tue, 21 Jun 2011 18:50:04 +0000 (14:50 -0400)]
Make Enable fail if unable to get PIN status.

Cleaned up handling of failures getting PIN status, so that
Enable fails, and also so that the UnlockRetries property
doesn't get a nonsensical value.

BUG=chrome-os-partner:4141
TEST=With no SIM and the rfkill switch set to "on", try to enable
the modem, either using mm-enable or via flimflam. Before this
fix, cromo would crash from an assertion failure. Now, the enable
operation simply fails. I also retested normal cases in which a
SIM is present and the rfkill switch is "off", both when the SIM
is PIN-locked and when it is not.

Change-Id: Ideddc2e5140cdd16857152f326b7b36994c8be35
Reviewed-on: https://gerrit-int.chromium.org/2505
Tested-by: Eric Shienbrood <ers@google.com>
Reviewed-by: Jason Glasgow <jglasgow@google.com>
2 years agoAdded GetMsIsdn method on org.freedesktop.ModemManager.Modem.Gsm.Card.
Eric Shienbrood [Wed, 1 Jun 2011 21:17:31 +0000 (17:17 -0400)]
Added GetMsIsdn method on org.freedesktop.ModemManager.Modem.Gsm.Card.

Support the new GetMsIsdn method I recently added to ModemManager.

BUG=chromium-os:15277
TEST=Test with dbus-send to directly invoke the new method, observe
that the correct phone number is returned. Also, test with new
version of flimflam that uses this method to get the MSISDN
and set it as the Cellular.MDN property on the cellular device.

Change-Id: I8224f6a8ebef46be520f804517165a0374e67749
Reviewed-on: https://gerrit-int.chromium.org/2197
Reviewed-by: Jason Glasgow <jglasgow@google.com>
Tested-by: Eric Shienbrood <ers@google.com>
2 years agoFix typo: ActivateManual key for mn-aaa should be mnaaa, not mnHaaa
David Rochberg [Fri, 10 Jun 2011 19:38:04 +0000 (15:38 -0400)]
Fix typo:  ActivateManual key for mn-aaa should be mnaaa, not mnHaaa

BUG=none
TEST=compiled

Change-Id: I6da1efe0c49a7408c9b9247bb0631156a5d83223
Reviewed-on: https://gerrit-int.chromium.org/2191
Tested-by: David Rochberg(internal) <rochberg@google.com>
Reviewed-by: Jason Glasgow <jglasgow@google.com>
2 years agogobi-cromo-plugin: Do not require enabled modem to change firmware
Jason Glasgow [Wed, 18 May 2011 18:54:44 +0000 (14:54 -0400)]
gobi-cromo-plugin: Do not require enabled modem to change firmware

Make the default modem type be gobi2 because there appear to be bugs
determining if the machine has a gobi2 or gobi3 modem.

BUG=chromium-os:15771
TEST=insert locked sim, modem_set_carrier Generic UMTS, reboot, Disable Mobile Broadband, modem_set_carrier Verizon Wireless

Change-Id: I855ac93880c5d927768a10874dadfb40c291cb45
Reviewed-on: https://gerrit-int.chromium.org/1744
Reviewed-by: Eric Shienbrood <ers@google.com>
Tested-by: Jason Glasgow <jglasgow@google.com>
2 years agogobi-cromo-plugin: Add gobi3k support in modem_set_carrier.
Elly Jones [Wed, 18 May 2011 18:54:44 +0000 (14:54 -0400)]
gobi-cromo-plugin: Add gobi3k support in modem_set_carrier.

This entails a corresponding change to the gobi3k sdk
(https://gerrit-int.chromium.org/#change,1410) and in the gobi3k library
(https://gerrit-int.chromium.org/#change,1412).

BUG=chromium-os:15295
TEST=Adhoc
modem_set_carrier {Sprint,Verizon} a bunch of times, back and forth.

Change-Id: Ib4df99876e1a3bd59737a18ff6eed4df3bd23c81
Signed-off-by: Elly Jones <ellyjones@google.com>
Reviewed-on: https://gerrit-int.chromium.org/1468

2 years agoProperly handle Gobi desync on StartDataSession:
David Rochberg [Tue, 24 May 2011 19:41:21 +0000 (15:41 -0400)]
Properly handle Gobi desync on StartDataSession:

If we see a desync on StartDataSession and we don't have a
cancellation outstanding, then handle as we would any other desync
(enqueue event to shut down cromo and kick the modem off the bus)

BUG=chromium-os:14545
TEST=network_3g, cases have been added to test this

Change-Id: I5ef4a6c3c633b53f1cb26bd5f61fe845c9da2a70
Reviewed-on: https://gerrit-int.chromium.org/1654
Tested-by: David Rochberg(internal) <rochberg@google.com>
Reviewed-by: Jason Glasgow <jglasgow@google.com>
2 years agoImplement GetSpn for Gobi.
Nathan Williams [Tue, 24 May 2011 17:50:08 +0000 (13:50 -0400)]
Implement GetSpn for Gobi.

BUG=crosbug.com/p/3945
TEST=dbus-send --system --dest=org.chromium.ModemManager --print-reply /org/chromium/ModemManager/Gobi/0 org.freedesktop.ModemManager.Modem.Gsm.Card.GetSpn

Change-Id: Ic6b9c6bafb29f93be4be8b75f6475d788276048a
Reviewed-on: https://gerrit-int.chromium.org/1646
Tested-by: Nathan J. Williams <njw@google.com>
Reviewed-by: Eric Shienbrood <ers@google.com>
Reviewed-by: Jason Glasgow <jglasgow@google.com>
2 years agogobi-cromo-plugin: Undo udev hack partly.
Elly Jones [Mon, 23 May 2011 22:39:36 +0000 (18:39 -0400)]
gobi-cromo-plugin: Undo udev hack partly.

I removed a call to RemoveDeviceByControlPath here, even though that call was
actually required. The udev event announcing that /dev/qcqmi0 is gone does not
mean that the sysfs file for the device is actually gone - the sysfs file
lingers as long as there are references to the device file held in kernelspace.

BUG=chromium-os:15295
TEST=Adhoc
modem_set_carrier a few times with 'modem status', checking carrier

Signed-off-by: Elly Jones <ellyjones@chromium.org>
Change-Id: I834eb166f7c4a50d65dbf81e3e0fa1361e8ac61e
Reviewed-on: https://gerrit-int.chromium.org/1619
Reviewed-by: Jason Glasgow <jglasgow@google.com>
Tested-by: Elly Jones <ellyjones@google.com>
2 years agogobi-cromo-plugin: Use short paths for devices.
Elly Jones [Thu, 19 May 2011 22:11:59 +0000 (18:11 -0400)]
gobi-cromo-plugin: Use short paths for devices.

There has been a bug in the device watcher for a long time that caused it to
access devices by short name ('qcqmi0') sometimes and long name ('/dev/qcqmi0')
other times. This caused spurious failures to delete devices and spurious starts
of the device watcher, since devices would not be seen to exist by control path
when they actually did exist.

Additionally, we can delete the invocation of RemoveDeviceByControlPath, since
we always call GetDeviceList before that point, and GetDeviceList will notice
immediately if a device is missing. Therefore, by the time we reach the
invocation of RemoveDeviceByControlPath, the device will already have been
detected to be missing and removed, so that removal is always spurious. Deleting
this invocationh also lets us delete RemoveDeviceByControlPath altogether.

BUG=chromium-os:15295
TEST=Adhoc
cromo -stderrthreshold 0 and watch debug output

Change-Id: Ida2a4f185ec503143b6335b652d3340daf2602c9
Signed-off-by: Elly Jones <ellyjones@google.com>
Reviewed-on: https://gerrit-int.chromium.org/1538
Reviewed-by: Jason Glasgow <jglasgow@google.com>
2 years agoGobi3k: Add VID/PID pairs to be ignored by modem manager
Jason Glasgow [Fri, 13 May 2011 19:52:09 +0000 (15:52 -0400)]
Gobi3k: Add VID/PID pairs to be ignored by modem manager

Add VID/PID pairs to black list of Qualcomm, Sony and Dell devices

BUG=chrome-os-partner:3451
TEST=Ensure that gobi 3K modems work on Kaen

Change-Id: I5e711fabdc59d35a7b6f62d75be9a45f721cbfc0
(cherry picked from commit 868bb0bf2fc47fa5cf6f85d3da3ccbe34065e814)
Reviewed-on: https://gerrit-int.chromium.org/1311
Reviewed-by: Elly Jones <ellyjones@google.com>
Tested-by: Jason Glasgow <jglasgow@google.com>
2 years agoGSM: Make Enable fail if the SIM card is PIN-locked.
Eric Shienbrood [Thu, 5 May 2011 19:01:25 +0000 (15:01 -0400)]
GSM: Make Enable fail if the SIM card  is PIN-locked.

Even though Gobi allows the modem to be enabled when the SIM card is
PIN-locked, certain subsequent operations fail, such as getting the
IMSI and registering on a network. For consistency with the way other
modems behave, we now artificially cause Enable to fail when the
SIM is PIN-locked, so that the flimflam modem manager plugoin doesn't
have to handle two different cases, or delay reporting that the modem
is enabled.

BUG=chromium-os-partner:3538
TEST=Tested both talking directly to cromo with mm-enable, and via
flimflam with enable-device.

Change-Id: Ia56892da86c3f5f12ef103ac3a1f8150b3f1ffd2
Reviewed-on: https://gerrit-int.chromium.org/1156
Reviewed-by: Jason Glasgow <jglasgow@google.com>
Tested-by: Eric Shienbrood <ers@google.com>
2 years agogobi-cromo-plugin: Implement SMS "List" support
Nathan Williams [Wed, 4 May 2011 18:34:34 +0000 (14:34 -0400)]
gobi-cromo-plugin: Implement SMS "List" support
for retrieving and displaying messages already received.

BUG=None
TEST=Log out of device. Send SMS message to device's number. Log in
and check that SMS is displayed.

Change-Id: I8281a8928eee78b34d8598711f4ba721ac7b31e9

2 years agoGetServingNetwork: Do not return errors when unregistered.
Jason Glasgow [Tue, 3 May 2011 19:45:34 +0000 (15:45 -0400)]
GetServingNetwork: Do not return errors when unregistered.

BUG=chromium-os:14257
TEST=Disable Mobile Data.  Reboot.  Enable Mobile Data.  Does network show up?
Change-Id: Id0f57303e51a742416db25db4504af676b70b9ba

2 years agoSay 0, not NULL when we mean 0.
David Rochberg [Tue, 3 May 2011 18:57:52 +0000 (14:57 -0400)]
Say 0, not NULL when we mean 0.
Fixes a build fail with GCC4.6

BUG=chromium-os:14527
TEST=Built with and without.  Assembler output identical.

Change-Id: If434b162381f69af31c45b4e5622107b32a5ede2

2 years agoIf we have a connect attempt pending on destruction, try to cancel it.
David Rochberg [Thu, 21 Apr 2011 20:21:57 +0000 (16:21 -0400)]
If we have a connect attempt pending on destruction, try to cancel it.

Before this, when a modem disappeared while we were trying to connect
(say, because we suspended) then the SDK would hang waiting for further
progress on the connect.

BUG=14259
TEST=suite_Cellular + manually suspending laptop after mm-connect and "gobi_modem.cc:128 Starter completing" but before "gobi_modem.cc:599 Returning deferred connect call"

Change-Id: Ie9c9c8934cf3a25bf63e7a58bdde0b3d29dc1cc5

R=jglasgow@google.com

Review URL: https://chromereviews.googleplex.com/2805020

2 years agoDo not leave some of the subsystems locked when we fail to acquire one subsystem...
David Rochberg [Thu, 21 Apr 2011 17:13:15 +0000 (13:13 -0400)]
Do not leave some of the subsystems locked when we fail to acquire one subsystem lock.

Move CallWrapper into an inner class so it's easier to test

BUG=chromium-os:14259

Review URL: https://chromereviews.googleplex.com/2803023

Change-Id: Iafa22fa947df8f1879a49860d5c1afd0d14936b3

2 years agoRemove cached session_state_ from gobi_modem object. Use seesion_id_ to gate disconnect.
David Rochberg [Thu, 21 Apr 2011 16:44:39 +0000 (12:44 -0400)]
Remove cached session_state_ from gobi_modem object.  Use seesion_id_ to gate disconnect.

This variable was doing us no good and it was causing a race between
when we returned from a Connect() DBus call (so that flimflam thought
it could try disconnecting us) and when SessionStateHandler got
called.

We now use session_id_ to gate disconnect, which seems substantially
more correct.

Change-Id: I7c92c9e657793b48d22eb898823dbd90ec3c0e96

R=ers@google.com,jglasgow@google.com
TEST=suite_Cellular
BUG=none

Review URL: https://chromereviews.googleplex.com/2811012

2 years agoPrevent cromo segfault when SDK PIN operation fails.
Eric Shienbrood [Wed, 20 Apr 2011 20:50:34 +0000 (16:50 -0400)]
Prevent cromo segfault when SDK PIN operation fails.

BUG=none
TEST=it doesn't crash anymore if GetUIMPinStatus fails.

Change-Id: I53dee34b0c6f3efb2ed3af01ea4f81dbf9f09cb8

R=rochberg@google.com

Review URL: https://chromereviews.googleplex.com/2809021

2 years agoAlways build unit tests
David Rochberg [Wed, 20 Apr 2011 20:36:47 +0000 (16:36 -0400)]
Always build unit tests

Remove spurious gflags dependency.  Not sure whether gflags was there
for boilerplate reasons or whether people were using it to pass
arguments to glog.  You can set the environment variable GLOG_flagname
to the flag value to get the same effect

TEST=still builds

BUG=chromium-os:14259

Change-Id: I4ca3fb33d146ea9f8cad5f9ce4e98b42625641b9

Review URL: https://chromereviews.googleplex.com/2788031

2 years agoCleaned up cromo dbus error reporting.
Eric Shienbrood [Fri, 15 Apr 2011 22:46:33 +0000 (18:46 -0400)]
Cleaned up cromo dbus error reporting.

Return fully qualified ModemManager error names where appropriate,
so that cromo is returning the same dbus errors as ModemManager.
Another pass still should be made through the code to rationalize
all error reporting, but the immediate changes are necessary to
match what flimflam expects to see, once it is changed to look
for the correct ModemManager errors.

Note that until the flimflam changes are pushed (soon), APN retry
will be broken, and so will PIN/PUK error reporting.

BUG=none
TEST=Tested APN cycling and PIN/PUK operations against a modified
version of flimflam.

Change-Id: If6e8d8453337a119073d2f219d4810541aa4ddcc

R=jglasgow@google.com,rochberg@google.com

Review URL: https://chromereviews.googleplex.com/2779015

2 years agoImplement org.freedesktop.ModemManager.Modem.Gsm.Network Scan and Register operations.
Eric Shienbrood [Wed, 13 Apr 2011 20:15:27 +0000 (16:15 -0400)]
Implement org.freedesktop.ModemManager.Modem.Gsm.Network Scan and Register operations.

BUG=chromium-os:11303
TEST=Manual testing. Invoked Scan and Register methods
both directly with cromo and via flimflam. Scan results
looked correct (T-Mobile and AT&T networks show up).
Registering seems to work, but there's not much I can
do after registering on another network since there is
no roaming agreement between AT&T and T-Mobile.

Change-Id: If38f88df59eb121fd6281a7e870f684e039a7136

R=jglasgow@google.com

Review URL: https://chromereviews.googleplex.com/2774015

2 years agogobi-cromo-plugin: Don't log periodic events.
Elly Jones [Mon, 11 Apr 2011 21:22:03 +0000 (17:22 -0400)]
gobi-cromo-plugin: Don't log periodic events.

They're boring and fill up syslog.

Change-Id: I4c633b33f5e85d76fb95cd8a361dfc69afa3ae45

BUG=chromium-os:13068
TEST=Adhoc
grep cromo /var/log/messages ; enjoy the silence

Signed-off-by: Elly Jones <ellyjones@google.com>
Review URL: https://chromereviews.googleplex.com/2741023

2 years agoIf we receive a disable while connecting, queue the disable and attempt to cancel...
David Rochberg [Fri, 8 Apr 2011 19:19:21 +0000 (15:19 -0400)]
If we receive a disable while connecting, queue the disable and attempt to cancel the connect.

BUG=chromium-os:9571
TEST=autotests in a separate CL

Change-Id: I86249d783751f67e212822a193dd520ca966bea6

Review URL: https://chromereviews.googleplex.com/2668048

2 years agoTweak the mapping of error codes for incorrect PIN.
Eric Shienbrood [Wed, 6 Apr 2011 21:54:01 +0000 (17:54 -0400)]
Tweak the mapping of error codes for incorrect PIN.

BUG=none
TEST=Manual testing - verify that flimflam reports
"org.chromium.flimflam.Device.IncorrectPin" for an incorrect PIN
instead of "org.chromium.flimflam.Device.PinRequired", as it used to.

Change-Id: I886256ac3a393c7f24c4180297168a9e710642cf

R=jglasgow@google.com

Review URL: https://chromereviews.googleplex.com/2749012

2 years agogobi-cromo-plugin: move modem and mm.sh to modem-utilities repo
Jason Glasgow [Thu, 31 Mar 2011 22:52:35 +0000 (18:52 -0400)]
gobi-cromo-plugin: move modem and mm.sh to modem-utilities repo

See also http://codereview.chromium.org/6780027/ and http://codereview.chromium.org/6728027/

Change-Id: I7b2499512cb3f9470aa4f17e03f4a124fb77674e

BUG=chrome-os-partner:2985
TEST=run ebuilds and make sure modem command works in crosh

Review URL: https://chromereviews.googleplex.com/2706021

2 years agogobi-cromo-plugin: Fix error handling and removed dead code
Jason Glasgow [Thu, 31 Mar 2011 21:55:49 +0000 (17:55 -0400)]
gobi-cromo-plugin: Fix error handling and removed dead code

An error on the modem would leave the modem API connected to the
Qualcomm SDK meaning that the modem could never recover. This could
happens if the rf-kill switch is enabled.

BUG=chromium-os:13632
TEST=run ./mm-enable and ./mm-disable repeatedly when modem is in sled
with rf-kill switch enabled

Review URL: https://chromereviews.googleplex.com/2711012

Change-Id: I2775b60bcbefc460245d6f2125603b848299d809

2 years agoSupport for ModemManager PIN and PUK operations.
Eric Shienbrood [Thu, 31 Mar 2011 21:49:10 +0000 (17:49 -0400)]
Support for ModemManager PIN and PUK operations.

BUG=chromium-os:11293
TEST=Tested directly using dbus-send to invoke the operations, and
also using a version of flimflam that supports corresponding methods
on the Device interface.

Change-Id: I09fbd64dd2f6e0f0b39ee3d0a555eff3cdc04085

R=jglasgow@google.com,ellyjones@google.com

Review URL: https://chromereviews.googleplex.com/2709019