All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] qmi: add service ID's
@ 2017-04-03 12:27 Jonas Bonn
  2017-04-03 12:27 ` [PATCH 2/3] qmi: fix bad lookup and double free Jonas Bonn
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jonas Bonn @ 2017-04-03 12:27 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2429 bytes --]

---
 drivers/qmimodem/qmi.c | 14 ++++++++++++++
 drivers/qmimodem/qmi.h |  7 +++++++
 2 files changed, 21 insertions(+)

diff --git a/drivers/qmimodem/qmi.c b/drivers/qmimodem/qmi.c
index 9b80455..e113b85 100644
--- a/drivers/qmimodem/qmi.c
+++ b/drivers/qmimodem/qmi.c
@@ -341,8 +341,12 @@ static const char *__service_type_to_string(uint8_t type)
 		return "UIM";
 	case QMI_SERVICE_PBM:
 		return "PBM";
+	case QMI_SERVICE_QCHAT:
+		return "QCHAT";
 	case QMI_SERVICE_RMTFS:
 		return "RMTFS";
+	case QMI_SERVICE_TEST:
+		return "TEST";
 	case QMI_SERVICE_LOC:
 		return "LOC";
 	case QMI_SERVICE_SAR:
@@ -357,8 +361,18 @@ static const char *__service_type_to_string(uint8_t type)
 		return "TMD";
 	case QMI_SERVICE_WDA:
 		return "WDA";
+	case QMI_SERVICE_CSVT:
+		return "CSVT";
+	case QMI_SERVICE_COEX:
+		return "COEX";
 	case QMI_SERVICE_PDC:
 		return "PDC";
+	case QMI_SERVICE_RFRPE:
+		return "RFRPE";
+	case QMI_SERVICE_DSD:
+		return "DSD";
+	case QMI_SERVICE_SSCTL:
+		return "SSCTL";
 	case QMI_SERVICE_CAT_OLD:
 		return "CAT";
 	case QMI_SERVICE_RMS:
diff --git a/drivers/qmimodem/qmi.h b/drivers/qmimodem/qmi.h
index 2233cdb..0cd8f7c 100644
--- a/drivers/qmimodem/qmi.h
+++ b/drivers/qmimodem/qmi.h
@@ -35,7 +35,9 @@
 #define QMI_SERVICE_CAT		10	/* Card application toolkit service */
 #define QMI_SERVICE_UIM		11	/* UIM service */
 #define QMI_SERVICE_PBM		12	/* Phonebook service */
+#define QMI_SERVICE_QCHAT	13
 #define QMI_SERVICE_RMTFS	14	/* Remote file system service */
+#define QMI_SERVICE_TEST	15
 #define QMI_SERVICE_LOC		16	/* Location service */
 #define QMI_SERVICE_SAR		17	/* Specific absorption rate service */
 #define QMI_SERVICE_CSD		20	/* Core sound driver service */
@@ -43,7 +45,12 @@
 #define QMI_SERVICE_TS		23	/* Thermal sensors service */
 #define QMI_SERVICE_TMD		24	/* Thermal mitigation device service */
 #define QMI_SERVICE_WDA		26	/* Wireless data administrative service */
+#define QMI_SERVICE_CSVT	29
+#define QMI_SERVICE_COEX	34
 #define QMI_SERVICE_PDC		36	/* Persistent device configuration service */
+#define QMI_SERVICE_RFRPE	41
+#define QMI_SERVICE_DSD		42
+#define QMI_SERVICE_SSCTL	43
 #define QMI_SERVICE_CAT_OLD	224	/* Card application toolkit service */
 #define QMI_SERVICE_RMS		225	/* Remote management service */
 #define QMI_SERVICE_OMA		226	/* OMA device management service */
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] qmi: fix bad lookup and double free
  2017-04-03 12:27 [PATCH 1/3] qmi: add service ID's Jonas Bonn
@ 2017-04-03 12:27 ` Jonas Bonn
  2017-04-03 12:27 ` [PATCH 3/3] modem: set_online is valid for AlwaysOnline modems Jonas Bonn
  2017-04-03 14:22 ` [PATCH 1/3] qmi: add service ID's Denis Kenzior
  2 siblings, 0 replies; 4+ messages in thread
From: Jonas Bonn @ 2017-04-03 12:27 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1371 bytes --]

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] modem: set_online is valid for AlwaysOnline modems
  2017-04-03 12:27 [PATCH 1/3] qmi: add service ID's Jonas Bonn
  2017-04-03 12:27 ` [PATCH 2/3] qmi: fix bad lookup and double free Jonas Bonn
@ 2017-04-03 12:27 ` Jonas Bonn
  2017-04-03 14:22 ` [PATCH 1/3] qmi: add service ID's Denis Kenzior
  2 siblings, 0 replies; 4+ messages in thread
From: Jonas Bonn @ 2017-04-03 12:27 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 932 bytes --]

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] qmi: add service ID's
  2017-04-03 12:27 [PATCH 1/3] qmi: add service ID's Jonas Bonn
  2017-04-03 12:27 ` [PATCH 2/3] qmi: fix bad lookup and double free Jonas Bonn
  2017-04-03 12:27 ` [PATCH 3/3] modem: set_online is valid for AlwaysOnline modems Jonas Bonn
@ 2017-04-03 14:22 ` Denis Kenzior
  2 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2017-04-03 14:22 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 243 bytes --]

Hi Jonas,

On 04/03/2017 07:27 AM, Jonas Bonn wrote:
> ---
>  drivers/qmimodem/qmi.c | 14 ++++++++++++++
>  drivers/qmimodem/qmi.h |  7 +++++++
>  2 files changed, 21 insertions(+)
>

All three applied, thanks.

Regards,
-Denis


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-03 14:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-03 12:27 [PATCH 1/3] qmi: add service ID's Jonas Bonn
2017-04-03 12:27 ` [PATCH 2/3] qmi: fix bad lookup and double free Jonas Bonn
2017-04-03 12:27 ` [PATCH 3/3] modem: set_online is valid for AlwaysOnline modems Jonas Bonn
2017-04-03 14:22 ` [PATCH 1/3] qmi: add service ID's Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.