[PATCH 01/10] device: identify physical devices with a generic 'uid'
Aleksander Morgado
aleksander at aleksander.es
Sat Aug 6 13:03:29 UTC 2016
All ports of the same modem reported by the kernel will all be associated with
a common 'uid' (unique id), which uniquely identifies the physical device.
This logic was already in place, what we do now is avoid calling it the 'sysfs
path' of the physical device, because we may not want to use that to identify
a device.
---
plugins/altair/mm-plugin-altair-lte.c | 4 +-
plugins/anydata/mm-plugin-anydata.c | 6 +--
plugins/cinterion/mm-plugin-cinterion.c | 6 +--
plugins/dell/mm-plugin-dell.c | 12 +++---
plugins/generic/mm-plugin-generic.c | 8 ++--
plugins/haier/mm-plugin-haier.c | 4 +-
plugins/huawei/mm-plugin-huawei.c | 8 ++--
plugins/iridium/mm-plugin-iridium.c | 4 +-
plugins/linktop/mm-plugin-linktop.c | 4 +-
plugins/longcheer/mm-plugin-longcheer.c | 4 +-
plugins/mbm/mm-plugin-mbm.c | 6 +--
plugins/motorola/mm-plugin-motorola.c | 4 +-
plugins/mtk/mm-plugin-mtk.c | 4 +-
plugins/nokia/mm-plugin-nokia-icera.c | 4 +-
plugins/nokia/mm-plugin-nokia.c | 4 +-
plugins/novatel/mm-plugin-novatel-lte.c | 4 +-
plugins/novatel/mm-plugin-novatel.c | 6 +--
plugins/option/mm-plugin-hso.c | 4 +-
plugins/option/mm-plugin-option.c | 4 +-
plugins/pantech/mm-plugin-pantech.c | 6 +--
plugins/samsung/mm-plugin-samsung.c | 4 +-
plugins/sierra/mm-plugin-sierra-legacy.c | 6 +--
plugins/sierra/mm-plugin-sierra.c | 8 ++--
plugins/simtech/mm-plugin-simtech.c | 6 +--
plugins/telit/mm-plugin-telit.c | 4 +-
plugins/thuraya/mm-plugin-thuraya.c | 4 +-
plugins/via/mm-plugin-via.c | 4 +-
plugins/wavecom/mm-plugin-wavecom.c | 4 +-
plugins/x22x/mm-plugin-x22x.c | 6 +--
plugins/zte/mm-plugin-zte.c | 10 ++---
src/mm-base-manager.c | 66 +++++++++++++++-----------------
src/mm-device.c | 41 +++++++++++---------
src/mm-device.h | 6 +--
src/mm-plugin-manager.c | 6 +--
src/mm-plugin.c | 2 +-
src/mm-plugin.h | 2 +-
36 files changed, 142 insertions(+), 143 deletions(-)
diff --git a/plugins/altair/mm-plugin-altair-lte.c b/plugins/altair/mm-plugin-altair-lte.c
index 751a6df..7f6a7c0 100644
--- a/plugins/altair/mm-plugin-altair-lte.c
+++ b/plugins/altair/mm-plugin-altair-lte.c
@@ -51,14 +51,14 @@ static const MMPortProbeAtCommand custom_at_probe[] = {
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
GList *probes,
GError **error)
{
- return MM_BASE_MODEM (mm_broadband_modem_altair_lte_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_altair_lte_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/anydata/mm-plugin-anydata.c b/plugins/anydata/mm-plugin-anydata.c
index ff76697..8037fb7 100644
--- a/plugins/anydata/mm-plugin-anydata.c
+++ b/plugins/anydata/mm-plugin-anydata.c
@@ -38,7 +38,7 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
@@ -48,7 +48,7 @@ create_modem (MMPlugin *self,
#if defined WITH_QMI
if (mm_port_probe_list_has_qmi_port (probes)) {
mm_dbg ("QMI-powered AnyDATA modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
@@ -56,7 +56,7 @@ create_modem (MMPlugin *self,
}
#endif
- return MM_BASE_MODEM (mm_broadband_modem_anydata_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_anydata_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/cinterion/mm-plugin-cinterion.c b/plugins/cinterion/mm-plugin-cinterion.c
index 2ee561a..d65ad53 100644
--- a/plugins/cinterion/mm-plugin-cinterion.c
+++ b/plugins/cinterion/mm-plugin-cinterion.c
@@ -130,7 +130,7 @@ cinterion_custom_init (MMPortProbe *probe,
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
@@ -140,7 +140,7 @@ create_modem (MMPlugin *self,
#if defined WITH_QMI
if (mm_port_probe_list_has_qmi_port (probes)) {
mm_dbg ("QMI-powered Cinterion modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_qmi_cinterion_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_qmi_cinterion_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
@@ -148,7 +148,7 @@ create_modem (MMPlugin *self,
}
#endif
- return MM_BASE_MODEM (mm_broadband_modem_cinterion_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_cinterion_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/dell/mm-plugin-dell.c b/plugins/dell/mm-plugin-dell.c
index 2ed4375..c40f40d 100644
--- a/plugins/dell/mm-plugin-dell.c
+++ b/plugins/dell/mm-plugin-dell.c
@@ -367,7 +367,7 @@ port_probe_list_has_manufacturer_port (GList *probes,
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
@@ -381,7 +381,7 @@ create_modem (MMPlugin *self,
#if defined WITH_QMI
if (mm_port_probe_list_has_qmi_port (probes)) {
mm_dbg ("QMI-powered Dell-branded modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
@@ -392,7 +392,7 @@ create_modem (MMPlugin *self,
#if defined WITH_MBIM
if (mm_port_probe_list_has_mbim_port (probes)) {
mm_dbg ("MBIM-powered Dell-branded modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_mbim_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_mbim_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
@@ -402,7 +402,7 @@ create_modem (MMPlugin *self,
if (port_probe_list_has_manufacturer_port (probes, DELL_MANUFACTURER_NOVATEL)) {
mm_dbg ("Novatel-powered Dell-branded modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_novatel_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_novatel_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
@@ -411,7 +411,7 @@ create_modem (MMPlugin *self,
if (port_probe_list_has_manufacturer_port (probes, DELL_MANUFACTURER_SIERRA)) {
mm_dbg ("Sierra-powered Dell-branded modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_sierra_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_sierra_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
@@ -428,7 +428,7 @@ create_modem (MMPlugin *self,
}
mm_dbg ("Dell-branded generic modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/generic/mm-plugin-generic.c b/plugins/generic/mm-plugin-generic.c
index 8fd0bdc..8f42930 100644
--- a/plugins/generic/mm-plugin-generic.c
+++ b/plugins/generic/mm-plugin-generic.c
@@ -50,7 +50,7 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
@@ -60,7 +60,7 @@ create_modem (MMPlugin *self,
#if defined WITH_QMI
if (mm_port_probe_list_has_qmi_port (probes)) {
mm_dbg ("QMI-powered generic modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
@@ -71,7 +71,7 @@ create_modem (MMPlugin *self,
#if defined WITH_MBIM
if (mm_port_probe_list_has_mbim_port (probes)) {
mm_dbg ("MBIM-powered generic modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_mbim_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_mbim_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
@@ -79,7 +79,7 @@ create_modem (MMPlugin *self,
}
#endif
- return MM_BASE_MODEM (mm_broadband_modem_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/haier/mm-plugin-haier.c b/plugins/haier/mm-plugin-haier.c
index ccc26b0..c56a148 100644
--- a/plugins/haier/mm-plugin-haier.c
+++ b/plugins/haier/mm-plugin-haier.c
@@ -32,14 +32,14 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
GList *probes,
GError **error)
{
- return MM_BASE_MODEM (mm_broadband_modem_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/huawei/mm-plugin-huawei.c b/plugins/huawei/mm-plugin-huawei.c
index 5d556e7..3bb303a 100644
--- a/plugins/huawei/mm-plugin-huawei.c
+++ b/plugins/huawei/mm-plugin-huawei.c
@@ -481,7 +481,7 @@ propagate_port_mode_results (GList *probes)
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
@@ -493,7 +493,7 @@ create_modem (MMPlugin *self,
#if defined WITH_QMI
if (mm_port_probe_list_has_qmi_port (probes)) {
mm_dbg ("QMI-powered Huawei modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
@@ -504,7 +504,7 @@ create_modem (MMPlugin *self,
#if defined WITH_MBIM
if (mm_port_probe_list_has_mbim_port (probes)) {
mm_dbg ("MBIM-powered Huawei modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_mbim_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_mbim_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
@@ -512,7 +512,7 @@ create_modem (MMPlugin *self,
}
#endif
- return MM_BASE_MODEM (mm_broadband_modem_huawei_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_huawei_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/iridium/mm-plugin-iridium.c b/plugins/iridium/mm-plugin-iridium.c
index d79df0f..08c0551 100644
--- a/plugins/iridium/mm-plugin-iridium.c
+++ b/plugins/iridium/mm-plugin-iridium.c
@@ -38,14 +38,14 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
GList *probes,
GError **error)
{
- return MM_BASE_MODEM (mm_broadband_modem_iridium_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_iridium_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/linktop/mm-plugin-linktop.c b/plugins/linktop/mm-plugin-linktop.c
index 7fb41a3..771f335 100644
--- a/plugins/linktop/mm-plugin-linktop.c
+++ b/plugins/linktop/mm-plugin-linktop.c
@@ -33,14 +33,14 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
GList *probes,
GError **error)
{
- return MM_BASE_MODEM (mm_broadband_modem_linktop_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_linktop_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/longcheer/mm-plugin-longcheer.c b/plugins/longcheer/mm-plugin-longcheer.c
index 59f2d8e..ea11070 100644
--- a/plugins/longcheer/mm-plugin-longcheer.c
+++ b/plugins/longcheer/mm-plugin-longcheer.c
@@ -186,14 +186,14 @@ longcheer_custom_init (MMPortProbe *probe,
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
GList *probes,
GError **error)
{
- return MM_BASE_MODEM (mm_broadband_modem_longcheer_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_longcheer_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/mbm/mm-plugin-mbm.c b/plugins/mbm/mm-plugin-mbm.c
index 2000444..b4b2752 100644
--- a/plugins/mbm/mm-plugin-mbm.c
+++ b/plugins/mbm/mm-plugin-mbm.c
@@ -40,7 +40,7 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
@@ -50,7 +50,7 @@ create_modem (MMPlugin *self,
#if defined WITH_MBIM
if (mm_port_probe_list_has_mbim_port (probes)) {
mm_dbg ("MBIM-powered Ericsson modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_mbim_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_mbim_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
@@ -58,7 +58,7 @@ create_modem (MMPlugin *self,
}
#endif
- return MM_BASE_MODEM (mm_broadband_modem_mbm_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_mbm_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/motorola/mm-plugin-motorola.c b/plugins/motorola/mm-plugin-motorola.c
index 96d7e4f..68c8d48 100644
--- a/plugins/motorola/mm-plugin-motorola.c
+++ b/plugins/motorola/mm-plugin-motorola.c
@@ -34,14 +34,14 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
GList *probes,
GError **error)
{
- return MM_BASE_MODEM (mm_broadband_modem_motorola_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_motorola_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/mtk/mm-plugin-mtk.c b/plugins/mtk/mm-plugin-mtk.c
index 5d3ea7d..080aef2 100644
--- a/plugins/mtk/mm-plugin-mtk.c
+++ b/plugins/mtk/mm-plugin-mtk.c
@@ -35,14 +35,14 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
/* MTK done */
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
GList *probes,
GError **error)
{
- return MM_BASE_MODEM (mm_broadband_modem_mtk_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_mtk_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/nokia/mm-plugin-nokia-icera.c b/plugins/nokia/mm-plugin-nokia-icera.c
index 58428e7..151a4ec 100644
--- a/plugins/nokia/mm-plugin-nokia-icera.c
+++ b/plugins/nokia/mm-plugin-nokia-icera.c
@@ -43,14 +43,14 @@ static const MMPortProbeAtCommand custom_at_probe[] = {
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
GList *probes,
GError **error)
{
- return MM_BASE_MODEM (mm_broadband_modem_icera_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_icera_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/nokia/mm-plugin-nokia.c b/plugins/nokia/mm-plugin-nokia.c
index a3e4749..cb3374c 100644
--- a/plugins/nokia/mm-plugin-nokia.c
+++ b/plugins/nokia/mm-plugin-nokia.c
@@ -44,14 +44,14 @@ static const MMPortProbeAtCommand custom_at_probe[] = {
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
GList *probes,
GError **error)
{
- return MM_BASE_MODEM (mm_broadband_modem_nokia_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_nokia_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/novatel/mm-plugin-novatel-lte.c b/plugins/novatel/mm-plugin-novatel-lte.c
index 0a7d2fb..9182c57 100644
--- a/plugins/novatel/mm-plugin-novatel-lte.c
+++ b/plugins/novatel/mm-plugin-novatel-lte.c
@@ -35,14 +35,14 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
GList *probes,
GError **error)
{
- return MM_BASE_MODEM (mm_broadband_modem_novatel_lte_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_novatel_lte_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/novatel/mm-plugin-novatel.c b/plugins/novatel/mm-plugin-novatel.c
index ccbd9a8..292f758 100644
--- a/plugins/novatel/mm-plugin-novatel.c
+++ b/plugins/novatel/mm-plugin-novatel.c
@@ -46,7 +46,7 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
@@ -56,7 +56,7 @@ create_modem (MMPlugin *self,
#if defined WITH_QMI
if (mm_port_probe_list_has_qmi_port (probes)) {
mm_dbg ("QMI-powered Novatel modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
@@ -64,7 +64,7 @@ create_modem (MMPlugin *self,
}
#endif
- return MM_BASE_MODEM (mm_broadband_modem_novatel_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_novatel_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/option/mm-plugin-hso.c b/plugins/option/mm-plugin-hso.c
index df5d34f..5b9bcbd 100644
--- a/plugins/option/mm-plugin-hso.c
+++ b/plugins/option/mm-plugin-hso.c
@@ -115,14 +115,14 @@ hso_custom_init (MMPortProbe *probe,
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
GList *probes,
GError **error)
{
- return MM_BASE_MODEM (mm_broadband_modem_hso_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_hso_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/option/mm-plugin-option.c b/plugins/option/mm-plugin-option.c
index 77f8d76..90184cc 100644
--- a/plugins/option/mm-plugin-option.c
+++ b/plugins/option/mm-plugin-option.c
@@ -34,14 +34,14 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
GList *probes,
GError **error)
{
- return MM_BASE_MODEM (mm_broadband_modem_option_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_option_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/pantech/mm-plugin-pantech.c b/plugins/pantech/mm-plugin-pantech.c
index b7b1791..734a41a 100644
--- a/plugins/pantech/mm-plugin-pantech.c
+++ b/plugins/pantech/mm-plugin-pantech.c
@@ -76,7 +76,7 @@ static const MMPortProbeAtCommand custom_at_probe[] = {
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
@@ -86,7 +86,7 @@ create_modem (MMPlugin *self,
#if defined WITH_QMI
if (mm_port_probe_list_has_qmi_port (probes)) {
mm_dbg ("QMI-powered Pantech modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
@@ -94,7 +94,7 @@ create_modem (MMPlugin *self,
}
#endif
- return MM_BASE_MODEM (mm_broadband_modem_pantech_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_pantech_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/samsung/mm-plugin-samsung.c b/plugins/samsung/mm-plugin-samsung.c
index 5434ad1..157d286 100644
--- a/plugins/samsung/mm-plugin-samsung.c
+++ b/plugins/samsung/mm-plugin-samsung.c
@@ -36,14 +36,14 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
GList *probes,
GError **error)
{
- return MM_BASE_MODEM (mm_broadband_modem_samsung_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_samsung_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/sierra/mm-plugin-sierra-legacy.c b/plugins/sierra/mm-plugin-sierra-legacy.c
index ac488cd..47bdf11 100644
--- a/plugins/sierra/mm-plugin-sierra-legacy.c
+++ b/plugins/sierra/mm-plugin-sierra-legacy.c
@@ -37,7 +37,7 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
@@ -45,13 +45,13 @@ create_modem (MMPlugin *self,
GError **error)
{
if (mm_common_sierra_port_probe_list_is_icera (probes))
- return MM_BASE_MODEM (mm_broadband_modem_sierra_icera_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_sierra_icera_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
product));
- return MM_BASE_MODEM (mm_broadband_modem_sierra_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_sierra_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/sierra/mm-plugin-sierra.c b/plugins/sierra/mm-plugin-sierra.c
index b6eabc4..03a06bd 100644
--- a/plugins/sierra/mm-plugin-sierra.c
+++ b/plugins/sierra/mm-plugin-sierra.c
@@ -43,7 +43,7 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
@@ -53,7 +53,7 @@ create_modem (MMPlugin *self,
#if defined WITH_QMI
if (mm_port_probe_list_has_qmi_port (probes)) {
mm_dbg ("QMI-powered Sierra modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
@@ -64,7 +64,7 @@ create_modem (MMPlugin *self,
#if defined WITH_MBIM
if (mm_port_probe_list_has_mbim_port (probes)) {
mm_dbg ("MBIM-powered Sierra modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_mbim_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_mbim_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
@@ -73,7 +73,7 @@ create_modem (MMPlugin *self,
#endif
/* Fallback to default modem in the worst case */
- return MM_BASE_MODEM (mm_broadband_modem_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/simtech/mm-plugin-simtech.c b/plugins/simtech/mm-plugin-simtech.c
index b736185..aa22414 100644
--- a/plugins/simtech/mm-plugin-simtech.c
+++ b/plugins/simtech/mm-plugin-simtech.c
@@ -38,7 +38,7 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
@@ -48,7 +48,7 @@ create_modem (MMPlugin *self,
#if defined WITH_QMI
if (mm_port_probe_list_has_qmi_port (probes)) {
mm_dbg ("QMI-powered SimTech modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
@@ -56,7 +56,7 @@ create_modem (MMPlugin *self,
}
#endif
- return MM_BASE_MODEM (mm_broadband_modem_simtech_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_simtech_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/telit/mm-plugin-telit.c b/plugins/telit/mm-plugin-telit.c
index 5a44ba6..caf3ef0 100644
--- a/plugins/telit/mm-plugin-telit.c
+++ b/plugins/telit/mm-plugin-telit.c
@@ -37,14 +37,14 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
GList *probes,
GError **error)
{
- return MM_BASE_MODEM (mm_broadband_modem_telit_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_telit_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/thuraya/mm-plugin-thuraya.c b/plugins/thuraya/mm-plugin-thuraya.c
index 1c0782d..ce1da62 100644
--- a/plugins/thuraya/mm-plugin-thuraya.c
+++ b/plugins/thuraya/mm-plugin-thuraya.c
@@ -40,14 +40,14 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
GList *probes,
GError **error)
{
- return MM_BASE_MODEM (mm_broadband_modem_thuraya_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_thuraya_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/via/mm-plugin-via.c b/plugins/via/mm-plugin-via.c
index d3e6762..a6cf5b3 100644
--- a/plugins/via/mm-plugin-via.c
+++ b/plugins/via/mm-plugin-via.c
@@ -36,14 +36,14 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
GList *probes,
GError **error)
{
- return MM_BASE_MODEM (mm_broadband_modem_via_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_via_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/wavecom/mm-plugin-wavecom.c b/plugins/wavecom/mm-plugin-wavecom.c
index 9d3307c..8ed217b 100644
--- a/plugins/wavecom/mm-plugin-wavecom.c
+++ b/plugins/wavecom/mm-plugin-wavecom.c
@@ -40,14 +40,14 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
GList *probes,
GError **error)
{
- return MM_BASE_MODEM (mm_broadband_modem_wavecom_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_wavecom_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/x22x/mm-plugin-x22x.c b/plugins/x22x/mm-plugin-x22x.c
index 68b897f..8e21075 100644
--- a/plugins/x22x/mm-plugin-x22x.c
+++ b/plugins/x22x/mm-plugin-x22x.c
@@ -189,7 +189,7 @@ x22x_custom_init (MMPortProbe *probe,
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
@@ -199,7 +199,7 @@ create_modem (MMPlugin *self,
#if defined WITH_QMI
if (mm_port_probe_list_has_qmi_port (probes)) {
mm_dbg ("QMI-powered X22X modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
@@ -207,7 +207,7 @@ create_modem (MMPlugin *self,
}
#endif
- return MM_BASE_MODEM (mm_broadband_modem_x22x_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_x22x_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/plugins/zte/mm-plugin-zte.c b/plugins/zte/mm-plugin-zte.c
index 075c314..239ee6b 100644
--- a/plugins/zte/mm-plugin-zte.c
+++ b/plugins/zte/mm-plugin-zte.c
@@ -61,7 +61,7 @@ static const MMPortProbeAtCommand custom_at_probe[] = {
static MMBaseModem *
create_modem (MMPlugin *self,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
@@ -71,7 +71,7 @@ create_modem (MMPlugin *self,
#if defined WITH_QMI
if (mm_port_probe_list_has_qmi_port (probes)) {
mm_dbg ("QMI-powered ZTE modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_qmi_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
@@ -82,7 +82,7 @@ create_modem (MMPlugin *self,
#if defined WITH_MBIM
if (mm_port_probe_list_has_mbim_port (probes)) {
mm_dbg ("MBIM-powered ZTE modem found...");
- return MM_BASE_MODEM (mm_broadband_modem_mbim_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_mbim_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
@@ -91,13 +91,13 @@ create_modem (MMPlugin *self,
#endif
if (mm_port_probe_list_is_icera (probes))
- return MM_BASE_MODEM (mm_broadband_modem_zte_icera_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_zte_icera_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
product));
- return MM_BASE_MODEM (mm_broadband_modem_zte_new (sysfs_path,
+ return MM_BASE_MODEM (mm_broadband_modem_zte_new (uid,
drivers,
mm_plugin_get_name (self),
vendor,
diff --git a/src/mm-base-manager.c b/src/mm-base-manager.c
index 275a855..cdc5d54 100644
--- a/src/mm-base-manager.c
+++ b/src/mm-base-manager.c
@@ -111,18 +111,17 @@ find_device_by_port (MMBaseManager *manager,
}
static MMDevice *
-find_device_by_sysfs_path (MMBaseManager *self,
- const gchar *sysfs_path)
+find_device_by_physdev_uid (MMBaseManager *self,
+ const gchar *physdev_uid)
{
- return g_hash_table_lookup (self->priv->devices,
- sysfs_path);
+ return g_hash_table_lookup (self->priv->devices, physdev_uid);
}
static MMDevice *
find_device_by_udev_device (MMBaseManager *manager,
GUdevDevice *udev_device)
{
- return find_device_by_sysfs_path (manager, g_udev_device_get_sysfs_path (udev_device));
+ return find_device_by_physdev_uid (manager, g_udev_device_get_sysfs_path (udev_device));
}
/*****************************************************************************/
@@ -151,8 +150,8 @@ device_support_check_ready (MMPluginManager *plugin_manager,
/* Receive plugin result from the plugin manager */
plugin = mm_plugin_manager_device_support_check_finish (plugin_manager, res, &error);
if (!plugin) {
- mm_info ("Couldn't check support for device at '%s': %s",
- mm_device_get_path (ctx->device), error->message);
+ mm_info ("Couldn't check support for device '%s': %s",
+ mm_device_get_uid (ctx->device), error->message);
g_error_free (error);
find_device_support_context_free (ctx);
return;
@@ -163,16 +162,16 @@ device_support_check_ready (MMPluginManager *plugin_manager,
g_object_unref (plugin);
if (!mm_device_create_modem (ctx->device, ctx->self->priv->object_manager, &error)) {
- mm_warn ("Couldn't create modem for device at '%s': %s",
- mm_device_get_path (ctx->device), error->message);
+ mm_warn ("Couldn't create modem for device '%s': %s",
+ mm_device_get_uid (ctx->device), error->message);
g_error_free (error);
find_device_support_context_free (ctx);
return;
}
/* Modem now created */
- mm_info ("Modem for device at '%s' successfully created",
- mm_device_get_path (ctx->device));
+ mm_info ("Modem for device '%s' successfully created",
+ mm_device_get_uid (ctx->device));
find_device_support_context_free (ctx);
}
@@ -268,19 +267,16 @@ device_removed (MMBaseManager *self,
/* Handle tty/net/wdm port removal */
device = find_device_by_port (self, udev_device);
if (device) {
- mm_info ("(%s/%s): released by modem %s",
- subsys,
- name,
- g_udev_device_get_sysfs_path (mm_device_peek_udev_device (device)));
+ mm_info ("(%s/%s): released by device '%s'", subsys, name, mm_device_get_uid (device));
mm_device_release_port (device, udev_device);
/* If port probe list gets empty, remove the device object iself */
if (!mm_device_peek_port_probe_list (device)) {
- mm_dbg ("Removing empty device '%s'", mm_device_get_path (device));
+ mm_dbg ("Removing empty device '%s'", mm_device_get_uid (device));
if (mm_plugin_manager_device_support_check_cancel (self->priv->plugin_manager, device))
mm_dbg ("Device support check has been cancelled");
mm_device_remove_modem (device);
- g_hash_table_remove (self->priv->devices, mm_device_get_path (device));
+ g_hash_table_remove (self->priv->devices, mm_device_get_uid (device));
}
}
@@ -297,9 +293,9 @@ device_removed (MMBaseManager *self,
*/
device = find_device_by_udev_device (self, udev_device);
if (device) {
- mm_dbg ("Removing device '%s'", mm_device_get_path (device));
+ mm_dbg ("Removing device '%s'", mm_device_get_uid (device));
mm_device_remove_modem (device);
- g_hash_table_remove (self->priv->devices, mm_device_get_path (device));
+ g_hash_table_remove (self->priv->devices, mm_device_get_uid (device));
return;
}
@@ -314,7 +310,7 @@ device_added (MMBaseManager *manager,
gboolean manual_scan)
{
MMDevice *device;
- const char *subsys, *name, *physdev_path, *physdev_subsys;
+ const char *subsys, *name, *physdev_uid, *physdev_subsys;
gboolean is_candidate;
GUdevDevice *physdev = NULL;
@@ -389,21 +385,21 @@ device_added (MMBaseManager *manager,
goto out;
}
- physdev_path = g_udev_device_get_sysfs_path (physdev);
- if (!physdev_path) {
+ physdev_uid = g_udev_device_get_sysfs_path (physdev);
+ if (!physdev_uid) {
mm_dbg ("(%s/%s): could not get port's parent device sysfs path", subsys, name);
goto out;
}
/* See if we already created an object to handle ports in this device */
- device = find_device_by_sysfs_path (manager, physdev_path);
+ device = find_device_by_physdev_uid (manager, physdev_uid);
if (!device) {
FindDeviceSupportContext *ctx;
/* Keep the device listed in the Manager */
device = mm_device_new (physdev, hotplugged);
g_hash_table_insert (manager->priv->devices,
- g_strdup (physdev_path),
+ g_strdup (physdev_uid),
device);
/* Launch device support check */
@@ -754,15 +750,15 @@ handle_set_profile (MmGdbusTest *skeleton,
{
MMPlugin *plugin;
MMDevice *device;
- gchar *physdev;
+ gchar *physdev_uid;
GError *error = NULL;
mm_info ("Test profile set to: '%s'", id);
/* Create device and keep it listed in the Manager */
- physdev = g_strdup_printf ("/virtual/%s", id);
- device = mm_device_virtual_new (physdev, TRUE);
- g_hash_table_insert (self->priv->devices, physdev, device);
+ physdev_uid = g_strdup_printf ("/virtual/%s", id);
+ device = mm_device_virtual_new (physdev_uid, TRUE);
+ g_hash_table_insert (self->priv->devices, physdev_uid, device);
/* Grab virtual ports */
mm_device_virtual_grab_ports (device, (const gchar **)ports);
@@ -774,8 +770,8 @@ handle_set_profile (MmGdbusTest *skeleton,
MM_CORE_ERROR_NOT_FOUND,
"Requested plugin '%s' not found",
plugin_name);
- mm_warn ("Couldn't set plugin for virtual device at '%s': %s",
- mm_device_get_path (device),
+ mm_warn ("Couldn't set plugin for virtual device '%s': %s",
+ mm_device_get_uid (device),
error->message);
goto out;
}
@@ -783,20 +779,20 @@ handle_set_profile (MmGdbusTest *skeleton,
/* Create modem */
if (!mm_device_create_modem (device, self->priv->object_manager, &error)) {
- mm_warn ("Couldn't create modem for virtual device at '%s': %s",
- mm_device_get_path (device),
+ mm_warn ("Couldn't create modem for virtual device '%s': %s",
+ mm_device_get_uid (device),
error->message);
goto out;
}
- mm_info ("Modem for virtual device at '%s' successfully created",
- mm_device_get_path (device));
+ mm_info ("Modem for virtual device '%s' successfully created",
+ mm_device_get_uid (device));
out:
if (error) {
mm_device_remove_modem (device);
- g_hash_table_remove (self->priv->devices, mm_device_get_path (device));
+ g_hash_table_remove (self->priv->devices, mm_device_get_uid (device));
g_dbus_method_invocation_return_gerror (invocation, error);
g_error_free (error);
} else
diff --git a/src/mm-device.c b/src/mm-device.c
index 665c95e..6ab90b2 100644
--- a/src/mm-device.c
+++ b/src/mm-device.c
@@ -31,7 +31,7 @@ G_DEFINE_TYPE (MMDevice, mm_device, G_TYPE_OBJECT);
enum {
PROP_0,
- PROP_PATH,
+ PROP_UID,
PROP_UDEV_DEVICE,
PROP_PLUGIN,
PROP_MODEM,
@@ -53,8 +53,8 @@ struct _MMDevicePrivate {
/* Whether the device is real or virtual */
gboolean virtual;
- /* Device path */
- gchar *path;
+ /* Unique id */
+ gchar *uid;
/* Parent UDev device */
GUdevDevice *udev_device;
@@ -324,7 +324,7 @@ mm_device_grab_port (MMDevice *self,
&self->priv->vendor,
&self->priv->product)) {
mm_dbg ("(%s) could not get vendor/product ID",
- self->priv->path);
+ self->priv->uid);
}
}
@@ -447,7 +447,7 @@ export_modem (MMDevice *self)
mm_dbg ("Exported modem '%s' at path '%s'",
(self->priv->virtual ?
- self->priv->path :
+ self->priv->uid :
g_udev_device_get_sysfs_path (self->priv->udev_device)),
path);
@@ -555,9 +555,9 @@ mm_device_create_modem (MMDevice *self,
/*****************************************************************************/
const gchar *
-mm_device_get_path (MMDevice *self)
+mm_device_get_uid (MMDevice *self)
{
- return self->priv->path;
+ return self->priv->uid;
}
const gchar **
@@ -717,19 +717,19 @@ mm_device_new (GUdevDevice *udev_device,
return MM_DEVICE (g_object_new (MM_TYPE_DEVICE,
MM_DEVICE_UDEV_DEVICE, udev_device,
- MM_DEVICE_PATH, g_udev_device_get_sysfs_path (udev_device),
+ MM_DEVICE_UID, g_udev_device_get_sysfs_path (udev_device),
MM_DEVICE_HOTPLUGGED, hotplugged,
NULL));
}
MMDevice *
-mm_device_virtual_new (const gchar *path,
+mm_device_virtual_new (const gchar *uid,
gboolean hotplugged)
{
- g_return_val_if_fail (path != NULL, NULL);
+ g_return_val_if_fail (uid != NULL, NULL);
return MM_DEVICE (g_object_new (MM_TYPE_DEVICE,
- MM_DEVICE_PATH, path,
+ MM_DEVICE_UID, uid,
MM_DEVICE_HOTPLUGGED, hotplugged,
MM_DEVICE_VIRTUAL, TRUE,
NULL));
@@ -753,9 +753,9 @@ set_property (GObject *object,
MMDevice *self = MM_DEVICE (object);
switch (prop_id) {
- case PROP_PATH:
+ case PROP_UID:
/* construct only */
- self->priv->path = g_value_dup_string (value);
+ self->priv->uid = g_value_dup_string (value);
break;
case PROP_UDEV_DEVICE:
/* construct only */
@@ -790,6 +790,9 @@ get_property (GObject *object,
MMDevice *self = MM_DEVICE (object);
switch (prop_id) {
+ case PROP_UID:
+ g_value_set_string (value, self->priv->uid);
+ break;
case PROP_UDEV_DEVICE:
g_value_set_object (value, self->priv->udev_device);
break;
@@ -830,7 +833,7 @@ finalize (GObject *object)
{
MMDevice *self = MM_DEVICE (object);
- g_free (self->priv->path);
+ g_free (self->priv->uid);
g_strfreev (self->priv->drivers);
g_strfreev (self->priv->virtual_ports);
@@ -850,13 +853,13 @@ mm_device_class_init (MMDeviceClass *klass)
object_class->finalize = finalize;
object_class->dispose = dispose;
- properties[PROP_PATH] =
- g_param_spec_string (MM_DEVICE_PATH,
- "Path",
- "Device path",
+ properties[PROP_UID] =
+ g_param_spec_string (MM_DEVICE_UID,
+ "Unique ID",
+ "Unique device id, e.g. the physical device sysfs path",
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
- g_object_class_install_property (object_class, PROP_PATH, properties[PROP_PATH]);
+ g_object_class_install_property (object_class, PROP_UID, properties[PROP_UID]);
properties[PROP_UDEV_DEVICE] =
g_param_spec_object (MM_DEVICE_UDEV_DEVICE,
diff --git a/src/mm-device.h b/src/mm-device.h
index 2da8222..57726e6 100644
--- a/src/mm-device.h
+++ b/src/mm-device.h
@@ -34,7 +34,7 @@ typedef struct _MMDevice MMDevice;
typedef struct _MMDeviceClass MMDeviceClass;
typedef struct _MMDevicePrivate MMDevicePrivate;
-#define MM_DEVICE_PATH "path"
+#define MM_DEVICE_UID "uid"
#define MM_DEVICE_UDEV_DEVICE "udev-device"
#define MM_DEVICE_PLUGIN "plugin"
#define MM_DEVICE_MODEM "modem"
@@ -78,7 +78,7 @@ gboolean mm_device_create_modem (MMDevice *self,
GError **error);
void mm_device_remove_modem (MMDevice *self);
-const gchar *mm_device_get_path (MMDevice *self);
+const gchar *mm_device_get_uid (MMDevice *self);
const gchar **mm_device_get_drivers (MMDevice *self);
guint16 mm_device_get_vendor (MMDevice *self);
guint16 mm_device_get_product (MMDevice *self);
@@ -104,7 +104,7 @@ gboolean mm_device_get_hotplugged (MMDevice *self);
/* For testing purposes */
-MMDevice *mm_device_virtual_new (const gchar *path,
+MMDevice *mm_device_virtual_new (const gchar *uid,
gboolean hotplugged);
void mm_device_virtual_grab_ports (MMDevice *self,
const gchar **ports);
diff --git a/src/mm-plugin-manager.c b/src/mm-plugin-manager.c
index 22965fd..8408dc3 100644
--- a/src/mm-plugin-manager.c
+++ b/src/mm-plugin-manager.c
@@ -1355,7 +1355,7 @@ plugin_manager_peek_device_context (MMPluginManager *self,
device_context = (DeviceContext *)(l->data);
if ((device == device_context->device) ||
- (! g_strcmp0 (mm_device_get_path (device_context->device), mm_device_get_path (device))))
+ (!g_strcmp0 (mm_device_get_uid (device_context->device), mm_device_get_uid (device))))
return device_context;
}
return NULL;
@@ -1427,7 +1427,7 @@ mm_plugin_manager_device_support_check (MMPluginManager *self,
if (device_context) {
g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_IN_PROGRESS,
"Device support check task already available for device '%s'",
- mm_device_get_path (device));
+ mm_device_get_uid (device));
g_object_unref (task);
return;
}
@@ -1439,7 +1439,7 @@ mm_plugin_manager_device_support_check (MMPluginManager *self,
self->priv->device_contexts = g_list_prepend (self->priv->device_contexts, device_context);
mm_dbg ("[plugin manager] task %s: new support task for device: %s",
- device_context->name, mm_device_get_path (device_context->device));
+ device_context->name, mm_device_get_uid (device_context->device));
/* Run device context */
device_context_run (self,
diff --git a/src/mm-plugin.c b/src/mm-plugin.c
index 78b767d..0d9b408 100644
--- a/src/mm-plugin.c
+++ b/src/mm-plugin.c
@@ -865,7 +865,7 @@ mm_plugin_create_modem (MMPlugin *self,
/* Let the plugin create the modem from the port probe results */
modem = MM_PLUGIN_GET_CLASS (self)->create_modem (MM_PLUGIN (self),
- mm_device_get_path (device),
+ mm_device_get_uid (device),
mm_device_get_drivers (device),
mm_device_get_vendor (device),
mm_device_get_product (device),
diff --git a/src/mm-plugin.h b/src/mm-plugin.h
index 0491679..afe300a 100644
--- a/src/mm-plugin.h
+++ b/src/mm-plugin.h
@@ -104,7 +104,7 @@ struct _MMPluginClass {
/* Plugins need to provide a method to create a modem object given
* a list of port probes (Mandatory) */
MMBaseModem *(*create_modem) (MMPlugin *plugin,
- const gchar *sysfs_path,
+ const gchar *uid,
const gchar **drivers,
guint16 vendor,
guint16 product,
--
2.9.0
More information about the ModemManager-devel
mailing list