Commit Graph

2375 Commits

Author SHA1 Message Date
Aleksander Morgado
d3831fc641 serial greylist: tag device from Netchip Technology 2013-04-16 14:42:28 +02:00
Aleksander Morgado
7244167761 serial greylist: fix udev tag name for Arduino devices 2013-04-16 14:42:21 +02:00
Aleksander Morgado
3c1e77d789 sim: fix signal emission
Signal should be emitted by the SIM object, not by the Modem object.
2013-04-11 19:21:56 +02:00
Aleksander Morgado
31215aba32 modem-helpers-qmi: explicitly add LTE as current cap if modem caps report it
For loading current capabilities we use a mix of "Technology Preference" (TP),
"System Selection Preference" (SSP) and DMS-reported capabilities. But, as we
also use TP and SSP for allowed modes, it may be the case that we end up
leaving 4G out of the allowed modes, which afterwards will make the modem not
report LTE as current capabilitiy, as TP/SSP don't include LTE.

So, just assume LTE is a current capability if DMS-reported capabilities include
it. We can really do this because LTE is the only 4G technology, the same logic
wouldn't apply correctly for 2G or 3G (due to having different techs for 3GPP
and 3GPP2).
2013-04-11 09:17:13 +02:00
Aleksander Morgado
162d96b116 test-modem-helpers-qmi: new unit tests to check the 'current-capabilities' logic
Based on Dan's tests with QMI modems.
2013-04-11 09:17:13 +02:00
Ben Chan
be8c8a99bb device: handle NULL returned by g_udev_device_get_driver() gracefully
This patch fixes a crash in mm_device_grab_port() when doing a string
comparison on a NULL returned by g_udev_device_get_driver().

Thread 0 *CRASHED* ( SIGSEGV @ 0x00000000 )

0x76b760b4   [libc-2.15.so]               - strcmp.c:38                      strcmp
0x76c66a7d   [libglib-2.0.so.0.3200.4]    - ghash.c:1704                     g_str_equal
0x76ee0e5d   [ModemManager]               - mm-device.c:147                  mm_device_grab_port
0x76edf9d9   [ModemManager]               - mm-manager.c:313                 device_added
0x76e95b2d   [libgudev-1.0.so.0.1.0]      - extras/gudev/gudevmarshal.c:84   g_udev_marshal_VOID__STRING_OBJECT
0x76d1fb2b   [libgobject-2.0.so.0.3200.4] - gclosure.c:777                   g_closure_invoke
0x76d2b88b   [libgobject-2.0.so.0.3200.4] - gsignal.c:3551                   signal_emit_unlocked_R
0x76d313c5   [libgobject-2.0.so.0.3200.4] - gsignal.c:3300                   g_signal_emit_valist
0x76d31569   [libgobject-2.0.so.0.3200.4] - gsignal.c:3356                   g_signal_emit
0x76e93bdd   [libgudev-1.0.so.0.1.0]      - extras/gudev/gudevclient.c:105   monitor_event
0x76c9beb7   [libglib-2.0.so.0.3200.4]    - giounix.c:166                    g_io_unix_dispatch
0x76c714c1   [libglib-2.0.so.0.3200.4]    - gmain.c:2539                     g_main_context_dispatch
0x76c71745   [libglib-2.0.so.0.3200.4]    - gmain.c:3146                     g_main_context_iterate
0x76c71a59   [libglib-2.0.so.0.3200.4]    - gmain.c:3340                     g_main_loop_run
0x76ede8ed   [ModemManager]               - main.c:142                       main
0x76b35f79   [libc-2.15.so]               - libc-start.c:226                 __libc_start_main
0x76edea49   [ModemManager]               + 0x00014a49
0x76eb4eab   [ld-2.15.so]                 + 0x0000aeab
2013-04-10 15:04:36 -05:00
Dan Williams
33a572b9d0 broadband-modem-qmi: ignore invalid signal strengths
Sometimes invalid signal strengths will be returned by the modem,
which we should ignore.  Otherwise they make the reported signal
quality bounce around from eg 21% -> 100%, or cause access
technology updates for radio interfaces that can't possible have
a usable signal.
2013-04-10 09:55:07 +02:00
Aleksander Morgado
c737c57eb0 broadband-modem-qmi: fix setup of unsolicited registration updates 2013-04-10 09:49:25 +02:00
Franko Fang
d56a87a3bd base-modem: keep AT port as possible data port if flagged as PPP 2013-04-09 18:41:14 +02:00
Aleksander Morgado
4d31315b95 port-probe: fix source_remove() vs signal_handler_disconnect() 2013-04-09 17:20:27 +02:00
Dan Williams
55fdc76a56 blacklist: move Arduino USB/Serial adapter to greylist
It's a generic adapter, should be in the manual-probe-only
greylist instead of the blacklist.
2013-04-08 11:09:46 -05:00
Dan Williams
660d59ab44 blacklist: ignore a few more Arduinos (rh #861620) 2013-04-08 10:54:47 -05:00
Aleksander Morgado
358fe7f906 base-modem: don't assume primary AT port is available
QMI modems may not have it.
2013-04-06 22:47:13 +02:00
Aleksander Morgado
3b6b049e51 serial-parser: detect 'NA' as a mobile equipment error
Just treat 'NA' as MM_MOBILE_EQUIPMENT_ERROR_NOT_ALLOWED error.

https://bugzilla.gnome.org/show_bug.cgi?id=697368
2013-04-05 19:11:24 +02:00
Aleksander Morgado
f9105bff87 api,introspection: update 'Validity' property in the SMS interface
We don't want to support only 'relative' validity, so don't assume that the
Validity property will always be a uint32 value.

Instead, we define the Validity propery as '(uv)' tuple, where the first value
(a MMSmsValidityType) specifies the type of validity, and the second value is
a variant formatted accordingly to what the validity type specifies (e.g. a
uint32 value if the type is MM_SMS_VALIDITY_TYPE_RELATIVE).
2013-04-05 17:48:51 +02:00
Aleksander Morgado
086557e5d5 iface-modem-simple: log about all parameters passed to Simple.Connect() 2013-04-05 10:27:43 +02:00
Aleksander Morgado
1cb5831af3 iface-modem: ensure we cancel the re-initialization idle if the modem goes away
https://bugzilla.gnome.org/show_bug.cgi?id=697290
2013-04-05 08:54:09 +02:00
Ben Chan
76ecc1301a broadband-bearer: handle NULL and character escaping of APN value 2013-04-05 08:10:26 +02:00
Aleksander Morgado
5554658cd2 port-probe: remove non-AT port hint, as it may come in ATI replies
We remove "/SRC/AMSS" as a hint of non-AT port, as it really comes in ATI
replies, see:

  [mm-at-serial-port.c:408] debug_log(): (ttyUSB6): <-- '<CR><LF>Manufacturer: Sierra Wireless, Incorporated<CR><LF>Model: USB 306<CR><LF>Revision: M3_0_10_1AP C:/WS/FW/M3_0_10_1AP/MDM8200/SRC/AMSS 2010/03/29 17:52:11<CR><LF>IMEI: xxxxxxxx<CR><LF>IMEI SV: 11<CR><LF>FSN: xxxxxxxxxx<CR><LF>3GPP Release 7<CR><LF>+GCAP: +CGSM,+DS,+ES<CR><LF><CR><LF><CR><LF>OK<CR><LF>'
  [mm-serial-parsers.c:188] mm_serial_parser_v1_parse(): Got response filtered in serial port: Not an AT response
  [mm-port-probe.c:148] mm_port_probe_set_result_at(): (tty/ttyUSB6) port is not AT-capable
2013-04-04 19:27:05 +02:00
Aleksander Morgado
069a17afd3 port-probe: remove no longer needed filter
Remove the additional check for AT responses done *after* having parsed the
response. This check only worked whenever the response string ended up matching
one of the regular expressions in the parser, which of course wasn't always.
2013-04-04 19:26:51 +02:00
Aleksander Morgado
f24fc68e04 port-probe: add a new serial parser filter to detect non-AT strings
We will check each string with our custom filter before even trying to
parse them. A MM_SERIAL_ERROR_PARSE_FAILED error will be issued whenever the
string doesn't match the filter.
2013-04-04 19:26:51 +02:00
Aleksander Morgado
4e4d139e30 serial-parsers: allow specifying a custom response filter
The serial parser will now allow specifying a custom user-provided filter, which
is applied before even trying to match successful/error responses. This filter
provides a very early barrier to detect strings that are clearly not going to
match.

E.g. this filter may be used during port probing to early detect non-AT ports.
2013-04-04 19:26:51 +02:00
Aleksander Morgado
38b120c861 port-probe: don't assume the NULL bytes will be at the beginning of the response
Also report as non-AT responses if the NUL bytes are embedded within a stream
of bytes which doesn't start with NUL. This e.g. applies to CnS ports from
Sierra modems, which show streams like:

~\0\245y\0}^T1_0_4_0BT R372 CNSZXD00000061 2011/05/12 15:25:25\0\0\0\0\0\0\0\0\0
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0T1_0_4_0AP R372 CNSZXD00000061 2011/05
/12 15:25:25\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
03\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0~~
\0Tb\0T1_0_4_0AP R372 CNSZXD
2013-04-04 19:26:51 +02:00
Ben Chan
2c3e2bd457 serial,blacklist: fix file mode (0755 -> 0644) 2013-04-04 19:04:22 +02:00
Aleksander Morgado
bc41dd40cd broadband-bearer: ensure we close the port even if we got cancelled
When there is an error in the connection attempt we need to close the dialling
port ourselves. In the case where we got an error and we also got cancelled,
we need to make sure that the port gets closed.
2013-04-04 16:59:19 +02:00
ori inbar
84e68cd4cd altair-lte: initial altair lte plugin 2013-04-04 09:39:37 +02:00
Aleksander Morgado
585b51f922 broadband-modem: remove incorrect debug log 2013-04-03 09:07:55 +02:00
Dan Williams
53b033c727 broadband-modem: turn off CNMI <ds> reporting if modem doesn't support it
MM doesn't yet parse the +CNMI=? response and dynamically figure out
what indication settings are supported, so add another last-resort
CNMI setting for the UMW190 which doesn't support any <ds> at all.

And the commands shouldn't be cached, so fix that too.
2013-04-02 12:17:40 -05:00
Aleksander Morgado
678f596ff9 qcdm-serial-port: avoid playing with GByteArray internals
Since glib 2.32, we can use g_byte_array_new_take() to build a new GByteArray
from an own allocated buffer, so skip playing with the GByteArray internals.
2013-04-02 17:04:01 +02:00
Aleksander Morgado
fc219be4d4 sms-part: properly skip validity field when given in absolute or enhanced format
We don't support absolute or enhanced format for validity, but we still need to
properly skip those fields if given.

According to GSM 03.40, they are both always 7 bytes, not just 1.
2013-04-02 16:14:49 +02:00
Aleksander Morgado
c1e70924d8 broadband-modem: update CMGL parsing logic
Pantech UMW190 modem uses a custom +CMGL response which includes only
three fields before the actual PDU, e.g:

  +CMGL: <index>,<status>,<something>\r\n<PDU>

instead of what we had before:

  +CMGL: <index>,<status>,<alpha>,<length>\r\n<PDU>

The CMGL parsing logic is now updated to use a regex to match the reply, and
also considering the UMW190 specific case.

Actually, we end up reading only the two first fields (index and status) which
are the ones we really need, so we skip the <length> and the <alpha> if given.

Added also unit tests to cover all these known cases.

Partially fixes https://bugzilla.gnome.org/show_bug.cgi?id=696723 (missing the
actual PDU parsing fixes).
2013-04-02 09:53:46 +02:00
Aleksander Morgado
4fe5b3e42c serial-usb greylist: added new USB<->Serial adapters
https://bugzilla.gnome.org/show_bug.cgi?id=643793
2013-04-01 16:38:29 +02:00
Aleksander Morgado
c9b7761ed5 base-modem: don't assume all cdc-wdm ports are QMI 2013-04-01 14:12:54 +02:00
Aleksander Morgado
a7b8cbb71d port-probe: don't reschedule next probing step when serial port buffer full
When the serial port buffer gets full of non-AT garbage during port probing,
we were re-scheduling the next probing step, which is completely wrong, as we
then would be processing the same probing task twice. If we get a buffer full,
just cancel the AT probing cancellable, which would cancel not only the possible
AT probings, but also the custom init if there is any.

Also, make sure that the custom_init() of the plugins out there don't return an
error if the GCancellable is cancelled. Cancelling the GCancellable means we
should just stop the custom_init(), and actually sending an error in
custom_init() means that the port should be set as unsupported by the plugin, so
completely different things.

Should fix https://bugzilla.gnome.org/show_bug.cgi?id=696695
2013-03-29 12:33:20 +01:00
Aleksander Morgado
1e71647927 broadband-modem: plugins may disable parent's access tech loading 2013-03-28 20:48:42 +01:00
ori inbar
633708b364 serial: add support to optionally send line-feed at the end of AT commands. 2013-03-28 20:15:58 +01:00
ori inbar
98772f2ec9 iface-modem-3gpp: handle access technology change in operator_loading state
This patch fixes a problem of disregarding CEREG/CGREG/CREG reported
access technology since we are in "registering" state - meaning we are
loading operator name+code. now even in this transition state the ACT
is updated.
2013-03-28 20:13:20 +01:00
Dan Williams
2bbe2f8327 device: read PCI VID/PID
Nozomi devices are old Option NV CardBus devices with the ttys (nozX)
hanging directly off the PCI device.  We need to read the vendor and
product IDs off them too.  It appears that udev screws up the ID_MODEL_ID
field (at least on F17, its set to the device path and not the PCI ID)
so just skip looking at the TTY itself and read the PCI parent, where
we're 100% sure to find the PCI IDs we want.
2013-03-28 20:06:53 +01:00
Aleksander Morgado
d9cf4fe91c iface-modem-3gpp: let plugins ignore facility locks
Plugins may decide which facility locks can be completely skipped from the list
being checked.
2013-03-28 20:06:53 +01:00
Aleksander Morgado
d6ac6508d9 plugin: explicitly request QMI probing
Plugins which may support QMI ports need to explicitly request QMI probing
in cdc-wdm devices. This should also avoid probing cdc-wdm ports when we know
that the plugin doesn't support them (e.g. with Ericsson MBM devices).

https://bugzilla.gnome.org/show_bug.cgi?id=696701
2013-03-28 17:33:08 +01:00
Dan Williams
190eb73bf9 broadband-modem: prefer specific access tech checks over generic +CGREG access tech (bgo #696705)
If the modem has specific access technology checks, don't override them
with the generic access technology from +CGREG responses, since that
doesn't have the granularity that specific checks do.  For example, the
+CGREG response only indicates UMTS, and cannot indicate HSDPA, HSUPA,
HSPA, HSPA+, DC-HSPA, etc.
2013-03-27 15:02:40 -05:00
Dan Williams
9119962e12 broadband-modem: remove debugging code
Slipped in while debugging Nozomi stuff; not caught in review.
2013-03-27 08:31:18 -05:00
Aleksander Morgado
b377a62377 iface-modem: never try to create a SIM in a CDMA-only modem
CDMA modems without LTE capabilities will usually not have a SIM, so just skip
loading a SIM object if so.

https://bugzilla.gnome.org/show_bug.cgi?id=696582
2013-03-27 08:27:30 -05:00
Dan Williams
7f1bea5fbf broadband-modem-qmi: zero-pad ESN to 8 characters
It's very likely to already be 8 characters, but if by some
chance it's 7, zero-pad like we do for AT+GSN responses in
the generic CDMA code.
2013-03-27 08:25:13 -05:00
Dan Williams
3b3326bdf0 broadband-modem: parse +GSN response for IMEI, MEID, and ESN (bgo #696596)
+GSN response differs widely between modems.  Some prefix the
MEID and/or ESN with 0x, some have leading zeros, some return the
MEID and the ESN, and some append the serial number to the end of
the IMEI.  Handle that and make the ESN, MEID, IMEI, and
EquipmentIdentifier parsing consistent.
2013-03-27 08:23:52 -05:00
Aleksander Morgado
f299a05571 sms-part: use correct printf modifier for gsize
This is the port to git master of the following commit:

    commit 294a91d9f6390d532399be35ddbf6a2b8d136576
    Author: Thomas Bechtold <thomasbechtold@jpberlin.de>
    Date:   Mon Mar 25 14:28:03 2013 +0100

        sms-utils: use correct printf modifier for gsize
2013-03-26 12:34:52 +01:00
Dan Williams
fcbaa43555 broadband-modem: minimally verify QCDM MDN before using it
Sometimes it's garbage, and we don't like garbage.
2013-03-25 16:18:28 -05:00
Aleksander Morgado
14bb687b94 iface-modem-cdma: fix use of uninitialized variable 2013-03-22 08:17:48 +01:00
Aleksander Morgado
3b66047d94 broadband-modem-qmi: implement automatic CDMA activation 2013-03-22 08:12:59 +01:00
Aleksander Morgado
6252df0bef broadband-modem-qmi: new generic power cycle action 2013-03-22 08:12:59 +01:00