Commit Graph

2049 Commits

Author SHA1 Message Date
Dan Williams
f95274e735 broadband-modem: load own numbers with QCDM too
Not many CDMA/EVDO-only modems support CNUM since it's not a
standard IS707/856 AT command, so for those that don't
support it and have a QCDM port, try grabbing the number from
NV memory.
2013-01-14 13:50:26 -06:00
Aleksander Morgado
8403a48b31 plugin-manager: new debug logs to help track probing issues 2013-01-11 12:20:57 +01:00
Aleksander Morgado
eec5d00a97 core,plugins: remove initial power down sequence
We no longer power down the modem during initialization, so remove that
implementation.
2013-01-11 10:05:46 +01:00
Aleksander Morgado
952d96234b broadband-modem: implement custom power state loading 2013-01-11 10:05:45 +01:00
Aleksander Morgado
696b879b6d broadband-modem-qmi: implement custom power state loading 2013-01-11 10:05:45 +01:00
Aleksander Morgado
e55b543d38 iface-modem: implement power mode loading and setting 2013-01-11 10:05:45 +01:00
Dan Williams
f50aa47fb2 sim-qmi: fix trivial GError literal issues/format string warnings 2013-01-10 10:09:35 -06:00
Aleksander Morgado
763e207e9c blacklist: ignore all devices from VID 0x0617
No modems from the Swiss Federal Institute of Technology.

https://bugzilla.gnome.org/show_bug.cgi?id=691384
2013-01-09 10:05:15 +01:00
Aleksander Morgado
dc7aa25f0a sim-qmi: translate common SIM-related QMI errors into ME errors
Upper layers expect Mobile Equipment errors, so try to translate known QMI
protocol errors.
2013-01-08 18:40:48 +01:00
Aleksander Morgado
1372933345 iface-modem,sim: improve lock info update logic
The logic to handle the lock information (current lock and unlock retry count)
wasn't handling all possible cases properly, e.g.:

 * When PIN is incorrectly entered too many times, a SIM-PUK error may happen.
   In this case we need to directly assume SIM-PUK is the current lock (some
   modems, like Option HSO ones, would incorrectly reply SIM-PIN if CPIN? asked
   just after the SIM-PUK error).

 * After every operation acting in SIM locks, we need to update the current
   unlock retry count.

This change tries to cover those cases, by:

 * The logic to check current lock is extended to also load the unlock retry
   count when needed.

 * Whenever a SIM-PUK error happens in the SIM operations, we directly assume
   that SIM-PUK is required, without re-asking CPIN?.

 * The overall logic of lock checking is now handled by a state machine, which
   is much easier to understand.
2013-01-08 18:40:47 +01:00
Aleksander Morgado
959bb9d2ff broadband-modem: launch the Firmware interface even on fatal errors
Even when there is a fatal error during initialization (e.g. missing PIN in a
3GPP modem), we should allow operations on the Firmware interface.
2013-01-07 22:25:46 +01:00
Ben Chan
e939221975 iface-modem, novatel-lte: disable network scan in LTE mode 2013-01-04 12:10:51 +01:00
Ben Chan
bc399d9cf8 iface-modem-3gpp,iface-modem-cdma: check for deallocated RegistrationCheckContext
This patch fixes a crash in periodic_registration_checks_ready() due to
access of an already deallocated RegistrationCheckContext.

Thread 0 *CRASHED* ( SIGSEGV @ 0x00000000 )

0x7fc344d355cd   [ModemManager]             - mm-iface-modem-cdma.c:1112   periodic_registration_checks_ready
0x7fc3449ea266   [libgio-2.0.so.0.3200.4]   - gsimpleasyncresult.c:767     g_simple_async_result_complete
0x7fc3449ea368   [libgio-2.0.so.0.3200.4]   - gsimpleasyncresult.c:779     complete_in_idle_cb
0x7fc344851dc4   [libglib-2.0.so.0.3200.4]  - gmain.c:2539                 g_main_context_dispatch
0x7fc344852147   [libglib-2.0.so.0.3200.4]  - gmain.c:3146                 g_main_context_iterate
0x7fc3448525a1   [libglib-2.0.so.0.3200.4]  - gmain.c:3340                 g_main_loop_run
0x7fc344d0f154   [ModemManager]             - main.c:158                   main
0x7fc34426a474   [libc-2.15.so]             - libc-start.c:234             __libc_start_main
0x7fc344d0eb68   [ModemManager]             + 0x0001bb68
2013-01-03 22:28:34 +01:00
Aleksander Morgado
1b0ab2ea60 broadband-bearer: dial port may be different to the primary port 2012-12-28 08:00:04 +01:00
Aleksander Morgado
731812fe34 plugin: avoid QMI-managed net ports when compiling without QMI support 2012-12-27 13:51:28 +01:00
Aleksander Morgado
80b68ac0ae plugin-manager: initially never start with the Generic plugin suggested
The generic plugin should be a fallback, so when starting to probe the port,
never start with the Generic plugin first.
2012-12-27 12:44:50 +01:00
Aleksander Morgado
ef31ff7535 broadband-bearer: PDP context deactivation may take longer
Update the default timeout from 3s to 10s.
2012-12-27 08:58:39 +01:00
Aleksander Morgado
c8fcf7a91d plugin: re-run subsystems filter before grabbing the ports
Every port probing will have the Generic plugin as fallback, and due to some
other issues in other plugins (see ee099fcd), we need to allow overwriting the
suggested plugin from the Generic to a more specific one.

One of the drawbacks of this is that we're actually allowing the Generic plugin
to probe and accept the port, which means that the generic plugin may accept a
specific port type (e.g. QMI) while the specific plugin wouldn't. So, we will
now also run the subsystems filter before grabbing the specific port, in order
to really filter out those cases. We still keep the subsystems filter in
pre-probing, so that we build a better initial plugin list to probe.
2012-12-27 08:53:45 +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
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
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
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
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
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
Aleksander Morgado
ad51361cb7 plugin-base: handle Huawei Data07 capabilities probing 2012-11-28 15:50:34 +01: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
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
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
Ben Chan
674ecaa6eb broadband-modem: check for NULL response in parse_caps_{cpin,cgmm,gcap} 2012-11-27 11:00:35 +01: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
af48e1c8b7 broadband-modem-qmi: by default request only GSM-WCDMA mode messages
This should probably fix the issues seen with the Novatel E362 (CDMA+LTE):

ModemManager[4813]: <debug> [1351697325.212782] [mm-broadband-modem-qmi.c:5541] load_initial_sms_parts(): loading messages from storage 'sm'...
ModemManager[4813]: [/dev/cdc-wdm0] Sending message...
<<<<<< QMUX:
<<<<<<   length  = 16
<<<<<<   flags   = 0x00
<<<<<<   service = "wms"
<<<<<<   client  = 2
<<<<<< QMI:
<<<<<<   flags       = "none"
<<<<<<   transaction = 3
<<<<<<   tlv_length  = 4
<<<<<<   message     = "List Messages" (0x0031)
<<<<<< TLV:
<<<<<<   type       = "Storage Type" (0x01)
<<<<<<   length     = 1
<<<<<<   value      = 01
<<<<<<   translated = 1
ModemManager[4813]: [/dev/cdc-wdm0] Received message...
>>>>>> QMUX:
>>>>>>   length  = 19
>>>>>>   flags   = 0x80
>>>>>>   service = "wms"
>>>>>>   client  = 2
>>>>>> QMI:
>>>>>>   flags       = "response"
>>>>>>   transaction = 3
>>>>>>   tlv_length  = 7
>>>>>>   message     = "List Messages" (0x0031)
>>>>>> TLV:
>>>>>>   type       = "Result" (0x02)
>>>>>>   length     = 4
>>>>>>   value      = 01:00:11:00
>>>>>>   translated = FAILURE: MissingArgument
ModemManager[4813]: <debug> [1351697325.215112] [mm-iface-modem-messaging.c:757] load_initial_sms_parts_ready(): Couldn't load SMS parts from storage 'sm': 'Couldn't list messages: QMI protocol error (17): 'MissingArgument''
2012-11-02 14:30:32 +01:00
Aleksander Morgado
b43575fdf9 iface-modem-messaging: fix storage string when reporting errors 2012-11-02 14:19:15 +01:00
Aleksander Morgado
9ec90d9a11 core,plugins: don't assume 'CS' supported when '2G' supported
We will not report 'CS' as a supported mode every time '2G' is supported. This
actually was forcing all plugins to handle a 'CS' fallback when they didn't have
CS-specific mode setup. So, to simplify things, we will only report 'CS' as
supported for those plugins which actually allow to select 'CS' mode (e.g. the
'wavecom' plugin).
2012-11-02 09:52:31 +01:00
Aleksander Morgado
55c05121ad broadband-modem-qmi: fix error reporting when loading current bands fails 2012-11-02 08:49:37 +01:00
Aleksander Morgado
1fd1f558f1 broadband-modem-qmi: implement CDMA BS location reporting 2012-11-02 08:23:11 +01:00
Aleksander Morgado
31ec55aea8 iface-modem-location: implement handling the CDMA BS location source 2012-11-02 08:23:11 +01:00
Ben Chan
02ef7d9547 iface-modem: load own numbers after SIM initialization
In 3GPP, own numbers are loaded from the SIM card, the loading of own
numbers should be scheduled after the SIM card is ready.
2012-11-02 08:19:30 +01:00
Aleksander Morgado
daf1a353c3 core: allow QMI modems without AT ports 2012-10-31 10:54:25 +01:00
Aleksander Morgado
25d35b6f91 broadband-modem-qmi: run power-down during init 2012-10-31 10:15:21 +01:00
Aleksander Morgado
120b660fd4 core,log: include logging from the 'Qmi' log domain
Sync with libqmi:

commit 2835a53732fdae32478dd954a9ee3fa8afd93cab
Author: Aleksander Morgado <aleksander@lanedo.com>
Date:   Tue Oct 30 15:02:24 2012 +0100

    libqmi-glib: define library G_LOG_DOMAIN
2012-10-30 16:06:27 +01:00
Aleksander Morgado
0ca6ae1b4b plugin-manager,plugin: run pre-probing filters early
For each port, we will construct the list of plugins to test with. In that list
we will include those plugins which are likely to handle a given port, so we
will skip all those which aren't.

To see if a plugin is likely or not, we will run the pre-probing filters before
adding them to the list, with the new `mm_plugin_discard_port_early()'. This
method will return one of these hints:

 * UNSUPPORTED: The plugin will not be able to handle this port.
 * MAYBE: The plugin may handle this port.
 * LIKELY: The plugin may (very likely) handle this port.
 * SUPPORTED: If any plugin should support the port, this is it.

Plugins reported to be 'likely' supporting the port will be probed before the
ones reported just as 'maybe'.

If a plugin reports 'supported' only that one and the fallback generic ones will
be tried.
2012-10-30 15:35:58 +01:00