diff mbox series

[v2,01/14] qmi: Introduce SERVICE_VERSION macro

Message ID 20240625164158.1170937-1-denkenz@gmail.com (mailing list archive)
State Accepted
Commit 17c59087a559a05dd457896d2919444275d17d74
Headers show
Series [v2,01/14] qmi: Introduce SERVICE_VERSION macro | expand

Commit Message

Denis Kenzior June 25, 2024, 4:41 p.m. UTC
This will make it easier to compare service major.minor versions in a
more readable manner.
---
 drivers/qmimodem/qmi.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

patchwork-bot+ofono@kernel.org June 26, 2024, 12:20 a.m. UTC | #1
Hello:

This series was applied to ofono.git (master)
by Denis Kenzior <denkenz@gmail.com>:

On Tue, 25 Jun 2024 11:41:37 -0500 you wrote:
> This will make it easier to compare service major.minor versions in a
> more readable manner.
> ---
>  drivers/qmimodem/qmi.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

Here is the summary with links:
  - [v2,01/14] qmi: Introduce SERVICE_VERSION macro
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=17c59087a559
  - [v2,02/14] qmi: Remove control_major and control_minor
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=c2fca8c3ff5a
  - [v2,03/14] qmi: Move service_handle allocation to service_family
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=1dada7a3caef
  - [v2,04/14] qmi: Move group id allocation out of qmi_device
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=97758fc3e797
  - [v2,05/14] qmi: Move service_info management into qrtr/qmux
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=d216d9826b3a
  - [v2,06/14] qmi: Rename qmi_device to qmi_transport
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=c98edde4fabb
  - [v2,07/14] qmi: Separate transport from qmux/qrtr debugging
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=3287d7b5e8b6
  - [v2,08/14] gobi: Enable io debugging only if OFONO_QMI_IO_DEBUG is set
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=369d68cab127
  - [v2,09/14] qmiqrtr: Enable io debugging only if OFONO_QMI_IO_DEBUG is set
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=37662676bce0
  - [v2,10/14] qmi: Move release_client operation into service_family
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=015266f253ab
  - [v2,11/14] qmi: Add dedicated service for qrtr
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=0e99a8932bae
  - [v2,12/14] qmi: debug print fd that QRTR data was received on
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=fba357d49292
  - [v2,13/14] unit: Use _auto_ to automatically tear-down test setup
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=e78bb3a9338e
  - [v2,14/14] unit: Add unit test for QRTR dedicated services
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=19a0671b111e

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/qmimodem/qmi.c b/drivers/qmimodem/qmi.c
index e3a8b225140f..5f29c4384803 100644
--- a/drivers/qmimodem/qmi.c
+++ b/drivers/qmimodem/qmi.c
@@ -36,6 +36,9 @@ 
 	l_util_debug((debug)->func, (debug)->user_data, "%s:%i " fmt,	\
 			__func__, __LINE__, ## args)
 
+#define SERVICE_VERSION(major, minor)				\
+	(((major) << 16) | (minor))
+
 struct qmi_device;
 struct qmi_request;
 
@@ -1199,6 +1202,7 @@  static void qmux_discover_callback(struct qmi_request *req, uint16_t message,
 	const void *ptr;
 	uint16_t len;
 	unsigned int i;
+	uint32_t control_version = 0;
 
 	result_code = tlv_get(buffer, length, 0x02, &len);
 	if (!result_code)
@@ -1233,6 +1237,7 @@  static void qmux_discover_callback(struct qmi_request *req, uint16_t message,
 		if (type == QMI_SERVICE_CONTROL) {
 			qmux->control_major = major;
 			qmux->control_minor = minor;
+			control_version = SERVICE_VERSION(major, minor);
 			continue;
 		}
 
@@ -1257,8 +1262,7 @@  done:
 	 * invoke it to reset the state, including release all previously
 	 * allocated clients
 	 */
-	if ((qmux->control_major == 1 && qmux->control_minor >= 5) ||
-			qmux->control_major > 1) {
+	if (control_version >= SERVICE_VERSION(1, 5)) {
 		struct qmi_request *req =
 			__control_request_alloc(QMI_CTL_SYNC, NULL, 0, 0);