chromiumos/third_party/modemmanager-next.git
38 hours agoMerge remote-tracking branch 'cros/upstream' into 'cros/master' master
Ben Chan [Mon, 20 May 2013 17:44:10 +0000 (10:44 -0700)]
Merge remote-tracking branch 'cros/upstream' into 'cros/master'

Change-Id: Idc7c26d9d4113a2c7dab3a7714ad87fc80617ef6

47 hours agonovatel: fix invalid comparison of unsigned expression upstream
Ben Chan [Mon, 20 May 2013 08:20:08 +0000 (01:20 -0700)]
novatel: fix invalid comparison of unsigned expression

This patch fixes the following invalid comparison of unsigned expression:

novatel/mm-plugin-novatel.c:148:29: error: comparison of unsigned
      expression >= 0 is always true [-Werror,-Wtautological-compare]
    if (ctx->nwdmat_retries >= 0) {
        ~~~~~~~~~~~~~~~~~~~ ^  ~

Bug reported on https://code.google.com/p/chromium/issues/detail?id=242150

2 days agobroadband-modem-qmi: when listing all SMS fails, list per tag
Aleksander Morgado [Fri, 17 May 2013 13:01:12 +0000 (15:01 +0200)]
broadband-modem-qmi: when listing all SMS fails, list per tag

Some QMI modems seem to fail when requesting to list all SMS messages in a given
storage. When this happens, we'll loop through all storages but performing per
tag list requests.

2 days agosms-qmi: always specify message mode when deleting SMS messages
Aleksander Morgado [Fri, 17 May 2013 11:11:43 +0000 (13:11 +0200)]
sms-qmi: always specify message mode when deleting SMS messages

2 days agobroadband-modem-qmi: always specify message mode when reading SMS
Aleksander Morgado [Thu, 16 May 2013 14:16:39 +0000 (16:16 +0200)]
broadband-modem-qmi: always specify message mode when reading SMS

2 days agobearer: defer forced disconnection when modem unregistered while connected
Aleksander Morgado [Thu, 9 May 2013 08:50:31 +0000 (10:50 +0200)]
bearer: defer forced disconnection when modem unregistered while connected

If the bearer is connected and we get a notification of being unregistered, wait
up to 15s to force the disconnection, in case we can recover the registration
in the meantime.

https://bugzilla.gnome.org/show_bug.cgi?id=699803

2 days agobearer: allow registration changes from/to SEARCHING without disconnecting
Aleksander Morgado [Tue, 7 May 2013 12:59:20 +0000 (14:59 +0200)]
bearer: allow registration changes from/to SEARCHING without disconnecting

We allow the modem to be connected while the registration state is 'SEARCHING',
which may happen when the coverage is poor.

2 days agoiface-modem-3gpp: remove the deferred registration updates
Aleksander Morgado [Tue, 7 May 2013 12:57:43 +0000 (14:57 +0200)]
iface-modem-3gpp: remove the deferred registration updates

We should really notify registration updates right away in the DBus interface.

2 days agodevice: check for NULL driver in add_port_driver
Ben Chan [Fri, 17 May 2013 18:05:44 +0000 (11:05 -0700)]
device: check for NULL driver in add_port_driver

This patch fixes a crash in MMDevice::add_port_driver() due to
g_str_equal() dereferencing a NULL driver returned by
mm_device_utils_get_port_driver().

Bug reported on https://code.google.com/p/chromium/issues/detail?id=241823

4 days agobuild: use -Wformat-security
Aleksander Morgado [Fri, 17 May 2013 21:14:36 +0000 (23:14 +0200)]
build: use -Wformat-security

5 days agosms: fix validity variant parsing
Aleksander Morgado [Fri, 17 May 2013 06:48:24 +0000 (08:48 +0200)]
sms: fix validity variant parsing

8 days agoconfigure.ac: enable maintainer mode by default
Adrian Bunk [Sun, 12 May 2013 14:10:32 +0000 (17:10 +0300)]
configure.ac: enable maintainer mode by default

This is how it should be, and also consistent with NetworkManager.

12 days agohuawei: use ^SYSINFOEX if available instead of ^SYSINFO
Aleksander Morgado [Thu, 9 May 2013 11:39:32 +0000 (13:39 +0200)]
huawei: use ^SYSINFOEX if available instead of ^SYSINFO

Newer Huawei modems, like the E3276 or the ME906 won't support ^SYSINFO, and we
should instead use the newer ^SYSINFOEX. By default, use ^SYSINFOEX when
available, as it provides more information than the plain ^SYSINFO.

E.g.:
    ^SYSINFOEX:2,3,0,1,,3,"WCDMA",41,"HSPA+"
    ^SYSINFOEX:2,3,1,1,1,3,”WCDMA”,46,”DC-HSPA+”

12 days agohuawei: ignore ^NDISSTAT unsolicited messages
Aleksander Morgado [Thu, 9 May 2013 10:36:08 +0000 (12:36 +0200)]
huawei: ignore ^NDISSTAT unsolicited messages

These messages give us information about the current connection status in the
NDIS interface. We already have other means to know this status, so we just
ignore the unsolicited message for now.

E.g.:
    ^NDISSTAT: 1,,,"IPV4"

12 days agohuawei: ignore ^HCSQ unsolicited messages
Aleksander Morgado [Thu, 9 May 2013 10:32:53 +0000 (12:32 +0200)]
huawei: ignore ^HCSQ unsolicited messages

Newer Huawei modems use ^HCSQ to report per-interface signal quality values,
but we don't know yet what each field means for each technology, so just ignore
them for now.

E.g.:
    ^HCSQ: "GSM", 53
    ^HCSQ: "WCDMA", 26, 24, 43
    ^HCSQ: "LTE", 40, 28, 216, 14

We also don't use this message to update current access technology information,
as it is not detailed enough (e.g. WCDMA doesn't specify whether it's plain UMTS
or HSDPA or HSPA+...)

2 weeks agonovatel: skip $NWDMAT if the modem has QMI ports
Aleksander Morgado [Tue, 7 May 2013 16:49:57 +0000 (18:49 +0200)]
novatel: skip $NWDMAT if the modem has QMI ports

2 weeks agonovatel: allow QMI-powered modems
Aleksander Morgado [Tue, 7 May 2013 07:11:28 +0000 (09:11 +0200)]
novatel: allow QMI-powered modems

2 weeks agonovatel: don't filter out the USB551L
Aleksander Morgado [Tue, 7 May 2013 07:08:17 +0000 (09:08 +0200)]
novatel: don't filter out the USB551L

We filter the E362 because it's managed by the Novatel LTE plugin. If we also
filter out the USB551L, but it's not explicitly grabbed by any other plugin, it
will default to the Generic one.

2 weeks agonovatel: don't explicitly filter by drivers
Aleksander Morgado [Tue, 7 May 2013 07:05:49 +0000 (09:05 +0200)]
novatel: don't explicitly filter by drivers

No real need to do it; the VID filter is already enough.

2 weeks agotelit: add basic plugin for Telit 3GPP and 3GPP2 devices
Dan Williams [Mon, 22 Apr 2013 15:57:48 +0000 (10:57 -0500)]
telit: add basic plugin for Telit 3GPP and 3GPP2 devices

2 weeks agosms: enforce message 'class' value validity
Dan Williams [Mon, 6 May 2013 15:51:01 +0000 (10:51 -0500)]
sms: enforce message 'class' value validity

Class is -1 to 3, so warn about out-of-bounds values when it's
being set on the client side.

2 weeks agosms: add support for message class
Dan Williams [Tue, 30 Apr 2013 17:07:16 +0000 (12:07 -0500)]
sms: add support for message class

We need to redefine the message class property to int since class
0 is a valid message class.  Thus -1 now means "unspecified class".

2 weeks agobroadband-modem-zte: chain up to parent access tech loading for CDMA-only devices...
Dan Williams [Mon, 29 Apr 2013 15:23:20 +0000 (10:23 -0500)]
broadband-modem-zte: chain up to parent access tech loading for CDMA-only devices (bgo #698850)

CDMA-only devices don't support +ZPAS for access tech loading, so chain up to the
parent so we get the QCDM fallback access tech loading functions.

https://bugzilla.gnome.org/show_bug.cgi?id=698850

2 weeks agobroadband-modem-nokia: load access technology with *CNTI if possible
Dan Williams [Fri, 3 May 2013 20:33:56 +0000 (15:33 -0500)]
broadband-modem-nokia: load access technology with *CNTI if possible

Works on the N9/N950, but not supported by the N900.

2 weeks agobroadband-modem-nokia: N900 doesn't disable echo unless explicitly done
Dan Williams [Fri, 3 May 2013 20:34:32 +0000 (15:34 -0500)]
broadband-modem-nokia: N900 doesn't disable echo unless explicitly done

During init, the N900 appears to ignore an E0 in the same command as
an E1.  So just add another init command to disable echo, which won't
have any effect on devices that work with the first command.

2 weeks agoMerge remote-tracking branch 'cros/upstream' into 'cros/master' factory-4128.B factory-spring-4131.B release-R28-4100.B
Ben Chan [Mon, 6 May 2013 08:12:26 +0000 (01:12 -0700)]
Merge remote-tracking branch 'cros/upstream' into 'cros/master'

Change-Id: Icb3d77372eb021efa21a7d469eb9220b0efa5dcd

2 weeks agosierra: remove comparison of unsigned expression >= 0
Ben Chan [Mon, 6 May 2013 07:24:25 +0000 (00:24 -0700)]
sierra: remove comparison of unsigned expression >= 0

This patch removes an unnecessary check of unsigned expression >= 0,
which also fixes the following clang warnings:

sierra/mm-broadband-modem-sierra.c:570:18: error: comparison of
unsigned expression >= 0 is always true
[-Werror,-Wtautological-compare]
            mode >= 0 &&
            ~~~~ ^  ~

Bug reported on https://code.google.com/p/chromium/issues/detail?id=235989
Patched by Yunlian Jiang <yunlian@chromium.org>

2 weeks agobroadband-bearer: fix cid check in disconnect_3gpp
Ben Chan [Tue, 30 Apr 2013 19:54:54 +0000 (12:54 -0700)]
broadband-bearer: fix cid check in disconnect_3gpp

A value 0 is used to denote an invalid/uninitialized CID. This patch
fixes a CID check in disconnect_3gpp() of MMBroadbandBearer such that it
disables all PDP contexts via AT+CGACT=0 when no specific CID is used
(i.e. cid == 0).

2 weeks agoMerge remote-tracking branch 'cros/upstream' into 'cros/master'
Ben Chan [Wed, 1 May 2013 16:47:31 +0000 (09:47 -0700)]
Merge remote-tracking branch 'cros/upstream' into 'cros/master'

Change-Id: I16512f829d3ac84f00739d14855f2eac74c6d72f

3 weeks agobroadband-modem: update signal quality normalization
Ben Chan [Tue, 30 Apr 2013 20:32:11 +0000 (13:32 -0700)]
broadband-modem: update signal quality normalization

This patch updates normalize_ciev_cind_signal_quality() in
MMBroadbandModem to remove an unnecessary check on 'quality >= 0' and
also makes sure the normalized signal quality is capped at 100 when no
maximum is specified.

This is revised from a patch originally authored by
Yunlian Jiang <yunlian@chromium.org>.

Bug reported on https://code.google.com/p/chromium/issues/detail?id=235989

3 weeks agoserial-port-qcdm: set SEND_DELAY to 0 (bgo #698869)
Dan Williams [Tue, 30 Apr 2013 14:38:32 +0000 (09:38 -0500)]
serial-port-qcdm: set SEND_DELAY to 0 (bgo #698869)

For some reason a number of ZTE CDMA devices want the whole QCDM
frame in one USB transaction, or at least don't like it being
broken up and sent byte-by-byte with a send delay.  They simply
don't respond.  Since testing indicates that every other QCDM
capable device I've got also handles a zero send delay on both
3.8.8 and 2.6.32, lets just set it to zero for everything,
which should speed things up a bit too.

https://bugzilla.gnome.org/show_bug.cgi?id=698869

3 weeks agomm-glib: use correct enum type
Yunlian Jiang [Mon, 29 Apr 2013 16:53:26 +0000 (11:53 -0500)]
mm-glib: use correct enum type

3 weeks agotime: normalize GetNetworkTime() response to local time + timezone info (bgo #697372)
Dan Williams [Wed, 24 Apr 2013 19:46:23 +0000 (14:46 -0500)]
time: normalize GetNetworkTime() response to local time + timezone info (bgo #697372)

The GetNetworkTime() response is defined to be an ISO8601 string, which
is in turn defined to be in local time.  Make sure that's reflected in
the documentation, and append the timezone offset to UTC where we have
it.

Oddly, Icera devices return their time info in UTC with an offset to
the local timezone, so we have to jump through some hoops there to
convert the response to localtime based on the reported offset.

Some additional fixes by Aleksander Morgado <aleksander@lanedo.com>.

https://bugzilla.gnome.org/show_bug.cgi?id=697372

3 weeks agobroadband-modem: fix assertion during capabilities checking (bgo #698845)
Dan Williams [Thu, 25 Apr 2013 20:07:19 +0000 (15:07 -0500)]
broadband-modem: fix assertion during capabilities checking (bgo #698845)

If no capabilities could be determined from the modem's responses,
result would be NULL but no error would be set, since the modem
didn't time out or have some other critical error, it simply didn't
report any recognized capabilities.  Ensure that an error is
reported in this case.

https://bugzilla.gnome.org/show_bug.cgi?id=698845

3 weeks agoMerge remote-tracking branch 'cros/upstream' into 'cros/master' stabilize-4068.0.B
Ben Chan [Thu, 25 Apr 2013 17:22:35 +0000 (10:22 -0700)]
Merge remote-tracking branch 'cros/upstream' into 'cros/master'

Change-Id: Ibc50b59bc332228075fa16d9f3ba67facaaed5d4

3 weeks agosms: initialize the validity property when creating SMS
Aleksander Morgado [Thu, 25 Apr 2013 17:05:04 +0000 (19:05 +0200)]
sms: initialize the validity property when creating SMS

3 weeks agolibmm-glib: handle relative validity in the MMSmsProperties
Aleksander Morgado [Thu, 25 Apr 2013 17:04:35 +0000 (19:04 +0200)]
libmm-glib: handle relative validity in the MMSmsProperties

3 weeks agobroadband-modem-icera: fix issues checking supported bands
Dan Williams [Wed, 24 Apr 2013 21:48:29 +0000 (16:48 -0500)]
broadband-modem-icera: fix issues checking supported bands

Icera devices include bands that the modem doesn't support in
the %IPBM=? list, so the plugin sets the band to its current
enabled/disabled value to test whether that band is supported.
There were two problems with this approach:

1) Setting an already-enabled band to be enabled apparently
isn't a NOP; it might take more than the 3 seconds given, and
if the response comes after 3 seconds, this greatly confuses
ModemManager because the AT command/reply sequence is now
messed up.  So increase the timeout to 10 seconds.

2) Why bother checking bands that are already enabled anyway?
We already know they are supported, so just don't check those
bands at all.  This requires some parkour because we use the
parsed band array from %IPBM=? to track whether bands are
enabled/disabled by indexing into the array, so instead just
use two separate arrays.  This actually makes the fix for #1
un-needed (because we never enable any bands) but it's good
to have #1 anyway.

3 weeks agoiface-modem: fix array insertion when setting bands
Dan Williams [Wed, 24 Apr 2013 20:04:57 +0000 (15:04 -0500)]
iface-modem: fix array insertion when setting bands

You can't g_array_insert_val() to an index that's beyond the end
of the array, which was happening if the user tried to set the
band list to "any":

mmcli -m 0 --set-bands=any

Just use g_array_append_val() instead.

==5618== Invalid read of size 2
==5618==    at 0x4A0A158: memcpy@GLIBC_2.2.5 (mc_replace_strmem.c:881)
==5618==    by 0x326201D8FB: g_array_insert_vals (string3.h:57)
==5618==    by 0x442EFB: mm_iface_modem_set_bands (mm-iface-modem.c:1982)
==5618==    by 0x44307E: handle_set_bands_auth_ready (mm-iface-modem.c:2100)
==5618==    by 0x326386DFF6: g_simple_async_result_complete (gsimpleasyncresult.c:775)
==5618==    by 0x4358E3: authorize_ready (mm-base-modem.c:1300)
==5618==    by 0x326386DFF6: g_simple_async_result_complete (gsimpleasyncresult.c:775)
==5618==    by 0x326386E0F8: complete_in_idle_cb (gsimpleasyncresult.c:787)
==5618==    by 0x3262047A54: g_main_context_dispatch (gmain.c:2715)
==5618==    by 0x3262047D87: g_main_context_iterate.isra.24 (gmain.c:3290)
==5618==    by 0x3262048181: g_main_loop_run (gmain.c:3484)
==5618==    by 0x426235: main (main.c:142)
==5618==  Address 0x10a7ea74e is not stack'd, malloc'd or (recently) free'd
==5618==
==5618==
==5618== Process terminating with default action of signal 11 (SIGSEGV)
==5618==  Access not within mapped region at address 0x10A7EA74E
==5618==    at 0x4A0A158: memcpy@GLIBC_2.2.5 (mc_replace_strmem.c:881)
==5618==    by 0x326201D8FB: g_array_insert_vals (string3.h:57)
==5618==    by 0x442EFB: mm_iface_modem_set_bands (mm-iface-modem.c:1982)
==5618==    by 0x44307E: handle_set_bands_auth_ready (mm-iface-modem.c:2100)
==5618==    by 0x326386DFF6: g_simple_async_result_complete (gsimpleasyncresult.c:775)
==5618==    by 0x4358E3: authorize_ready (mm-base-modem.c:1300)
==5618==    by 0x326386DFF6: g_simple_async_result_complete (gsimpleasyncresult.c:775)
==5618==    by 0x326386E0F8: complete_in_idle_cb (gsimpleasyncresult.c:787)
==5618==    by 0x3262047A54: g_main_context_dispatch (gmain.c:2715)
==5618==    by 0x3262047D87: g_main_context_iterate.isra.24 (gmain.c:3290)
==5618==    by 0x3262048181: g_main_loop_run (gmain.c:3484)
==5618==    by 0x426235: main (main.c:142)

3 weeks agosierra: handle probing ERROR response better
Dan Williams [Wed, 24 Apr 2013 19:44:57 +0000 (14:44 -0500)]
sierra: handle probing ERROR response better

The USB305 (Icera-based) apparently has a port that replies to everything
with ERROR, and that port is unusable.  Make sure it's ignored, otherwise
MM may claim it as the primary AT port since it technically speaks AT.

3 weeks agohuawei: only expect custom inits to be run on tty ports
Aleksander Morgado [Wed, 24 Apr 2013 21:25:53 +0000 (23:25 +0200)]
huawei: only expect custom inits to be run on tty ports

3 weeks agozte: ensure error is set when +ZSNT response parser doesn't match
Aleksander Morgado [Wed, 24 Apr 2013 21:15:43 +0000 (23:15 +0200)]
zte: ensure error is set when +ZSNT response parser doesn't match

3 weeks agox22x: ensure error is set when +SYSSEL response parser doesn't match
Aleksander Morgado [Wed, 24 Apr 2013 21:12:12 +0000 (23:12 +0200)]
x22x: ensure error is set when +SYSSEL response parser doesn't match

3 weeks agosierra: ensure error is set when !SELRAT response parser doesn't match
Aleksander Morgado [Wed, 24 Apr 2013 21:10:56 +0000 (23:10 +0200)]
sierra: ensure error is set when !SELRAT response parser doesn't match

3 weeks agonovatel: ensure error is set when $NWRAT response parser doesn't match
Aleksander Morgado [Wed, 24 Apr 2013 21:08:09 +0000 (23:08 +0200)]
novatel: ensure error is set when $NWRAT response parser doesn't match

3 weeks agohuawei: ensure error is set when ^CPIN response parser doesn't match
Aleksander Morgado [Wed, 24 Apr 2013 21:07:45 +0000 (23:07 +0200)]
huawei: ensure error is set when ^CPIN response parser doesn't match

3 weeks agomodem-helpers: ensure error is set when +CRM response parser doesn't match
Aleksander Morgado [Wed, 24 Apr 2013 21:05:12 +0000 (23:05 +0200)]
modem-helpers: ensure error is set when +CRM response parser doesn't match

3 weeks agoqcdm: remove unnecessary NULL check on free()
Ben Chan [Thu, 25 Apr 2013 00:37:55 +0000 (17:37 -0700)]
qcdm: remove unnecessary NULL check on free()

This patch removes a few unnecessary NULL checks on free(), which also fixes
the following clang warnings:

result.c:59:27: error: if statement has empty body [-Werror,-Wempty-body]
        if (v->u.u8_array);
                          ^
result.c:59:27: note: put the semicolon on a separate line to silence this warning
result.c:62:28: error: if statement has empty body [-Werror,-Wempty-body]
        if (v->u.u16_array);
                           ^
result.c:62:28: note: put the semicolon on a separate line to silence this warning

Bug reported on https://code.google.com/p/chromium/issues/detail?id=219280
Patched by Yunlian Jiang <yunlian@chromium.org>

3 weeks agox22x: add Archos G9 device tags
Dan Williams [Wed, 24 Apr 2013 22:09:04 +0000 (17:09 -0500)]
x22x: add Archos G9 device tags

3 weeks agoMerge remote-tracking branch 'cros/upstream' into 'cros/master'
Ben Chan [Wed, 24 Apr 2013 21:11:41 +0000 (14:11 -0700)]
Merge remote-tracking branch 'cros/upstream' into 'cros/master'

Change-Id: If7575116cd04d2424534c0785ea9c3461639bffe

3 weeks agoaltair-lte: minor coding style fixes
Aleksander Morgado [Wed, 24 Apr 2013 21:06:34 +0000 (23:06 +0200)]
altair-lte: minor coding style fixes

3 weeks agoaltair-lte: Add SIM unlock retries query to the Altair plugin.
ori inbar [Tue, 23 Apr 2013 18:15:42 +0000 (13:15 -0500)]
altair-lte: Add SIM unlock retries query to the Altair plugin.

3 weeks agox22x: fix regex when parsing +SYSSEL response
Aleksander Morgado [Wed, 24 Apr 2013 20:48:18 +0000 (22:48 +0200)]
x22x: fix regex when parsing +SYSSEL response

The numbers reported by +SYSSEL may have more than one digit, e.g.:
  +SYSSEL: 14,2,0,0

https://bugzilla.gnome.org/show_bug.cgi?id=698774

3 weeks agobearer: allow specifying default IP family for bearers
Ben Chan [Mon, 22 Apr 2013 21:34:44 +0000 (14:34 -0700)]
bearer: allow specifying default IP family for bearers

This patch adds a 'bearer-default-ip-family' property to MMBearer, which
specifies the default IP family to use for a bearer when no explicit
value is given via the simple connect properties. The default IP family
is set to IPv4 in MMBearer but can be overridden by a MMBearer subclass,
which allows a modem plugin to specify an appropriate default value.
(cherry picked from commit 4ac3a6d4f212b3fc04e004c85b89fd567e865ffa)

4 weeks agobearer: allow specifying default IP family for bearers
Ben Chan [Mon, 22 Apr 2013 21:34:44 +0000 (14:34 -0700)]
bearer: allow specifying default IP family for bearers

This patch adds a 'bearer-default-ip-family' property to MMBearer, which
specifies the default IP family to use for a bearer when no explicit
value is given via the simple connect properties. The default IP family
is set to IPv4 in MMBearer but can be overridden by a MMBearer subclass,
which allows a modem plugin to specify an appropriate default value.

4 weeks agoMerge remote-tracking branch 'cros/upstream' into 'cros/master' stabilize-4035.0.B
Ben Chan [Sun, 21 Apr 2013 00:51:30 +0000 (17:51 -0700)]
Merge remote-tracking branch 'cros/upstream' into 'cros/master'

Change-Id: Ibf4a2a9d88f5e65371e2f5f8b5e66f6154509b09

4 weeks agobroadband-modem-qmi: work around old Gobi 1K firmware SetDataFormat issue
Dan Williams [Fri, 19 Apr 2013 21:24:17 +0000 (16:24 -0500)]
broadband-modem-qmi: work around old Gobi 1K firmware SetDataFormat issue

It seems that really old Gobi 1K firmware (from ~2008) doesn't implement
the SetDataFormat command, and will simply ignore the request without
replying to it.  But the device works just fine if we retry the
QMI port open operation without the SetDataFormat request.

The downside of this is is that on older kernels, the qmi_wwan driver
won't automatically fix up any raw-ip packets it receives, but the
old Gobi devices don't ever send raw-ip packets anyway, so it's not
a problem.

4 weeks agobroadband-modem-mbim: don't make no-SIM errors directly fatal, retry instead
Aleksander Morgado [Fri, 19 Apr 2013 06:34:40 +0000 (08:34 +0200)]
broadband-modem-mbim: don't make no-SIM errors directly fatal, retry instead

The MC7710 will report a MBIM_SUBSCRIBER_READY_STATE_SIM_NOT_INSERTED status
when initializing and the SIM is not ready yet. So retry a couple of times as we
do for MBIM_SUBSCRIBER_READY_STATE_NOT_INITIALIZED. If all retries are consumed,
get the last reported status to build the error.

This change makes all modems without SIM require up to 10s to get fully
initialized and exposed in DBus; but it shouldn't be a big deal as the modems
are unusable anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=698264

4 weeks agoiface-modem: skip modem_after_sim_unlock() for CDMA-only devices
Dan Williams [Thu, 18 Apr 2013 17:19:46 +0000 (12:19 -0500)]
iface-modem: skip modem_after_sim_unlock() for CDMA-only devices

We don't support SIM/RUIM on CDMA devices (yet), so for now it makes
no sense to run the after-sim-unlock step on CDMA-only devices where
a SIM won't be present.

Unfortunately we don't know at this point whether there is a SIM
or not, so if the modem is a multi-mode device (implying it has a SIM
slot) and its plugin implements the modem_after_sim_unlock() hook,
the hook will still be executed and might cause an unecessary delay
when a SIM is not inserted.

4 weeks agoiface-modem: for multimode 3GPP+3GPP2 devices, check if SIM is available
Aleksander Morgado [Thu, 18 Apr 2013 16:32:13 +0000 (18:32 +0200)]
iface-modem: for multimode 3GPP+3GPP2 devices, check if SIM is available

If SIM is not available, no 3GPP caps in current caps.

4 weeks agoiface-modem: ignore SIM errors in 3GPP2-capable devices
Aleksander Morgado [Thu, 18 Apr 2013 13:15:38 +0000 (15:15 +0200)]
iface-modem: ignore SIM errors in 3GPP2-capable devices

We already fully skipped SIM unlock check in 3GPP2-only devices; now we also
ignore SIM errors if the device is a 3GPP+3GPP2 device.

4 weeks agocore: rework logging code to remove log message truncation (bgo #698312)
Dan Williams [Thu, 18 Apr 2013 15:19:57 +0000 (10:19 -0500)]
core: rework logging code to remove log message truncation (bgo #698312)

Use a static GString which will resize itself if the log message
is bigger than the current string size, but will also ensure we
don't do a ton of memory reallocation on every log message.

Previously all log messages were trucated at 512 bytes due to the
log buffer char array being 512 bytes long.

4 weeks agoplugin-manager: handle race condition during probing
Aleksander Morgado [Thu, 18 Apr 2013 14:46:17 +0000 (16:46 +0200)]
plugin-manager: handle race condition during probing

The specific case:
 * Modem exposes cdc-wdm port, Generic plugin probes it successfully as QMI.
 * Modem exposes new ports, including the wwan one. All ttys fail probing
   because they're neither AT nor QCDM (CnS in this case).
 * The wwan port ends up without a port being suggested and is not grabbed.

The root cause of this is that we do not propagate the suggested plugin to newly
added ports when it's the Generic one. If it wasn't the Generic one, the newly
added ports would start with the suggested one for probing.

Now, handle this by looking for the device-specified plugin when the port
probing ends without a specific port given. If there is such a device-specified
plugin accept the port, and otherwise, reject it.

4 weeks agobroadband-modem: read current capabilities via QCDM if available (bgo #698229)
Dan Williams [Wed, 17 Apr 2013 19:56:11 +0000 (14:56 -0500)]
broadband-modem: read current capabilities via QCDM if available (bgo #698229)

Many multi-mode Qualcomm devices report all available modes in their
AT+GCAP response (for example, CDMA/EVDO and GSM/UMTS) but they cannot
actually function in all these modes at the same time.  The modem's
actual current capabilities are expressed by the QCDM NV ModePref
item, which is not reflected in the AT+GCAP response.

Reading the current capabilities from the NV ModePref item ensures
that ModemManager does not create interfaces for the modem which
the modem cannot actually implement.

Because the generic modem plugin does not implement the Modem
Capabilities hook (because there is no standard way to determine
what access technologies a modem supports), the Current Capabilities
are copied to the Modem Capabilities.  For devices that support
QCDM this means that Modem Capabilies which used to be created from
the GCAP response and thus would contain all available capabilities
now contain only current capabilities.  This isn't a problem though
since there was no way to switch the devices to use any of their
other capabilities, becuase there aren't any standard commands for
it.  Plugins that know how to switch their modem's capabilities
should (and they already do) override load_current_capabilities
and load_modem_capabilities to get the correct information.

4 weeks agosms-part: check UDH length vs available size before trying to read it
Aleksander Morgado [Thu, 18 Apr 2013 12:43:06 +0000 (14:43 +0200)]
sms-part: check UDH length vs available size before trying to read it

https://bugzilla.gnome.org/show_bug.cgi?id=698246

4 weeks agoqcdm: fix CDMA1x Pilot Sets pilot handling
Dan Williams [Wed, 17 Apr 2013 22:18:05 +0000 (17:18 -0500)]
qcdm: fix CDMA1x Pilot Sets pilot handling

The helper functions got the return code of qcdm_result_* wrong
and thus failed all requests for pilot sets.

4 weeks agombm: allow MBIM devices
Aleksander Morgado [Wed, 17 Apr 2013 17:15:24 +0000 (19:15 +0200)]
mbm: allow MBIM devices

4 weeks agobuild: MBIM support is auto
Aleksander Morgado [Wed, 17 Apr 2013 13:34:23 +0000 (15:34 +0200)]
build: MBIM support is auto

Use it if found, don't use it if not found.

Can be explicitly requested with --with-mbim.

4 weeks agodevice: look for vendor/product ID on the grandparent for MBIM devices
Aleksander Morgado [Wed, 17 Apr 2013 10:18:41 +0000 (12:18 +0200)]
device: look for vendor/product ID on the grandparent for MBIM devices

4 weeks agosierra: allow MBIM modems handled by the plugin
Aleksander Morgado [Tue, 16 Apr 2013 20:20:33 +0000 (22:20 +0200)]
sierra: allow MBIM modems handled by the plugin

4 weeks agobearer-mbim: handle static IP configuration
Aleksander Morgado [Sun, 14 Apr 2013 19:22:12 +0000 (21:22 +0200)]
bearer-mbim: handle static IP configuration

4 weeks agobearer-mbim: update connection timeout values
Aleksander Morgado [Sun, 14 Apr 2013 12:19:32 +0000 (14:19 +0200)]
bearer-mbim: update connection timeout values

4 weeks agobearer-mbim: activate packet service during connection request
Aleksander Morgado [Sun, 14 Apr 2013 12:18:07 +0000 (14:18 +0200)]
bearer-mbim: activate packet service during connection request

4 weeks agobearer-mbim: no auth protocol if neither user nor password given
Aleksander Morgado [Sun, 14 Apr 2013 11:45:11 +0000 (13:45 +0200)]
bearer-mbim: no auth protocol if neither user nor password given

4 weeks agobearer-mbim: implement bearer disconnection
Aleksander Morgado [Sun, 14 Apr 2013 10:54:12 +0000 (12:54 +0200)]
bearer-mbim: implement bearer disconnection

4 weeks agobearer-mbim: gather a unique session id in the [0,255] range
Aleksander Morgado [Sun, 14 Apr 2013 10:39:45 +0000 (12:39 +0200)]
bearer-mbim: gather a unique session id in the [0,255] range

4 weeks agobearer-mbim: implement bearer connection
Aleksander Morgado [Sun, 14 Apr 2013 08:58:16 +0000 (10:58 +0200)]
bearer-mbim: implement bearer connection

4 weeks agobearer-mbim: log available provisioned contexts during connection
Aleksander Morgado [Sun, 14 Apr 2013 07:31:19 +0000 (09:31 +0200)]
bearer-mbim: log available provisioned contexts during connection

4 weeks agobroadband-modem-mbim: implement access technologies updates
Aleksander Morgado [Sat, 13 Apr 2013 16:35:24 +0000 (18:35 +0200)]
broadband-modem-mbim: implement access technologies updates

4 weeks agobroadband-modem-mbim: add TODO about the network scan
Aleksander Morgado [Sat, 13 Apr 2013 16:23:32 +0000 (18:23 +0200)]
broadband-modem-mbim: add TODO about the network scan

4 weeks agobroadband-modem-mbim: implement 3GPP registration request
Aleksander Morgado [Sat, 13 Apr 2013 16:18:29 +0000 (18:18 +0200)]
broadband-modem-mbim: implement 3GPP registration request

4 weeks agoapi,errors: define new GPRS related errors
Aleksander Morgado [Sat, 13 Apr 2013 16:18:06 +0000 (18:18 +0200)]
api,errors: define new GPRS related errors

4 weeks agobroadband-modem-mbim: implement 3GPP registration logic
Aleksander Morgado [Sat, 13 Apr 2013 15:43:58 +0000 (17:43 +0200)]
broadband-modem-mbim: implement 3GPP registration logic

4 weeks agosim-mbim: add TODO about the home provider info
Aleksander Morgado [Sat, 13 Apr 2013 14:22:03 +0000 (16:22 +0200)]
sim-mbim: add TODO about the home provider info

4 weeks agobroadband-modem-mbim: implement signal quality updates
Aleksander Morgado [Sat, 13 Apr 2013 14:17:55 +0000 (16:17 +0200)]
broadband-modem-mbim: implement signal quality updates

4 weeks agobroadband-modem-mbim: process signal state indications
Aleksander Morgado [Sat, 13 Apr 2013 13:52:30 +0000 (15:52 +0200)]
broadband-modem-mbim: process signal state indications

4 weeks agobroadband-modem-mbim: implement 3GPP unsolicited messages setup/cleanup
Aleksander Morgado [Sat, 13 Apr 2013 13:20:07 +0000 (15:20 +0200)]
broadband-modem-mbim: implement 3GPP unsolicited messages setup/cleanup

4 weeks agobroadband-modem-mbim: implement enabled facility locks loading
Aleksander Morgado [Sat, 13 Apr 2013 12:01:02 +0000 (14:01 +0200)]
broadband-modem-mbim: implement enabled facility locks loading

4 weeks agobroadband-modem-mbim: implement IMEI loading
Aleksander Morgado [Sat, 13 Apr 2013 10:33:41 +0000 (12:33 +0200)]
broadband-modem-mbim: implement IMEI loading

4 weeks agobroadband-modem-mbim: implement the 3GPP interface
Aleksander Morgado [Sat, 13 Apr 2013 10:30:10 +0000 (12:30 +0200)]
broadband-modem-mbim: implement the 3GPP interface

4 weeks agobroadband-modem-mbim: build fake manufacturer and model strings
Aleksander Morgado [Sat, 13 Apr 2013 09:54:08 +0000 (11:54 +0200)]
broadband-modem-mbim: build fake manufacturer and model strings

4 weeks agobroadband-modem-mbim: implement power up/down
Aleksander Morgado [Sat, 13 Apr 2013 09:45:23 +0000 (11:45 +0200)]
broadband-modem-mbim: implement power up/down

4 weeks agobroadband-modem-mbim: simplify power state loading
Aleksander Morgado [Sat, 13 Apr 2013 07:44:41 +0000 (09:44 +0200)]
broadband-modem-mbim: simplify power state loading

4 weeks agobroadband-modem-mbim,sim-mbim: update message creator/parser names
Aleksander Morgado [Thu, 11 Apr 2013 18:09:27 +0000 (20:09 +0200)]
broadband-modem-mbim,sim-mbim: update message creator/parser names

Sync with libmbim commit:
    commit b73673bf30a82e95819deb17296c9234399f0795
    Author: Aleksander Morgado <aleksander@lanedo.com>
    Date:   Thu Apr 11 20:07:12 2013 +0200

        mbim-codegen: properly define the 4 types of messages that we may have

4 weeks agobroadband-modem-mbim: implement own numbers loading
Aleksander Morgado [Thu, 11 Apr 2013 18:08:56 +0000 (20:08 +0200)]
broadband-modem-mbim: implement own numbers loading

4 weeks agosim-mbim: implement SIM identifier and IMSI loading
Aleksander Morgado [Thu, 11 Apr 2013 18:07:21 +0000 (20:07 +0200)]
sim-mbim: implement SIM identifier and IMSI loading

4 weeks agosim-mbim: these modems don't allow to enable/disable/change PIN if locked
Aleksander Morgado [Thu, 11 Apr 2013 18:03:39 +0000 (20:03 +0200)]
sim-mbim: these modems don't allow to enable/disable/change PIN if locked

4 weeks agosim-mbim: implement PIN changing
Aleksander Morgado [Thu, 11 Apr 2013 18:03:07 +0000 (20:03 +0200)]
sim-mbim: implement PIN changing

4 weeks agobroadband-modem-mbim: check SIM status with 'Subscriber Ready Status'
Aleksander Morgado [Thu, 11 Apr 2013 18:02:53 +0000 (20:02 +0200)]
broadband-modem-mbim: check SIM status with 'Subscriber Ready Status'

4 weeks agombim-port: make port closing async always
Aleksander Morgado [Thu, 11 Apr 2013 17:21:21 +0000 (19:21 +0200)]
mbim-port: make port closing async always

Don't just close the port and forget, really wait to get the CLOSE response
before going on.