Commit Graph

8856 Commits

Author SHA1 Message Date
Sergey Matyukevich 3303268d02 gemalto: gprs: support automatic context activation
Implement read_settings function to get configuration for automatic
contexts. AT^SWWAN command activates PDP context unless it has been
already activated automatically, and then starts DHCP server in the
ME. So AT^SWWAN command should be run for automatic context as well
in order to obtain IP settings from the ME.

This commit also fixes the issue uncovered by the added support for
automatic contexts: as per modem specs, AT+CGACT context should not
be reused for AT^SWWAN. Though that worked for some reason when
automatic context was reactivated without proper deactivation.

Note that in both cases success code is reported to the core before
AT^SWWAN response. This is because the ME waits until DHCP negotiation
has finished before sending the "OK" or "ERROR" result code.
2020-12-30 10:54:50 -06:00
Denis Kenzior 3c8f24769a gemalto: Fix compiler error
Fix compiler error introduced due to a bad merge

Fixes: de0d5a19 ("gemalto: gprs: support different gprs protocols")
2020-12-26 11:36:00 -06:00
Sergey Matyukevich de0d5a19c1 gemalto: gprs: support different gprs protocols
Add support for IPv6 and dual mode gprs contexts.
2020-12-22 10:36:46 -06:00
Sergey Matyukevich 3551cc89ec gemalto: gprs: cgev gprs context deactivation
Gemalto ELS81x modems use 'ME PDN DEACT' message to notify about gprs
context deactivation. Process this 'deactivate' event in CGEV handler.
2020-12-22 10:34:48 -06:00
Sergey Matyukevich 97aea7414c plugin: gemalto: fix source of gprs notifications
Modem USB interface does not receive certain gprs context notifications.
Fix gprs chat: use Application USB interface to receive all the modem
notifications.
2020-12-22 10:34:48 -06:00
Denis Kenzior cf9e6d048d build: Add check for rawmemchr
Otherwise the build will complain about multiple definitions
2020-12-22 10:32:12 -06:00
Richard Röjfors 429a5a57da util: Fix implicit enum conversion
GCC10 complains about the following:

src/smsutil.c: In function ‘sms_text_prepare_with_alphabet’:
src/smsutil.c:3594:8: error: implicit conversion from ‘enum sms_alphabet’ to ‘enum gsm_dialect’ [-Werror=enum-conversion]
 3594 |        alphabet, &used_locking,

smsutil and util has an enum each for representing
the same thing; The SMS alphabet. They share the same
values, so an explicit type cast makes GCC happy.
2020-12-22 09:45:05 -06:00
Richard Röjfors 66cd5df5d7 huawei: Fix implicit enum conversion
GCC 10 warns about this implicit conversion:

drivers/huaweimodem/radio-settings.c: In function ‘band_gsm_from_huawei’:
drivers/huaweimodem/radio-settings.c:107:10: error: implicit conversion from ‘enum ofono_radio_band_umts’ to ‘enum ofono_radio_band_gsm’ [-Werror=enum-conversion]
  107 |   return OFONO_RADIO_BAND_UMTS_ANY;

Member from the incorrect enum was returned, both had the value 0, so
the code would still work.
2020-12-22 09:43:36 -06:00
Lars Poeschel 285fad8f39 quectel: Power on/off with a gpio pulse
Current implementation uses a gpio level of 1 for powering on quectel
modems using a gpio and a level of 0 for powering off.
Normally quectel modems are powered on or off by a gpio pulse on their
PWR_KEY pin. They turn on by the first pulse and turn then off by the
next pulse. The pulse length varies between different modems.
For power on the longest I could in the quectel hardware is "more than
2 seconds" from Quectel M95 Hardware Design Manual.
For Quectel EC21 this is ">= 100 ms".
For Quectel MC60 this is "recommended to be 100 ms".
For Quectel UC15 this is "at least 0.1 s".
For power off the four modems in question vary between a minimum pulse
length of 600-700ms.
This implements a 2100ms pulse for power on and 750ms for power off.

If you have some special circuitry that powers your modem by gpio level
and you need the old behaviour, you can switch to gpio level powering
by setting environment variable OFONO_QUECTEL_GPIO_LEVEL. The gpio goes
to high level for the modem to power on and to low level if it should
power off.
2020-10-06 15:42:46 -05:00
Lars Poeschel 4a098c724a quectel: Extend power-on timeout
More complicated modems emerge and they need longer start-up times. An
EC21 takes about 13 seconds to boot up. This is slightly longer than the
20 * 500 ms we have at the moment. This extends the retries to 30, so we
have 30 * 500 ms and this does successfully power up an EC21 modem.
2020-09-29 09:22:45 -05:00
Nikhil Jha 0153cefeeb build: remove obsolete m4 macro
As per https://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html
LT_INIT should be used instead.
2020-09-29 09:14:22 -05:00
Christophe Ronco 7594a000dd common: APN with a dot in second position are not invalid
APN with a dot in second position (example: "t.est") are wrongly
considered invalid.
2020-09-29 09:11:08 -05:00
Pavel Machek 07e00b7215 droid 4: Add probing.
Probe Droid 4 modem. This should result in basic support working.
2020-09-15 10:24:37 -05:00
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 23e1a56a47 xmm7xxx: Fix non compiling file
CC       plugins/xmm7xxx.o
../plugins/xmm7xxx.c:63:10: fatal error: dbus.h: No such file or directory
   63 | #include "dbus.h"
      |          ^~~~~~~~
compilation terminated.
2020-09-08 11:02:25 -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 23c78bd316 plugins: gemalto: alternative gprs-context driver
Use alternative gprs context driver for gemalto modems
that provide USB ethernet interfaces for data path.
2020-08-19 09:50:44 -05:00
Sergey Matyukevich 71ceaf93fd plugins: udevng: detect gemalto network interfaces
Some gemalto modems, including ELS81x, may provide more than one
USB ethernet interface. Detect and save both network interfaces
rather than only the last one.
2020-08-19 09:50:41 -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
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