port-qmi: allow MMPortQmi to get the net sysfs path

Will be set by base modem when organizing ports, similar to
net driver name. Required for fetching the TX and RX endpoint IDs
through sysfs from linux 5.14 onwards.
This commit is contained in:
Joel Selvaraj
2021-07-21 12:40:31 +05:30
parent 1d4caa929f
commit 43c9c47b04
2 changed files with 16 additions and 0 deletions

View File

@@ -56,6 +56,7 @@ struct _MMPortQmiPrivate {
QmiDevice *qmi_device;
GList *services;
gchar *net_driver;
gchar *net_sysfs_path;
#if defined WITH_QRTR
QrtrNode *node;
#endif
@@ -2372,6 +2373,17 @@ mm_port_qmi_set_net_driver (MMPortQmi *self,
/*****************************************************************************/
void
mm_port_qmi_set_net_sysfs_path (MMPortQmi *self,
const gchar *net_sysfs_path)
{
g_assert (MM_IS_PORT_QMI (self));
g_assert (!self->priv->net_sysfs_path);
self->priv->net_sysfs_path = g_strdup (net_sysfs_path);
}
/*****************************************************************************/
typedef struct {
QmiDevice *qmi_device;
} PortQmiCloseContext;
@@ -2589,6 +2601,7 @@ dispose (GObject *object)
g_clear_object (&self->priv->qmi_device);
g_clear_pointer (&self->priv->net_driver, g_free);
g_clear_pointer (&self->priv->net_sysfs_path, g_free);
G_OBJECT_CLASS (mm_port_qmi_parent_class)->dispose (object);
}

View File

@@ -89,6 +89,9 @@ gboolean mm_port_qmi_close_finish (MMPortQmi *self,
void mm_port_qmi_set_net_driver (MMPortQmi *self,
const gchar *net_driver);
void mm_port_qmi_set_net_sysfs_path (MMPortQmi *self,
const gchar *net_sysfs_path);
typedef enum {
MM_PORT_QMI_FLAG_DEFAULT = 0,
MM_PORT_QMI_FLAG_WDS_IPV4 = 1,