Commit Graph

2375 Commits

Author SHA1 Message Date
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
Aleksander Morgado
e5b4b4d0e5 plugin-manager: use dispose() as we're holding plugin objects 2012-10-30 15:35:58 +01:00
Aleksander Morgado
49c19bf83e plugin: avoid unneeded vendor/product AT probing if already passed USB ID filter
Don't require vendor/product string probing if the plugin already had
vendor/product ID filters and we actually passed those.
2012-10-30 15:35:58 +01:00
Aleksander Morgado
3f255b628a plugin-manager,plugin: improve logging
Logging which are the reasons for a plugin to filter a given port really help
when trying to debug user issues. Some other general logging improvements also
done.
2012-10-30 15:35:58 +01:00
Aleksander Morgado
28114f66d5 iface-modem,broadband-modem: update 'enabling->enabled transition logic
It is not the Modem interface the one notifying about the 'enabling->enabled'
transition, it's the BroadbandModem directly doing it, covering all the enabling
sequences of all the interfaces.
2012-10-30 15:35:34 +01:00
Aleksander Morgado
d09d02442f iface-modem,broadband-modem: update 'disabling->disabled' transition logic
It is not the Modem interface the one notifying about the 'disabling->disabled'
transition, it's the BroadbandModem directly doing it, covering all the
disabling sequences of all the interfaces.
2012-10-30 15:35:33 +01:00
Aleksander Morgado
a12d1e36b0 iface-modem: when transitioning to ENABLED check registration-specific states 2012-10-30 15:35:33 +01:00
Aleksander Morgado
f667898eca iface-modem: ignore registration-related state changes if enabling or disabling 2012-10-30 15:35:33 +01:00
Aleksander Morgado
db80fd2550 iface-modem: ignore bearer related state changes if disabling or enabling 2012-10-30 15:35:33 +01:00
Aleksander Morgado
1642863037 iface-modem-simple: avoid intermediate states
If the modem is currently disabling, we need to wait to get fully disabled
before starting with the new connection sequence.

If the modem is currently disconnecting, we need to wait to get fully
disconnected before starting with the new connection sequence.
2012-10-30 15:35:33 +01:00
Aleksander Morgado
4fc3f52791 iface-modem: new helper method to wait until a final state is reached 2012-10-30 15:35:33 +01:00
Aleksander Morgado
a772b28ad6 broadband-modem-qmi: only give gsm/wcdma acquisition order if both 2G & 3G given 2012-10-25 16:50:08 +02:00
Aleksander Morgado
79af94fdbd broadband-modem-qmi: don't treat no-effect errors as failure when setting SSP 2012-10-25 16:49:16 +02:00
Aleksander Morgado
e2d20974c1 iface-modem: don't re-set interface skeleton after PIN unlock
Before the change, the client application loses all new property change
notifications in the interface object:

$ sudo mmcli -m 0 -w
	/org/freedesktop/ModemManager1/Modem/0: Initial state, 'locked'
	/org/freedesktop/ModemManager1/Modem/0: State changed, 'locked' --> 'initializing' (Reason: None or unknown)

After the change, it doesn't:

$ sudo mmcli -m 0 -w
	/org/freedesktop/ModemManager1/Modem/0: Initial state, 'locked'
	/org/freedesktop/ModemManager1/Modem/0: State changed, 'locked' --> 'initializing' (Reason: None or unknown)
	/org/freedesktop/ModemManager1/Modem/0: State changed, 'initializing' --> 'disabled' (Reason: None or unknown)
	/org/freedesktop/ModemManager1/Modem/0: State changed, 'disabled' --> 'enabling' (Reason: User request)
	/org/freedesktop/ModemManager1/Modem/0: State changed, 'enabling' --> 'registered' (Reason: User request)
	/org/freedesktop/ModemManager1/Modem/0: State changed, 'registered' --> 'disabling' (Reason: User request)
	/org/freedesktop/ModemManager1/Modem/0: State changed, 'disabling' --> 'disabled' (Reason: User request)
2012-10-25 16:19:51 +02:00
Aleksander Morgado
7fd09123f8 broadband-bearer: log all found PDP contexts before looking for a match 2012-10-25 16:19:34 +02:00
Aleksander Morgado
675d8aeeea tests: add PDP context reply parser test for Samsung/Icera replies 2012-10-25 16:19:28 +02:00
Aleksander Morgado
e499d32ef1 core: add info logs to show main state machine start/stop points 2012-10-25 16:19:24 +02:00
Aleksander Morgado
6d4a4d647c broadband-modem: disable echo in secondary port when enabling 2012-10-25 16:19:15 +02:00
Aleksander Morgado
d3ddfd583c broadband-modem: make sure the primary port is used for the modem init sequence 2012-10-25 16:19:11 +02:00
Dan Williams
90e67404d6 bearer-qmi: get and log current IP settings when connecting the bearer
All addresses are given as machine byte order, and thus must be converted
to network byte order (BE) before passing to inet_ntop().
2012-10-23 18:20:24 +02:00
Aleksander Morgado
29e3c0e742 bearer: fix connection allowance rules in 3GPP+LTE modems
Only force disconnection of the bearer if not registered in any network or if
registered in both 3GPP and CDMA roaming networks.
2012-10-22 19:09:08 +02:00
Aleksander Morgado
82f91f3217 iface-modem: when playing with bands is not supported, use 'unknown' 2012-10-22 19:06:49 +02:00
Aleksander Morgado
219aff47e0 iface-modem: try to avoid showing 'any' as current bands
Just expose the list of supported bands when the current bands is set to 'any'.
2012-10-22 19:06:49 +02:00
Aleksander Morgado
b317996a8e iface-modem: always ensure that current bands is a subset of supported bands
In QMI modems the logic behind supported and current bands is completely
separated in different services (DMS vs NAS). Actually, the list reported by NAS
as current band preferences seems to include more values than the ones reported
by DMS as supported bands (e.g. CDMA bands are reported even if the firmware
image is GSM/HSPA only).

So, just clean up the list of current preferred bands so that no more than those
given as supported is used.
2012-10-22 19:06:49 +02:00
Aleksander Morgado
5978258d85 base-modem-at: handle NULL responses from the serial parsing in sequences 2012-10-22 12:33:19 +02:00