Commit Graph

8834 Commits

Author SHA1 Message Date
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
Shweta Jain d2fd1721f3 xmm7xxx-enable-esim-feature-in-xmm_ofono 2020-08-13 10:08:43 -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
Lars Poeschel 446a5ae394 quectel: Try to update voltage only, when received "vbatt"
As there are some more sources of +QIND: activated, do now only update
voltage when we get the
+QIND: "vbatt",-1
but not on things like
+QIND: "act","LTE"
or
+QIND: "csq",20,99
2020-08-07 11:11:39 -05:00
Lars Poeschel ab8d482af1 quectel: Set URC port to uart1 on EC21
Set the URC port of the Quectel EC21 to uart1 when it is used through
it's serial port. This setting is saved to non-volatile storage by the
modem automatically.
2020-08-07 11:09:53 -05:00
Lars Poeschel a56976e2bb Revert "quectel: EC21 needs aux channel to be the first mux channel"
This reverts commit 1868dbf2b3.
Development for this was done on EC21 firmware version
EC21EFAR06A01M4G_BETA0318. It now turns out, that actual release
firmware versions for this modem again need the original mux order with
aux channel as the second mux channel. (We know for sure for firmware
version EC21EFAR06A03M4G.)
We do not know for sure when and for what firmware versions quectel did
the switch back on the mux order, but we suspect that the "BETA"
firmware is the only one with the reversed mux order. This "BETA"
firmware was only given out for development purposes and will not appear
"in the wild", so we revert the patch here and hope for the best.
2020-08-07 11:04:35 -05:00
JongSeok Won 325a4b2998 rilmodem: support cell type LTE for netmon 2020-07-31 10:21:00 -05:00
JongSeok Won 4f4fcc4944 netmon: added PCI, TAC, SNR value
To support cell type LTE, the value of PCI, TAC, SNR is added
2020-07-31 10:18:53 -05:00
JongSeok Won 8ba6158011 doc: added PCI, TAC, SNR property in networkmonitor-api 2020-07-31 10:17:05 -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
Denis Kenzior 3940514013 AUTHORS: Mention JongSeok's contributions 2020-07-21 08:42:21 -05:00
JongSeok Won 1708c2b0c8 rilmodem: fix typo error in netmon.c 2020-07-21 08:38:03 -05:00
Sean Nyekjaer e4d77210ea udevng: Add support for Quectel BG96 modem 2020-07-13 14:05:00 -05:00
Denis Kenzior aeeb321a72 AUTHORS: Mention Shweta's contributions 2020-07-08 11:49:10 -05:00
Shweta Jain d0c014111e gatchat: increase line buffer max size
Some modems might transfer results that are larger than the current
buffer.  Increase it.
2020-07-08 11:47:55 -05:00
Denis Kenzior ae8eb80d87 AUTHORS: Mention Sergey's contributions 2020-06-29 10:20:28 -05:00
Sergey Matyukevich 2807a5fe55 plugins: gemalto: enable LTE for ELS81x
Enable LTE atom for Cinterion ELS81x modems.
2020-06-29 10:20:01 -05:00
Sergey Matyukevich 28d4be1af2 plugins: udevng: detect Centirion ELS81x modem
Enable detection of Centirion ELS81x modem.
2020-06-29 10:20:01 -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 c83d693097 gprs: clean context properly
After a context is detached, the context is not properly cleared. In
addition to releasing the context:

- Reset the context settings (IP, DNS, interface, ...).
- Signal the Active flag as false.
2020-06-25 12:04:54 -05:00
Jimmy Gysens ef7e5f016b huawei: send restore settings command on startup
When initializing a Huawei device, send the AT&F0 command to restore the
default AT settings on device restart.

Huawei stores all APN settings, which can cause issues when changing the
APN. The AT&F0 command makes sure the device starts from a clean state.
2020-06-25 11:36:20 -05:00
Denis Kenzior b1d9be030c AUTHORS: Mention Jimmy's contributions 2020-06-25 11:35:09 -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
Slava Monich 47b52aab34 lte: Use the right D-Bus interface for property change signal 2020-06-18 15:37:45 -05:00
Slava Monich cf4a4a7bd0 cbs: Allow the last CBS fragment to be truncated
That does happen in real life.
2020-06-18 15:34:20 -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
Denis Kenzior 9fd44f11c8 AUTHORS: Mention Marius' contributions 2020-06-10 14:23:28 -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
Denis Kenzior a88d1120a4 doc: sim-api was missing SetProperty method 2020-05-26 22:23:58 -05:00
Lars Poeschel 1868dbf2b3 quectel: EC21 needs aux channel to be the first mux channel
The Quectel EC21 does only work correctly, if the mux channel used for
aux is the first mux channel. It does only put it's URC messages in the
first mux channel, so this has to be the aux channel in our case.
To be flexible on the mux order we introduce two arrays here, that then
contain the initialization data in their needed order.
Initialization data is then applied by for-looping over this array.
2020-05-26 22:22:09 -05:00
Denis Kenzior 2d991d8296 AUTHORS: Mention Lars' contributions 2020-05-21 08:28:45 -05:00
Lars Poeschel 8ce74ba07b quectel: EC21 add ussd with atmodem driver 2020-05-21 08:28:30 -05:00
Lars Poeschel f7f3b754ad voicecall: Quectel modem do not understand AT+CNAP 2020-05-21 08:28:20 -05:00
Lars Poeschel c7de38491d quectel: EC21 does not understand AT+QIURC
Because the Quectel EC21 does not understand the AT+QIURC command, we
leave that out during initialisation.
2020-05-21 08:28:09 -05:00
Lars Poeschel debd73639a quectel: Query the model before setting up the mux
This is a change for the EC21. It will require specific handling before
and right after setting up the mux. So this change prepares this. It
queries the modem model before the mux (CMUX) is activated.
2020-05-21 08:24:40 -05:00
Lars Poeschel c121ccebc2 quectel: use lte atom on EC21 2020-05-21 08:24:37 -05:00
Lars Poeschel 3c158ceee9 quectel: Add Quectel EC21 to known serial modems
This adds the Quectel EC21 to the known modems of the quectel driver and
therefore allows to use it with its serial interface.
2020-05-21 08:24:29 -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
joey@joeyhewitt.com cf850de632 build: require dbus >= 1.6
dbus_validate_path() is used several times. dbus's NEWS says it was
added in 1.5.12.
2020-03-04 10:03:20 -06: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
Denis Kenzior 8e78d4dba5 allowed-apns: Do not try to unregister unnecessarily
allowed-apns plugin will try to uregister the AllowedAccessPoints
interface whenever the sim state changes, even when not registered.
This results in the (benign) error being printed inside
ofono_modem_remove_interface:

Interface org.ofono.AllowedAccessPoints not found on the interface_list
2020-02-07 11:08:13 -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
Antara Borwankar d90cfdd71c sim: handling crash in error scenario for SIM PIN query
In case of error in sim_pin_query_cb function. pin_type is set
to -1. This is causing segmentation fault in function
sim_passwd_name due to invalid index pin_type = -1. Fixing this
issue by handling error case before calling sim_passwd_name
function.
2019-12-20 12:46:18 -06:00
Antara Borwankar f76e1d75d0 xmm7xxx: modified handling of XSIM states for xmm modems
+XSIM:7 state as defined in xmm7560 functional AT specification
only indicates ready for attach.

+CPIN: READY is received after SIM is completely initialized.
Also indicating readiness of Phonebook and SMS. Hence moving the
creation of SMS and Phonebook atom to xmm7xxx_post_sim function.

+XSIM:4 PUK needed state was not handled. It must be handled
same as PIN needed state. Added handling of this case to
switch_sim_state_status function.
2019-12-20 12:32:39 -06:00
Richard Röjfors aa89c19a50 gprs: Update attach state on context deactivation for LTE
To be considered attached on LTE a context should be activated.
But in case the context got deactivated we did not update
the attached state, it remained attached.
That caused the connection manager to try to re-activate the
context manually, but for LTE thats done automatically.
In the case of ublox it returns errors, which is passed
on to the connection manager, which tries again and
again, until we get attached again.

It looked like this:
12:03:18 ofonod[547]: Aux: < \r\n+CIEV: 2,3\r\n
12:03:23 ofonod[547]: Aux: < \r\n+CIEV: 2,2\r\n

Deactivated

12:16:01 ofonod[547]: Aux: < \r\n+CGEV: NW PDN DEACT 4\r\n
12:16:01 ofonod[547]: drivers/ubloxmodem/gprs-context.c:cgev_notify() cid 4, active cid: 4
12:16:01 ofonod[547]: src/gprs.c:ofono_gprs_context_deactivated() 0x1743e50 0x17424a8 4

Connection manager now try to activate, over and over again
because Attached remains TRUE

12:16:01 ofonod[547]: drivers/ubloxmodem/gprs-context.c:ublox_gprs_activate_primary() cid 1
12:16:01 ofonod[547]: Aux: > AT+CGDCONT=1,"IP","apn"\r
12:16:01 ofonod[547]: Aux: < \r\nOK\r\n
12:16:01 ofonod[547]: drivers/ubloxmodem/gprs-context.c:cgdcont_cb() ok 1
12:16:01 ofonod[547]: Aux: > AT+CGACT=1,1\r
12:16:01 ofonod[547]: Aux: < \r\n+CME ERROR: 30\r\n
12:16:01 ofonod[547]: drivers/ubloxmodem/gprs-context.c:cgact_enable_cb() ok 0
12:16:01 ofonod[547]: src/gprs.c:pri_activate_callback() 0x17475c0
12:16:01 ofonod[547]: src/gprs.c:pri_activate_callback() Activating context failed with error: No network service
12:16:01 ofonod[547]: drivers/ubloxmodem/gprs-context.c:ublox_gprs_activate_primary() cid 1
12:16:02 ofonod[547]: Aux: > AT+CGDCONT=1,"IP","apn"\r
12:16:02 ofonod[547]: Aux: < \r\nOK\r\n
12:16:02 ofonod[547]: drivers/ubloxmodem/gprs-context.c:cgdcont_cb() ok 1
12:16:02 ofonod[547]: Aux: > AT+CGACT=1,1\r
12:16:02 ofonod[547]: Aux: < \r\n+CME ERROR: 30\r\n
12:16:02 ofonod[547]: drivers/ubloxmodem/gprs-context.c:cgact_enable_cb() ok 0
12:16:02 ofonod[547]: src/gprs.c:pri_activate_callback() 0x17475c0
12:16:02 ofonod[547]: src/gprs.c:pri_activate_callback() Activating context failed with error: No network service
.
.
.
12:16:14 ofonod[547]: drivers/ubloxmodem/gprs-context.c:ublox_gprs_activate_primary() cid 1
12:16:14 ofonod[547]: Aux: > AT+CGDCONT=1,"IP","apn"\r
12:16:14 ofonod[547]: Aux: < \r\nOK\r\n
12:16:14 ofonod[547]: drivers/ubloxmodem/gprs-context.c:cgdcont_cb() ok 1
12:16:14 ofonod[547]: Aux: > AT+CGACT=1,1\r
12:16:14 ofonod[547]: Aux: < \r\n+CME ERROR: 30\r\n
12:16:14 ofonod[547]: drivers/ubloxmodem/gprs-context.c:cgact_enable_cb() ok 0
12:16:14 ofonod[547]: src/gprs.c:pri_activate_callback() 0x17475c0
12:16:14 ofonod[547]: src/gprs.c:pri_activate_callback() Activating context failed with error: No network service
12:16:14 ofonod[547]: drivers/ubloxmodem/gprs-context.c:ublox_gprs_activate_primary() cid 1
12:16:14 ofonod[547]: Aux: > AT+CGDCONT=1,"IP","apn"\r
12:16:14 ofonod[547]: Aux: < \r\nOK\r\n
12:16:14 ofonod[547]: drivers/ubloxmodem/gprs-context.c:cgdcont_cb() ok 1
12:16:14 ofonod[547]: Aux: > AT+CGACT=1,1\r

The context got activated again

12:16:14 ofonod[547]: Aux: < \r\n+CGEV: ME PDN ACT 4\r\n\r\n+CIEV: 9,2\r\n\r\n+CTZE: +04,0,"19/12/11,13:17:58"\r\n
12:16:14 ofonod[547]: drivers/ubloxmodem/network-registration.c:ctze_notify() tz +04 dst 0 time 19/12/11,13:17:58
12:16:14 ofonod[547]: src/network.c:ofono_netreg_time_notify() net time 2019-12-11 13:17:58 utcoff 3600 dst 0
12:16:14 ofonod[547]: Aux: < \r\n+CME ERROR: 100\r\n
12:16:14 ofonod[547]: drivers/ubloxmodem/gprs-context.c:cgact_enable_cb() ok 0
12:16:14 ofonod[547]: src/gprs.c:pri_activate_callback() 0x17475c0
12:16:14 ofonod[547]: src/gprs.c:pri_activate_callback() Activating context failed with error: Unknown error
2019-12-11 15:08:26 -06:00
Richard Röjfors 3b7d8e003e gprs: Don't modify the context if assign fails
There was an issue while running LTE and the connection
manager tried to activate the context with CID 1 while
it got automatically activated at the same time with
CID 4.

When the automatic activation happened ofono_gprs_cid_activated
got called which tried to assign the context, but that failed
since the driver context was considered in use
(by the activation call).
Eventhough it failed, the context was modified,
cid was set to 0 (making cid 1 leak).
Then release_context got called which clear pointers
assigned to the context.

A bit later the activation callback got called, in my case
activation failed. Due to the failure it tries to clean up
by calling context_settings_free, but unfortunately the pointers
where reset above causing ofono to segfault du to null pointer
derefs.

Instead we make sure assign_context does not touch the context
unless it succeeds. Then there is no need to call release_context
if assign fails.
That ensures the context being intact when the activation callback
gets called.

03:23:21 ofonod[545]: Aux: < \r\n+CGEV: ME PDN ACT 4\r\n\r\n+CTZE: +04,0,"19/12/10,04:25:03"\r\n
03:23:21 ofonod[545]: drivers/ubloxmodem/network-registration.c:ctze_notify() tz +04 dst 0 time 19/12/10,04:25:03
03:23:21 ofonod[545]: src/network.c:ofono_netreg_time_notify() net time 2019-12-10 04:25:03 utcoff 3600 dst 0
03:23:22 ofonod[545]: Aux: > AT+CGDCONT?\r
03:23:22 ofonod[545]: drivers/ubloxmodem/gprs-context.c:ublox_gprs_activate_primary() cid 1

Connection manager requests activation, will mark the context in use and assign
it cid 1.

03:23:22 ofonod[545]: Aux: < \r\n+CGDCONT: 1,"IP","m2m.tele2.com","",0,0,0,0,0,0\r\n
03:23:22 ofonod[545]: Aux: < +CGDCONT: 4,"IP","m2m.tele2.com.mnc003.mcc248.gprs","100.69.174.133",0,0,0,0,0,0\r\n
03:23:22 ofonod[545]: Aux: < \r\nOK\r\n
03:23:22 ofonod[545]: drivers/atmodem/gprs.c:at_cgdcont_read_cb() ok 1
03:23:22 ofonod[545]: src/gprs.c:ofono_gprs_cid_activated() cid 4
03:23:22 ofonod[545]: Can't assign context to driver for APN.

Since its marked in use above, we fail to assign it cid 4. When that fails
the cid is cleared an all context pointers are set to NULL.

03:23:22 ofonod[545]: Aux: > AT+CGDCONT=1,"IP","m2m.tele2.com"\r
03:23:22 ofonod[545]: Aux: < \r\nOK\r\n
03:23:22 ofonod[545]: drivers/ubloxmodem/gprs-context.c:cgdcont_cb() ok 1
03:23:22 ofonod[545]: Aux: > AT+CGACT=1,1\r
03:23:22 ofonod[545]: Aux: < \r\n+CME ERROR: 100\r\n
03:23:22 ofonod[545]: drivers/ubloxmodem/gprs-context.c:cgact_enable_cb() ok 0
03:23:22 ofonod[545]: src/gprs.c:pri_activate_callback() 0x853480
03:23:22 ofonod[545]: src/gprs.c:pri_activate_callback() Activating context failed with error: Unknown error

Activation callback, and it failed. Will try to clean up, but the pointers are
NULL'ed...

Dec 10 03:23:22 ofonod[545]: Aborting (signal 11) [/usr/sbin/ofonod]
2019-12-11 14:35:34 -06:00
Jimmy Gysens d7d49eb1d5 huawei: Fix infinite loop on modem removal
After unplugging a Huawei USB dongle, the 'atoms' in oFono are removed
via 'flush_atoms'.  Every atom has a destruct function pointer, used as
destructor.  This includes the gprs_context atom that is currently
active.

The function calls are:
flush_atoms -> destruct -> gprs_context_remove ->
at_gprs_context_remove -> modem_disconnect

Because the device is physically removed, the IO channel for the AT
port is gone.  In 'at_gprs_context_remove', there is an attempt to
resume communication over that AT port, but that is not possible. This
is detected, and 'io_disconnect' (pointer to 'modem_disconnect') is
called. 'modem_disconnect' has the same atom and tries to remove it
again, so it calls the same destructor.  This continues infinitely.

This patch moves the GPRS context removal so that it only happens if the
modem port could be re-opened successfully.  If the port cannot be
re-opened (in the case of modem removal), the atom is already in the
process of being removed by the process kicked off in flush_atoms.

This fix is limited to Huawei devices and has been tested using the
following devices:

- E3531i-2
- E3372
- E3531s-2
- E369
- E1552
2019-11-21 21:12:53 -06:00
David Lechner cd13b2b5f3 test: make all files executable
This sets the executable bit on the only two files in the test directory
that do not already have it set.
2019-11-18 15:35:01 -06:00