Commit Graph

8750 Commits

Author SHA1 Message Date
Martin Hundebøll b73a681972 atmodem: sms: don't request URC buffering for Quectel UC15 modems
Add a vendor quirk to avoid an error being returned when setting up sms
notification for Quectel UC15 modems.
2019-09-04 07:23:46 -05:00
Richard Röjfors 2d868fac1f ublox: gprs: React on context deactivation
In case a context get deactivated when a AT+CGACT=0 is
not issued, indicate that to gprs core.
This can happen if the device has an auto activated
LTE context and modem switches over to for instance UTRAN.
2019-09-02 16:39:02 -05:00
Martin Hundebøll 62e8e3c1e2 quectel: swap cmuxed ports
According to the manual, when using CMUX on the UC15, it outputs
unsolicited indications on port 2 (i.e. /dev/gsmtty2), so the quectel
plugin must use this when registering for such.
2019-09-02 16:25:43 -05:00
Richard Röjfors 06de0c3067 gprs: Remove prior attaching state logic
Commit 1fd419e5b4 and
0167c3339c introduced logic that
treated ofono_gprs_cid_activated as an 'attaching' state.

Since gprs_attached_update now guarantees that we
will not get attached without having a context activated
in LTE, this is not needed anymore. It also potentially
interferes in case the driver was actually attaching.
2019-08-21 13:27:26 -05:00
Richard Röjfors b50ff27d3f gprs: Check for LTE in gprs_attached_update
Since we have a different condition for the attach state
when running on LTE, we should consider it in gprs_attached_update.
Previously it's done in some instances. But for instance if
the driver got detached from GPRS but now running on LTE with a
context up, we would be deattached.
2019-08-21 13:11:11 -05:00
Pavel Machek 30fd4b3e34 atmodem: introduce send_clcc() to reduce code duplication
Reduce code duplication by introducing send_clcc function.
2019-08-19 14:45:16 -05:00
Martin Hundebøll bff7de9552 quectel: convert power event reasons to lower case 2019-08-13 05:48:47 -05:00
Martin Hundebøll cbd8a66e95 doc: convert quectel power event reasons to lower case 2019-08-13 05:48:47 -05:00
Martin Hundebøll 61cca1809a quectel: replace g_at_chat_set_wakeup_command() with g_at_chat_retry()
If the modem isn't powered on, the use of g_at_chat_set_wakeup_command()
makes ofono send out AT strings in an endless loop. Avoid this by using
g_at_chat_retry() in a timer instead.
2019-08-13 02:09:22 -05:00
Martin Hundebøll e69a30f1df gatchat: add g_at_chat_retry()
The current API doesn't support canceling an in-progress command;
instead g_at_chat_cancel() simply removes the callback.

In cases where the modem doesn't respond at all to a command, a chat is
simply stalled without any way to write new commands to the modem.

Support that case by adding a g_at_chat_retry() function to the API. The
function does nothing if the command is not yet in-progress, or if the
command is finished. Otherwise, it resets the bytes-written counter to
re-write the command string.
2019-08-13 02:09:09 -05:00
Richard Röjfors e3d5ac1f16 atmodem: Implement the list_activated_contexts callback
The callback calls cgact and cgdcont to get information
regarding any activate context.
2019-08-13 01:56:53 -05:00
Richard Röjfors 9a1b490e78 gprs: Ignore activated contexts during init, list them later
There is an issue if an context gets auto activated early,
then provisioning might not have run yet for instance,
so a "new" context is created, which might be duplicated
by a provisioning context later.
So ignore the activated contexts until gprs is ready,
then it calls the driver to list active contexts.
2019-08-13 01:41:16 -05:00
Richard Röjfors aea2ce4e18 gprs: Add list_active_contexts
This is useful for instance during startup where early
activated contexts can be listed at a suitable point in time.
2019-08-13 01:41:16 -05:00
Marcel Holtmann e0f62cdb7a atmodem: Remove the pointless #pragma once 2019-08-13 00:54:27 +02:00
Marcel Holtmann 702b2b533b gisi: Fix compiler warnings from -Wpragmas 2019-08-13 00:53:45 +02:00
Richard Röjfors 88ee0123ab gprs: Do not detach when running LTE and GPRS is unavailable.
There are cases where the gprs status might updated to for instance
"unknown" while LTE is the bearer.
In that case we should not set the attach state to FALSE,
since then running LTE the conext activation reflects the attached
state.
2019-08-12 15:45:40 -05:00
Marcel Holtmann f7fca8b662 Release 1.30 2019-08-12 20:54:02 +02:00
Marcel Holtmann 8b46671d5e build: Add missing drivers/atmodem/network-registration.h 2019-08-12 20:14:32 +02:00
Marcel Holtmann a4e7e8788a quectel: Add missing include for sys/socket.h 2019-08-12 20:02:34 +02:00
Marcel Holtmann a4e267cb3a build: Add internal copy of linux/gsmmux.h for older systems 2019-08-12 19:53:40 +02:00
Marcel Holtmann 80b1d6a6ee build: Add internal copy of linux/gpio.h for older systems 2019-08-12 19:46:17 +02:00
Marcel Holtmann 7c3e2728e3 gisi: Fix compiler warnings from -Waddress-of-packed-member 2019-08-12 19:38:06 +02:00
Marcel Holtmann fd69b05542 isimodem: Fix size calculation for address array 2019-08-12 19:36:42 +02:00
Richard Röjfors 5752702cbe gprs: Do not leak CID on failure to assign context 2019-08-07 17:10:17 -05:00
Richard Röjfors d4ced627e0 gprs: Use -1 as netreg status during init.
Previously the valid "unknown" netreg status was set
during startup, but its a bit problematic for gprs.
There might be cases where a LTE context is activated
before netreg is finished updating its status.
Resulting in gprs taking faulty actions.
Instead we set the status to -1 until we are updated
with a known value.
During the time the status is -1, gprs postpones actions until
the status is valid (>= 0).
2019-08-07 16:54:25 -05:00
Richard Röjfors cfac75a332 atmodem: Check for auto activated contexts during init
To detect if a context gets activated before we register
for unsolicited events we need to check if any is
already activated, and flag it auto activated.
2019-07-24 02:11:25 -05:00
Martin Hundebøll 1107d3cbc3 quectel: implement dbus signals for modem power notifications
The Quectel modems issues unsolicited strings in case of power related
events. The UC15 uses +QIND: for the events, while M95 and MC60 uses
descriptive strings. (UC15 also uses a string for normal power down).

Register listeners for these strings/codes. The handler emits an
appropriate dbus signal, and closes down the modem if needed.
2019-07-22 02:40:00 -05:00
Martin Hundebøll b57fff4843 doc: document power-event signals for quectel Hardware API 2019-07-22 02:39:55 -05:00
Martin Hundebøll 133233845e quectel: add dbus hardware interface
For now the interface only exposes the modem supply voltage, but is
added as a preparation for signaling power events.
2019-07-22 02:37:56 -05:00
Martin Hundebøll 311a04a178 doc: add documentaion for Quectel hardware API 2019-07-22 02:37:10 -05:00
Martin Hundebøll 9b681d7a27 quectel: pass vendor id to gprs and gprs-context
The gprs-context does special casing on the quectel serial modem when
probing the supported layer 2 protocols, so pass the vendor id when
setting up the atoms.
2019-07-19 10:34:32 -05:00
Martin Hundebøll d97912f5f1 atmodem: gprs-context: parse list-less CGDATA response
The Quectel M95 and MC60 modems respond to AT+CGDATA=? with a single
+CGDATA="PPP", but the callback in gprs-context expects a list of
protocols.

Avoid falling back to the old-style ATD*99 by not expecting a list of
protocols for serial quectel modems.
2019-07-19 10:34:25 -05:00
Jonas Bonn 2bb87d88ff udevng: detect LARA R2 series 2019-07-19 02:47:29 -05:00
Jonas Bonn 9b1d83eaea ubloxmodem: Add model entries for LARA R2 series 2019-07-19 02:46:57 -05:00
Jonas Bonn a39944a5c0 ublox: use custom netreg atom 2019-07-19 02:45:10 -05:00
Jonas Bonn b4b74f009f ublox: network-registration atom
For uBlox modems, a bit of custom setup is required, but after that the
generic "atmodem" (27.007-compatible) method implementations are
sufficient.  This driver, therefore, just puts the custom probe method
into place and defers remaining functionality to the recently exported
atmodem implementations.
2019-07-19 02:45:05 -05:00
Jonas Bonn 819f89f955 ublox: be explicit about lack of IPv6
The TOBY L4 has no IPv6 support whatsoever.
2019-07-19 01:43:26 -05:00
Jonas Bonn 3a53f140cc ublox: add SMS support 2019-07-19 01:43:23 -05:00
Jonas Bonn 5559874592 ublox: add voicecall support 2019-07-19 01:42:45 -05:00
Jonas Bonn 353b7bc3e9 ublox: create only 1 gprs context
Some uBlox modems support multiple, simultaneously active contexts.  These
contexts are either bridged to the network interface or handled
transparently by the modem acting like a router.

The problem with this approach is that ofono and ofono clients (e.g.
mmsd) expect a dedicated _local_ network interface for each context.

As such, it doesn't make sense for ofono to set up the multiple gprs
contexts.
2019-07-19 01:42:15 -05:00
Jonas Bonn 5b1d6f4e13 ublox: determine gprs-context driver from network interface
Some u-blox devices present a USB network class device for data and some
just switch to PPP on (one of) the communication channel(s).  Whether
the atmodem or ubloxmodem gprs-context driver should be used depends on
whether or not the network interface is present; check this condition
directly when deciding which driver to us.
2019-07-19 01:41:43 -05:00
Jonas Bonn a86d6ffede atmodem: export struct netreg
In order to do inheritance by composition.
2019-07-19 01:38:56 -05:00
Jonas Bonn 3e55559301 atmodem: export generic netreg funcs
An upcoming netreg driver for uBlox modems will need to override the
probe method in order to set itself up, but for further functionality
the "generic" AT implementations are sufficient.  The easiest way to do
this is to just set up a vtable with a custom probe implementation and
defer all other methods to the common/generic methods.

The problem is that the AT methods are not actually exported.  This
generic AT functionality was not intended to be hooked directly into
other drivers.

This patch exports all the methods of the atmodem network-registration
driver implementation so that they can be used as generic/common
implementations for other drivers.
2019-07-19 01:38:52 -05:00
Martin Hundebøll 1c168e8338 test: process-context-settings: print settings to stderr
Prepare the test to print commands to execute and let the caller
evaluate those. In that way, more commands can be added to also set up
name servers and default routes without secretly breaking the existing
system network setup.
2019-07-19 01:22:00 -05:00
Martin Hundebøll 777ae04611 test: process-context-settings: use ip instead of ifconfig/route 2019-07-19 01:21:54 -05:00
Christophe Ronco 17bf6ac7c0 qmimodem: remember lac and cellid
Lac and cellid information are optional in ss_info notifications.
Remember them in order to give a correct information each time a
notification is received.
2019-07-19 01:19:23 -05:00
Martin Hundebøll e98af8127f quectel: add support for the Quectel MC60 modem
The modem is AT-compatible with the Quectel M95 modem, but also features
a GNSS module.
2019-07-17 10:27:31 -05:00
Martin Hundebøll 5a255d6e62 quectel: store model id in private data
Some Quectel models supports different features such as GNSS or
different URC strings. Add a field in the quectel data structure to be
used when adding support for said features.
2019-07-17 10:26:53 -05:00
Martin Hundebøll bac8a9cf8d quectel: enable call volume settings 2019-07-17 10:26:16 -05:00
Martin Hundebøll 8be2adc908 atmodem: rename OFONO_VENDOR_QUECTEL_M95
Other serial connected modems (i.e the MC60 model) from is AT-compatible
with the M95 model, so rename the M95 vendor id to be common for both.
2019-07-17 10:25:51 -05:00