Commit 33744c51 made it recommended only, but the reason for change
seemed more of not failing building images without anything providing
the ofono-configs. On provider-info there shouldn't be similar
problems and there should be a dependency for it.
The following property has been added to the API:
string Registration [readwrite, Sailfish OS specific]
The IMS registration strategy. Valid values are:
"disabled" keep registration off
"enabled" manual registration
"auto" keep registration on
The Register() method, if implemented, will fail
with [service].Error.NotAllowed if the value of
this property is "disabled".
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.
According to the u-blox AT Commands Manual and my tests
the response prefix of AT+UUSBCONF is "+UUSBCONF:", including
a colon. The colon was missing in the code, causing next step
to parse a number to fail, since a colon is not a number.
In a recent patch vendor family was only set if the device
did not support USBCONF, but that resulted in drivers
being registered the "generic" vendor. That caused
for instance netreg to use incorrect cmer mode and fail
on TOBY-L210.
Adding two new properties to sim manager interface to handle
dual SIM single active use case.
CardSlotCount [readonly]
Contains the count of number of SIM card slots available.
ActiveCardSlot [readwrite]
Contains the index of the currently active SIM card slot
for dual SIM single active mode.
Trying to set the networking mode to "bridge" mode in the plugin is bogus
because the setting does not apply until after the device has been
reset. Instead, the current setting should be queried.
If a user wants to set the modem networking mode, the setting should be
made outside of ofono.
The gprs-context driver has already been adjusted to query the
networking mode and to set things up accordingly.
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.
Depending on the transport used on the data connection we want either
the "atmodem" (PPP) driver or the "ubloxmodem". For the "ubloxmodem",
we want to pass the model data so this patch wrangles some parameters to
make sure that right driver and right variant data are passed.
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
ttyACM0 (USB interface 02) is reportedly unreliable (breaking DHCP setup)
so the recommended approach is to use ttyACM2 (USB interface 06)
exclusively.
Some aspects of a device are detectable at runtime, like the USB profile
detection that was added in a patch preceding this one. This patch
switches the driver over from creating a new "vendor id" for each
profile to just setting a flag. This is more easily extensible as we
detect other features of the modem.
The TOBY L2 series of modems presents a number of different
configurations with different throughtput characteristics. These
configurations are packaged up as USB profiles; moreover, changing the
profile actually changes the USB model ID so this is even more like
selecting a different "device" altogether. Nonetheless, all we need to
know is which profile is selected in order to set things up correctly
and this can be queried directly.
This patch adds a call to UUSBCONF for applicable modems in order to
query the USB configuration to find out which profile is active.
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 patch adds a call to CGMM into the modem_enable path in order to
establish the specific device model. From this device model string, a
model-specific capabilities structure can be selected.
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.
Many ublox modems can sit on either the USB bus or talk directly to a
UART. The udev plugin mostly takes care of figuring out what ports to
talk to and the protocol is common for all devices after that.
This patch simplifies the setup a bit:
i) There must always be an aux channel for communication with the modem
ii) The aux channel may be found behind the string Aux for USB modems
or Device for serial modems
iii) If the Modem string is set, use it; if not set, assume it's not
available.
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.
While adding the sim pin cache feature, pin_name could cause issue in
cases when sim pin is not there.
log:
ofonod[27810]: drivers/atmodem/sim.c:at_cpin_cb() crsm_pin_cb: READY
ofonod[27810]: src/sim.c:sim_pin_query_cb() sim->pin_type: 0, pin_type: 0
ofonod[27810]: Aborting (signal 11) [./src/ofonod]
ofonod[27810]: ++++++++ backtrace ++++++++
ofonod[27810]: #0 0x7fb7a7586cb0 in /lib/x86_64-linux-gnu/libc.so.6
ofonod[27810]: #1 0x7fb7a7693cd8 in /lib/x86_64-linux-gnu/libc.so.6
ofonod[27810]: #2 0x4d899b in sim_pin_query_cb() at src/sim.c:3174
ofonod[27810]: #3 0x4649e7 in at_cpin_cb() at drivers/atmodem/sim.c:1304
ofonod[27810]: #4 0x4a5d70 in at_chat_finish_command() at gatchat/gatchat.c:462
The if statements were over 80 characters and breaking them up made the
code look a bit uglier. So refactor the if statements to just figure
out the data path 'n' parameter or return an error. On success, form
the datapath string and return it.
Also bump the buffer size and use snprintf to be safe(r).
This patch allows a driver to set the interface only once, instead of at
every context activation. The previous way was originally designed for
PPP and RAW_IP based contexts which would have a (potentially)
differently named interface after each context activation due to use of
TUN/TAP. This also worked for static high-speed interface setups as
well, since these usually had a single interface only.
For devices that support multiple high-speed interfaces it would be
advantageous to have each gprs_context get an interface assignment right
in the modem driver and skip having to setup the interface on every
activation.
Since the commit that introduced the notification API of a SIM inserted
and initialized I can not unlock the SIM card on a WP7607 modem.
The previously mentioned commit: 54d56d763e40bc44c99a9b24aa0477bd373ea085
Adding SIM PIN caching feature to oFono. oFono now caches the SIM PIN1
type against the ICCID throughout its lifetime in a link list and
enters implicitly upon modem reset/crash.
Note, that this behavior can violate 3GPP spec 21.111, section 5.3 -
User Data stored in ME if that section is interpreted very strictly.
However, our interpretation is that firmware resets are allowed, based
on historic precedent. Helps in user experience by not barring out
cellular services unless pin is entered manually.
Handles cases of incorrect pin and sim pin changed externally.
Clear cached PIN incase modem disabled manually and selectively when
sim is removed.
Seperate 'pin_cache_enter_cb' added without dbus calls to handle
implict entering of cached pin.
For now this behavior is applicable to all modems by default. In the
future it may be needed to make this behavior opt in or otherwise
configurable.
This implements support for selecting endianess for the SMS data message
multi-byte parameters. By default big endian is used but little endian
is required in some special protocols. Thus, omitting flag value results
in the "GSM" setting which is the big endian used by default.
This required adding a new sms_datagram_prepare_with_endianess() plugin
API call that is called by the original sms_datagram_prepare() with GSM
encoding.
This affects only the new SendDataMessage D-Bus API. A value 0x02 for
little endian is added to enum ofono_sms_data_flag().
This adds a new D-Bus API call "SendDataMessage" to be used for sending
a SMS data message. This is required especially by AML but can be
utilized for other uses as well.
The given message data is defined as a byte array so pre-encoded data
is only supported. Additionally source and destination ports as well as
flags are to be defined for the SMS data message. Flag
OFONO_SMS_DATA_FLAG_DELIVERY_REPORT (0x01) determine the need for
delivery reports. Other flags may be added later on.
This also implements the filter functionality for the SMS data messages.
This can be utilized by the plugins to react to the sent SMS data
messages appropriately.
This removes the exceptions made for emergency calls to disallow
filtering of them via plugins. Thus, this allows the plugins to detect
if an emergency call is made and make an action based on it.
Those are required by external plugins to properly support USSD sending.
ofono_ussd_decode_free() is basically a g_free() and its only purpose
is to keep ofono API glib-free. External plugins shouldn't make any
assumptions about how return values are allocated by the core.
The way it was done, slot driver wasn't always notified about the
role change after IMSI update (e.g. when SIM gets hot-swapped or
enabled/disabled) which could result in mobile data remaining
disabled.
skipping TAP/TUN support check from gprs-context probe for
xmm vendor. xmm modem does not require TAP/TUN support. Also
it is not enabled by default in enbedded yocto bsp.
when the voice call driver is probing, I noticed sometimes
a CME Error with the code = 4 (operation not supported)
related to AT commands "AT+CSSN=1,1" and "AT^SLCC=1".
In the current voice call implementation for Gemalto modems
the ofono_voicecall_create() is called on the gemalto_pre_sim().
The sim is not totaly readed by the module, it is not yet
online which is causing a sporadic problem at driver
intialization also when launching some outgoing/incoming calls.
This change moves the ofono_voicecall_create() to the
gemalto_post_online() to be sure that sim is well registred
and online. Several other call related atoms are also moved to
post_online state.
At some point, self-explanatory icons meant that no text was sent to the
agent, yet stktest was never updated to reflect that behavior. Update
this properly.
inet_ntoa was called twice in a row and as a result both primay and
secondary DNS were pointing to same static buffer containing last
value (secondary DNS).
As a result, ofono always advertised the secondary DNS twice through
DBus ConnectionContext.GetProperties 'DomainNameServers'.
Related: https://osmocom.org/issues/3031
CC drivers/mbimmodem/mbim.o
drivers/mbimmodem/mbim.c: In function ‘command_write_handler’:
drivers/mbimmodem/mbim.c:490:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=]
l_info("n_iov: %lu, %lu", n_iov + 1, (size_t) written);
^
drivers/mbimmodem/mbim.c:490:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ [-Wformat=]
drivers/mbimmodem/mbim.c: In function ‘command_read_handler’:
drivers/mbimmodem/mbim.c:649:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=]
l_info("header_offset: %lu", device->header_offset);
^
drivers/mbimmodem/mbim.c:650:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=]
l_info("segment_bytes_remaining: %lu", device->segment_bytes_remaining);
^
The ofono_lte_default_attach_info now handles also the protocol and the
authentication method, username and password.
Co-authored-by: Martin Baschin <martin.baschin@googlemail.com>
the cb_data can be used by creating the structure with cb_data_new,
and then there are two possibilities:
- use it in a single callback function, and destroy it with a call to
g_free.
Example:
- calling function:
struct cb_data *cbd = cb_data_new(cb, data);
if (g_at_chat_send(chat, buf, NULL, at_cgatt_cb, cbd, g_free) > 0)
return;
g_free(cbd);
- called function (here at_cgatt_cb):
static void at_cgatt_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_gprs_cb_t cb = cbd->cb;
struct ofono_error error;
decode_at_error(&error,
g_at_result_final_response(result));
cb(&error, cbd->data);
}
note the absence of explicit g_free(cbd);
- pass it through a train of callback functions, adding a reference at
each pass cb_data_ref, and removing it with cb_data_unref.
the use of cb_data_ref would replace a new object creation, while the
use of cb_data_unref the use of g_free.
Example:
- calling function:
struct cb_data *cbd = cb_data_new(cb, data);
// no cb_ref at the creation
if (g_at_chat_send(chat, buf, NULL,
at_lte_set_default_attach_info_cb,
cbd, cb_data_unref) > 0)
goto end;
cb_data_unref(cbd);
- called function 1 (at_lte_set_default_attach_info_cb):
static void at_lte_set_default_attach_info_cb(gboolean ok,
GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
cbd = cb_data_ref(cbd);
if (g_at_chat_send(chat, buf, NULL,
at_cgatt_cb, cbd, cb_data_unref) > 0)
return;
cb_data_unref(cbd);
}
- called function 2 (at_cgatt_cb):
like above. no call to g_free or cb_data_unref. The terminal function
doesn't need to know about the reference scheme.
this patch provides the handling for the modem-depending powered timeout
It provides the trivial implementation for
ofono_modem_set_powered_timeout_hint, introducing the ofono_modem
variable timeout_hint, used together with the existing ofono_modem
variable timeout.
The default value, previously hardcoded as a magic number, is provided
by the DEFAULT_POWERED_TIMEOUT define and set as soon as the
ofono_modem struct is created, and then can be overwritten by the
aforementioned ofono_modem_set_powered_timeout_hint.
function to set the powered timeout for those cases where a device might
require longer time to boot (uncommon).
The function is effective if called before Powered=true,
so it is best called by modem detection logic and prior to calling
ofono_modem_register.
The function at_util_get_cgdcont_command computes the AT+CGDCONT
string, as per 3GPP 27.007.
It uses a second function, at_util_gprs_proto_to_pdp_type,
that returns the pdp_type string for the command
This function converts the ofono enum ofono_gprs_auth_method
into the value of the 3GPP 27.007 'auth_proto' variable of +CGAUTH so
that it can be passed directly to the AT command.
Many LTE networks require user authentication, even for the default
context. In particular, most of the private APNs use this facility
to add some control on top of the MNO providing the service, so that
another user of the same network cannot access the private one.
As such, we add these parameters to the default context
settings that will attempt to use when registering to the network.
The additional parameters added by this patch are: protocol, user, and
password. These are sufficient to allow to connect to networks
available to the patch author where ofono previously failed to register
to the network at all.
Co-authored-by: Martin Baschin <martin.baschin@googlemail.com>
Co-authored-by: Denis Kenzior <denis.kenzior@intel.com>
The ofono_lte_default_attach_info is extended with protocol,
authentication method, username and password.
Co-authored-by: Martin Baschin <martin.baschin@googlemail.com>
Added 4 properties for handling the type of context and the
authentication method, exactly like in any gprs context handling.
The properties are named after the equivalent gprs-context one, for
compatibility and uniformity.
Co-authored-by: Martin Baschin <martin.baschin@googlemail.com>
The plugin for Gemalto modems is enriched with all voice-related atoms,
as well as USSD.
All except the voicecall itself are from the atmodem, while the
voicecall is from gemaltomodem.
This atom uses the URC ^SLCC to monitor the call status, as well as
incoming calls.
Note the use in the atom of the variable GemaltoVtsQuotes: this is
needed to support future modules, as of today not yet available in the
plugin.
There are a large number of files in the tree that define _GNU_SOURCE
despite not actually using features hidden behind this flag. This patch
removes all these definitions in one fell swoop...
The driver vtables are read-only structures. This patch declares them as
'const' allowing the compiler to (optionally) put them in the RELRO
section. RELRO pages may be marked as read-only by the linker after
the relocations have been done ensuring that they aren't inadvertently
or maliciously altered at runtime.
the following functions:
gprs_proto_to_string
gprs_proto_from_string
gprs_auth_method_to_string
gprs_auth_method_from_string
are moved from gprs.c to common.c, with related declaration in common.h
so that they can also be accessed from lte core functions
ofono_gprs_proto and ofono_gprs_auth_method, and related length consts,
moved to types.h from gprs-context.h,
so that they can be shared also with lte core functions
This method makes explicit the lack of authentication.
When selected, the username and password are ignored, but they are not
changed in the user-defined properties for the context.
This treatment is necessary to allow setting independently auth_method,
username and password.
This method is also selected implicitly when username is set to
an empty string. Also this selection is done without changing the
user-defined auth_method for the context, so that the behavior is
consistent.
Patch to be considered, if support for EUTRAN SMS states accepted.
SMS registered flag while sending sms to consider the new EUTRAN
registered status also.
plugins/cellinfo-netmon.c: In function 'cellinfo_netmon_notify':
plugins/cellinfo-netmon.c:85:44: warning: '%0*d' directive output may be truncated writing between 1 and 2147483647 bytes into a region of size 3 [-Wformat-truncation=]
snprintf(s_mnc, OFONO_MAX_MNC_LENGTH, "%0*d",
^~~~
plugins/cellinfo-netmon.c:85:43: note: directive argument in the range [0, 999]
snprintf(s_mnc, OFONO_MAX_MNC_LENGTH, "%0*d",
^~~~~~
src/gprs-provision.c: In function 'ofono_gprs_provision_get_settings':
src/gprs-provision.c:60:2: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
if (mcc == NULL || strlen(mcc) == 0 || mnc == NULL || strlen(mnc) == 0)
^
plugins/generic-phonebook.c: In function 'export_entries':
plugins/generic-phonebook.c:942:2: warning: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
if (strcmp(storage, "SM") != 0) {
^
Not having it defined prior to use may result in weird compilation
errors about pointer type being incompatible with iself, e.g.
expected struct ofono_modem * but argument is of type struct ofono_modem *
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.
The sim atom is now created with the GEMALTO vendor instead of
CINTERION. This is because GEMALTO has superceeded CINTERION and the
gemalto plugin will be updated to handle (legacy) modems from cinterion
as well as current gemalto devices.
In some case linux report 'driver' as valid yet vid and pid as NULL.
Adding NULL check to prevent seg fault.
Log:
ofonod[23829]: plugins/udevng.c:udev_start()
ofonod[23829]: plugins/udevng.c:enumerate_devices()
ofonod[23829]: plugins/udevng.c:check_usb_device() hub [1d6b:0002]
ofonod[23829]: plugins/udevng.c:check_usb_device() usb [1d6b:0002]
ofonod[23829]: plugins/udevng.c:check_usb_device() usbhid [03f0:034a]
ofonod[23829]: plugins/udevng.c:check_usb_device() usbhid [03f0:034a]
ofonod[23829]: plugins/udevng.c:check_usb_device() usb [1d6b:0002]
ofonod[23829]: plugins/udevng.c:check_usb_device() cdc_acm [(null):(null)]
ofonod[23829]: Aborting (signal 11) [./src/ofonod]
The AT command reference for Quectel M95 specifies that remaining SIM
pin retires can be queried using AT+QTRPIN, which responds with one
count for each pin-type:
+QTRPIN: 3,3,10,10
After entering the PIN code, enable an extra AT+CPIN? for the M95
vendor.
Since the merge of udev.c into udevng.c all cleanup function must handle
both usb devices and serial devices. Add this distinction to
check_remove(), so that is doesn't try to iterate the .serial member as
if it were a .devices list.
When ofono dies while connected using PPP, modem AT channel is not put
back to command mode (tested with HUAWEI modems E3372 and MS2372).
If ofono is restarted, it won't be able to connect as it gets no answer
to AT commands on this AT channel.
This patch adds a quirk to immediately send escape sequence on modem
channel when gprs-context atom is removed.
In case we try to enter the PIN/PUK and fail to enter a correct code,
the PIN/PUK retries are not rechecked as they should be.
Reported by: Florent Beillonnet <florent.beillonnet@gmail.com>
It seems that the function at_pin_send_puk should have been changed
along with at_pin_send, because it's also refering to the
at_pin_send_cb callback
See this commit : ba9f126716db3ae0bf6a3139088d9657cfb8b851
The return value from ofono_modem_register was not being checked. If this fails
the modem object is not setup and causes a crash. This was specifically seen
when using the mbim driver without having configured with mbim support.
Now the modem object gets destroyed properly if the modem registration fails.
On the SIMCom SIM7100E, setting AT+COLP=1 causes there to be no
response at all from "ATD...;" commands until the call is answered.
The results in oFono stalling rather than creating a new VoiceCall
object.
We fix this by adding SIMCOM to the list of vendors for whom we set
AT+COLP=0 rather than AT+COLP=1.
Add support for the SIM7100E modem. We add a new "sim7100" plugin
because there's no other AT-based modem that has support for both GPRS
and voice calls.
In file included from unit/test-mbim.c:28:0:
unit/test-mbim.c: In function ‘parse_device_caps’:
unit/test-mbim.c:332:9: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
assert(cellular_class = 1);
QMI_UIM_GET_CARD_STATUS is retried in more error cases
when trying to get password type.
In case of failure, driver report an error instead of
OFONO_SIM_PASSWORD_INVALID. This avoids a crash.
Use right slot and application to get card status, PIN status and PIN
retries. Without this patch, SIMs where selected application and slot
numbers are different are not detected.
The way things are currently coded, the gobi plugin calls
qmi_device_discover and does nothing else until it succeeds. As such,
we can safely assume that the version_list is set up when we go to
create a service.
The only thing this output parameter is being used for now is for
getting the transaction ID. Return the TID directly from
__submit_requesta and drop the 'head' parameter altogether.
The only way request_alloc can fail is if one of the memory allocation
routines fail to allocate memory. However, Linux memory allocation
doesn't really fail in this manner; memory can be overcommited and the
out-of-memory reaper will take care of re-establishing the balance when
excess memory is actually accessed.
Given this, request_alloc will never return anything other than success
and the failure paths will never be exercised.
The service and control requests differ slightly in their headers, but
this difference is minor enough that we can handle it directly in the
request submission routine. This patch unifies the header setup for the
two request types.
After setting up the request structure, qmi_service_send makes no
further use of the 'param' and 'service' fields of the service_send_data
structure. This patch removes those fields and frees 'param'
immediately after the request has been allocated and the parameter data
thereby copied into the send buffer.
==2870== Conditional jump or move depends on uninitialised value(s)
==2870== at 0x4C2ED31: __memcmp_sse4_1 (vg_replace_strmem.c:972)
==2870== by 0x4F451A: sim_pin_retries_query_cb (sim.c:462)
==2870== by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870== by 0x45544A: service_send_callback (qmi.c:2143)
==2870== by 0x452D00: handle_packet (qmi.c:815)
==2870== by 0x452E85: received_data (qmi.c:863)
==2870== by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x4C680B: main (main.c:256)
==2870== Uninitialised value was created by a stack allocation
==2870== at 0x459B1A: query_pin_retries_cb (sim.c:531)
==2870==
==2870== Conditional jump or move depends on uninitialised value(s)
==2870== at 0x4F451D: sim_pin_retries_query_cb (sim.c:462)
==2870== by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870== by 0x45544A: service_send_callback (qmi.c:2143)
==2870== by 0x452D00: handle_packet (qmi.c:815)
==2870== by 0x452E85: received_data (qmi.c:863)
==2870== by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x4C680B: main (main.c:256)
==2870== Uninitialised value was created by a stack allocation
==2870== at 0x459B1A: query_pin_retries_cb (sim.c:531)
==2870==
==2870== Conditional jump or move depends on uninitialised value(s)
==2870== at 0x4F3DFB: get_pin_retries (sim.c:278)
==2870== by 0x4F4553: sim_pin_retries_query_cb (sim.c:467)
==2870== by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870== by 0x45544A: service_send_callback (qmi.c:2143)
==2870== by 0x452D00: handle_packet (qmi.c:815)
==2870== by 0x452E85: received_data (qmi.c:863)
==2870== by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x4C680B: main (main.c:256)
==2870== Uninitialised value was created by a stack allocation
==2870== at 0x459B1A: query_pin_retries_cb (sim.c:531)
==2870==
==2870== Conditional jump or move depends on uninitialised value(s)
==2870== at 0x4F3E65: get_pin_retries (sim.c:288)
==2870== by 0x4F4553: sim_pin_retries_query_cb (sim.c:467)
==2870== by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870== by 0x45544A: service_send_callback (qmi.c:2143)
==2870== by 0x452D00: handle_packet (qmi.c:815)
==2870== by 0x452E85: received_data (qmi.c:863)
==2870== by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x4C680B: main (main.c:256)
==2870== Uninitialised value was created by a stack allocation
==2870== at 0x459B1A: query_pin_retries_cb (sim.c:531)
==14399== 28 bytes in 4 blocks are definitely lost in loss record 151 of 390
==14399== at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
==14399== by 0x209065: convert_gsm_to_utf8_with_lang (util.c:651)
==14399== by 0x2091D1: convert_gsm_to_utf8 (util.c:690)
==14399== by 0x22DDA7: ussd_decode (smsutil.c:4738)
==14399== by 0x18BF71: qmi_ussd_request (ussd.c:233)
==14399== by 0x2183EA: ussd_initiate (ussd.c:614)
==14399== by 0x27B6C8: process_message (object.c:259)
==14399== by 0x27D1CD: generic_message (object.c:1070)
==14399== by 0x5170732: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.14)
==14399== by 0x5161D83: dbus_connection_dispatch (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.14)
==14399== by 0x27907C: message_dispatch (mainloop.c:72)
==14399== by 0x4E826A9: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==14399== 16 bytes in 8 blocks are definitely lost in loss record 132 of 390
==14399== at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
==14399== by 0x59E03D9: strndup (strndup.c:43)
==14399== by 0x18277E: qmi_result_get_string (qmi.c:1794)
==14399== by 0x184221: get_ids_cb (devinfo.c:129)
==14399== by 0x18353B: service_send_callback (qmi.c:2286)
==14399== by 0x18093C: handle_packet (qmi.c:831)
==14399== by 0x180ADD: received_data (qmi.c:880)
==14399== by 0x4E826A9: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==14399== by 0x4E82A5F: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==14399== by 0x4E82D81: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==14399== by 0x201900: main (main.c:306)
The ofono phone number max length is 80 so a buffer size of 64 is
obviously insufficient. Expanding the buffer to 128 prevents a
potential failure and suppresses the folowing compiler warning:
../drivers/atmodem/sms.c: In function ‘at_csca_set’:
../drivers/atmodem/sms.c:108:40: warning: ‘%s’ directive output may be truncated writing up to 80 bytes into a region of size 55 [-Wformat-truncation=]
snprintf(buf, sizeof(buf), "AT+CSCA=\"%s\",%d", sca->number, sca->type);
^~
../drivers/atmodem/sms.c:108:2: note: ‘snprintf’ output between 13 and 103 bytes into a destination of size 64
snprintf(buf, sizeof(buf), "AT+CSCA=\"%s\",%d", sca->number, sca->type);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HFP spec 1.7.1 (4.34.1) says:
The Codec ID for the mandatory narrow band codec (CVSD) shall
always be included.
If wide band speech is supported, then the mandatory codec (mSBC)
shall be included unless it is temporarily unavailable.
Any other optional wide band speech codecs may also be included
in this list as long as the mandatory codec is included first.
---
The wording in spec is slightly vague on what the ordering of
mandatory narrow band codec (CVSD) and - IF wide band speech
is supported - mandatory wide band coded (mSBC) should be.
oFono's take is that the mandatory narrow band codec should
be listed first, and when mSBC is there oFono will abort the
connection.
To fix this we can be less pedantic about the ordering of
codecs - as long as the mandatory ones are there.
1. Exposed D-Bus clients list to plugin as ofono_dbus_clients
2. Signal has to be properly declared, otherwise it's not emitted
3. Added missing unit tests
Larger MTU means better throughput, and the original problem for which
this workaround was implemented was specific to MMS. There's no reason
to limit MTU for other data connections.
Add a new org.nemomobile.ofono.CellInfo.Unsubscribe method. If it is called
ofono excludes the client from cell info consumers. The updates will be
disabled if no one client left.
There is an issue when some of the Mediatek modems do not accept empty
path to the EFpbr file on the USIM and do reset themselves.
This fix appends usim_path to the GET DATA command when it comes to
exporting phonebook from SIM card and prevents crashes like described
one.
The intent here was to find the contents of the 3 low order bits
according to Table 11-5 in ETSI 102.221. However, the mask ended up
only grabbing the contents of the 2 low order bits.
grilio_channel_retry_request() returns FALSE if the request is pending,
i.e. has been submitted but there was no reply yet. In that case, in
order to retry right away, we need to cancel the already submitted
request (and ignore the reply when it arrives) and resubmit a fresh
new one.
Currently, the DBus queue stops working after an asynchronous request
has been completed while another request is pending. This commit adds
__ofono_dbus_queue_submit_next(), which fires a pending request after
the previous one completes.
There is an issue when network operators return "allowed" flag no matter
which SIM card you are using currently. In that case, when user tries to
manually connect to such networks, it takes too long to have 2 (by
default) retries until device will get back to its home network.
So the solution is not to set additional retries to the
RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL request, as it has been done
in RILJ.
Otherwise it's not clear how the client is supposed to wait for
org.ofono.HandsfreeAudioManager to appear and how to figure out
whether it's ever going to appear.
Trying to connect too soon will result in profile interface registration
failure with timeout error, effectively blocking for dbus timeout (25s
by default).
There's no need for RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG, since we
are not using its result anyway. Better just register for notifications
which would simply never arrive if CBS doesn't work at all.
Important requests, however, better be retried on RIL_E_INVALID_STATE.
The radio caps manager will not do anything until the roles are assigned
to modems, so data manager must select the modem with highest capabilities
for LTE instead of the first one.
Some RILs (e.g. Sony Xperia X, MediaTek) report bogus operator names
in response to QUERY_AVAILABLE_NETWORKS request. We can make user's
life easier by looking up possible operator name in MBPI database
based on MCC and MNC (assuming those are reported correctly) in case
if weirdness is detected.
To turn this feature on, add this to /etc/ofono/ril_subscription.conf
config file:
replaceStrangeOperatorNames=true
The SmsHistory plugin uses a global variable to determine if it is already
registered. Because of that, Ofono provides org.ofono.SmsHistory only for
the first modem, and SMS delivery notifications do not work on the others.
After this commit is applied, the plugin will be registered for each modem.
On some devices RIL requires to reset the modem while switching radio
capabilities. During this procedure all associated objects should be
disposed and replaced by new instances. This patch fixes a memory
leak through RilCellInfo object.
There's no need to wait for modem to get powered on. This is just a user
setting - if it can't be applied right away, it will be applied later at
appropriate time.
Changed ril_radio_confirm_power_on() to send RADIO_POWER request even if
we think that modem is powered on. Some RILs change power state without
letting us know and that's what this function is for - to make sure that
power is on when we think that it's on.
Also, mobile data need to be disallowed before deleting the modem
object, so that power keep-on request could be submitted before
bringing the modem offline, to keep power on while data call is
being deactivated (if there was one).
On some devices SET_NETWORK_SELECTION_AUTOMATIC takes significant time,
because it triggers a complete scan of available PLMNs. If applied, this
commit will make ofono to issue QUERY_NETWORK_SELECTION_MODE first and
check whether the mode actually needs to be changed.
On some devices (such as BQ Aquarius NS208) SET_NETWORK_SELECTION_AUTOMATIC
takes a long time and ofono fails with timeout. If applied, this commit
will make network selection timeout configurable.
If applied, this commit will add a new ril_devmon implementation which
controls network state updates by sending SET_UNSOLICITED_RESPONSE_FILTER.
This is useful for devices with RIL version >= 15 if they ignore
both SEND_DEVICE_STATE and SEND_SCREEN_STATE requests as some Qualcomm-
based devices do.
Non-privileged process will get org.ofono.Error.AccessDenied from
RegisterAgent. Other methods already check that D-Bus call is coming
from a registered agent.
Apparently, the only way to get rid of "warning: G_ADD_PRIVATE" is to
completely disable all Glib deprecation warnings in the entire file.
G_GNUC_BEGIN/END_IGNORE_DEPRECATIONS macros don't help :/
With some networks we sometimes start getting error 55 (Multiple
PDN connections for a given APN not allowed) when trying to setup
an LTE data call and this error doesn't go away until we successfully
establish a data call over 3G. Then we can switch back to LTE.
When an LTE modem registers with the network, a default bearer is
automatically established. The APN used for this bearer is taken from
whatever default settings the modem has.
The LTE atom takes cares of setting up the default context/profile with
the APN to use. From there, a default bearer will be established when
the modem registers with the network. This results in a call to 'Get
LTE Attach Parameters' which tells us what APN the gateway negotiated
with us.
If we can't get the APN, we do what the AT driver does: pretend the
bearer wasn't established. This is a reasonable fallback, currently,
because connman can't handle zero-length APN's anyway; the previous
approach of setting the APN to 'automatic' breaks connman badly when it
needs to switch between LTE and non-LTE networks.
This atom needs to be created in post_sim so that the APN can be
written to the default profile before the modem attempts to use the
setting to connect to the network.
This patch adds an LTE atom for QMI modems.
This atom sets the APN that the LTE default bearer should use when
establishing its PDP context. This APN needs to be set on the 'default'
profile so the atom queries which profile is the default and resets
it before allowing the APN to be set.
Once configured, the default profile settings are used when the
modem connects to the network; for this reason, the LTE atom needs
to be instantiated in post_sim, before the modem is set online.
==31530== 88 bytes in 2 blocks are definitely lost in loss record 132 of 186
==31530== at 0x4C2BF8F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==31530== by 0x5847B97: vasprintf (in /lib64/libc-2.23.so)
==31530== by 0x510AE38: g_vasprintf (gprintf.c:316)
==31530== by 0x50D8BDF: g_strdup_vprintf (gstrfuncs.c:514)
==31530== by 0x50D8CAA: g_strdup_printf (gstrfuncs.c:540)
==31530== by 0x4F706B: build_nai (sim-auth.c:660)
==31530== by 0x4F706B: sim_auth_register (sim-auth.c:738)
==31530== by 0x4F706B: ofono_sim_auth_create (sim-auth.c:768)
==31530== by 0x4ACBB4: modem_change_state (modem.c:525)
==31530== by 0x4AD0CD: sim_state_watch.part.5 (modem.c:720)
==31530== by 0x4CF6D0: call_state_watches (sim.c:366)
==31530== by 0x4CF6D0: sim_set_ready (sim.c:1475)
==31530== by 0x4CF6D0: sim_imsi_obtained (sim.c:1577)
==31530== by 0x45D868: at_cimi_cb (sim.c:453)
==31530== by 0x49CB5F: at_chat_finish_command (gatchat.c:459)
==31530== by 0x49DAC7: at_chat_handle_command_response (gatchat.c:521)
==31530== by 0x49DAC7: have_line (gatchat.c:600)
==31530== by 0x49DAC7: new_bytes (gatchat.c:759)
Calling from memory index is very similar in functionality to dialing
the last called number. So we rename the functions so we can reuse them,
to deal with memory index calling. Function names now also reflect this
is for hfp.
To change the default behavior in respect to selecting the data SIM, the
following option can be added to /etc/ofono/main.conf:
[ModemManager]
AutoSelectDataSim=on
And data SIM will be picked automatically if none is selected by the user.
All possible options:
off = option is off (default)
once = automatically select data SIM once
always = make sure that data SIM is always selected
"on" is equivalent to "always"
Those symbols are not exported by ofono anyway and can't be
referenced by external plugins. Built-in plugins can pull those
headers directly from the source tree.
Add forceGsmWhenRadioOff config option
On some phones (such as Jolla C), even if the slot which has been
using LTE gets powered off, we still need to explicitly set its
preferred mode to GSM, to make LTE machinery available to the other
slot.
Some RILs don't like it when we do this.
See merge request mer-core/ofono!241
On some phones (such as Jolla C), even if the slot which has been
using LTE gets powered off, we still need to explicitly set its
preferred mode to GSM, to make LTE machinery available to the other
slot.
Some RILs don't like it when we do this.
If an operation is in progress and an operation is canceled, we don't
actually destroy it, but simply clear out the callback. In the case of
a context being destroyed, the operation is left on the simfs op_q with
a dangling pointer to the already freed context. So the current logic
in sim_fs_op_free tries to access invalid memory.
Fix this by performing the watch operations in sim_fs_end_current
instead and setting the context pointer appropriately.
0 0x00007ffff7b20517 in g_queue_is_empty () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
1 0x00005555556adcdd in sim_fs_op_free (pointer=0x5555559cb990) at src/simfs.c:101
2 0x00007ffff7b205fc in g_queue_foreach () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
3 0x00007ffff7b2065b in g_queue_free_full () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
4 0x00005555556add81 in sim_fs_free (fs=0x5555559c0780) at src/simfs.c:125
5 0x00005555556828f3 in sim_remove (atom=0x5555559cb000) at src/sim.c:3175
6 0x000055555564f16f in flush_atoms (modem=0x555555a8fb00, new_state=MODEM_STATE_POWER_OFF) at src/modem.c:432
7 0x000055555564f3bd in modem_change_state (modem=0x555555a8fb00, new_state=MODEM_STATE_POWER_OFF)
at src/modem.c:510
8 0x000055555564ff99 in set_powered (modem=0x555555a8fb00, powered=0) at src/modem.c:896
9 0x000055555565074c in modem_set_property (conn=0x55555596c8d0, msg=0x55555596e460, data=0x555555a8fb00)
at src/modem.c:1120
There's no need to wait for anything in this case.
Also, call ofono_sim_initialized_notify() when completing pin entry
in ril_sim_pin_change_state_cb() to let the core know that we are
ready to accept further requests.
==7578== at 0x4C2AB80: malloc
==7578== by 0x4E856D0: g_malloc
==7578== by 0x4E9B2ED: g_slice_alloc
==7578== by 0x4E9C0C5: g_slist_prepend
==7578== by 0x40EC77: sim_parse_app_template_entries (simutil.c:1604)
==7578== by 0x405AF6: test_application_entry_decode (test-simutil.c:487)
==7578== by 0x4EA3D05: g_test_run_suite_internal
==7578== by 0x4EA405A: g_test_run_suite
==7578== by 0x4EA4090: g_test_run
==7578== by 0x40714E: main (test-simutil.c:655)
==7219== 852 (16 direct, 836 indirect) bytes in 1 blocks are definitely lost in loss record 28 of 31
==7219== at 0x4C2AB80: malloc
==7219== by 0x4E856D0: g_malloc
==7219== by 0x4E9B2ED: g_slice_alloc
==7219== by 0x4E9C0C5: g_slist_prepend
==7219== by 0x40EC05: sms_assembly_add_fragment_backup (smsutil.c:2666)
==7219== by 0x40E0A3: sms_assembly_load (smsutil.c:2463)
==7219== by 0x40E67D: sms_assembly_new (smsutil.c:2550)
==7219== by 0x402C41: test_serialize_assembly (test-sms-root.c:104)
==7219== by 0x4EA3D05: g_test_run_suite_internal
==7219== by 0x4EA405A: g_test_run_suite
==7219== by 0x4EA4090: g_test_run
==5231== 284 (16 direct, 268 indirect) bytes in 1 blocks are definitely lost in loss record 107 of 111
==5231== at 0x4C2AB80: malloc
==5231== by 0x4E856D0: g_malloc
==5231== by 0x4E9B2ED: g_slice_alloc
==5231== by 0x4E9C0C5: g_slist_prepend
==5231== by 0x417E9C: sms_assembly_add_fragment_backup (smsutil.c:2666)
==5231== by 0x417AE8: sms_assembly_add_fragment (smsutil.c:2580)
==5231== by 0x40B70E: test_decode_unicode (test-sms.c:1836)
==5231== by 0x4EA3D05: g_test_run_suite_internal
==5231== by 0x4EA405A: g_test_run_suite
==5231== by 0x4EA4090: g_test_run
==5231== by 0x40C100: main (test-sms.c:1950)
==5231==
==5231== 284 (16 direct, 268 indirect) bytes in 1 blocks are definitely lost in loss record 108 of 111
==5231== at 0x4C2AB80: malloc
==5231== by 0x4E856D0: g_malloc
==5231== by 0x4E9B2ED: g_slice_alloc
==5231== by 0x4E9C0C5: g_slist_prepend
==5231== by 0x417E9C: sms_assembly_add_fragment_backup (smsutil.c:2666)
==5231== by 0x417AE8: sms_assembly_add_fragment (smsutil.c:2580)
==5231== by 0x40BACA: test_decode_unicode (test-sms.c:1857)
==5231== by 0x4EA3D05: g_test_run_suite_internal
==5231== by 0x4EA405A: g_test_run_suite
==5231== by 0x4EA4090: g_test_run
==5231== by 0x40C100: main (test-sms.c:1950)
==16702== 6 bytes in 1 blocks are definitely lost in loss record 5 of 63
==16702== at 0x4C2AB80: malloc
==16702== by 0x405782: convert_gsm_to_utf8_with_lang (util.c:651)
==16702== by 0x4058F0: convert_gsm_to_utf8 (util.c:690)
==16702== by 0x408606: sim_network_name_parse (simutil.c:801)
==16702== by 0x408D32: sim_eons_add_pnn_record (simutil.c:1024)
==16702== by 0x403A10: test_eons (test-simutil.c:377)
==16702== by 0x4EA3D05: g_test_run_suite_internal
==16702== by 0x4EA405A: g_test_run_suite
==16702== by 0x4EA4090: g_test_run
==16702== by 0x40522E: main (test-simutil.c:655)
==31530== 366 (48 direct, 318 indirect) bytes in 3 blocks are definitely lost in loss record 165 of 186
==31530== at 0x4C2BF8F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==31530== by 0x50BB3A3: g_malloc (gmem.c:94)
==31530== by 0x50D62B4: g_slice_alloc (gslice.c:1025)
==31530== by 0x50D7A1E: g_slist_prepend (gslist.c:254)
==31530== by 0x4DD0B3: sim_parse_app_template_entries (simutil.c:1590)
==31530== by 0x4D2242: discover_apps_cb (sim.c:1509)
==31530== by 0x45E364: at_discover_apps_cb (sim.c:1579)
==31530== by 0x49CB5F: at_chat_finish_command (gatchat.c:459)
==31530== by 0x49DAC7: at_chat_handle_command_response (gatchat.c:521)
==31530== by 0x49DAC7: have_line (gatchat.c:600)
==31530== by 0x49DAC7: new_bytes (gatchat.c:759)
==31530== by 0x49FCEF: received_data (gatio.c:122)
==31530== by 0x510C2F3: g_io_unix_dispatch (giounix.c:165)
==31530== by 0x50B2D44: g_main_dispatch (gmain.c:3203)
aid_sessions was not properly reset to NULL when freed:
Program received signal SIGSEGV, Segmentation fault.
__ofono_watchlist_free (watchlist=0x0) at src/watch.c:91
91 for (l = watchlist->items; l; l = l->next) {
(gdb) bt
func=0x4ceca0 <aid_session_free>, user_data=0x0)
at /var/tmp/portage/dev-libs/glib-2.50.3-r1/work/glib-2.50.3/glib/gslist.c:878
free_func=0x4ceca0 <aid_session_free>)
at /var/tmp/portage/dev-libs/glib-2.50.3-r1/work/glib-2.50.3/glib/gslist.c:172
at src/sim.c:2605
user_data=<optimized out>) at plugins/phonesim.c:511
func=0x49c8a0 <at_notify_call_callback>, user_data=0x7fffffffdbc0)
at /var/tmp/portage/dev-libs/glib-2.50.3-r1/work/glib-2.50.3/glib/gslist.c:878
chat=0x7b70b0) at gatchat/gatchat.c:417
==16709== 16 bytes in 1 blocks are definitely lost in loss record 139 of 377
==16709== at 0x4C2AB80: malloc
==16709== by 0x52966D0: g_malloc
==16709== by 0x52AC2ED: g_slice_alloc
==16709== by 0x52AD625: g_slist_append
==16709== by 0x4049E9: voicecall_filter_request_init (voicecall-filter.c:81)
==16709== by 0x404FE8: voicecall_filter_request_dial_new (voicecall-filter.c:315)
==16709== by 0x4055D2: __ofono_voicecall_filter_chain_dial (voicecall-filter.c:556)
==16709== by 0x403C5B: test_cancel1 (test-voicecall-filter.c:899)
==16709== by 0x52B4D05: g_test_run_suite_internal
==16709== by 0x52B505A: g_test_run_suite
==16709== by 0x52B5090: g_test_run
==16709== 88 (16 direct, 72 indirect) bytes in 1 blocks are definitely lost in loss record 289 of 377
==16709== at 0x4C2AB80: malloc
==16709== by 0x52966D0: g_malloc
==16709== by 0x52AC2ED: g_slice_alloc
==16709== by 0x52AD625: g_slist_append
==16709== by 0x4049E9: voicecall_filter_request_init (voicecall-filter.c:81)
==16709== by 0x40533E: voicecall_filter_request_incoming_new (voicecall-filter.c:446)
==16709== by 0x40571F: __ofono_voicecall_filter_chain_incoming (voicecall-filter.c:598)
==16709== by 0x403AA7: test_restart (test-voicecall-filter.c:855)
==16709== by 0x52B4D05: g_test_run_suite_internal
==16709== by 0x52B505A: g_test_run_suite
==16709== by 0x52B5090: g_test_run
Fix an error message from dbus about the path supplied not being valid.
Related to commit f58e7685b0078df470300b99cd89fb9b3c45d1c0
ofonod[19107]: src/voicecall.c:voicecall_dial_shortcut() check position
ofonod[19107]: src/voicecall.c:synthesize_outgoing_call() Registering new call: 1
process 19107: arguments to dbus_message_iter_append_basic() were incorrect, assertion "_dbus_check_is_valid_path (*string_p)" failed in file ../../../dbus/dbus-message.c line 2759.
This is normally a bug in some application using the D-Bus library.
Certain modems doesn't support manual registering (gobi 2000).
Translate the error code into ofono error to report a
more detailed debug error message.
For certain modems it's not clear if they support all actions or not.
In such cases use CME errors which allows generate NotSupported
messages.
Conflicts:
ofono/src/network.c
The IP Configuration data structure does not match any of the existing
data structure serialization conventions in the rest of the MBIM
specification. So add IPv4 / v6 specific extractors for IPV4 address
and IPV4 Element structures.
Some protocols (like MBIM) do not properly support default bearer
semantics. Instead they want everything to function like UMTS/GSM where
the context has to be explicitly attached / activated.
Instead of delaying the cpin entry callback until the sim is found to be
'ready', call back into the core right away. The core will wait until
the initialized notification is called from the driver before proceeding
with the rest of the initialization procedure.
The sim state query is now being done in the background and potential
leaking of cbd is now fixed.
SMS_SEND uses an embedded databuffer inside MBIM_SET_SMS_SEND which
wants to use a local offset (local to the databuffer structure) as
opposed to the offset from the start of the static buffer.
For zero element arrays we might inadvertently run past the end of the
iov buffer. Fix this by adding additional checks that n_elem > 0 and
don't call _iter_get_data unless needed.
This change is likely to break multiple drivers. One can easily emulate
the current behavior (pre-this commit) by calling
ofono_sim_initialized_notify after ofono_sim_inserted_notify.
All the functionality for the simauth driver was moved
into the sim atom. This patch transitions the simauth
atom to using those API's instead of the simauth driver
API's.
With this change it made more sense to store each AID
as its own object structure so the AID and object path
could be re-used rather than generating it on the fly.
Renamed the simauth 'sim' variable to 'sa' to keep it
consistent now that the simauth structure references
the sim atom as 'sim'.
Moved logical access API from simauth to sim atom. This removes
the need for a simauth driver completely, as the rest of the
functionality was moved in previous commits.
In SimManager, the Retries property isn't used for gemalto modems.
The at command AT^SPIC is used to get the remaining retries left
for the current required password type.
This commit enable the use of the driver in the gemalto plugin
In SimManager, the Retries property isn't used for gemalto modems.
The at command AT^SPIC is used to get the remaining retries left
for the current required password type.
This commit adds the implementation in the SIM driver of the retries
queries.
API to create a sim context for the ISIM application, if found.
During AID discovery, if an ISIM AID is found, a new fs object is
initialized for the ISIM which will be used for any future
ISIM context creation.
The simfs atom could not read EF's that did not exist on the
'default' ADF directory. This implements a new way to read EF's
that exist on a given AID. A new fs object/context can be
initialized for a given AID. Using this fs context with
the existing read file API will read from that AID rather than
the default ADF.
Accessing an AID requires opening a channel to that application.
This patch implements session management API's so that other atoms
can access a given AID. Now any atom can get a session ID from the
sim atom. This will either reuse an existing session or open a new
channel. Once done, the atom should release the session which will
automatically close the channel when no atoms are using it.
The major functional change to the sim atom is the AID discovery
phase of initialization. Now, the sim atom is not 'ready' until AID
discovery finishes where before, the sim was 'ready' after the IMSI
had been obtained. If application discovery is not supported then
the the sim atom behaves as it did before.
ISIM and newer AID's require opening a logical channel to read
their EF's. This requires new driver API's to discover AID's,
open/close a channel, and reading the EF's from an opened channel.
This functionality was moved from the simauth module.
The Le parameter in the AUTHENTICATE command was not being
set for GSM authentication. This did work, but explicitly
setting it to 0 as UMTS does was more consitent.
When modem does not answer or answers slowly to a discovery request,
a timeout occurs.
In timeout callback, request should be removed from queues to avoid
treating answer if it arrives later.
synthethize_outgoing_call was only used once from dial_handle_result.
So move all the logic of registering the call to D-Bus and adding it to
the voicecalls list to that function.
This will allow synthethize_outgoing_call to be used from other
callbacks where the dial callback is guaranteed to return before any
call state notifications, e.g. in the case of +BLDN.
The Quectel EC21 does not provide the SMS PDU on the message event
notification.
This patch adds a call to 'raw read' on the message ID from the event
notification if the event notification does not already contain the
message data.
The message data begins with the SMSC length, type, and address so
the TPDU length is adjusted accordingly in the raw_read callback. This
differs from the way the raw message data is handled in the case
that it is included in the event notification itself. As I don't have
access to any other QMI modem at this time, I'm can not confirm that
this difference is reasonable.
Implemented the core API's needed for sim-auth:
list_apps: already implemented
open_channel: Opens a logical channel with +CCHO
close_channel: Closes logical channel with +CCHC
logical_access: Access an opened channel with +CGLA
The sim-auth module atom can now be used for SIM application discovery
and authentication. The atom will automatically discover SIM
applications available on the SIM and register a new DBus object under
the modem, whos name is the AID string e.g.
/modem1/A0000000871004FFFFFFFF8906190000
A list of discovered AID object paths and types can be retrieved by
calling GetApplications() under the modems (new)
org.ofono.SimAuthentication interface which returns "a{oa{sv}}" where
o = path (e.g. above)
and the dictionary contains the following properties:
Type: "Umts" or "Ims"
Name: "USim" or "ISim"
The Type signifies which interfaces the AID object will have:
Umts = org.ofono.USimApplication
Ims = org.ofono.ISimApplication
These interfaces will contain the supported USIM/ISIM authentication
algorithms. Where:
org.ofono.USimApplication has:
GetProperties()
GsmAuthenticate()
UmtsAuthenticate()
org.ofono.ISimApplication has:
GetProperties()
ImsAuthenticate()
Added new dbus interfaces for SimAuth module as well as
function prototype definitions to simauth header.
org.ofono.SimAuthentication:
Interface to hold the auth object to type mapping property
org.ofono.USimApplication:
Application with USim functionality (GSM/UMTS auth)
org.ofono.ISimApplication:
Application with ISim functionality (IMS auth)
The existing service check API takes both SST and UST services
and could inadvertently return success on a service if one
(SST or UST) service did not exist. This adds an API specifically
for checking for a UST service, and if the UST dir is not available
it will return FALSE, rather than possibly returning true on some
other SST service.
Parsing a SIM application only copied the 16 byte AID
portion, which included the application type. Parsing out
the type makes sorting much easier for modules using the
parser.
The nokia-gpio plugin should not try to create symlinks to relevant gpio
pins under /dev/cmt, since the location it is looking is no longer
correct on newer kernels and it might change again in the future. This
patch removes code from nokia-gpio that tries to create a symlink.
Users will now need to symlink the modem gpios to /dev/cmt themselves.
On the 4.13 kernel, this can be done by, for example, adding a udev rule
to:
# ln -sf /sys/bus/hsi/devices/n900-modem /dev/cmt
The HUP results in errors in gatio which will deref parts
of the AT channel. This makes it impossible to recover and
send further AT commands after the HUP.
This is needed to find out the maximum fragment size that this device
supports. The minimum length specified in the spec is 64, however 512
bytes is recommended.
We also attempt to parse how many simultaneous commands can be
outstanding at a given time. In theory MBIM supports multiple
outstanding commands through the use of transaction-id matching, but it
seems some devices only support a single outstanding command at a time.
There are tests that are compiled even when not using sailfish_rilmodem, which still require libglibutil and dbus-glib-1. Without it, tests would fail to build.
Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com>
Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
Some RILs accept one RAT in SET_PREFERRED_NETWORK_TYPE but return
a different one in response to GET_PREFERRED_NETWORK_TYPE. If both
RATs belong to the same family (2G, 3G or LTE), just leave it as is,
there's no need to repeat SET_PREFERRED_NETWORK_TYPE request.
"If we have a Proxy, no other settings are relevant" was a wrong assumption.
Proxy host name may require DNS resolution, which in turn requires at least
addresses of DNS servers.
By default, data profiles are off because in most cases everything
works without them. In those cases when they are needed, they can
be turned on with the following options in the config file:
useDataProfiles
mmsDataProfileId
Note that it's different from ofono_gprs_context_get_type() which
typically returns OFONO_GPRS_CONTEXT_TYPE_ANY no matter what's the
current usage of the context.
With enableSimToolkit option in ril_subscription.conf
Defaults to true.
It's more of a workaround than a solution to the "SIM removed" problem,
but better to have at least that than nothing at all.
Some devices don't understand GSM_WCDMA_AUTO and want to see
GSM_WCDMA instead. Now we can make those happy by configuring
UMTS mode in /etc/ofono/ril_subscription.conf like this:
umtsNetworkMode=0
When sending an SMS message to multiple recipients, multiple calls to
SendMessage are received in rapid succession. Delay sending the first
one in such a batch slightly so that we hopefully have at least the next
one queued up to start sending in "MMS" mode, otherwise it seems
messages can be lost or erroneously sent twice.
This exposes sailfish_watch object to ofono plugins. Also, removed
dependency on glib headers from the header file.
Lots of changes but those are mostly mechanical.
Since upstream ofono started migrating away from glib and losing
its value for us as upstream project, it's ok now to start dropping
sailfish prefixes in the source code. This code is ours now to maintain.
Failed connection request doesn't release ofono context id but we don't
need to worry about those ids because the real ones are allocated by rild.
We just need to release ofono ids whenever we no longer need them.
Completion routine must be invoked even if rild never replies.
The timeout (5 min) may seem ridiculously long but sometimes it
does take minutes in roaming.
Close interface on BlueZ exit and reconnect to BlueZ and re-create
interfaces when the daemon appears again. Now HFP AG is usable with
wanted or crash caused restarts of BlueZ daemon without needing to
restart oFono.
Normally we should be able to have two simultaneously active
data contexts - one for mobile data and one for MMS. However
some devices may require that mobile data is disconnected
before we can send or receive MMS.
With more than one modem we don't play indicators etc correctly to
headset if the call is coming to a modem we are not watching. As the
modem is picked arbitrarily in hfp plugins, it is better to be able to
follow multiple modems at the same time.
When modems disappear they automatically are removed from the emulator,
with two or more modems it is possible that only one remains for a while
and new modems appear, to handle these cases add functionality to add
modems to the emulator.
Sometimes data calls survive change of radio technology and just get
disassociated from ofono context and we may end up trying to activate
another context, thinking that the previous one is gone, even though
it's still alive. This is something that (at least some) operators
don't like, and start start rejecting our data calls.
Plugins may reference data structures allocated by each other.
They all need to be deinitialized first, only then it should be
safe to unload the libraries.
ofono_gprs_filter plugins implementing API version 1 or later
should call this function when their configuration changes and
mobile data may have become disallowed for the current SIM.
Typically responses to USSD requests are coming with status
zero (NOTIFY) but some are coming with status 2 (TERMINATED).
If those contain data, the data should be presented to the user.
[ussd] Don't ignore data from TERMINATED response. Fixes JB#41734
Most MTK RIL implementations don't support this request and don't even
bother to reply which slows things down because we wait for this request
to complete at startup.
The code was incorrectly assuming that each data call block has the
same size. This is an absolutely wrong assumption. It's especially
wrong if one data call has IPv6 addresses assigned and the other one
doesn't - in this case one block may be several times bigger than
the other.
The regression was introduced by commit 8c9e3704
In addition to the usual /etc/ofono/ril_subscription.conf config file,
additional *.conf files from /etc/ofono/ril_subscription.d directory
will be merged in.
The same (or very similar) kinds of hardware may be (and are!)
running different MTK adaptation software, totally incompatible
with each other. The new approach is an attempt to figure it out
based on the unsolicited events we are receiving from rild.
It's still possible to exlicitely choose the variant (e.g. mtk2)
Support for dual-IMSI SIMs
When subscription gets switched via STK, rild generates SIM_REFRESH
event and we need to reinitialize the SIM, i.e. re-read all the
EFs, at least under GSM/Telecom DF. Currently, reinitialization
is performed by simulating a SIM swap. That, however, has an
unpleasant side effect - the phones which don't support hot-swap
ask the user to reboot the phone (in this case, unnecessarily).
A better way of reinitializing the SIM should be implemented,
which wouldn't generate this misleading warning, but in the
meantime let's merge this one because it at least appears to work.
See merge request !172
It's better to simulate SIM card removal at RilSimCard level.
That way the presence of the SIM card won't be reported until
we fetch the actual SIM status (which may require a few retries
if the reset was initiated by STK).
In Sailfish OS the Attached flag is used by connman to check whether
context activation is possible. There won't be any context activation
if Attached stays false.
MTK RILs (at least some of them) are not bothering to submit
the standard CALL_STATE_CHANGED event when a new incoming call
is received. Let's do it for them.
Even if they suddenly change their mind and start sending
CALL_STATE_CHANGED events, there's no harm in receiving
multiple events - we will handle that just fine.
MTK rild appears to send this event (with 3 integers as the payload),
whenever data registration state changes. That's a good time to poll
the current state.
Huawei LTE modems use AT^SYSCFGEX and AT^SYSINFOEX instead of
AT^SYSCFG and AT^SYSINFO.
If we want to be able to attach on LTE with this modem, we must use
AT^SYSCFGEX to configure rat mode and band. Using AT^SYSCFG, mode any
means UMTS or GSM.
Add support for automatic context activation by adding read_settings.
It also adds detach_shutdown to make sure context is cleaned up when
network registration is lost.
This is a rudimentary implementation that contains technology and RSSI
and BitErrorRate, plus RSRQ/RSRP for LTE networks. More data can be
added as needed.
This implementations uses the 'Get Signal Strength' QMI method to retrieve
the data. Operator fields (MNC, LAC, etc) can be gotten from the 'Serving
Cell' method if needed, but since this data is already provided in the
NetworkRegistration object it doesn't seem necessary to repeat it here
when an additional communication to the modem is required.
This patch fixes up some fallout from the merging of the udev and udevng
modules.
i) The 'serial' modems in question are not necessarily serial modems at
all; for example, the N900 ISI modems appear as network devices and don't
have a devnode. This patch relaxes the requirement that a devnode exist.
ii) The modem driver was being set to 'legacy', which is a remnant of
an earlier approach to merging these modules. The driver needs to be
properly set to the value of the OFONO_DRIVER property in order for the
setup function to be found.
iii) The serial modem's private data was being added to the modem
structure incorrectly...
In particular point iii) above shows that there is essentially nobody
using these devices which makes modifications in this area tricky.
When registering callbacks before ofono_netreg_register(), callbacks
will use the netreg api which might lead into undefined behaviour,
because certain fields aren't yet initilized.
Added implementation for RegisterAgent and UnregisterAgent in
NetworkMonitor interface and added netmonagent source file for agent
implemention.
Conflicts:
ofono/src/ofono.conf
added new DBUS methods RegisterAgent and UnregisterAgent to
Networkmonitor interface so that any client of ofono can register for
serving cell updates. Added new agent interface NetworkMonitorAgent
with two methods, ServingCellInformationChanged and Release.
This provides the list of available technologies in the radio-settings
atom. The list is queried by the DMS Get Capabilities method; ofono
takes care of caching the available technologies for us so we don't need
to worry about this method being called excessively.
call_status_to_string() is useful for debug output.
Change signature to contain enum call_status
Replace default case to get compiler warning when new enums added
The QMI radio-settings atom was just a skeleton and did not even implement
the mandtory property TechnologyPreference. As such, it probably should
never even have been registered for the modem. Nonetheless, this patch
puts this mandatory property into place.
This is implemented via the 'Set System Selection' method by way of the
'mode' parameter. This seems to best reflect the intention of the Ofono
API and works as expected when tested with a Quectel EC21.
Some notes:
i) There is an alternative function called 'Set Technology Preference'
which provides similar functionality. This 'technology preference'
is updated automatically when the 'system selection mode' is modified
so everything seems to be in order.
ii) For the EC21, switching the underlying technology works seamlessly.
There are indications, however, that some modems _might_ require a
reset before changes take effect; that bridge will need to be crossed
if reached.
Fix a warning.
./include/gprs-context.h:99:61: error: ‘struct ofono_modem’ declared
inside parameter list will not be visible outside of this definition
or declaration...
Previously, these drivers would check /sys/devices/virtual/misc/tun to
see if TUN is supported, and bail out otherwise. However, the tun module
can sometimes be autoloaded by opening the /dev/net/tun file. In this
case the /dev file already exists, but the /sys file only gets created
after the modul is loaded.
Additionally, the ppp code does not use the /sys file, but only the
/dev file, so checking for the existence of the latter seems a better
indicator of expected success.
When registering to an operator ofono uses the old RAT.
In the case the modem is not connected to any network, this would use
QMI_NAS_NETWORK_RAT_NONE which results in the error OP_DEVICE_UNSUPPORTED.
Use QMI_NAS_NETWORK_RAT_NO_CHANGE instead to not define any preference.
Fix a warning when only voicecall.h is included:
'struct ofono_modem declared' inside parameter list will not be visible
outside of this definition or declaration struct ofono_voicecall
*ofono_voicecall_create(struct ofono_modem *modem,...
If the ME storage is full, the modem will reject new messages
with a SMPP RP-Error 'Protocol error, unspecific'.
It seems the qmimodem is first checking the ME storage for
free space, then deliver the SMS via QMI and not saving it
to the ME anyway.
Using QMI_WMS_STORAGE_TYPE_NONE it doesn't check for free space.
Tested-on: Quectel EC20
add documentation about interface cinterion.HardwareMonitor.
This interface exposes a single method to access temperature and supply
voltage of the modem.
Gemalto modems have hardware related commands, allowing to monitor voltage
and temperature. These parameters will be accessible on DBus interface:
org.ofono.HardwareMonitor.
- Create the DBus method table with one entry: GetStatistics. This method
would return temperature and voltage values.
- Create a dedicated structure to handle the DBus methods.
- Create enable/disable functions to handle DBus interface registration.
When qmi_device_shutdown is used and the callback provided utilizes
qmi_device_unref, an access into already freed memory is triggered.
Sequence of events is:
1. timeout fires
2. glib calls timeout callback (e.g. shutdown_callback) which in turn
calls shutdown_func (gobi shutdown_cb) which in turn calls
qmi_device_unref()
3. qmi_device_unref calls g_source_remove, which doesn't call the
destroy callback (it is blocked)
4. qmi_device_unref then frees the memory used by device
5. glib then calls the source destroy callback (e.g. shutdown_destroy)
which results in just freed memory being used.
glib appears to always call the destroy callback, even if the source has
been removed previously. So to work around the issue, delay the actual
g_free until the destroy callback is invoked.
There are two problems with using pri_set_apn. The first issue is that
this function was built to be used by the set_property handler and
assumes the presence of a pending DBusMessage.
The second issue is that it touches the settings store.
In the case of auto-activated contexts no pending message exists. Also,
we should not be touching the settings store as the APN might
potentially be a value that has not been provisioned. Or in some cases
bogus.
sailfish_watch expected to be notified by ofono of every ICCID or IMSI
change, however it wasn't happening when SIM card was getting removed.
That messed things up.
ofono becomes very unhappy if they don't. Also, completion
is required in order to eventually reset SIM I/O active flag.
If doesn't make sense to keep it on forever.
In addition to not doing unnecessary SIM I/O, this fixes memory leaks
like this one:
==10096== 74 (56 direct, 18 indirect) bytes in 2 blocks are definitely lost in loss record 1,252 of 1,342
==10096== at 0x4841BF0: calloc (vg_replace_malloc.c)
==10096== by 0x4B03117: g_malloc0 (gmem.c)
==10096== by 0xF83DF: concat_lang_prefs (sim.c)
==10096== by 0xF8697: sim_efpl_read_cb (sim.c)
==10096== by 0x12CBF7: sim_fs_op_read_block_cb (simfs.c)
This happens when we receive a proactive Refresh command from SIM Tookit
which is generated by some SIMs when people are moving between home and
roaming networks.
This adds Acquire method which can be used by agents that require
pulling the fd directly instead of waiting a NewConnection.
Note: sounds servers like PulseAudio do auto suspend streams when idle
for a certain amount of time and once anything happens it will resume
the stream, though this all happens in the so called IO thread in a
blocking fashion making it impossible to receive the fd via NewConnetion
causing the stream to fail to resume. There are other forms to work
around but this seems to be most convenient as we do want the auto
suspend feature to work properly but letting the stream to fail to
resume may create unexpected artifacts while the NewConnection is
handled in main thread.
Apparently, an empty APN in an ofono context means that that the context
cannot be activated. connman definitely interprets it this way.
This patch sets a default name of "automatic" for the default bearer if
no other LTE APN is supplied (which is currently the case as the LTE
atom is not in place yet). Without this, connman happily ignores the
context, even though it has been activated by ofono.
When the modem attaches to an LTE network, a default bearer is
automatically negotiated using the "defalt profile" settings. The
QMI modem, however, does not given any explicit indication that
the bearer exists; instead, we must assume its existence based on
the network registration state.
This patch extends the GPRS atom to signal the presence of a
default bearer when it detects network connectivity on an LTE
network.
Apparently it's not legal to create a QMI service multiple times for
a device. I've been testing with a Quectel EC21 and here it works fine
to do so, but the general case would require "shared" services across
atoms.
This patch switches the users of the NAS and WDS services over to using
a "shared" service instead of each instatiating their own instance.
There are three principal ways for a context to become disconnected:
i) deactivate_primary() is called
ii) the network registration is lost and the context is cleaned up
via _detach_shutdown() (via release_all_contexts())
iii) the network decides to disconnect the context
We need to watch the packet status in order to detect case iii). For
case i) and ii), stop_net will be called, the pkt_handle will be
cleared, and subsequent packet status notifications be ignored.
This patch makes it so that the packet status "disconnected" event
is only propagated when the pkt_handle has not been cleared, indicating
an unrequested disconnection.
This should fix a race reported by Christophe Ronco whereby the packet
status disconnect notification is called between activate_primary
(start_net) and it's callback (start_net_cb).
This adds handling for ServicesResolved signal which tells when BlueZ
is done resolving the device services so the code will no longer ignore
devices that got its services resolved after Paired signal.
In case the UUIDs are not updated, as they are still being resolved, when
Paired property changes a modem will never be registered.
In order to fix this problem allow modems to be registered directly
during NewConnection.
SMS reception is not working for Gemalto modems because of +CMT parsing.
PDU length is the first argument of +CMT URCs in Gemalto modems.
Add a switch case on vendor info to handle Gemalto case.
Also handle acknowledgment, +CNMA takes only one parameter.
CMT parsing is moved from at_parse_cmt() to at_cmt_notify(). This
function is modified to match the style of at_cmgr_notify() and it
includes a switch case for CINTERION modems.
This follows the same pattern as the Telit QMI modems, routing the
setup through a QMI driver. I think this can be cleaned up somehow,
but for now this at least provides support for these two modem models
so that others can aid in testing.
This is a "leaf" header and doesn't even have header guards, but
it still seems natural that the header should pull in its own declarations
rather than relying on the including source file to ensure that they
are included.
The detach_shutdown method is invoked to unconditionally release
an active context. For QMI, this is equivalent to a call to
deactivate_primary.
This patch makes the callback to deactivate_primary optional and
implements detach_shutdown to simply call it. When there is no
callback, the stop_net callback notifies ofono about the context
release via an asynchronous ofono_gprs_context_deactivated() call.
For LTE networks, a default bearer is automatically activated when
the modem registers to the network. QMI modems, however, do not
automatically enable the network interface just because the bearer
exists; a call to "start network" needs to be made in order to
get the packet handle before get_settings will return any data and
the network interface can be configured.
This patch makes read_settings call "start network" in order to
enable the interface for the default bearer. No new bearer will
be created with this call and the settings for the bearer will come
from the default profile, irregardless of what parameters are passed
to the "start network" method.
The ofono_gprs_cid_activated attachment machinery cannot go through
ofono_gprs_status_notify for getting the attached property set because
that would result in the automatic contexts that were just set up
being released. As such, it needs to call gprs_set_attached_property
manually. Doing so, however, means that the driver_attached property
never gets set, resulting in all contexts being released when the
network transitions between registered states (roaming/non-roaming).
ofono_gprs_status_notify is an asynchronous notification that messes
with the 'attached' state of the GPRS atom. This method is normally
prevented from running while an attach is in progress because the
attachment machinery wants to finish up and make it's own determination
of attach state.
When automatic context activation is relevant, as for LTE networks,
the ofono_gprs_cid_activated machinery replaces the usual set_attach
machinery for attaching to the network. The cid_activated variant,
however, does not guard against simulatenous invocations of
ofono_gprs_status_notify. This causes a race whereby status_notify
sets the state to 'attached' before the context is fully constructed
and set to active. If the connection manager sees the 'attached'
state before there are any 'active' contexts, it may decide to
activate a context manually which is not the correct behaviour for
this type of network.
This patch makes the *_cid_activated machinery an 'attaching' state,
introducing the same guards that set_attached has to prevent
ofono_gprs_status_notify from running concurrently.
For LTE, a context is created automatically when the modem registers
to the network. The read_settings function is called for these
automatic contexts to get their configuration.
The GPRS context needs to be configured with connection parameters when
the bearer has been established. This was only partially implemented, so
this patch adds additional parameters to those passed to the context.
Calling the ps_state/cs_state alternatives *ATTACH_STATUS* was confusing
because there is also a status field in the *serving_system structure.
This patch does a minor rename and adds the appropriate definitions for
the status field.
qmi_device_shutdown allocated a new orphaned data structure and kicked
off a timeout to wait for the shutdown to complete. The logic was quite
racy, but the main issue was that the timeouts could not be canceled
when the underlying qmi_device object was destroyed. This resulted in
crashes.
This patch switches to first-past-the-gate mechanism. Since only the
modem driver should be issuing a qmi_device_shutdown call, this should
not be a limitation. The shutdown source is then tracked on the
qmi_device object itself and is canceled when the qmi_device object is
freed.
As an added bonus, the shutdown_destroy callback should now actually
function. Before it was simply never called.
struct discovery was allocated for every discovery procedure that was
kicked off, which itself allocated a structure. This patch uses a
class/subclass concept to only allocate a single structure per discovery
procedure.
Calling set_online(TRUE) for an AlwaysOnline modem should succeed; the
modem is, after all, in the requested state when the call returns.
Returning not_implemented is not necessarily wrong, but it's a bit ugly.
This function was never removing discovery instances because it was looking
them up in the wrong list. This led to some strangeness with the discovery
callbacks being invoked after the "failure" timeout of 5 seconds and
consequent failures with everything getting out of sync.
With this patch we fix the lookup to use the correct queue. There's also
a double-free in the function that was never being hit before because the
lookups never succeeded; fix that as well.
With this, service discovery and creation work as expected when testing with
an EC21.
Telit AT modem firmware (tested with UE910-EUR) generates
+CGREG: 0\r\n\r\n+CGEV: NW DETACH
after a context is de-activated and ppp connection closed.
Then, after a random amount of time (observed from a few seconds
to a few hours), an unsolicited +CGREG: 1 arrives.
Attempt to fix the problem, by sending AT+CGATT=1 once.
This does not re-activate the context, but if a network connection
is still correct, will generate an immediate +CGREG: 1.
...and disable old udev code by shorting it out in it's init() function.
The check_device function is augmented to differentiate between USB
and serial devices:
- if the device sits on a USB bus, the device is handled as before
- if not, an attempt is made to handle the device as a serial device
This adds, but does not hook up, support for simple serial modems. These
modems generally have only a single device node so are simpler than the
USB devices which generally have different device nodes for different
functions. These modems are currently handled by udev.c, but this
functionality will allow to remove that module completely in a later patch.
- A new "device_info" type is created called serial_device_info
- the function add_serial_device sets up a modem_info structure and a
serial_device_info for the device
- A reference to the device's udev node is saved in the device info
- The device driver is retrieved from the OFONO_DRIVER environment variable
which needs to be set up by some udev rule
- Setup functions are added for these types of devices: a common function
setup_serial_modem covers the generic (simple) case, whereas modems
with special requirements are given their own setup functions to handle
the special bits
- Modem destroy needs to know the "device_info" type in order to clean
up properly, so a 'type' value is set on the modem_info structure to
guide selection of the proper cleanup function
There are various device & service discovery tasks that are initiated
based on a qmi_device object. qmi_device object does not currently
keep track of these tasks. Unfortunately the qmi_device object can
go away at any time, and these tasks can become orphaned.
The result of this can lead to crashes. E.g. a discovery task timeout fires
after the qmi_device object has been destroyed. Since the object is no
longer valid, any accesses to it will likely result in a SEGFAULT.
This patch attempts to track all discovery tasks on the qmi_device
object itself, so that they can be cleaned up properly. This patch does
not handle the qmi_device_shutdown functionality.
Adding a modem boils down to finding the device in the hierarchy with
the OFONO_DRIVER property. The original code special-cased the property
being on the device itself rather than on a parent device. This patch
combines the two cases.
This patch simplifies and cleans up the check_usb_device function a bit
by doing the two following (slightly intertwined) things:
1) The parent "usb_device" is searched for early in this function and this
device will always have the ID_VENDOR_ID and ID_MODEL_ID properties.
As such, we can get them from this device and thereby be certain that
we _always_ have them available.
2) The logic of iterating the vendor_list table is cleaned up. It's
easier to follow and won't be any less efficient.
Telit QMI modems have a problem with the low-power operating modes.
After entering and leaving such a state, UIM service does not return.
The sim card is still marked as powered-down. The QMI interface does
not have a way to power it back on.
To avoid this, keep modems with the "AlwaysOnline" flag online
in the disable-modem and offline-modem procedures.
Telit QMI modems can return non-utf-8 characters in plmn-desc.
Observed with LE910-SVG and Verizon. When that happens, libdbus
will abort ofono.
If non-utf-8 characters are detected, use mccmnc string.
LTE modems (observed with Telit LE910 V1) can power on
already registered to a network. In that case, the SS_INFO
change notification will never arrive, and the gprs driver
will never be marked as attached.
To avoid this situation, read SS_INFO at probe time, and if
registered, mark the gprs driver as attached.
This was introduced by the previous patch:
drivers/qmimodem/devinfo.c: In function ‘get_ids_cb’:
drivers/qmimodem/devinfo.c:129:14: error: implicit declaration of function ‘strcmp’ [-Werror=implicit-function-declaration]
if (!str || strcmp(str, "0") == 0) {
On E3372 after a GPRS disconnection, modem AT channel (used by PPP) gets
disconnected (G_IO_HUP and G_IO_ERR are detected in received_data
in gatio.c).
After that all connection attempts fail because we are not able to send
any AT commands on modem channel (it is closed).
With this patch, when this behavior is detected, we close gprs context
driver, reopen AT channel and gprs context driver.
This plugin allows to provision gprs-context data based on MCC and MNC.
This is useful when provisioning using mbpi fails (either because you
are using a private APN or because there are multiple internet type context
for your operator in mbpi database).
Config file is STORAGEDIR/provisioning.
Config file should look like that:
[operator:MCC1,MNC1]
internet.AccessPointName=apn1
internet.Username=myUsername
internet.Password=myPassword
internet.AuthenticationMethod=pap
internet.Protocol=ipv6
[operator:MCC2,MNC2]
internet.AccessPointName=apn2
The only mandatory parameter for each operator is internet.AccessPointName.
Parameter description:
internet.AccessPointName: APN
internet.Username: Username
internet.Password: Password
internet.AuthenticationMethod: authentication method.
Possible values are:
- pap
- chap
Default is chap if unset.
internet.Protocol: protocol
Possible values are:
- ip: ipv4
- ipv6
- dual
Default is ip if not set.
All parameters are prefixed with internet to be able to extend this plugin
to other type of contexts (MMS, ...).
Conflicts:
ofono/Makefile.am
ofono/plugins/file-provision.c
Command read_file_info on MC7304 always fails.
Using qmicli or AT command, I am able to read file info.
Qmicli command is:
qmicli -d /dev/cdc-wdm0 --uim-get-file-attributes=0x3f00,0x7fff,0x6fad
[(null)] Successfully got file '/dev/cdc-wdm0' attributes from the UIM:
Card result:
SW1: '0x90'
SW2: '0x00'
File attributes:
File size: 4
File ID: 28589
File type: transparent
Record size: 0
Record count: 0
Read security attributes: (always) (null)
Write security attributes: (single) adm
Increase security attributes: (always) (null)
Deactivate security attributes: (single) adm
Activate security attributes: (single) adm
Raw: 62:17:82:02:41:21:83:02:6F:AD:8A:01:05:8B:...
After a check of parameters sent by qmimodem driver and qmicli,
the only difference is on parameter "Session Information".
Session type sent by qmimodem driver is 'Card on slot 1'.
Session type sent by qmicli command is 'primary-gw-provisioning'.
Changing session type in qmimodem driver fixed problem (on this modem).
Comparing with what is done by qmili command
Some modems do not support AT+CGDATA="PPP",X to enter data state.
Use AT+CGDATA=? to detect these modems and for them use ATD*99***X#
to enter data state.
drivers/rilmodem/stk.c: In function ‘ril_stk_probe’:
drivers/rilmodem/stk.c:210:18: error: ‘data’ is used uninitialized in
this function [-Werror=uninitialized]
struct cb_data *cbd = cb_data_new(stk, NULL, data);
At least firmware version 12.00.405 on the UE910-EUR otherwise
closes the AT command port whenever the PPP connection is
dropped, and we'd be left in a funny state.
sending RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING after
stk atom is created so that modem will inititialize
sim toolkit by sending terminal profile to sim.
During gprs-context driver probe function, check kernel device driver
data format and modem low level data format.
If they are different, align kernel device driver data format on
modem low level data format.
If an error occurs during this process, continue probing without error.
This is inspired by what is done in qmicli and qmi-network (package
libqmi).
Add a way to get and set data format expected by kernel device driver.
This is inspired by what is done in qmicli (package libqmi).
It does not use QMI protocol but a sysfs exported by kernel driver.
To use this feature, kernel version must be equal or more than 4.5.
Network Control Model is a new Communication Device Class
protocol for exchanging Ethernet frames over USB.
NCM is intended to be used with high-speed network
attachments such as HSDPA and LTE data services.
Telit modems HE910 and UE910 share the same USB
vendor and device IDs (1bc7:0021) but they are
different devices.
HE910 is HSPA Class 14/6 and UE910 is Class 8/6.
Both come in voice-enabled variants.
HE910 also comes in variants with built-in GPS.
Add a new location-reporting driver for Gemalto Cinterion modems based
on telit implementation + use it in gemalto plugin. It supports
activation of GNSS engine (Request) with command AT^SGPSC. This driver
is tested on PHS8. NMEA frames are accessible on /dev/ttyUSB1.
Retry command QMI_UIM_GET_CARD_STATUS during query_passwd_state if a
temporary error status has been detected.
This happens with a MC7430 modem when query_passwd_state is called just
after PIN is entered.
Add a new function setup, based on telit, to handle Gemalto P-family
discovery. The setup looks for USB interfaces:
application=/dev/ttyUSB2
gps=/dev/ttyUSB1
modem=/dev/ttyUSB3
Actual cinterion plugin is not compliant with newer Gemalto modems.
Gemalto plugin is based on cinterion with a custom struct to handle the
interfaces Application and Modem.
CGDCONT result parsing fails if first list contains several ranges. For
example with modem Cinterion PHS8:
AT+CGDCONT=?
+CGDCONT: (1-17,101-116),"IP",,,(0),(0-4)
Solution: read first range and jump to second list instead of trying to
close the brackets.
Password state and number of retries asked to modem using
QMI_UIM_GET_CARD_STATUS command rather than remembered after initial
QMI_UIM_GET_CARD_STATUS command.
Add read_imsi feature to qmimodem sim driver.
This is based on DMS service.
On MC7430, this is mandatory to be able to use this driver for GPRS
connection because reading IMSI via EF reads fails.
SIM card can be removed while the query is in progress. There's
still a remote possibility that SIM card is removed and inserted
back while the query is pending, that would start the second query
sequence and end up invoking sim_initialize() twice. But at least
these checks reduce the probability of something like that happening.
QMI notification messages handlers are never called on MC7430 without this fix.
- Do not test transaction id before calling notification handler. On MC7430,
notification messages contain a not null transaction id (starts with 1,
increased at each message for a particular client).
- On MC7304 transaction id in notification messages is always 0.
Get current signal strength (type: 0x01), not list of other signals strength
(0x10)
Without this fix:
- I can't get a signal strength on MC7430 because list does not exist
(only one signal strength).
- On MC7304, result is wrong
Add the following types to use with ublox modems +UCGED command.
EARFCN: E-UTRA Absolute Radio Frequency Channel Number.
EBand: E-UTRA operating Band.
CQI: Channel Quality Indicator.
- useless return at the end of a function
- mixed tabs & spaces for indentation
- over 80 characters for the comment
- line > 80 characters due to access technology conversion. Replaced
with a direct assignment.
drivers/ubloxmodem/netmon.c: In function ‘req_cb_data_unref’:
drivers/ubloxmodem/netmon.c:131:10: error: ‘return’ with a value, in
function returning void [-Werror]
return NULL;
This adds a netmon driver for ublox. The driver support both +COPS and
+CESQ commands to return the previously added ofono netmon types:
RSCP: Received Signal Code Power
ECN0: Received Energy Ratio
RSRQ: Reference Signal Received Quality
RSRP: Reference Signal Received Power
Current revision makes the driver use ref countig when chaining multiple
AT commands.
Display the following fields if they are returned.
RXLEV: Received Signal Strength
RSCP: Received Signal Code Power
ECN0: Received Energy Ratio
RSRQ: Reference Signal Received Quality
RSRP: Reference Signal Received Power
This adds documentation for the following fields in
networkmonitor-api.txt
RSCP: Received Signal Code Power
ECN0: Received Energy Ratio
RSRQ: Reference Signal Received Quality
RSRP: Reference Signal Received Power
Add more ofono netmon info types that will be served through the netmon
interface. The main user of this now will be the ublox modem.
RSCP: Received Signal Code Power
ECN0: Received Energy Ratio
RSRQ: Reference Signal Received Quality
RSRP: Reference Signal Received Power
Otherwise the attached state gets to be set before the actual LTE
automatic context is ready. This triggers a race between connman
and ofono: connman sees status attached before the context is active
so connman will try to activate another context with same apn and will
fail over and over again.
The U-Blox documentation specifies the following:
* get interface ip and dns from +CGDCONTRDP
* get gw ip and netmask from +UIPADDR
However, different firmware versions have different befaviour:
* On newer firmware, +UIPADDR returns error. But it's possible to configure
gateway ip == ipterface ip (read from CGDCONTRDP).
* On older firmware, we can actually use the commands specified in the
docs.
This patch runs +CGDCONTRDP, configures everything and then tries to run
+UIPADDR. In that works, reconfigures gw ip and netmask.
Adds U-Blox Toby L2 driver for setting the default APN via the
+UCGDFLT command. Currently only IPv4 is supported. APN is
not stored to modem's non-volatile memory. oFono will manage this
default APN via it's config storage.
When receiving an empty default APN, the value is reset.
This implementation can only get/set the default APN setting. But
anything expected for this atom is there:
* D-Bus interface
* sync-ing settings to/from file
* interaction with driver
Conflicts:
ofono/src/ofono.h
Events like +CLCC and +CCWA can have contact name attached to the
end of line. If this field contains odd number of quotation marks,
parser will eventually reject such message as malformatted.
.. primarily to make gprs.h identical to upstream. Besides, it's an internal
function, it doesn't have to be defined in gprs.h and exported from ofono in
the first place.
The state needs to be checked prior to calling __ofono_atom_register
because atom registration calls OFONO_ATOM_WATCH_CONDITION_REGISTERED
callbacks each of which may call ofono_sim_inserted_notify. Should
that happen, by the time __ofono_atom_register returns, ofono_sim
will be in OFONO_SIM_STATE_INSERTED state and sim_initialize will
be called twice if the initial state was OFONO_SIM_STATE_NOT_PRESENT.
If nothing else, that results in memory leaks like this one (because
IMSI will be queried twice, among other things):
==3017== 16 bytes in 1 blocks are definitely lost in loss record 187 of 475
==3017== at 0x483F380: malloc (vg_replace_malloc.c:296)
==3017== by 0x4AFB0DF: g_malloc (gmem.c:94)
==3017== by 0x4B12185: g_strdup (gstrfuncs.c:363)
==3017== by 0xF79D3: sim_imsi_obtained (sim.c:1535)
==3017== by 0xF7BB3: sim_imsi_cb (sim.c:1594)
==3017== by 0x66C23: at_cimi_cb (sim.c:441)
==3017== by 0xA6B53: at_chat_finish_command (gatchat.c:459)
==3017== by 0xA6D9F: at_chat_handle_command_response (gatchat.c:521)
==3017== by 0xA70AF: have_line (gatchat.c:600)
==3017== by 0xA76DF: new_bytes (gatchat.c:759)
==3017== by 0xABACF: received_data (gatio.c:122)
==3017== by 0xAD093: watch_dispatch (gatmux.c:461)
==3017== by 0xAC5D3: dispatch_sources (gatmux.c:180)
==3017== by 0xAC98F: received_data (gatmux.c:265)
==3017== by 0x4AF606F: g_main_dispatch (gmain.c:3154)
==3017== by 0x4AF606F: g_main_context_dispatch (gmain.c:3769)
==3017== by 0x4AF631D: g_main_context_iterate.isra.4 (gmain.c:3840)
==3017== by 0x4AF658F: g_main_loop_run (gmain.c:4034)
==3017== by 0xBE8AF: main (main.c:261)
Otherwise write_watcher_destroy_notify can be invoked after
GAtMux has been deallocated which results in write after free:
==3952== Invalid write of size 4
==3952== at 0xABF54: write_watcher_destroy_notify (gatmux.c:285)
==3952== by 0x4AF21E7: g_source_callback_unref (gmain.c:1561)
==3952== by 0x4AF2E53: g_source_destroy_internal.constprop.8 (gmain.c:1207)
==3952== by 0x4AF61CF: g_main_dispatch (gmain.c:3177)
==3952== by 0x4AF61CF: g_main_context_dispatch (gmain.c:3769)
==3952== by 0x4AF658F: g_main_loop_run (gmain.c:4034)
==3952== by 0xBDDBB: main (main.c:261)
==3952== Address 0x50c6cb0 is 8 bytes inside a block of size 4,396 free'd
==3952== at 0x4840B28: free (vg_replace_malloc.c:530)
==3952== by 0xACB53: g_at_mux_unref (gatmux.c:642)
==3952== Block was alloc'd at
==3952== at 0x4841BF0: calloc (vg_replace_malloc.c:711)
==3952== by 0xAC9DF: g_at_mux_new (gatmux.c:603)
==3952== by 0xADF2F: g_at_mux_new_gsm0710_basic (gatmux.c:1160)
Leaving them there may result in invalid reads like this:
==2312== Invalid read of size 4
==2312== at 0xAB8C0: dispatch_sources (gatmux.c:134)
==2312== by 0xAC5D3: channel_close (gatmux.c:479)
==2312== by 0x4AE8885: g_io_channel_shutdown (giochannel.c:523)
==2312== by 0x4AE8A1D: g_io_channel_unref (giochannel.c:240)
==2312== by 0xAC423: watch_finalize (gatmux.c:426)
==2312== by 0x4AF2CC9: g_source_unref_internal (gmain.c:2048)
==2312== by 0x4AF44E1: g_source_destroy_internal (gmain.c:1230)
==2312== by 0x4AF44E1: g_source_destroy (gmain.c:1256)
==2312== by 0x4AF5257: g_source_remove (gmain.c:2282)
==2312== by 0xAB5CB: io_shutdown (gatio.c:325)
==2312== by 0xAB667: g_at_io_unref (gatio.c:345)
==2312== by 0xA72C7: at_chat_unref (gatchat.c:972)
==2312== by 0xA829B: g_at_chat_unref (gatchat.c:1446)
==2312== Address 0x51420f0 is 56 bytes inside a block of size 60 free'd
==2312== at 0x4840B28: free (vg_replace_malloc.c:530)
==2312== by 0x4AF2D33: g_source_unref_internal (gmain.c:2075)
==2312== by 0x4AF44E1: g_source_destroy_internal (gmain.c:1230)
==2312== by 0x4AF44E1: g_source_destroy (gmain.c:1256)
==2312== by 0x4AF5257: g_source_remove (gmain.c:2282)
==2312== by 0xAB46B: g_at_io_set_write_handler (gatio.c:283)
==2312== by 0xA713F: at_chat_suspend (gatchat.c:938)
==2312== by 0xA72B7: at_chat_unref (gatchat.c:971)
==2312== by 0xA829B: g_at_chat_unref (gatchat.c:1446)
==2312== Block was alloc'd at
==2312== at 0x4841BF0: calloc (vg_replace_malloc.c:711)
==2312== by 0x4AFB117: g_malloc0 (gmem.c:124)
==2312== by 0x4AF401F: g_source_new (gmain.c:892)
==2312== by 0xAC6A7: channel_create_watch (gatmux.c:506)
==2312== by 0x4AE7C4F: g_io_add_watch_full (giochannel.c:649)
==2312== by 0xAB4EB: g_at_io_set_write_handler (gatio.c:297)
==2312== by 0xA7103: chat_wakeup_writer (gatchat.c:931)
==2312== by 0xA753F: at_chat_send_common (gatchat.c:1045)
==2312== by 0xA850F: g_at_chat_send (gatchat.c:1502)
It's also necessary to add additional references to the sources
for the duration of the dispatch_sources loop because any source
can be removed when any callback is invoked (and not necessarily
the one being dispatched).
unit/test-sailfish_sim_info.c:86:33: signed and unsigned type in conditional expression
drivers/ril/ril_netmon.c:46:12: comparison between signed and unsigned integer expressions
Let's assume that plugin API is going to be backward compatible. If
we start to actually use binary ofono plugins (possibly, 3rd-party),
backward compatibility becomes a must.
==2941== Invalid read of size 4
==2941== at 0x69338: sim_state_cb (sim.c:1301)
==2941== by 0x71DCB: cpin_check_cb (atutil.c:567)
==2941== by 0xA602B: at_chat_finish_command (gatchat.c:459)
==2941== by 0xA6277: at_chat_handle_command_response (gatchat.c:521)
==2941== by 0xA6587: have_line (gatchat.c:600)
==2941== by 0xA6BB7: new_bytes (gatchat.c:759)
==2941== by 0xAAFAF: received_data (gatio.c:124)
==2941== by 0x4AF606F: g_main_dispatch (gmain.c:3154)
==2941== by 0x4AF606F: g_main_context_dispatch (gmain.c:3769)
==2941== by 0x4AF658F: g_main_loop_run (gmain.c:4034)
==2941== by 0xBDDBB: main (main.c:261)
==2941== Address 0x519c344 is 4 bytes inside a block of size 12 free'd
==2941== at 0x4840B28: free (vg_replace_malloc.c:530)
==2941== by 0x71F33: at_util_sim_state_query_free (atutil.c:613)
==2941== by 0x6930B: sim_state_cb (sim.c:1297)
==2941== by 0x71DCB: cpin_check_cb (atutil.c:567)
==2941== by 0xA602B: at_chat_finish_command (gatchat.c:459)
==2941== by 0xA6277: at_chat_handle_command_response (gatchat.c:521)
==2941== by 0xA6587: have_line (gatchat.c:600)
==2941== by 0xA6BB7: new_bytes (gatchat.c:759)
==2941== by 0xAAFAF: received_data (gatio.c:124)
==2941== by 0x4AF606F: g_main_dispatch (gmain.c:3154)
==2941== by 0x4AF606F: g_main_context_dispatch (gmain.c:3769)
==2941== by 0x4AF658F: g_main_loop_run (gmain.c:4034)
==2941== by 0xBDDBB: main (main.c:261)
And it generally doesn't make sense to use slice allocator for allocating
the structures that are a) large and b) allocated at startup and not freed
until the program exits.
Invokes a callback for each registered plugin. It's needed by debuglog
plugin because external plugins have __debug section of their own and
debuglog needs access to debug_start and debug_stop of such plugins
in order to enable or disable plugin logs.
If /etc/ofono/ril_subscription.conf doesn't exist or doesn't contain
any modem sections (the latter is the case on Jolla 1 for historical
reasons) ofono falls back to the default configuration which should
use the default start timeout.
If there are no supported modems, ofono should be happy and the ready
flag should become true because the UI is waiting for this flag at
startup (and in this case there's nothing to wait for).
With multi-sim setup we get last cause code 0xffff when incoming
call is ending due to other multi-sim phone answering the call.
Due to this handle the 0xffff as remote hangup if call status is
incoming.
It's identical to RIL_REQUEST_SEND_SMS, except that more messages are
expected to be sent soon. If possible, SMS relay protocol link is kept
open (eg TS 27.005 AT+CMMS command)
GTest: run: /testsimutil/ber tlv encode EFpnn
==16777== Conditional jump or move depends on uninitialised value(s)
==16777== at 0x4068CB: ber_tlv_iter_next (simutil.c:369)
==16777== by 0x406C39: ber_tlv_find_by_tag (simutil.c:483)
==16777== by 0x407E1D: sim_eons_add_pnn_record (simutil.c:1027)
==16777== by 0x402C39: test_ber_tlv_builder_efpnn (test-simutil.c:181)
==16777== by 0x4EA3A80: g_test_run_suite_internal
==16777== by 0x4EA3F9A: g_test_run_suite
==16777== by 0x4EA3FD0: g_test_run
==16777== by 0x4042FA: main (test-simutil.c:518)
Valgrind was complaining about it like this:
==18099== Conditional jump or move depends on uninitialised value(s)
==18099== at 0x4C32281: strspn
==18099== by 0x41286B: cbs_decode_text (smsutil.c:4140)
==18099== by 0x40675C: test_cbs_encode_decode (test-sms.c:1417)
Missing manager_create callback would cause a memory leak like this:
==9972== 96 bytes in 4 blocks are definitely lost in loss record 336 of 356
==9972== at 0x483F3EC: malloc (vg_replace_malloc.c:299)
==9972== by 0x4AEE0DF: g_malloc (gmem.c:94)
==9972== by 0x4B03F51: g_slice_alloc (gslice.c:1025)
==9972== by 0x4B0438F: g_slice_alloc0 (gslice.c:1051)
==9972== by 0x1200B: sailfish_slot_manager_new (sailfish_manager.c:1019)
==9972== by 0x12243: sailfish_slot_driver_init (sailfish_manager.c:1075)
==9972== by 0x4AE906F: g_main_dispatch (gmain.c:3154)
==9972== by 0x4AE906F: g_main_context_dispatch (gmain.c:3769)
==9972== by 0x4AE931D: g_main_context_iterate.isra.4 (gmain.c:3840)
==9972== by 0x4AE958F: g_main_loop_run (gmain.c:4034)
==9972== by 0xACB7: test_basic (test-sailfish_manager.c:370)
==9972== by 0x4B0B89F: test_case_run (gtestutils.c:2158)
==9972== by 0x4B0B89F: g_test_run_suite_internal (gtestutils.c:2241)
==9972== by 0x4B0BACD: g_test_run_suite_internal (gtestutils.c:2253)
The new sailfish_manager plugin contains the code necessary for
proper integration of ofono into Sailfish OS (mostly, that's
Sailfish OS specific D-Bus interfaces) and can be used by pretty
much any driver, not necessarily ril.
Removed unnecessary checks for memory allocation failures.
Replaced inotify stuff with a simpler version of the same thing -
since we already depend on libglibutil, there's no reason not to
use functions from there.
LTE could be enabled for the slot that has no SIM card in it.
In that case we want to swap the capabilities so that LTE
becomes available to the slot that does have a SIM in it.
1. Don't allow any other requests while radio caps switch is ongoing.
2. Wait for all other requests to complete before starting the switch
3. Deactivate data calls, disable data before the switch
4. Increased the timeouts
When a USSD notification is received in the USER_ACTION state,
the state needs to be switched to IDLE. Some networks send 0
(no further user action required) after the response timeout
expires. That should result in the user input form getting
removed from the screen.
Some operators provide IP address of the MMS proxy
prepending zeros to each number shorter then 3 digits,
e.g. "192.168.094.023" instead of "192.168.94.23".
That may look nicer but it's actually wrong because
the numbers starting with zeros are interpreted as
octal numbers. In the example above 023 actually means
16 and 094 is not a valid number at all.
In addition to publishing these broken settings on their
web sites, some of the operators send them over the air,
in which case we can't even blame the user for entering
an invalid IP address. We better be prepared to deal with
those.
Since nobody in the world seems to be actually using the
octal notation to write an IP address, let's remove the
leading zeros if we find them in the host part of the MMS
proxy URL.
Even though it's not really required at build time anymore, let's still
keep it there because this requirement is hardcoded in configure.ac which
we pull from upstream.
... and added unit/coverage script which runs the tests and
generates html report.
Code coverage has to be enabled with --enable-test-coverage
configure switch
ANY is supposed to allow either PAP or CHAP to be performed at plugin's
discretion. This is now the default (rather than CHAP)
NONE disables the authentication alltogether.
plugins/provision.c is the original upstream provisioning plugin and
plugins/sailfish_provision.c is the Sailfish OS specific thing. They
are mutually exclusuve.
Sailfish OS specific plugin is enabled with --enable-sailfish-provision
configure switch. By default, the upstream plugin is used.
Errors returned by g_key_file_get_integer have to be deallocated
by the caller to avoid leaks like these:
==13330== 104 (24 direct, 80 indirect) bytes in 2 blocks are definitely lost
==13330== at 0x483F3EC: malloc (vg_replace_malloc.c)
==13330== by 0x4B020DF: g_malloc (gmem.c)
==13330== by 0x4B17F51: g_slice_alloc (gslice.c)
==13330== by 0x4AE80B9: g_error_new_valist (gerror.c)
==13330== by 0x4AE830B: g_set_error (gerror.c)
==13330== by 0x4AF5681: g_key_file_get_value (gkeyfile.c)
==13330== by 0x4AF6817: g_key_file_get_integer (gkeyfile.c)
==13330== by 0x10CFE3: radio_load_settings (radio-settings.c)
==13330== by 0x10D2E3: ofono_radio_settings_register (radio-settings.c)
If GET_SIM_STATUS succeeds but DEVICE_IDENTITY keeps on failing,
allow the latter to time out. Some RILs behave that way until the
modem has been properly initialized.
If PUK is required, app state is PUK and pin1_state is ENABLED_BLOCKED.
If the card is permanently locked, app state is still PUK but pin1_state
becomes ENABLED_PERM_BLOCKED. That way we can tell whether the SIM card
is locked even if the number of remaining attempts is not available.
After we have entered an invalid pin too many times, RIL signals
the SIM status change, we request the new status but ofono core
asks us for the new passwd state before our SIM status query has
completed. We need to wait for the query to complete before we can
report the new status to the core.
It also won't hurt if we request a fresh SIM status every time
when query_passwd_state callback is called, just in case if RIL
fails to notify us about the SIM status change.
Handle fancy variant of LAST_CALL_FAIL_CAUSE response
Some RILs get creative and invent their own formats.
They must be very proud of it.
See merge request !106
Allow to configure custom hangup reasons
One can define localHangupReasons and remoteHangupReasons in
ril_subscription.conf which will be treated as normal local or
remote hangup reasons.
See merge request !104
One can define localHangupReasons and remoteHangupReasons in
ril_subscription.conf which will be treated as normal local or
remote hangup reasons. The value is a comma-separated list of
numbers, e.g.
localHangupReasons=20,39
Quite a few things in SailfishOS assume that each modem has exactly
one internet and one mms context. However, ofono's D-Bus API allows
any application to arbitrarily add and remove connection contexts
which can screw things up quite badly. Since this functionality is
not used by SailfishOS, it should be disabled.
org.nemomobile.ofono.ModemManager.ModemError signal is emitted
when rild crash is detected. Also, the new GetModemErrors method
allows to query how many times which instance of rild has crashed
since ofono was (re)started.
The workaround is no longer needed. All SIM I/O requests have to
be completed even if the SIM card is removed while the request is
pending. Otherwise simfs request queue gets stuck.
Add rilmodem test engine. This engine is an improvement on the rilmodem
test server that allows us to test generic interactions with the
rilmodem driver. Instead of just be able to check content of received/
sent bytes on the rild socket, we can now specify a set of steps for a
test that include interactions with the atom. The step types are
- TST_ACTION_SEND: The harness sends a parcel
- TST_ACTION_CALL: The harness calls a driver function
- TST_EVENT_RECEIVE: The driver sends a parcel
- TST_EVENT_CALL: The driver calls a harness (atom) function
When the modes are modified with AT^SETPORT="FF;12,1,16", this modem
and pcui will appear using different ids. Update the interfaces
identifier accordingly.
The huawei E3372 exposes two USB tty at /dev/ttyUSB0 and /dev/ttyUSB1
/dev/ttyUSB1 is properly detected as modem.
/dev/ttyUSB0 is the pcui.
lsusb shows 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
strtol clamps returned value between INT_MIN and INT_MAX, causing
invalid value (255.255.255.127) being reported for any address
if last octet > 127 when sizeof(long) == 4.
split ril_pin_change_state_cb based on functionality w.r.t.
facility lock, puk and pin. Rename ril_pin_change_state to
more appropriate name ril_set_facility_lock and rename
ril_pin_change_state_cb to ril_enter_sim_pin_cb.
query facility during initialization is modified from back
to back invocation to chain manner to keep it inline with
RIL design. All vendor RIL does not support back to back
handling since RIL telephony framework sends the request
synchronously.
Added 'sofia3gr.ThermalManagement' interface to sofia3gr plugin and
floated 'TransmitPowerThrottling' as an ofono property under that,
to support modem throttling.
'sofia3gr.ThermalManagement'
1.Will be available ONLY if modem throttling is supported in RIL.
This is determined by sending a RIL request during ofono start,
to get current throttling state. If it succeeds, interface is
published otherwise not.
'TransmitPowerThrottling'
1.GetProperties will be allowed both when modem is ON & OFF.
2.GetProperties will be serviced by looking it up from state
information maintained inside ofono. No RIL call will be made.
3.SetProperty will be allowed ONLY when modem is ON.
4.SetProperty request will be forwarded to RIL ONLY if
new state != current state. If RIL request succeeds, state
information will be updated and also, a property change signal
will be emitted.
gril may be destroyed in the request callback (e.g in the callback of
set modem power off request). 'out_queue' and 'command_queue' is NULL.
there will be glib runtime warning if use them.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.