ofono: Make the oFono Plugin Modem Interface Order Tolerant
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | ofono: Add additional 'DBG' statements.plugins/ | +30 | 0 replies | |
| 2/4 | ofono: Use goto error-handling semantics in 'add_cm_context'.plugins/ | +11 | 0 replies | |
| 3/4 | ofono: Documentation: Add comment about entry condition for 'context_changed'.plugins/ | +6 | 0 replies | |
| 4/4 | ofono: Provide a secondary opportunity to get CM props and contexts.plugins/ | +24 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/4] ofono: Make the oFono Plugin Modem Interface Order Tolerant
This addresses and closes #135 by providing a secondary opportunity to send D-Bus request to get Connection Manager interface properties and contexts at the successful closure of 'try_create_device' since the primary opportunity in 'modem_update_interfaces' is missed in the following test case:
# connmanctl disable cellular
# /etc/init.d/connman stop
# /etc/init.d/ofono stop
# rm -rf /var/lib/ofono/*
# rm -rf /var/lib/connman/cellular*
# /etc/init.d/ofono start
# /etc/init.d/connman start
# connmanctl enable cellularAt this point, ofonod will create a fully-provisioned and -functional Cellular service, with both IPv4 and IPv6 Cellular network contexts. However, connmand has no network and no service associated with it so, so any Connection Manager client observing the Cellular service state will observe it failing, on timeout.
In this use case, the ordering of the oFono 'lte' (Long-term Evolution) and 'cm' (Connection Manager) modem interfaces shared between 'ofonod' and 'connmand' is different from what they normally are in the case where a Cellular connection has already been established. Consequently, when the 'cm' interface state change notification addition arrives, the connman device has not yet been created because in 'modem_update_interfaces' executing 'cm_get_properties' and 'cm_get_contexts' is dependent on the presence of 'modem->device':
if (api_added(old_ifaces, new_ifaces, OFONO_API_CM)) {
if (modem->device) {
cm_get_properties(modem);
cm_get_contexts(modem);
}
}Unfortunately, that does not and cannot happen until the 'lte' modem interface is added because 'try_create_device' has these conditionals:
if ((modem->capabilities & LTE_CAPABLE) &&
!has_interface(modem->interfaces, OFONO_API_LTE))
return false;and the 'lte' interface is added only moments later (rather than moments earlier as is normal outside this use case), but too late nonetheless. So, the ofono plugin will never get 'cm' interface properties or Cellular network contexts.
With this change, each call to 'try_create_device' now has an opportunity to check if the 'cm' interface has been added and, if it has, to request 'cm' properties and contexts.
Grant Erickson (4):
ofono: Add additional 'DBG' statements.
ofono: Use goto error-handling semantics in 'add_cm_context'.
ofono: Documentation: Add comment about entry condition for
'context_changed'.
ofono: Provide a secondary opportunity to get CM props and contexts.
plugins/ofono.c | 78 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 71 insertions(+), 7 deletions(-)
Signature · 1 line
2.45.0