New subject: [PATCH 2/3] qmi: fix bad lookup and double free
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.
---
drivers/qmimodem/qmi.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/qmimodem/qmi.c b/drivers/qmimodem/qmi.c
index e113b85..a0d79e1 100644
--- a/drivers/qmimodem/qmi.c
+++ b/drivers/qmimodem/qmi.c
@@ -901,7 +901,7 @@ static void __qmi_device_discovery_complete(struct qmi_device
*device,
GList *list;
struct discovery *d;
- list = g_queue_find_custom(device->req_queue,
+ list = g_queue_find_custom(device->discovery_queue,
discover_data, __discovery_compare);
if (!list)
return;
@@ -909,7 +909,6 @@ static void __qmi_device_discovery_complete(struct qmi_device
*device,
d = list->data;
g_queue_delete_link(device->discovery_queue, list);
- d->destroy(d->discover_data);
__discovery_free(d, NULL);
}
--
2.9.3
New subject: [PATCH 3/3] modem: set_online is valid for AlwaysOnline modems
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.
---
src/modem.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/modem.c b/src/modem.c
index b1e8d3e..ac361be 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -754,8 +754,12 @@ static DBusMessage *set_property_online(struct ofono_modem *modem,
if (ofono_modem_get_emergency_mode(modem) == TRUE)
return __ofono_error_emergency_active(msg);
- if (modem_is_always_online(modem) == TRUE)
- return __ofono_error_not_implemented(msg);
+ if (modem_is_always_online(modem) == TRUE) {
+ if (online)
+ return dbus_message_new_method_return(msg);
+ else
+ return __ofono_error_not_implemented(msg);
+ }
modem->pending = dbus_message_ref(msg);
--
2.9.3