Commit Graph

2375 Commits

Author SHA1 Message Date
Aleksander Morgado
e0f3716d26 modem-helpers: don't return any result if an error happens when parsing CPMS=?
We shouldn't rely on the caller to cleanup intermediate results when returning
an error.
2014-06-27 09:20:40 +02:00
Aleksander Morgado
4406b1e6ec modem-helpers: improve +CMTI indication regex
Allow whitespaces added in several places, like between the comma and the index,
which is what the Cinterion PHS8 does:
  <CR><LF>+CMTI: "MT", 5<CR><LF>
2014-06-25 17:40:06 +02:00
Aleksander Morgado
08ecc14722 base-modem: quicker find matching cdc-wdm QMI or MBIM ports 2014-06-23 18:12:27 +02:00
Aleksander Morgado
7c347aa3ec port: store parent sysfs path in each MMPort 2014-06-23 18:12:27 +02:00
Prathmesh Prabhu
9e93e22482 bearer-mbim: fix disconnect error handling case split
The first case, with no error, needs to check that there was no original error.
Currently, if an error occurs and the resulting NwError is parsed correctly, the
case split treats it as a no-error case.
2014-06-20 12:54:39 -05:00
Prathmesh Prabhu
699a25b802 modem-helpers-mbim: map more MbimNwError to MMMobileEquipmentError
Commit 55e40ea b1ae81a in libmbim ("libmbim-glib: add additional GMM
cause codes to MbimNwError") added one more GMM cause code to
MbimNwError. This patch maps that to MMMobileEquipmentError.

This patch requires libmbim >= 1.9.0
2014-06-19 18:05:48 +02:00
Prathmesh Prabhu
6491d82655 bearer-mbim: disconnect attempt should succeed if bearer is already disconnected
When trying to disconnect bearer, if the modem responds with
MBIM_STATUS_ERROR_CONTEXT_NOT_ACTIVATED, take it to mean that the bearer has
already been disconnected.
2014-06-18 10:05:39 -05:00
Aleksander Morgado
ed623f6628 iface-modem-messaging: don't skip MT storage when reading if it's the only one 2014-06-16 18:03:38 +02:00
Dan Williams
ca0a567f74 broadband-bearer-qmi: support IPv6 configuration and use static for IPv4 2014-06-13 11:30:49 -05:00
Dan Williams
7673a1d3a3 bearer-mbim: use DHCP method when only an IPv6 link-local address is found
When only given a link-local address, then SLAAC must be used to
retrieve the real prefix.
2014-06-13 11:30:49 -05:00
Dan Williams
e68d51f439 broadband-bearer: also return IPv6 config if IPv6 context is used
If the subclass doesn't override IP config retrieval, and IPv6 was
used when connecting the bearer, return IPv6 config too.
2014-06-13 11:30:49 -05:00
Dan Williams
e9395d83e3 broadband-bearer: pass the IP family to subclasses when getting IP config
Subclasses may need to know which IP families were used for the setup
so they can return the correct IP configuration.  We can't just use
the MMBearer default_ip_family becuase that isn't the family that
was actually used during the connection.
2014-06-13 11:30:49 -05:00
Ben Chan
235fb874c9 modem-helpers-mbim: map more MbimNwError to MMMobileEquipmentError
Commit b1ae81a in libmim ("libmbim-glib: add additional GMM cause codes
to MbimNwError") added additional GMM cause codes to MbimNwError. This
patch maps some of those MbimNwError to MMMobileEquipmentError.

This patch requires libmbim >= 1.9.0
2014-06-10 10:18:28 +02:00
Thieu Le
0b975f2266 altair-lte: update PCO to handle latest VZW deployment
Update PCO handling code such that it conforms to the latest VZW network
behavior. This includes updating the way we mark a SIM as provisioned.
In the old network, only provisioned SIMs can attach to the network.
Now, unprovisioned SIMs can attach and connect to the network.

Change-Id: Ie454f6fb6d8764161f167e93a4235bb93fbde59a
2014-06-09 16:55:12 +02:00
Ben Chan
af810a0a87 bearer-mbim: pass the right GError pointer to response parsers 2014-06-09 12:28:19 +02:00
Dan Williams
aedcb376a8 iface-modem: make "signal quality updated" log message debug not info
Otherwise your logs fill up if the signal quality changes, which is
pretty frequently for many devices.
2014-06-04 14:11:16 -05:00
Yegor Yefremov
dcb627a61f trivial: resolve maybe-uninitialized warnings
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2014-06-04 14:11:16 -05:00
Ben Chan
7c389511d8 tests: fix more memory leaks 2014-06-03 10:51:51 +02:00
Aleksander Morgado
c9dc702eaa plugin-manager: fix defer-until-suggested probing tasks
If a task is marked as defer-until-suggested (e.g. a wwan port) and there was
already a 'best' plugin set in the parent device, use it to complete the
deferred task.

This may happen in e.g. MBIM devices if the WWAN port arrives later than the
already probed /dev/cdc-wdm character device.
2014-06-02 17:41:49 +02:00
Bjørn Mork
239ab6ca6b blacklist: ignore Infineon flashloader device
A device like this shows up briefly while the Sierra EM7345 is booting:

P:  Vendor=8087 ProdID=0716 Rev= 0.00
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=(none)
E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

We do have a driver identifying this as an "Infineon Flashloader"
device.  It is not a modem in any case, and should be ignored.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2014-06-02 16:42:25 +02:00
Ben Chan
4213d2fe69 broadband-modem: report an error when enabling a modem in FAILED state
If the initialization of the Modem3gpp / ModemCdma interface fails, the
modem transitions to the FAILED state. But since the Modem interface is
already initialized and exported over DBus, it is possible to invoke the
Enable method on the Modem interface. This patch changes
MMBroadbandModem to report an error if one tries to enable the modem in
the FAILED state instead of raising an assertion.
2014-06-02 08:55:08 +02:00
Ben Chan
6e7bae9dc5 tests: fix memory leaks
This patch fixes memory leaks in unit tests detected by LeakSanitizer.
2014-05-30 13:31:41 +02:00
Ben Chan
8cdf45c66c core: add E-UTRAN operating band 44
E-UTRAN operating band 44 is specified in 3GPP release 11 (see Table
5.5-1 "E-UTRA operating bands" in 3GPP TS 36.101 version 11.2.0 Release
11).
2014-05-29 10:06:24 +02:00
Ben Chan
c8ad177db9 sms: remove unnecessary MM_BASE_MODEM() casts 2014-05-21 11:59:11 +02:00
Ben Chan
d375224ffe broadband-bearer: remove unnecessary MM_BASE_MODEM() casts 2014-05-21 11:58:32 +02:00
Ben Chan
37b0402ee5 core: minor coding style fixes 2014-05-20 09:32:29 +02:00
Ben Chan
adcda0a544 broadband-modem-mbim: refine access technology updates
This patch refines the access technology updates on a MBIM modem by
observing the MBIM_CID_PACKET_SERVICE notifications in addition to the
MBIM_CID_REGISTER_STATE notifications. If a MBIM_CID_PACKET_SERVICE
notification indicates the highest available data class, the current
access technology is updated to reflect that. Otherwise, the access
technology is updated according to the available data classes indicated
by a MBIM_CID_REGISTER_STATE notification.
2014-05-19 12:47:16 +02:00
Dan Williams
8e3b67bf44 broadband-bearer-qmi: don't set APN if it isn't given
If the APN was empty (implying that the modem/network should choose
the default APN) this caused an assertion in libqmi.  Just don't
set an APN if we aren't given one.
2014-05-07 16:18:11 -05:00
Ben Chan
79b34b77b4 port-probe: remove the 3s wait before opening a MBIM port
The 3s wait before opening a MBIM port is not necessary for handling a
delayed response to the MBIM OPEN messages. mbim_device_open() already
retries the MBIM OPEN message when the MBIM device does not respond.
2014-04-03 09:34:16 +02:00
David (Pololu)
09d92ef333 blacklist: All devices from Pololu Corporation except some possible future products.
We make many USB virtual COM port devices, none of which are modems.
ModemManager's automatic attempts to access those devices can cause
problems.

That might change in the future, so we have left two potential
future product IDs off of the blacklist.
2014-04-02 08:54:17 +02:00
Ben Chan
a0ddcaa7a4 bearer-mbim: update MTU in bearer IP config properties
This patch modifies MMBearerMbim to update the MTU value in the bearer
IPv4 and IPv6 config property when such information is available in the
MBIM_CID_IP_CONFIGURATION response.
2014-03-25 17:10:22 +01:00
Ben Chan
4de728447a bearer-mbim: fix a misleading comment 2014-03-25 12:13:54 +01:00
Aleksander Morgado
e9cae166cc blacklist: ignore empiriKit science lab controller device 2014-03-24 16:24:48 +01:00
Ben Chan
4827933f0c port-serial: fix command context completion when clearing command queue
This patch removes an extra invocation of g_simple_async_result_complete
on the result associated with each command context in the command queue
when mm_port_serial_close clears the queue. It also changes the code to
complete the results in idle, which avoids a nested invocation of
mm_port_serial_close. That could happen if the completion of the result
calls mm_port_serial_close again (e.g. via at_command_context_free,
at_sequence_context_free in mm-base-modem-at.c). The nested invocation
of mm_port_serial_close could create undesirable effects (e.g. the
assertion on open_count > 0 fails in case of a forced close).
2014-03-18 15:11:36 +01:00
Ben Chan
31a19c2299 broadband-modem,modem-helpers: improve +CGDCONT? error handling
This patch fixes the following crash, which happens when
MMBroadbandBearer tries to parse the NULL response of a failed +CGDCONT?
query. It also fixes a leak in parse_pdp_list where it fails to free the
GError object return by mm_3gpp_parse_cgdcont_read_response.

Thread 0 *CRASHED* ( SIGSEGV @ 0x00000000 )

0x7feb15564c11   [ModemManager]            - mm-modem-helpers.c:850      mm_3gpp_parse_cgdcont_read_response
0x7feb15518e51   [ModemManager]            - mm-broadband-bearer.c:927   parse_pdp_list
0x7feb1551ada2   [ModemManager]            - mm-base-modem-at.c:189      at_sequence_parse_response
0x7feb151d4b86   [libgio-2.0.so.0.3400.3]  - gsimpleasyncresult.c:775    g_simple_async_result_complete
0x7feb1556e223   [ModemManager]            - mm-port-serial-at.c:355     serial_command_ready
0x7feb151d4b86   [libgio-2.0.so.0.3400.3]  - gsimpleasyncresult.c:775    g_simple_async_result_complete
0x7feb1556a834   [ModemManager]            - mm-port-serial.c:141        command_context_complete_and_free
0x7feb1556bc26   [ModemManager]            - mm-port-serial.c:734        port_serial_got_response
0x7feb1556c51a   [ModemManager]            - mm-port-serial.c:758        port_serial_timed_out
0x7feb1508cc33   [libglib-2.0.so.0.3400.3] - gmain.c:4026                g_timeout_dispatch
0x7feb1508c087   [libglib-2.0.so.0.3400.3] - gmain.c:2715                g_main_context_dispatch
0x7feb1508c437   [libglib-2.0.so.0.3400.3] - gmain.c:3290                g_main_context_iterate
0x7feb1508c891   [libglib-2.0.so.0.3400.3] - gmain.c:3484                g_main_loop_run
0x7feb1550ad16   [ModemManager]            - main.c:154                  main
0x7feb14a9e9c6   [libc-2.15.so]            - libc-start.c:234            __libc_start_main
0x7feb1550a808   [ModemManager             + 0x00023808
2014-03-14 08:31:32 +01:00
Ben Chan
f14a2ea14e broadband-modem-mbim: handle subscriber info updates
Subscriber information like MSISDNs / MDNs may not be readily available
when MMIfaceModem queries for it during modem initialization.

This patch modifies MMBroadbandModemMbim to subscribe to the
MBIM_CID_SUBSCRIBER_READY_STATUS notification and update the
'OwnNumbers' property of the Modem interface when the information
becomes available.
2014-03-06 14:32:29 +01:00
Ben Chan
a7da3fc387 broadband-modem-mbim: update to use mbim_message_device_service_subscribe_list
libmbim renames 'MBIM_CID_DEVICE_SERVICE_SUBSCRIBER_LIST' to
'MBIM_CID_DEVICE_SERVICE_SUBSCRIBE_LIST' to be consistent with the MBIM
specification. This patch updates MMBroadbandModemMbim accordingly.
2014-03-06 14:31:29 +01:00
Ben Chan
70fb7c2ede broadband-modem: fix hdr_subsys_state_info_ready
hdr_subsys_state_info_ready() did not implement the GAsyncReadyCallback
function signature, which led to a crash. This patch fixes
hdr_subsys_state_info_ready() to properly extract the QCDM response from
the GAsyncResult object.
2014-03-06 09:04:17 +01:00
Ben Chan
4a5a0197b5 port-mbim: increase timeout of device open operation
A MBIM device typically delays its response to an 'Open' command when it
has not completed the initialization process. This patch increases the
timeout of the MBIM device open operation from 10s to 30s to handle
situations where the device takes much longer to initialize.
2014-03-04 19:27:19 +01:00
Ben Chan
f20724ec3f iface-modem: allow setting power state to OFF when modem is in FAILED state 2014-03-03 11:18:23 +01:00
Aleksander Morgado
65eda92ceb broadband-modem: allow querying current charset
So that plugins can use it.
2014-02-28 16:35:18 +01:00
Aleksander Morgado
8a47dce5fb iface-modem-3gpp: request access tech update after registration attempt 2014-02-28 16:35:18 +01:00
Aleksander Morgado
73dad3d899 iface-modem: allow requesting the refresh of the access tech
For periodic updates, we may want to request an explicit re-check at some point,
instead of waiting for the next scheduled update.
2014-02-28 16:35:18 +01:00
Ben Chan
5d88c2ff8f broadband-modem-mbim: handle if unlock retries info is not available
By setting the 'RemainingAttempts' field of a MBIM_CID_PIN response to
0xffffffff, a MBIM modem indicates that it does not support the
information on the number of remaining attempts for pin-related
operations. This patch modifies MMBroadbandModemMbim to handle this case
properly, instead of reporting a very large unlock retries count.
2014-02-27 09:38:37 +01:00
Aleksander Morgado
accb611e1f base-modem: if no AT primary given, try to use data port
The Cinterion PHS8 reports a single AT port to be used as data port, and no
other port as primary. In this case, recover the tty as primary AT port, instead
of failing with an error.
2014-02-26 11:52:50 +01:00
Aleksander Morgado
00a924617c broadband-modem-qmi: implement full power off
The power off command will transition the device to the OFFLINE state. After
this, the modem will not be able to go online again unless it is power-cycled,
either externally (cut power and re-establish power) or through another
transition to QMI_DMES_OPERATING_MODE_RESET (which ModemManager will not
implement for this case).
2014-02-20 11:15:03 +01:00
Aleksander Morgado
9239fbcd7a iface-modem: allow transitioning to the OFF power state
There are systems in which the modem power source can be controlled externally,
e.g. to switch it on or off. In these cases, it is sometimes advisable to be
able to tell the modem to cleanly shut off completely before the power is cut.
So, allow transitioning to the OFF power state if the modem supports it, even if
afterwards the modem could be completely unreachable.
2014-02-20 11:15:03 +01:00
Ben Chan
705dd0133d broadband-modem-mbim: handle network initiated disconnect
Observing registration updates via the MBIM_CID_REGISTER_STATE
notification alone is not always sufficient to detect if the modem is
disconnected from the network. In case of a network-initiated
disconnect, it is possible that the modem is disconnected from the
network but remains registered.

This patch modifies MMBroadbandModemMbim to subscribe to the
MBIM_CID_CONNECT notification. Upon receiving a notification of a
deactivated session ID, the corresponding bearer is reported as
disconnected.
2014-02-20 10:27:03 +01:00
Ben Chan
1866aad9d3 bearer: remove unnecessary MM_BEARER() casts 2014-02-20 10:23:36 +01:00
Dan Williams
acc7b4b8b9 Revert "broadband-modem-mbim: update to use mbim_message_device_service_subscribe_list"
This reverts commit 8327db70b9.

libmbim change not committed yet...
2014-02-19 18:59:24 -06:00