Commit Graph

3315 Commits

Author SHA1 Message Date
Aleksander Morgado
7da2a65b43 plugins: fix generic GObject related macros 2012-12-27 08:48:11 +01:00
Aleksander Morgado
f923e95861 base-modem: don't set the modem valid if we didn't export the Modem interface
If an error occurs early during the initialization (e.g. during port setup), we
would be aborting without even having exported the modem interface. So detect
that case and skip setting the modem as valid.
2012-12-27 08:48:11 +01:00
Aleksander Morgado
4ffa871228 zte: ignore net ports in non-Icera based modems
Plain non-Icera ZTE modems will use ATD calls and PPP to establish the
connection, so ignore 'net' ports that may be found in the way (e.g. when the
modem is a QMI modem and we're not using QMI support).
2012-12-27 08:48:10 +01:00
Aleksander Morgado
ded8bfe965 hso: new helper code to debug GPS related issues
Disabled in normal compilation, can be enabled to debug issues.
2012-12-24 19:06:26 +01:00
Aleksander Morgado
4d4ea9c369 iface-modem-location: fix periodic reporting of the GPS location info
The Location property was never being updated properly.
2012-12-24 18:57:39 +01:00
Aleksander Morgado
850a7737b8 broadband-modem: fix reloading of operator code when enabling 3GPP location
When the 3GPP location is enabled, we need to reload the operator code
information, but only if the modem is registered in a 3GPP network.

Now, instead of looking at the global modem state value, look at the specific
3GPP registration state. This will avoid issues like:
 * updating 3GPP operator info and the modem registered in a CDMA network.
 * not updating the 3GPP operator info when the modem is registered in a 3GPP
   network but not yet fully enabled (i.e. 'enabling').
2012-12-24 15:54:37 +01:00
Anton Blanchard
0380045aac ModemManager: Blacklist Dangerous Prototypes Bus Pirate v4
The Bus Pirate v4 presents itself as a CDC ACM device which
ModemManager attempts to configure. This results in a range
of confusing issues because it injects a bunch of AT commands
over whatever is going on at the time.

Firmware updates were failing at random points and avrdude
failed to work at all. Blacklisting it fixed my issues.
2012-12-23 16:55:27 +01:00
Dan Williams
c08b03f6fd sierra: fix APP1 PPP functionality
Unfortunately, Sierra secondary APP ports reply to +GCAP with
only "OK", and not their APP port number or model number.  So instead
of using +GCAP, we have to use ATI to get secondary port information.
This allows us to detect which port is the APP1 port that we can
potentially use for PPP, leaving the primary port available for
control and status.

Also, some modems have up to 3 or 4 APP secondary ports, which we
need to ensure aren't used as primary.  The previous check for +GCAP
handled that, but let's make it more explicit.

AT+GCAP reply:
OK

ATI reply:
Sierra Wireless, Inc.
C885
APP1
OK

See also: 3f3987e09ee762e48c1d53cb42a1288ce9f332cb (MM_06)
2012-12-17 14:23:00 -06:00
Aleksander Morgado
dc9bbefbc0 icera,hso: don't wait to get connected if the primary port is removed
If the primary port is gone (e.g. when going to sleep) and we are just in the
middle of a connection attempt, we won't be able to receive any unsolicited
message regarding the status of the attempt. So, if we detect that the port is
forced to get closed, we'll just treat it as a connection failure.

http://code.google.com/p/chromium-os/issues/detail?id=35391
2012-12-12 12:56:47 +01:00
Aleksander Morgado
f20922ba9d bearer: check if signal handler is connected before trying to disconnect it
Avoids warnings like:
GLib-GObject-WARNING **: gsignal.c:2576: instance `0x78624028' has no handler with id `148'
2012-12-12 12:55:33 +01:00
Aleksander Morgado
c43c8958d0 sms-part: plug memleak 2012-12-12 12:21:17 +01:00
Dan Williams
9d5e2c608d sierra: implement the Time interface for 3GPP and CDMA devices 2012-12-11 12:48:38 -06:00
Dan Williams
5427f0d356 sierra: restore longer CFUN=1 timeout for older devices
Turns out older devices (like the C885/AT&T Mercury) crash often
when we don't wait for them to settle from CFUN=1.  5 seconds is
too short, but the crashes go away when we wait for 10 seconds.
Newer modems like the USB306 don't have this problem, so we just
check to see if the modem is a DirectIP device (using sierra_net)
and only use the shorter timeout for those newer devices.

This is a separate problem from some older modems returning ERROR
to valid commands that are sent too soon after CFUN=1, which was
observed on really old devices like the PCMCIA 860.
2012-12-10 16:33:05 -06:00
Dan Williams
26c19ff474 release: bump version to 0.7.990 2012-12-07 15:43:26 -06:00
Dan Williams
46d2d40e9d release: update NEWS 2012-12-07 15:38:57 -06:00
Dan Williams
d952571b2b broadband-modem: strip prefixes from GMM/GMR/GMI replies
Some devices prefix the replies with the command, some don't, so
strip off the prefix if it exists.
2012-12-05 14:38:50 -06:00
Dan Williams
4b23fd00a0 icera: implement Time interface support check 2012-12-05 14:38:50 -06:00
Dan Williams
8c1f80a9a4 huawei: implement Time interface for CDMA modems 2012-12-05 13:49:21 -06:00
Dan Williams
4e980d1739 icera: report 4-digit year as required by ISO-8601
Assume 2000 + year.
2012-12-05 12:15:51 -06:00
Dan Williams
dd51f7a6ae libmm-glib: document mm_get_uint_from_str()
Unlike strtol/stroul, this function doesn't ignore leading or
trailing non-digit characters, so document that restriction.
2012-12-05 11:43:58 -06:00
Dan Williams
75731cf21c modem-helpers: add EVDO rev. B and "CDMA2000 1X" to access tech helper
Some Huawei modems report these, and we may use the generic helper
in the future.
2012-12-05 11:43:58 -06:00
Dan Williams
e3a71711bf huawei: handle CDMA allowed modes 2012-12-05 11:27:54 -06:00
Dan Williams
c3984d3982 huawei: fix crash disabling CDMA unsolicited response handlers
Parent MMBroadbandModem may not implement these functions so we
shouldn't call them unless it does.
2012-12-05 11:27:54 -06:00
Dan Williams
f0ba40f3a1 huawei: implement Huawei-specific CDMA signal quality checks
Many Huawei CDMA modems implement vendor commands for 1x and EVDO
signal quality, so use them since they are more accurate than the
generic signal checking.

(port of a similar patch for MM_06 by heiher <admin@heiher.info>)
2012-12-05 11:27:54 -06:00
Dan Williams
8fdcfd5b97 huawei: consolidate MODE parsing
Both CDMA and 3GPP modems emit this, but using slightly different
formats.
2012-12-05 10:49:21 -06:00
Dan Williams
56e5ecdc1b huawei: consolidate SYSINFO parsing
Both CDMA and 3GPP modems use SYSINFO, so consolidate the parsing of
its response.
2012-12-05 10:49:21 -06:00
Aleksander Morgado
b39ae775d6 serial: clear serial info struct before calling ioctl()
We need the kernel driver to give a proper value for the 'closing_wait'
variable, but don't assume it will.

This should solve the following kind of issues reported by valgrind:

==8985== Conditional jump or move depends on uninitialised value(s)
==8985==    at 0x4409A6: mm_serial_port_close (mm-serial-port.c:932)
==8985==    by 0x41A420: disable_all_done (mm-generic-cdma.c:753)
==8985==    by 0x4125A4: mm_manager_shutdown (mm-manager.c:1130)
==8985==    by 0x40DE35: main (main.c:203)
2012-12-03 16:45:41 +01:00
Dan Williams
1e23fe62fe sierra: USB 306 modems support PPP on the APPx ports 2012-11-29 11:42:03 -06:00
Aleksander Morgado
ad51361cb7 plugin-base: handle Huawei Data07 capabilities probing 2012-11-28 15:50:34 +01:00
Aleksander Morgado
b0746c591f huawei: don't assume g_regex_match_full() sets error when not matching 2012-11-27 22:04:04 +01:00
Dan Williams
2f28193cd4 broadband-modem-huawei: don't call non-existent MMBroadbandModem CDMA functions 2012-11-27 14:50:14 -06:00
Dan Williams
ef644fba84 hso: DIAG ports aren't always DIAG
The 'hso' driver tags Icera-based modems' proprietary protocol port
as a DIAG port, but since they aren't Qualcomm-based, it's not
a DIAG port.  Just turn off AT probing and let QCDM probing
fail the port instead of assuming it's a DIAG port.
2012-11-27 09:56:25 -06:00
Dan Williams
c90e41fb13 port-probe: early-exit if port is certainly not AT capable
If we read a response that indicates the port is definitely not an
AT capable port, stop AT probing.  Certain ports that use proprietary
protocols or other non-AT protocols tend to spew data at us, so when
this happens we can cut probing short.
2012-11-27 09:56:25 -06:00
Dan Williams
a01e8aa317 serial-port: consistently use mm_warn() instead of g_warning() 2012-11-27 09:56:25 -06:00
Dan Williams
8772d63389 serial-port: stop reading data if the serial port was closed
If a response processor closed the port, don't try to read any
more data from it.  Move the priv->watch_id check to the
while condition so the loop terminates before calling
g_io_channel_read_chars() again, which caused a warning since
the underlying file descriptor was already closed.

Also, bytes_read will never be less than zero (it's unsigned),
so skip the bytes_read > 0 check and just assert that this
condition is true.
2012-11-27 09:56:25 -06:00
Dan Williams
a7167b93b9 port-probe: fix crash in buffer-full processing
Signal was attached with user_data as MMPortProbe*, but
serial_buffer_full() treated user_data as a PortProbeRunTask*.
Hillarity ensued.
2012-11-27 09:56:25 -06:00
Dan Williams
6106d1d6a2 port-probe: fix checking of Icera capability on some devices
Sierra devices often have limited AT parsers on their APP ports
which reply with OK to any command they don't understand, and
thus we need to actually check for a valid IPSYS reply instead of
just checking whether the IPSYS request completed without error.

Previously MM would detect Icera capability on devices that
didn't actually have it.
2012-11-27 09:56:25 -06:00
Dan Williams
3e39144100 qcdm: handle more test failures for NW subsystem
Bandrich C120 returns BAD_LENGTH rather than BAD_COMMAND, perhaps
because it re-uses the same subsystem number for something else.
2012-11-27 09:56:25 -06:00
Dan Williams
33f440c885 broadband-modem: fall back to +CSQ if +CIND signal quality checking fails
If +CIND fails for any reason (generic failure, wrong indexes, etc) or
reports zero signal strength (quirky modem) then fall back to +CSQ.
2012-11-27 09:56:25 -06:00
Aleksander Morgado
562055b53b libmm-glib,manager: client creation may fail, avoid explicit MM_MANAGER() cast 2012-11-27 16:25:51 +01:00
Jiří Klimeš
e97b229e66 core: fix possible crash in g_utf8_validate()
We can skip additional UTF-8 validity check when parsing operator.
mm_charset_take_and_convert_to_utf8() already does a UTF-8 validity check
internally before returning the string, so it's pointless to do a new one
on the returned string.
Plus, mm_charset_take_and_convert_to_utf8() may really return NULL, which
would end up in segfaulting as g_utf8_validate() expects always a non-NULL
string.

Based on 219424a6e2d017491a05ecbed661bccde3f991ef (MM_06 branch)
2012-11-27 13:25:25 +01:00
Aleksander Morgado
e6052a4abf icera,hso: don't disconnect() cancellable in the cancellation callback
The logic gets completely stuck when this happens:

Stack trace below:
#0  0x77661424 in __kernel_vsyscall ()
#1  0x77337c3c in pthread_cond_wait ()
#2  0x773cebaa in g_cond_wait () from /usr/lib/libglib-2.0.so.0
#3  0x774c03cc in g_cancellable_disconnect () from /usr/lib/libgio-2.0.so.0
#4  0x76955d36 in connect_cancelled_cb (cancellable=0x78e055a0, self=0x78e0b590)
#5  0x77460982 in g_cclosure_marshal_VOID__VOIDv () from /usr/lib/libgobject-2.0.so.0
#6  0x7745ed8a in ?? () from /usr/lib/libgobject-2.0.so.0
#7  0x77478435 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#8  0x77478eb3 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#9  0x774c01eb in g_cancellable_cancel () from /usr/lib/libgio-2.0.so.0
#10 0x776a0eab in mm_bearer_disconnect (self=0x78e0b590, callback=0x776c5980 <disconnect_ready>,
#11 0x776c57de in disconnect_next_bearer (ctx=0x78e12870) at mm-iface-modem-simple.c:898
#12 0x776c58d2 in disconnect_auth_ready (self=0x78df3048, res=0x78e06210, ctx=0x78e12870)
#13 0x774fed25 in g_simple_async_result_complete () from /usr/lib/libgio-2.0.so.0
#14 0x776a8c4e in authorize_ready (authp=0x78db68d0, res=0x76801638, simple=0x78e06210)
#15 0x774fed25 in g_simple_async_result_complete () from /usr/lib/libgio-2.0.so.0
#16 0x774fee3e in ?? () from /usr/lib/libgio-2.0.so.0
#17 0x7738a7a2 in ?? () from /usr/lib/libglib-2.0.so.0
#18 0x7738ce83 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#19 0x7738d248 in ?? () from /usr/lib/libglib-2.0.so.0
#20 0x7738d6eb in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#21 0x77696a7d in main (argc=2, argv=0x7fbb1f04) at main.c:158

http://code.google.com/p/chromium-os/issues/detail?id=36448
2012-11-27 11:26:51 +01:00
Ben Chan
674ecaa6eb broadband-modem: check for NULL response in parse_caps_{cpin,cgmm,gcap} 2012-11-27 11:00:35 +01:00
Aleksander Morgado
cf46ed4238 libmm-glib,manager: register DBus error associations in advance
In order to have a proper conversion between DBus error names and GErrors for
our known domains, the associations need to be registered before any DBus
call attempt.

Given that the high-level API of libmm-glib has its entry point always in the
MMManager, just register them as soon as the first such object is created.
2012-11-15 09:39:26 +01:00
Dan Williams
b74741e642 qcdm: get/set functions for hybrid preference 2012-11-14 11:11:03 -06:00
Dan Williams
773d0022d0 qcdm: trivial cleanup of log item numbers 2012-11-14 11:08:04 -06:00
Dan Williams
79652bb671 qcdm: clarify log item command length member 2012-11-14 11:07:57 -06:00
Dan Williams
e798b6e663 serial: fix warning when driver doesn't support closing_wait (bgo #630670)
It appears that GIOChannel might also do some flushing, so make sure
our warning captures that delay if there is one.  Also be paranoid
and make sure nothing reset our closing_wait value.
2012-11-14 11:03:56 -06:00
Aleksander Morgado
191eabe952 blacklist: skip probing Atmel samba bootloader
https://bugzilla.gnome.org/show_bug.cgi?id=688213
2012-11-13 07:42:04 +01:00
Aleksander Morgado
c2db8abe52 huawei: better detection of data port on some modems
Some devices (e173) appear to lie about NDIS support; GETPORTMODE reports NDIS
is enabled, but that port is actually the MDM port and responds to AT commands.
So, if we get a port reported as NDIS and none reported as MDM, use the one
reported as NDIS for PPP.

https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/1057186
2012-11-12 09:49:48 +01:00