Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Ofono to 1.32 #28

Open
wants to merge 306 commits into
base: master
Choose a base branch
from

Conversation

piggz
Copy link
Contributor

@piggz piggz commented Feb 16, 2022

Builds upon the 1.31 PR, cherry picking all commits up to 1.32 with the followin changes:
Reworked:
https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?h=1.34&id=f9204363e00a28fcb3bce1fb838681db5dd2b6df (jolla had a change)
https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?h=1.34&id=cf850de6328e51a448de2cee08e0145bc814ba05
https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?h=1.34&id=d841e741994f3db2bbdef4a0e1c68542d6ca2887 (jolla had change in simutil.c)
https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?h=1.34&id=ec80a0b32adf8df633d249c2c7de694f37f9ab53 (header differences in network.c and voicecall.c)
https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?h=1.34&id=8e78d4dba5d54b4b1175a53973ceb6f829c22bfa (added include stdbool.h>

Skipped:
https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?h=1.34&id=17b6c6c31461c4e2034573f1d3af2ca39edfaac0 (already present)
https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?h=1.34&id=9111a1ac53b42d083d1e06a6ce768c588612116d (jolla code different)
https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?h=1.34&id=3b7d8e003e773ed543f4ff03e1190b3513eb94eb (jolla code different)
https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?h=1.34&id=cf4a4a7bd0384abdc8a7610413a977e2457caac0 (already present)
https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?h=1.34&id=84bfd8fe875db697c6ae7273aa1ad2cdcbf25092 (ell)
https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?h=1.34&id=2df4bd71937b56c7b1e5a9ddffe9d702f7630bd1 (ell)
https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?h=1.34&id=906c126009cfab13ea8eb6febabf4a28bf5217b0 (alerady present)
https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?h=1.34&id=e31ffc9891361640ea78e1abe16894daf247b337 (already present)
https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/?h=1.34&id=c83d693097fcafd7d1fbea79c051f27c3849dd59 (already present)

lynxis and others added 30 commits February 13, 2022 17:09
The message can be emitted without the fields being present. In this case ber or rssi are 0
resulting in a null pointer deref.
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"
if (ctx->apn) is always true since apn is an array variable
if (ctx->apn) always evalues to true since it is an array member
We pass in the maximum size of the buffer to the read system call.  On
the astronomically unlikely chance that we indeed read the full buffer
full of data, the subsequent assignment will overflow it.  Fix this by
passing sizeof(buf) - 1 to the read system call instead.
In case strlen(ICCID) > 20, we simply return without freeing the ICCID
value first.
if (ctx->message_proxy) always resolves to TRUE
The default context created when provisioning fails is simply a context
with an empty APN
ctx->message_center and ctx->message_proxy are arrays and thus
always evaluate as true
The code is not really copying strings but 2 or 3 character sof the MNC.
Make this clearer.
nikhiljha and others added 30 commits February 16, 2022 15:32
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.
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.
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.
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.
Otherwise the build will complain about multiple definitions
Modem USB interface does not receive certain gprs context notifications.
Fix gprs chat: use Application USB interface to receive all the modem
notifications.
Gemalto ELS81x modems use 'ME PDN DEACT' message to notify about gprs
context deactivation. Process this 'deactivate' event in CGEV handler.
Add support for IPv6 and dual mode gprs contexts.
Fix compiler error introduced due to a bad merge

Fixes: de0d5a1 ("gemalto: gprs: support different gprs protocols")
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.
Add support for gprs contexts with username, password,
and specific authentication type.
Selection capability for authentication method via a command line
argument has been added
Some modems such as Quectel EC200T do not honor the default value for
the Async-Control-Character-Map (ACCM) configuration option defined in
RFC 1548 6.2 as 0xffffffff. This patch suggests to use RX ACCM = 0 for
Ofono by default as pppd does for instance. This will reduce PPP data
overhead as well.
Support for the Quectel EC200 USB modem series has been added. The model
identification AT command has been added as the first step in the
communication with a Quectel USB modem.
Implement network monitoring driver for gemalto modems that
are able to provide serving cell information and basic
measurements using AT+CQS and AT^SMONI commands.
Enable netmon functionality for Gemalto ELS81x modems.
Gemalto modem reports raw measurements in dBm. Reported values may
include negative numbers. Meanwhile oFono follows ETSI TS 27.007,
so negative numbers do not really exist at the API level.

Modify gemalto netmon driver to report measurements according to
27.007. For this purpose re-scale from what Gemalto firmware
reports into something that 27.007 recommends.
Add helper to validate if TLV value is a valid UTF8 string.
Note that both null-terminated and non null-terminated UTF8
strings are considered valid.
Make sure that IMS private identity is a valid UTF8 string before
setting sim->impi field. Otherwise ofono may crash on dbus assert
when SIM properties are reported via org.ofono.SimManager interface.
Handle USSD QMI indication messages.
Add support for UCS2 USS Data coding scheme.
Check for User Action TLV type.
g_utf8_validate_len() is support after glib 2.60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.