Commit Graph

5790 Commits

Author SHA1 Message Date
Aleksander Morgado
8c39f2c551 sierra: implement PIN/PUK retry count loading
Not all Sierra modems support it, but those which do reply like this:

    AT+CPINC=?
    OK

    AT+CPINC?
    +CPINC: 3,3,10,10
2013-04-04 19:26:51 +02:00
Aleksander Morgado
464f33f77f sierra: early detect non-AT ports
Detect the parser filter errors during our custom_init(), and set the port as
not being AT if the error found.
2013-04-04 19:26:51 +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
Aleksander Morgado
4ea827a3a1 sierra: too many timeout errors during custom init means non-AT port
Reduces probing time of the modem in ~10s.
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
e60ad8d8dc mbm: ignore *ESTKSMS unsolicited messages
https://bugzilla.gnome.org/show_bug.cgi?id=697280
2013-04-04 18:32:55 +02:00
Aleksander Morgado
d2b4ab9d9c sierra: 'data' may be NULL if the parent dialling fails 2013-04-04 17:22:45 +02:00
Aleksander Morgado
a62624aa22 sierra: plug memleak 2013-04-04 17:18:23 +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
Aleksander Morgado
0d20a7c85a altair-lte: minor style changes 2013-04-04 09:48:54 +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
Dan Williams
b67a3948b5 qcdm: fix IM*I buffer sizes for GSM and WCDMA state info requests
Found by Enrico Murador.
2013-04-02 12:10:54 -05:00
Aleksander Morgado
9ffb424ed4 pantech: skip WMC ports
WMC ports will return "ERROR" to all AT commands, except for "AT" itself. So
just provide a custom AT probing logic, which uses "ATE0" instead, and assumes
the port is not an AT port if an error is returned.
2013-04-02 17:41:54 +02: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
bb4f4f4e9e pantech: fully skip the SIM storage in the messaging interface
Seems that trying to use the SIM storage hangs a UMW190  modem, so just fully
ignore it for now.

https://bugzilla.gnome.org/show_bug.cgi?id=696724
2013-04-02 09:53:46 +02:00
Aleksander Morgado
a066cc84cf mbm: fix udev rule tagging logic 2013-04-01 17:53:13 +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
David Castellanos
2896e711ae x22x: Fix problem in set allowed mode
NM attempts to set allowed and preferred mode during the connection
process. The plugin x220x does not handle properly when NM request
allowed mode to '2g, 3g' and the preferred mode to 'none'.

This commit attempts to solve the problem described above. When this
situation happens, establish the mode of the modem has 'ANY' (which
seems the safest one) instead of just throwing an error.

Signed-off-by: David Castellanos <dcastellanos@indra.es>
2013-04-01 16:03:39 +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
5ffad1f51f mbm: don't tag only tty ports, and also grab cdc-wdm ports
We also need to tag cdc-wdm ports, so that they get grabbed but ignored and
not QMI-probed.

https://bugzilla.gnome.org/show_bug.cgi?id=696701
2013-04-01 14:02:51 +02:00
Aleksander Morgado
b9b5ca39df mbm: wait for unlock reporting READY after PIN/PUK unlock
MBM modems will lie about the unlock status just after having sent a
correct PIN or PUK. So, explicitly wait to get in READY state after having
sent the PIN or PUK, before keeping on.

https://bugzilla.gnome.org/show_bug.cgi?id=696702
2013-03-29 20:17:59 +01:00
Dan Williams
477623f0a0 broadband-modem-novatel: implement CDMA time API (bgo #696739)
Use AT$NWLTIME to get current time and UTC offset.
2013-03-29 08:49:47 -05: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
Aleksander Morgado
effd574a63 option: don't apply both vendor and product filters at the same time
The probing logic expects either one or the other right now. In this case, it is
just simpler to include the Nozomi-related VID in the vendor filter, and remove
the product filter.
2013-03-28 20:06:53 +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
e33fc37ec2 option: ignore PH_SIM facility lock in 'nozomi' based modems
https://bugzilla.gnome.org/show_bug.cgi?id=696593
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
Dan Williams
fea5b7a670 broadband-modem-icera: make CME 3 errors fail power-up (bgo #696742)
+CME ERROR: 3 (Not Allowed) means airplane mode, at least for the
Samsung Yxxxx devices that I've got.  And if we get this error
on any other devices, chances are they'll fail to power up too.
2013-03-28 12:35:32 -05: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
Aleksander Morgado
b76dc134bf novatel: try to flip secondary ports to AT as soon as possible
So do it during port probing. If we send this command early enough in the
first AT port being probed, it should flip the secondary ports to AT mode
before their port probing is finished.

https://bugzilla.gnome.org/show_bug.cgi?id=696696
2013-03-28 17:05:48 +01:00
Dan Williams
ca97f0e79f broadband-modem-sierra: fix trivial copy & paste error 2013-03-27 18:02:50 -05: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
Dan Williams
95b46c16f1 broadband-modem-sierra: add after-sim-unlock delay
Older devices may crash if asked to connect right after sending the
PIN and unlocking the SIM; they simply stop responding to AT commands
around the first request for access technology and then reboot.  A
delay seems prevents this behavior.

Since it's not uncommon to require a delay after SIM unlock, add one
for newer sierra_net devices as well, even though we're not quite
sure if they need one or not.  It doesn't hurt, at least.
2013-03-25 15:49:08 -05:00
Dan Williams
8ebce66f96 sierra: fix time check warnings for modems that don't support time
'result' may be NULL even if no error is set.  Errors aren't set
because we want to continue the !TIME/!SYSTIME sequence regardless
of errors, so we can figure out which command the modem supports.

Trying to get a uint32 out of a NULL GVariant makes glib complain,
and it's wrong, so don't do that.
2013-03-25 15:08:31 -05:00