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.
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.
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.
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.
CNMA isn't mentioned in the m95 documentation, but trial'n'error has
revealed some details:
* the CSMS query returns the list (0,128) instead of a range
* CNMA is enabled by setting 128 as CSMS service
* once enabled, SMS deliveries are acked by sending AT+CNMA without a
value setting
Add m95 quirks to the atmodem driver, so that CNMA is correctly
detected, configured, and used.
Glib emits a warning when g_hash_table_destroy() is called on a NULL
pointer:
GLib-CRITICAL **: 13:27:40.269: g_hash_table_destroy: assertion 'hash_table != NULL' failed
Add a check to avoid this warning.
Fixes:
../git/drivers/ubloxmodem/gprs-context.c: In function ‘ublox_gprs_activate_primary’:
../git/drivers/ubloxmodem/gprs-context.c:339:2: error: ‘auth’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
snprintf(buf, sizeof(buf), "AT+UAUTHREQ=%u,%u,\"%s\",\"%s\"",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcd->active_context, auth, username, password);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../git/drivers/ubloxmodem/gprs-context.c:324:11: note: ‘auth’ was declared here
unsigned auth;
^~~~
CC drivers/mbimmodem/mbim-message.o
drivers/mbimmodem/mbim-message.c: In function ‘_iter_copy_string’:
drivers/mbimmodem/mbim-message.c:199:18: error: cast increases required
alignment of target type [-Werror=cast-align]
Setting <connect_flag> in AT+XDATACHANNEL set command to 0. This will
disable intermediate result reporting of "CONNECT" and "NO CARRIER"
on control channel.
This resolves the issue of getting failure response for offline-modem
since "NO CARRIER" is received as result of AT+CFUN operation instead
of "OK".
It looks like a previous line was copied and cd->username was re-terminated
instead of password. This also fixes a compiler error when using GCC 9:
In function ‘strncpy’,
inlined from ‘isi_gprs_activate_primary’ at drivers/isimodem/gprs-context.c:546:3:
/usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ output may be truncated copying 53 bytes from a string of length 255 [-Werror=stringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xmm7xxx based devices (among others) return 0 as cid for default
pdp context. Fix the atmodem gprs driver logic to work with such
devices by initializing last_auto_context_id to -1 instead of 0
to indicate a deactivated context.
Change message class none configuration from directly delivering a new
message in the event indication to storing it in the modem's NV then
sending an event indication identifying the new message. Also, add
checking for stored, unread messages at boot up.
This fixes a scenario where the modem powers on, automatically
connects to the network, receives a message, and sends an indication
before oFono has fully initialized. Now, the message is saved and
retrieved after initialization.
This also helps with suspend/resume on platforms where the modem,
supports waking the host CPU upon SMS reception. And, the platform
design limitation is that the modem's interfaces (eg, cdc-wdm, wwan,
etc) disconnect on suspend and reconnect on resume. This causes oFono
to re-initialize and miss the message indication because it was sent
before oFono is ready. Now, the wake up message is saved and retrieved
after initialization.
When a context gets activated we read its settings, but
if the context gets deactivated during this time we should
not indicate that the context is activated when the settings
are received.
Handled IPv6 address after activating PDP context.
Received IPv6 address is of format addr + netmask in the same string
in the form of "a1.a2.a3.a4.a5.a6.a7.a8.a9.a10.a11.a12.a13.a14.a15.a16.
m1.m2.m3.m4.m5.m6.m7.m8.m9.m10.m11.m12.m13.m14.m15.m16"
Some modems, eg. Quectel EC25E, return the ESN, IMEI, and MEID even
though they support only one network type in a region. Current serial
number query gives precedence to the ESN if it exists, and does not
consider the IMEI and MEID.
Add a check of the supported radio interfaces in deciding which
serial number to return. If radio interfaces are 3GPP based, then
return the IMEI, else return the ESN. If neither exist, return MEID
if available, else fail.
The ublox modems always run DHCP when in router mode.
Unfortunately the code overwrote the IP settings with
static IP settings while activating.
Now we respect the networking_mode regardless if
we read settings during activation or read settings
phase.
Handled DSSA use case for xmm7modem. Added driver function
to switch between available card slots for SIM.
Only one SIM will be active at a given time. On calling this
function the active SIM will be removed and the card slot made
inactive and SIM in the other card slot will be made active.
Use case is similar to a SIM swap/change where one SIM is replaced
another SIM in the same slot.
The TOBY L2 may run in either "bridge" mode or "router" mode. For this
model, query the configured mode so that the appropriate settings are
communicated when the context is activated.
The TOBY L4 supports only "router mode" where the modem presents a
network interface that one can run a DHCP client against. Behind this
interface, the modem takes care of routing packets via NAT by:
i) selecting the relevant context based on destination IP
ii) using the first activated context as the default route
In order to have the connection manager, thus, do the right thing, the
context only needs to report itself as being active and with the IP
settings set to method "dhcp". There's no need for the connection manager
to know details like what IP address the context was assigned.
Tested with connman that does the right thing when it finds an active
"dhcp" context.
There are a couple of semi-independent changes here:
* use the 'vendor' parameter to pass the modem 'model'
* support TOBY L4 modem which uses a fixed CID for configuring the EPS
default bearer
* add the setup of authentication parameters that was recently added to
the atmodem LTE driver
This flag should be set on devices that support multiple USB profiles
and will be used to determine whether or not querying USB profiles is
appropriate/necessary.
This sets up some device model data structures and adds some helpers for
manipulating them. These data structures are a first step to trying to
support the large number of devices that ublox produces with a common
driver structure.
The 'Toby L2'-specific vendor type is used only to prevent the CMER
command from attempting to set mode '3'. For all u-blox models, mode
'3' is just an alias for mode '1'. As such, mode '1' can be used in
place of mode '3', removing the model-specific quirk in favour of a
vendor-specific quirk.
With this change, the L2-specific vendor type is no longer needed.