Commit Graph

1856 Commits

Author SHA1 Message Date
Pavel Machek cb79f71ffe droid 4: special handling for SMSes
Droid 4	 modem is "special" (aka broken) so and getting incoming SMSes
to work is quite tricky. This should get it right.
2020-09-15 10:21:44 -05:00
Pavel Machek 25fd00588a droid 4: add special handling required for voice calls and SIM
Droid 4 modem is "special" (aka broken) so it seems to need a bit of
error handling.
2020-09-15 10:17:55 -05:00
Denis Kenzior 52091a1af0 qmimodem: Fix format warning
../../drivers/qmimodem/network-registration.c: In function
‘extract_ss_info’:
../../drivers/qmimodem/network-registration.c:131:54: warning: ‘%03d’
directive output may be truncated writing between 3 and 5 bytes into a
region of size 4 [-Wformat-truncation=]
  131 |   snprintf(operator->mcc, OFONO_MAX_MCC_LENGTH + 1, "%03d",
        |                                                      ^~~~
	../../drivers/qmimodem/network-registration.c:131:53: note:
	directive argument in the range [0, 65535]
  131 |   snprintf(operator->mcc, OFONO_MAX_MCC_LENGTH + 1,
	      "%03d",
	            |
		    ^~~~~~

The MCC/MNC fields are limited to three digits.  Clamp the input to 999
to avoid the warning.
2020-09-08 11:19:54 -05:00
Lars Poeschel 21f148afe9 atmodem: Detect usage of AT+CGEREP
Currently AT+CGEREP=2,1 is sent in case we don't know what the modem
needs. (default case) Not all modems understand this. So, we first query
what the modem supports with AT+CGEREP=? and then use this information
to be nice to the modem. This way modems, like the Quectel M95 that do
only understand AT+CGEREP=1 do also work nicely.
2020-09-01 11:10:14 -05:00
Lars Poeschel a811aca98a atmodem: Signal quality on quectel serial modems
As the default way of getting the signal quality with +CIND is also
unstable on quectel serial modems (the same as on quectel EC21). In fact
the signal quality is only updated on cell changes. Those trigger a
manual AT+CSQ in ofono and get an update this way, but the URCs do not
work.
So we implement a quectelish way here as well. The quectelish way is
very similar to the way ifx modems work. We can reuse their csq_notify
function.
2020-08-25 11:39:58 -05:00
Lars Poeschel dbc1fb62ac atmodem: Deactivate AT+CPSB for quectel serial modems
There are at the moment two quectel modems in ofono vendored as
OFONO_VENDOR_QUECTEL_SERIAL: The M95 and the MC60.
Both modems are GSM only modems, and their official documentation does
not mention the AT+CPSB command.
I have a M95 here that gives an error on issuing the AT+CPSB=1 command.
So skip this command for these two modems.
2020-08-19 09:57:09 -05:00
Sergey Matyukevich da1ef6588b drivers: gemalto: add gprs-context driver
Some gemalto modems provide USB ethernet interfaces for data path.
Implement gprs-context driver for such modems to send data via
USB ethernet rather than fallback to PPP.
2020-08-19 09:50:39 -05:00
Lars Poeschel 288f263ab6 gprs: Quectel EC21 does not understand AT+CPSB
The Quectel EC21 modem does not understand the AT+CPSB command, and we
did not find a suitable replacement in the
Quectel_EC25&EC21_AT_Commands_Manual_V1.3.pdf
AT+CPSB gives an error on this modem, so we just skip it.
2020-08-17 10:14:38 -05:00
Lars Poeschel a01613ad13 atmodem: Get strength and tech the quectel way on EC21
I had some trouble getting network strengh and access technology the
standard way on Quectel EC21. It does work - but only kind of. I did not
get URCs when I am sure I should. This way through CIEV, CIND and CMER
is also not documented in Quectel documentation, so I suspect this to be
unsupported.
This is now changed to the "quectelish" way of gettings those values and
this does work more fine-grained and reliable on the Quectel EC21.
2020-08-11 10:47:58 -05:00
Lars Poeschel 3401d9e29c Add a vendor OFONO_VENDOR_QUECTEL_EC2X
The distinction between OFONO_VENDOR_QUECTEL and
OFONO_VENDOR_QUECTEL_SERIAL does not suffice for EC21/EC25 in some
places, so introduce and use a new vendor:
OFONO_VENDOR_QUECTEL_EC2X
2020-08-11 10:47:36 -05:00
JongSeok Won 325a4b2998 rilmodem: support cell type LTE for netmon 2020-07-31 10:21:00 -05:00
JongSeok Won 7a6872b3ee rilmodem: set proto type during setting initial attach apn
Added the protocol type of initial attach apn depends on protocol
type in LTE Atom.
2020-07-21 08:55:56 -05:00
JongSeok Won 1708c2b0c8 rilmodem: fix typo error in netmon.c 2020-07-21 08:38:03 -05:00
Jimmy Gysens b513bf8d33 huawei: fix AT^SYSCFGEX acqorder "0201"
Commit 6c574ee24a ("huawei: the AT^SYSCFGEX
command supports additional modes") has a mistake for acqorder "0201". It
should be UMTS and GSM preferred.
2020-06-26 10:30:10 -05:00
Jimmy Gysens 6c574ee24a huawei: the AT^SYSCFGEX command supports additional modes
- LTE and UMTS preferred (acqorder = 0302);
AT^SYSCFGEX="0302",40000000,2,4,40000000

- UMTS and GSM preferred (acqorder = 0201);
AT^SYSCFGEX="0201",40000000,2,4,40000000

For AT^SYSCFG, the modes are not available.
2020-06-25 11:33:58 -05:00
Christophe Ronco 6cc1851b18 huawei: use AT^SYSCFG for radio setting operations on 3G only modems
AT^SYSCFGEX must be used on LTE Huawei modems to enable LTE support.
But some modems (or firmwares?) do not support this command and AT^SYSCFG
must be used to get/set radio settings.
This has been introduced in commit:
22adf6402c

There is a bug in this commit and AT^SYSCFGEX commands are used even on
modems not supporting it.
2020-06-11 09:30:04 -05:00
Marius Gripsgard 4e61dc355e qmimodem: Implement data capability bearer notify
This implements data capability bearer notify to qmi modem.
Since this is included in the serving system response this
just adds a new data extraction for dc.
2020-06-10 14:23:06 -05:00
Lars Poeschel f7f3b754ad voicecall: Quectel modem do not understand AT+CNAP 2020-05-21 08:28:20 -05:00
JongSeok Won 48c5ab07af rilmodem: update call direction from the isMT value
oFono cannot determines the call of direction when the voicecall
is triggered in rilmodem
2020-04-02 18:09:55 -05:00
Richard Röjfors 952f1d00be ublox: network-registration: Handle UREG unsolicited during poll
In the case a unsolicited indication for UREG was received
while the status was polled. The poll response failed to parse.
This since the unsolicited indication only carries one
parameter, while the poll response is expected to carry two.

Update the code to loop until the response is found.

The log below shows a case where this happened.

10:07:55 ofonod[520]: Aux: > AT+UREG?\r
10:07:55 ofonod[520]: Aux: < \r\n+CGREG: 4\r\n\r\n+UREG: 0\r\n\r\n+CIEV: 9,1\r\n
10:07:55 ofonod[520]: src/gprs.c:ofono_gprs_status_notify() /ublox_0 status unknown (4)
10:07:55 ofonod[520]: src/gprs.c:ofono_gprs_detached_notify() /ublox_0
10:07:55 ofonod[520]: Aux: < \r\n+UREG: 1,0\r\n
10:07:55 ofonod[520]: Aux: < \r\nOK\r\n
2020-02-14 11:24:14 -06:00
Richard Röjfors 90dadace21 Instead of implementing an own copy of requesting and parsing
CREG, reuse the existing one from at-modem.
2020-02-07 10:49:10 -06:00
Denis Kenzior 4a078b353b atutil: Add missing va_end 2019-11-13 17:01:15 -06:00
Denis Kenzior 66bc5b3fd4 mbim: Don't copy too much
_mbim_message_build doesn't really care about the fragmentation header
contents, so just don't copy those unnecessarily.
2019-11-13 17:01:15 -06:00
Marcel Holtmann 96a83c167e huawei: Increase string buffer to avoid overflow 2019-10-31 08:38:47 +01:00
Richard Röjfors 78a5b4b735 ublox: netreg: Also subscribe to UREG URC's
It turns out that both L2xx and L4xx modems are a bit
buggy when it comes to send CREG URC's when the tech changes.
Try to overcome this by subscribing to both UREG and CREG,
and poll the other when any of the URC's are received.
Protect from doing simultaneous polls though.
2019-10-01 11:22:33 -05:00
Antara Borwankar b9da075d63 atmodem: CGDCONT handling for cid 0
Added handling for cid 0 in +CGDCONT callback.
2019-09-30 11:14:50 -05:00
Martin Hundebøll f8090396b8 atmodem: sim: remove quectel serial vendor quirk
The sim inserted/initialized state is handled properly in the quectel
plugin now, so remove the "auto-initialized" quirk from the atmodem
sim driver.
2019-09-26 16:38:39 -05:00
Richard Röjfors 388248d6a1 ublox: network-registration: Check ureg for tech also for L2 modems
It seems like the CREG reporting from the L2 modems are quite
buggy. An example for a L210 where CREG reports UTRAN while
COPS and UREG reports LTE. A manual poll also indicates LTE.

I also found that the technology mapping was incorrect,
probably confused with enum packet_bearer.

A commented log showing where CREG is not trustable:

UREG indicates LTE
21:59:29 : < \r\n+UREG: 7\r\n
21:59:29 : < \r\n+CIEV: 9,2\r\n
21:59:29 : < \r\n+CGEV: NW MODIFY 1,0,0\r\n
21:59:31 : < \r\n+CIEV: 2,2\r\n
21:59:39 : < \r\n+CIEV: 2,3\r\n
21:59:44 : < \r\n+CIEV: 2,2\r\n
22:01:38 : < \r\n+CIEV: 2,3\r\n
22:01:43 : < \r\n+CIEV: 2,2\r\n

A CREG indicating UTRAN with HSDPA and HSUPA
22:29:39 : < \r\n+CREG: 5,"0000","00000000",6\r\n
22:29:39 : > AT\r
22:29:39 : < \r\nOK\r\n
22:29:39 : > AT+COPS=3,2\r
22:29:39 : < \r\n+CIEV: 9,2\r\n
22:29:39 : < \r\nOK\r\n
22:29:39 : > AT+COPS?\r

An immediate cops indicating LTE
22:29:39 : < \r\n+COPS: 0,2,"24007",7\r\n
22:29:39 : < \r\nOK\r\n
22:29:39 : > AT+CSQ\r
22:29:39 : < \r\n+CIEV: 2,4\r\n
22:29:39 : < \r\n+CSQ: 26,4\r\n
22:29:39 : < \r\nOK\r\n
22:29:39 : > AT+CGATT=1\r
22:29:39 : < \r\nOK\r\n
22:29:39 : > AT+COPS=3,0\r
22:29:39 : < \r\nOK\r\n
22:29:39 : > AT+COPS?\r

Another cops also indicates LTE
22:29:39 : < \r\n+COPS: 0,0,"Tele2",7\r\n <- 7: LTE
22:29:39 : < \r\nOK\r\n
22:29:39 : > AT+CGREG?\r

CGREG indicates unknown -> normal on LTE
22:29:39 : < \r\n+CGREG: 2,4\r\n
22:29:39 : < \r\nOK\r\n
22:29:44 : < \r\n+CIEV: 9,2\r\n
22:29:46 : < \r\n+CIEV: 2,2\r\n
22:56:23 : < \r\n+CIEV: 2,3\r\n
22:56:28 : < \r\n+CIEV: 2,2\r\n
22:59:40 : < \r\n+CIEV: 2,4\r\n

Manual poll shows we are running LTE
at+creg?
+CREG: 2,5,"2AFC","01DB0206",7

OK
2019-09-25 20:53:08 -05:00
Antara Borwankar f3a5016a67 xmm7modem: Fix to set gateway in pdp context
gateway was not being listed in context settings. Fixed teh bug
to show correct gateway address.
2019-09-20 09:54:50 -05:00
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
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
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
Marcel Holtmann e0f62cdb7a atmodem: Remove the pointless #pragma once 2019-08-13 00:54:27 +02:00
Marcel Holtmann fd69b05542 isimodem: Fix size calculation for address array 2019-08-12 19:36:42 +02: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 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 9b1d83eaea ubloxmodem: Add model entries for LARA R2 series 2019-07-19 02:46:57 -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 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
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 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
Martin Hundebøll 46616a52d9 atmodem: sms: add quectel m95 quirks
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.
2019-07-12 09:41:08 -05:00
Martin Hundebøll 181e8d3da7 atutil: guard call to g_hash_table_destroy()
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.
2019-07-05 17:17:44 -05:00
Martin Hundebøll 35b61e3ec2 ubloxmodem: fix maybe-unitialized error
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;
           ^~~~
2019-06-21 12:54:10 -05:00
Denis Kenzior 5ee73d9101 mbim: Fix warning
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]
2019-06-21 12:47:18 -05:00
Antara Borwankar e794adb0f2 xmm7modem: disabling reporting of intermediate results for CGDATA
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".
2019-06-20 11:21:25 -05:00
James Prestwood a6001c1153 isimodem: gprs-context: properly null terminate cd->password
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));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-06-17 13:49:53 -05:00