Skip to contentSkip to conversation

qmimodem: Support 16-bit service types

PATCH Applied Steve Schrock 2 participants 3 messages Feb 17, 2024 – Feb 20, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 qmimodem: Support 16-bit service types

Prepare for QRTR which has service types greater than 255.

---
 drivers/qmimodem/qmi.c | 8 ++++----
 drivers/qmimodem/qmi.h | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/qmimodem/qmi.c +4 -4
index 7f0d6054..3c8c00a6 100644
@@ -1115,7 +1115,7 @@ static const void *tlv_get(const void *data, uint16_t size,
 	return NULL;
 }
 
-bool qmi_device_get_service_version(struct qmi_device *device, uint8_t type,
+bool qmi_device_get_service_version(struct qmi_device *device, uint16_t type,
 					uint16_t *major, uint16_t *minor)
 {
 	struct qmi_version *info;
@@ -1134,7 +1134,7 @@ bool qmi_device_get_service_version(struct qmi_device *device, uint8_t type,
 	return false;
 }
 
-bool qmi_device_has_service(struct qmi_device *device, uint8_t type)
+bool qmi_device_has_service(struct qmi_device *device, uint16_t type)
 {
 	struct qmi_version *info;
 	int i;
@@ -2171,7 +2171,7 @@ static void service_create_shared_data_free(gpointer user_data)
 	g_free(data);
 }
 
-bool qmi_service_create_shared(struct qmi_device *device, uint8_t type,
+bool qmi_service_create_shared(struct qmi_device *device, uint16_t type,
 			qmi_create_func_t func, void *user_data,
 			qmi_destroy_func_t destroy)
 {
@@ -2227,7 +2227,7 @@ bool qmi_service_create_shared(struct qmi_device *device, uint8_t type,
 }
 
 bool qmi_service_create(struct qmi_device *device,
-				uint8_t type, qmi_create_func_t func,
+				uint16_t type, qmi_create_func_t func,
 				void *user_data, qmi_destroy_func_t destroy)
 {
 	return qmi_service_create_shared(device, type, func,
drivers/qmimodem/qmi.h +4 -4
index 8006e015..3fdf960b 100644
@@ -97,8 +97,8 @@ bool qmi_device_discover(struct qmi_device *device, qmi_discover_func_t func,
 bool qmi_device_shutdown(struct qmi_device *device, qmi_shutdown_func_t func,
 				void *user_data, qmi_destroy_func_t destroy);
 
-bool qmi_device_has_service(struct qmi_device *device, uint8_t type);
-bool qmi_device_get_service_version(struct qmi_device *device, uint8_t type,
+bool qmi_device_has_service(struct qmi_device *device, uint16_t type);
+bool qmi_device_get_service_version(struct qmi_device *device, uint16_t type,
 					uint16_t *major, uint16_t *minor);
 
 bool qmi_device_sync(struct qmi_device *device,
@@ -158,10 +158,10 @@ typedef void (*qmi_result_func_t)(struct qmi_result *result, void *user_data);
 typedef void (*qmi_create_func_t)(struct qmi_service *service, void *user_data);
 
 bool qmi_service_create(struct qmi_device *device,
-				uint8_t type, qmi_create_func_t func,
+				uint16_t type, qmi_create_func_t func,
 				void *user_data, qmi_destroy_func_t destroy);
 bool qmi_service_create_shared(struct qmi_device *device,
-				uint8_t type, qmi_create_func_t func,
+				uint16_t type, qmi_create_func_t func,
 				void *user_data, qmi_destroy_func_t destroy);
 
 struct qmi_service *qmi_service_ref(struct qmi_service *service);
Signature · 13 lines
2.40.1


-- 


*Confidentiality Note:* We care about protecting our proprietary 
information, confidential material, and trade secrets. This message may 
contain some or all of those things. Cruise will suffer material harm if 
anyone other than the intended recipient disseminates or takes any action 
based on this message. If you have received this message (including any 
attachments) in error, please delete it immediately and notify the sender 
promptly.
#1 lore raw

PATCH 2/2 qmimodem: Fix checkpatch.pl warnings and errors

---
 drivers/qmimodem/qmi.c |  7 ++++---
 drivers/qmimodem/qmi.h | 12 ++++++------
 2 files changed, 10 insertions(+), 9 deletions(-)
drivers/qmimodem/qmi.c +4 -3
index 3c8c00a6..c9c80975 100644
@@ -299,6 +299,7 @@ static void __hexdump(const char dir, const unsigned char *buf, size_t len,
 
 	if (i % 16 > 0) {
 		size_t j;
+
 		for (j = (i % 16); j < 16; j++) {
 			str[(j * 3) + 1] = ' ';
 			str[(j * 3) + 2] = ' ';
@@ -720,6 +721,7 @@ static uint16_t __request_submit(struct qmi_device *device,
 		req->tid = hdr->transaction;
 	} else {
 		struct qmi_service_hdr *hdr;
+
 		hdr = req->buf + QMI_MUX_HDR_SIZE;
 		hdr->type = 0x00;
 		hdr->transaction = device->next_service_tid++;
@@ -1142,9 +1144,8 @@ bool qmi_device_has_service(struct qmi_device *device, uint16_t type)
 	for (i = 0, info = device->version_list;
 			i < device->version_count;
 			i++, info++) {
-		if (info->type == type) {
+		if (info->type == type)
 			return true;
-		}
 	}
 
 	return false;
@@ -2260,7 +2261,7 @@ void qmi_service_unref(struct qmi_service *service)
 	unsigned int hash_id;
 
 	if (!service)
-                return;
+		return;
 
 	if (__sync_sub_and_fetch(&service->ref_count, 1))
 		return;
drivers/qmimodem/qmi.h +6 -6
index 3fdf960b..21537a76 100644
@@ -62,12 +62,12 @@ enum qmi_device_expected_data_format {
 };
 
 enum qmi_data_endpoint_type {
-    QMI_DATA_ENDPOINT_TYPE_UNKNOWN   = 0x00,
-    QMI_DATA_ENDPOINT_TYPE_HSIC      = 0x01,
-    QMI_DATA_ENDPOINT_TYPE_HSUSB     = 0x02,
-    QMI_DATA_ENDPOINT_TYPE_PCIE      = 0x03,
-    QMI_DATA_ENDPOINT_TYPE_EMBEDDED  = 0x04,
-    QMI_DATA_ENDPOINT_TYPE_BAM_DMUX  = 0x05,
+	QMI_DATA_ENDPOINT_TYPE_UNKNOWN   = 0x00,
+	QMI_DATA_ENDPOINT_TYPE_HSIC      = 0x01,
+	QMI_DATA_ENDPOINT_TYPE_HSUSB     = 0x02,
+	QMI_DATA_ENDPOINT_TYPE_PCIE      = 0x03,
+	QMI_DATA_ENDPOINT_TYPE_EMBEDDED  = 0x04,
+	QMI_DATA_ENDPOINT_TYPE_BAM_DMUX  = 0x05,
 };
 
 void qmi_free(void *ptr);
Signature · 13 lines
2.40.1


-- 


*Confidentiality Note:* We care about protecting our proprietary 
information, confidential material, and trade secrets. This message may 
contain some or all of those things. Cruise will suffer material harm if 
anyone other than the intended recipient disseminates or takes any action 
based on this message. If you have received this message (including any 
attachments) in error, please delete it immediately and notify the sender 
promptly.
#2 lore raw
In reply to Steve Schrock
This series was applied to ofono.git (master) by Denis Kenzior <[email protected]>:

Hello:

This series was applied to ofono.git (master)
by Denis Kenzior <[email protected]>:

Quoted 5 lines · On Sat, 17 Feb 2024 00:30:31 +0000 you wrote:

Prepare for QRTR which has service types greater than 255.

---
 drivers/qmimodem/qmi.c | 8 ++++----
 drivers/qmimodem/qmi.h | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

Here is the summary with links:
- [1/2] qmimodem: Support 16-bit service types

    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=6984ddd42694
  - [2/2] qmimodem: Fix checkpatch.pl warnings and errors
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=00444ee7c8bf

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html