port-probe: create port-qmi using a QRTR node
For QRTR devices, create the qmi ports using the QRTR node.
This commit is contained in:

committed by
Aleksander Morgado

parent
aeed8c9e5b
commit
5f1bac5cf8
@@ -42,6 +42,10 @@
|
|||||||
#include "mm-port-qmi.h"
|
#include "mm-port-qmi.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined WITH_QRTR
|
||||||
|
#include "mm-kernel-device-qrtr.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined WITH_MBIM
|
#if defined WITH_MBIM
|
||||||
#include "mm-port-mbim.h"
|
#include "mm-port-mbim.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -491,22 +495,33 @@ wdm_probe_qmi (MMPortProbe *self)
|
|||||||
ctx = g_task_get_task_data (self->priv->task);
|
ctx = g_task_get_task_data (self->priv->task);
|
||||||
|
|
||||||
#if defined WITH_QMI
|
#if defined WITH_QMI
|
||||||
|
/* Create a port and try to open it */
|
||||||
|
mm_obj_dbg (self, "probing QMI...");
|
||||||
|
|
||||||
|
#if defined WITH_QRTR
|
||||||
|
if (MM_IS_KERNEL_DEVICE_QRTR (self->priv->port)) {
|
||||||
|
g_autoptr(QrtrNode) node = NULL;
|
||||||
|
|
||||||
|
node = mm_kernel_device_qrtr_get_node (MM_KERNEL_DEVICE_QRTR (self->priv->port));
|
||||||
|
|
||||||
|
/* Will set MM_PORT_SUBSYS_QRTR when creating the mm-port */
|
||||||
|
ctx->port_qmi = mm_port_qmi_new_from_node (mm_kernel_device_get_name (self->priv->port), node);
|
||||||
|
} else
|
||||||
|
#endif /* WITH_QRTR */
|
||||||
{
|
{
|
||||||
MMPortSubsys subsys = MM_PORT_SUBSYS_USBMISC;
|
MMPortSubsys subsys = MM_PORT_SUBSYS_USBMISC;
|
||||||
|
|
||||||
mm_obj_dbg (self, "probing QMI...");
|
|
||||||
|
|
||||||
if (g_str_equal (mm_kernel_device_get_subsystem (self->priv->port), "rpmsg"))
|
if (g_str_equal (mm_kernel_device_get_subsystem (self->priv->port), "rpmsg"))
|
||||||
subsys = MM_PORT_SUBSYS_RPMSG;
|
subsys = MM_PORT_SUBSYS_RPMSG;
|
||||||
|
|
||||||
/* Create a port and try to open it */
|
|
||||||
ctx->port_qmi = mm_port_qmi_new (mm_kernel_device_get_name (self->priv->port), subsys);
|
ctx->port_qmi = mm_port_qmi_new (mm_kernel_device_get_name (self->priv->port), subsys);
|
||||||
mm_port_qmi_open (ctx->port_qmi,
|
|
||||||
FALSE,
|
|
||||||
NULL,
|
|
||||||
(GAsyncReadyCallback) port_qmi_open_ready,
|
|
||||||
self);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mm_port_qmi_open (ctx->port_qmi,
|
||||||
|
FALSE,
|
||||||
|
NULL,
|
||||||
|
(GAsyncReadyCallback) port_qmi_open_ready,
|
||||||
|
self);
|
||||||
#else
|
#else
|
||||||
/* If not compiled with QMI support, just assume we won't have any QMI port */
|
/* If not compiled with QMI support, just assume we won't have any QMI port */
|
||||||
mm_port_probe_set_result_qmi (self, FALSE);
|
mm_port_probe_set_result_qmi (self, FALSE);
|
||||||
|
Reference in New Issue
Block a user