kernel-device,qrtr: common physdev UID for all QRTR nodes

Add a common physdev UID to all ports in the Qualcomm SoC, so that they
are all bound together to the same modem object.

This change assumes that no external plugged device ever exports a
QRTR node in the QRTR bus (e.g. that no PCI or USB device would ever
do that). This assumption is likely wrong, but given that we're
currently limiting the QRTR support to the Qualcomm SoC plugin, the
assumption is valid for us for now.
This commit is contained in:
Aleksander Morgado
2021-01-17 14:51:16 +01:00
parent 2b126725bf
commit 591d904f5c
2 changed files with 7 additions and 8 deletions

View File

@@ -112,14 +112,7 @@ kernel_device_get_name (MMKernelDevice *_self)
static const gchar *
kernel_device_get_physdev_uid (MMKernelDevice *_self)
{
MMKernelDeviceQrtr *self;
self = MM_KERNEL_DEVICE_QRTR (_self);
if (!self->priv->physdev_uid)
self->priv->physdev_uid = g_strdup_printf ("qrtr%d", qrtr_node_get_id (self->priv->node));
return self->priv->physdev_uid;
return MM_KERNEL_DEVICE_QRTR_PHYSDEV_UID;
}
static const gchar *

View File

@@ -31,6 +31,12 @@
/* Subsytem string reported for all QRTR nodes; not really a kernel subsystem */
#define MM_KERNEL_DEVICE_QRTR_SUBSYSTEM "qrtr"
/* Physical device UID string reported for all QRTR nodes; equal to the UID
* used in the 'qcom-soc' plugin, which is the only one supporting QRTR nodes
* for now. This UID must be equal for all ports on the same modem, and so for
* Qualcomm SoCs we use the same plugin name as common string. */
#define MM_KERNEL_DEVICE_QRTR_PHYSDEV_UID "qcom-soc"
/* Helper to create a unique device name from the QRTR node id */
gchar *mm_kernel_device_qrtr_helper_build_name (guint32 node_id);