summaryrefslogtreecommitdiff
path: root/src/libqmi-glib
diff options
context:
space:
mode:
authorAleksander Morgado <aleksandermj@chromium.org>2023-09-28 11:54:08 +0000
committerAleksander Morgado <aleksandermj@chromium.org>2023-09-29 08:53:17 +0000
commiteab592eb265f1c2454ba714cae71101e2e04bca7 (patch)
tree181c4bab515274602d221ffd4a5e75c4b1b75277 /src/libqmi-glib
parent14c8674a5f649a25c5de49c4fbc98c92b39e98c3 (diff)
libqmi-glib: QRTR specific allocate/release CID operations are internal
Diffstat (limited to 'src/libqmi-glib')
-rw-r--r--src/libqmi-glib/qmi-device.c54
-rw-r--r--src/libqmi-glib/qmi-endpoint-mbim.c4
-rw-r--r--src/libqmi-glib/qmi-endpoint-qmux.c4
-rw-r--r--src/libqmi-glib/qmi-endpoint-qrtr.c12
-rw-r--r--src/libqmi-glib/qmi-endpoint.h8
-rw-r--r--src/libqmi-glib/qmi-proxy.c12
6 files changed, 47 insertions, 47 deletions
diff --git a/src/libqmi-glib/qmi-device.c b/src/libqmi-glib/qmi-device.c
index c74e088..b3ee74b 100644
--- a/src/libqmi-glib/qmi-device.c
+++ b/src/libqmi-glib/qmi-device.c
@@ -1180,14 +1180,14 @@ allocate_cid_qrtr_ready (QmiClientCtl *client_ctl,
GAsyncResult *res,
GTask *task)
{
- g_autoptr(QmiMessageCtlAllocateCidQrtrOutput) output = NULL;
+ g_autoptr(QmiMessageCtlInternalAllocateCidQrtrOutput) output = NULL;
QmiService service;
guint8 cid;
GError *error = NULL;
AllocateClientContext *ctx;
/* Check result of the async operation */
- output = qmi_client_ctl_allocate_cid_qrtr_finish (client_ctl, res, &error);
+ output = qmi_client_ctl_internal_allocate_cid_qrtr_finish (client_ctl, res, &error);
if (!output) {
g_prefix_error (&error, "CID allocation failed in the CTL client (QRTR): ");
g_task_return_error (task, error);
@@ -1196,14 +1196,14 @@ allocate_cid_qrtr_ready (QmiClientCtl *client_ctl,
}
/* Check result of the QMI operation */
- if (!qmi_message_ctl_allocate_cid_qrtr_output_get_result (output, &error)) {
+ if (!qmi_message_ctl_internal_allocate_cid_qrtr_output_get_result (output, &error)) {
g_task_return_error (task, error);
g_object_unref (task);
return;
}
/* Allocation info is mandatory when result is success */
- g_assert (qmi_message_ctl_allocate_cid_qrtr_output_get_allocation_info (output, &service, &cid, NULL));
+ g_assert (qmi_message_ctl_internal_allocate_cid_qrtr_output_get_allocation_info (output, &service, &cid, NULL));
ctx = g_task_get_task_data (task);
@@ -1449,16 +1449,16 @@ qmi_device_allocate_client (QmiDevice *self,
}
/* 16-bit service */
else if (ctx->service > G_MAXUINT8 && ctx->service <= G_MAXUINT16) {
- g_autoptr(QmiMessageCtlAllocateCidQrtrInput) input = NULL;
-
- input = qmi_message_ctl_allocate_cid_qrtr_input_new ();
- qmi_message_ctl_allocate_cid_qrtr_input_set_service (input, ctx->service, NULL);
- qmi_client_ctl_allocate_cid_qrtr (self->priv->client_ctl,
- input,
- timeout,
- cancellable,
- (GAsyncReadyCallback)allocate_cid_qrtr_ready,
- task);
+ g_autoptr(QmiMessageCtlInternalAllocateCidQrtrInput) input = NULL;
+
+ input = qmi_message_ctl_internal_allocate_cid_qrtr_input_new ();
+ qmi_message_ctl_internal_allocate_cid_qrtr_input_set_service (input, ctx->service, NULL);
+ qmi_client_ctl_internal_allocate_cid_qrtr (self->priv->client_ctl,
+ input,
+ timeout,
+ cancellable,
+ (GAsyncReadyCallback)allocate_cid_qrtr_ready,
+ task);
} else
g_assert_not_reached ();
return;
@@ -1516,14 +1516,14 @@ client_ctl_release_cid_qrtr_ready (QmiClientCtl *client_ctl,
GAsyncResult *res,
GTask *task)
{
- g_autoptr(QmiMessageCtlReleaseCidQrtrOutput) output = NULL;
+ g_autoptr(QmiMessageCtlInternalReleaseCidQrtrOutput) output = NULL;
GError *error = NULL;
/* Note: even if we return an error, the client is to be considered
* released! (so shouldn't be used) */
/* Check result of the async operation */
- output = qmi_client_ctl_release_cid_qrtr_finish (client_ctl, res, &error);
+ output = qmi_client_ctl_internal_release_cid_qrtr_finish (client_ctl, res, &error);
if (!output) {
g_task_return_error (task, error);
g_object_unref (task);
@@ -1531,7 +1531,7 @@ client_ctl_release_cid_qrtr_ready (QmiClientCtl *client_ctl,
}
/* Check result of the QMI operation */
- if (!qmi_message_ctl_release_cid_qrtr_output_get_result (output, &error)) {
+ if (!qmi_message_ctl_internal_release_cid_qrtr_output_get_result (output, &error)) {
g_task_return_error (task, error);
g_object_unref (task);
return;
@@ -1619,16 +1619,16 @@ qmi_device_release_client (QmiDevice *self,
}
/* 16-bit service */
else if (service > G_MAXUINT8 && service <= G_MAXUINT16) {
- g_autoptr(QmiMessageCtlReleaseCidQrtrInput) input = NULL;
-
- input = qmi_message_ctl_release_cid_qrtr_input_new ();
- qmi_message_ctl_release_cid_qrtr_input_set_release_info (input, service, cid, NULL);
- qmi_client_ctl_release_cid_qrtr (self->priv->client_ctl,
- input,
- timeout,
- cancellable,
- (GAsyncReadyCallback)client_ctl_release_cid_qrtr_ready,
- task);
+ g_autoptr(QmiMessageCtlInternalReleaseCidQrtrInput) input = NULL;
+
+ input = qmi_message_ctl_internal_release_cid_qrtr_input_new ();
+ qmi_message_ctl_internal_release_cid_qrtr_input_set_release_info (input, service, cid, NULL);
+ qmi_client_ctl_internal_release_cid_qrtr (self->priv->client_ctl,
+ input,
+ timeout,
+ cancellable,
+ (GAsyncReadyCallback)client_ctl_release_cid_qrtr_ready,
+ task);
} else
g_assert_not_reached ();
return;
diff --git a/src/libqmi-glib/qmi-endpoint-mbim.c b/src/libqmi-glib/qmi-endpoint-mbim.c
index 1f4e21c..17773cb 100644
--- a/src/libqmi-glib/qmi-endpoint-mbim.c
+++ b/src/libqmi-glib/qmi-endpoint-mbim.c
@@ -336,8 +336,8 @@ endpoint_send (QmiEndpoint *self,
/* Disallow private CTL operations */
if ((qmi_message_get_service (message) == QMI_SERVICE_CTL) &&
- (qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_ALLOCATE_CID_QRTR ||
- qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_RELEASE_CID_QRTR)) {
+ (qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_INTERNAL_ALLOCATE_CID_QRTR ||
+ qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_INTERNAL_RELEASE_CID_QRTR)) {
g_set_error (error, QMI_CORE_ERROR, QMI_CORE_ERROR_FAILED,
"MBIM endpoint expects only 8bit QMI services");
return FALSE;
diff --git a/src/libqmi-glib/qmi-endpoint-qmux.c b/src/libqmi-glib/qmi-endpoint-qmux.c
index e516e9d..f9f0147 100644
--- a/src/libqmi-glib/qmi-endpoint-qmux.c
+++ b/src/libqmi-glib/qmi-endpoint-qmux.c
@@ -475,8 +475,8 @@ endpoint_send (QmiEndpoint *self,
/* Disallow private CTL operations */
if ((qmi_message_get_service (message) == QMI_SERVICE_CTL) &&
- (qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_ALLOCATE_CID_QRTR ||
- qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_RELEASE_CID_QRTR)) {
+ (qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_INTERNAL_ALLOCATE_CID_QRTR ||
+ qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_INTERNAL_RELEASE_CID_QRTR)) {
g_set_error (error, QMI_CORE_ERROR, QMI_CORE_ERROR_FAILED,
"QMUX endpoint expects only 8bit QMI services");
return FALSE;
diff --git a/src/libqmi-glib/qmi-endpoint-qrtr.c b/src/libqmi-glib/qmi-endpoint-qrtr.c
index 4ef2f66..611794a 100644
--- a/src/libqmi-glib/qmi-endpoint-qrtr.c
+++ b/src/libqmi-glib/qmi-endpoint-qrtr.c
@@ -278,8 +278,8 @@ construct_alloc_tlv (QmiMessage *message,
qmi_message_tlv_write_complete (message, init_offset, NULL);
}
- if (qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_ALLOCATE_CID_QRTR ||
- qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_RELEASE_CID_QRTR) {
+ if (qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_INTERNAL_ALLOCATE_CID_QRTR ||
+ qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_INTERNAL_RELEASE_CID_QRTR) {
g_assert (service <= G_MAXUINT16);
return init_offset &&
qmi_message_tlv_write_guint16 (message, QMI_ENDIAN_LITTLE, service, NULL) &&
@@ -330,7 +330,7 @@ handle_alloc_cid (QmiEndpointQrtr *self,
return;
}
service = (QmiService)service_tmp;
- } else if (qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_ALLOCATE_CID_QRTR) {
+ } else if (qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_INTERNAL_ALLOCATE_CID_QRTR) {
guint16 service_tmp;
if (!qmi_message_tlv_read_guint16 (message, init_offset, &offset, QMI_ENDIAN_LITTLE, &service_tmp, &error)) {
@@ -389,7 +389,7 @@ handle_release_cid (QmiEndpointQrtr *self,
return;
}
service = (QmiService)service_tmp;
- } else if (qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_RELEASE_CID_QRTR) {
+ } else if (qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_INTERNAL_RELEASE_CID_QRTR) {
guint16 service_tmp;
if (!qmi_message_tlv_read_guint16 (message, init_offset, &offset, QMI_ENDIAN_LITTLE, &service_tmp, &error)) {
@@ -441,11 +441,11 @@ handle_ctl_message (QmiEndpointQrtr *self,
{
switch (qmi_message_get_message_id (message)) {
case QMI_MESSAGE_CTL_ALLOCATE_CID:
- case QMI_MESSAGE_CTL_ALLOCATE_CID_QRTR:
+ case QMI_MESSAGE_CTL_INTERNAL_ALLOCATE_CID_QRTR:
handle_alloc_cid (self, message);
break;
case QMI_MESSAGE_CTL_RELEASE_CID:
- case QMI_MESSAGE_CTL_RELEASE_CID_QRTR:
+ case QMI_MESSAGE_CTL_INTERNAL_RELEASE_CID_QRTR:
handle_release_cid (self, message);
break;
case QMI_MESSAGE_CTL_SYNC:
diff --git a/src/libqmi-glib/qmi-endpoint.h b/src/libqmi-glib/qmi-endpoint.h
index c603867..975b847 100644
--- a/src/libqmi-glib/qmi-endpoint.h
+++ b/src/libqmi-glib/qmi-endpoint.h
@@ -32,10 +32,10 @@
#include "qmi-message.h"
/* Constants for allocating/releasing clients */
-#define QMI_MESSAGE_CTL_ALLOCATE_CID 0x0022
-#define QMI_MESSAGE_CTL_RELEASE_CID 0x0023
-#define QMI_MESSAGE_CTL_ALLOCATE_CID_QRTR 0xFF22
-#define QMI_MESSAGE_CTL_RELEASE_CID_QRTR 0xFF23
+#define QMI_MESSAGE_CTL_ALLOCATE_CID 0x0022
+#define QMI_MESSAGE_CTL_RELEASE_CID 0x0023
+#define QMI_MESSAGE_CTL_INTERNAL_ALLOCATE_CID_QRTR 0xFF22
+#define QMI_MESSAGE_CTL_INTERNAL_RELEASE_CID_QRTR 0xFF23
typedef void (*QmiMessageHandler) (QmiMessage *message,
gpointer user_data);
diff --git a/src/libqmi-glib/qmi-proxy.c b/src/libqmi-glib/qmi-proxy.c
index 08e8d96..60f2a3f 100644
--- a/src/libqmi-glib/qmi-proxy.c
+++ b/src/libqmi-glib/qmi-proxy.c
@@ -50,11 +50,11 @@
#define QMI_MESSAGE_OUTPUT_TLV_RESULT 0x02
#define QMI_MESSAGE_OUTPUT_TLV_ALLOCATION_INFO 0x01
#define QMI_MESSAGE_CTL_ALLOCATE_CID 0x0022
-#define QMI_MESSAGE_CTL_ALLOCATE_CID_QRTR 0xFF22
+#define QMI_MESSAGE_CTL_INTERNAL_ALLOCATE_CID_QRTR 0xFF22
#define QMI_MESSAGE_INPUT_TLV_RELEASE_INFO 0x01
#define QMI_MESSAGE_CTL_RELEASE_CID 0x0023
-#define QMI_MESSAGE_CTL_RELEASE_CID_QRTR 0xFF23
+#define QMI_MESSAGE_CTL_INTERNAL_RELEASE_CID_QRTR 0xFF23
#define QMI_MESSAGE_CTL_INTERNAL_PROXY_OPEN 0xFF00
#define QMI_MESSAGE_CTL_INTERNAL_PROXY_OPEN_INPUT_TLV_DEVICE_PATH 0x01
@@ -629,7 +629,7 @@ track_cid (Client *client,
return;
}
info.service = (QmiService)service_tmp;
- } else if (qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_ALLOCATE_CID_QRTR) {
+ } else if (qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_INTERNAL_ALLOCATE_CID_QRTR) {
guint16 service_tmp;
if (!qmi_message_tlv_read_guint16 (message, init_offset, &offset, QMI_ENDIAN_LITTLE, &service_tmp, &error)) {
@@ -682,7 +682,7 @@ untrack_cid (QmiProxy *self,
return;
}
info.service = (QmiService)service_tmp;
- } else if (qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_RELEASE_CID_QRTR) {
+ } else if (qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_INTERNAL_RELEASE_CID_QRTR) {
guint16 service_tmp;
if (!qmi_message_tlv_read_guint16 (message, init_offset, &offset, QMI_ENDIAN_LITTLE, &service_tmp, &error)) {
@@ -872,7 +872,7 @@ device_command_ready (QmiDevice *device,
if (qmi_message_get_service (response) == QMI_SERVICE_CTL) {
qmi_message_set_transaction_id (response, request->in_trid);
if (qmi_message_get_message_id (response) == QMI_MESSAGE_CTL_ALLOCATE_CID ||
- qmi_message_get_message_id (response) == QMI_MESSAGE_CTL_ALLOCATE_CID_QRTR)
+ qmi_message_get_message_id (response) == QMI_MESSAGE_CTL_INTERNAL_ALLOCATE_CID_QRTR)
track_cid (request->client, response);
}
@@ -922,7 +922,7 @@ process_message (QmiProxy *self,
/* Try to untrack QMI client as soon as we detect the associated
* release message, no need to wait for the response. */
if (qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_RELEASE_CID ||
- qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_RELEASE_CID_QRTR)
+ qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_INTERNAL_RELEASE_CID_QRTR)
untrack_cid (self, client, message);
} else
track_implicit_cid (self, client, message);