hso: Set modem name based on udev network interface name
Hi Denis,
Quoted 6 lines
De : Denis Kenzior
Hi Benoît,
I prefer you do this in plugins/hso and not in udev.
Is the patch below correct ? I moved the call to set_name to hso_probe.
Benoît
--
Subject: [PATCH] hso: Set modem name based on udev network interface name
Useful if you have multiple identical modems and you need a way to know which modem you're talking to.
--- plugins/hso.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
plugins/hso.c +6 -0
@@ -59,6 +59,7 @@ struct hso_data {static int hso_probe (struct ofono_modem *modem) { struct hso_data *data; + const char *interface; DBG("%p", modem);
@@ -68,6 +69,11 @@ static int hso_probe(struct ofono_modem *modem) ofono_modem_set_data(modem, data); + /* Set name based on network interface name */ + interface = ofono_modem_get_string(modem, "NetworkInterface"); + if (interface) + ofono_modem_set_name(modem, interface); + return 0; }
--
Hi Benoit,
Quoted 21 lines
Subject: [PATCH] hso: Set modem name based on udev network interface name
Useful if you have multiple identical modems and you need a way to know which modem you're talking to.
--- plugins/hso.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)plugins/hso.c +1
-0@@ -59,6 +59,7 @@ struct hso_data {static int hso_probe (struct ofono_modem *modem) {struct hso_data *data; +const char *interface;DBG ("%p" , modem);
plugins/hso.c static int hso_probe(struct ofono_modem *modem) · line 78
Quoted 10 lines
plugins/hso.c +5
-0@@ -68,6 +69,11 @@ static int hso_probe(struct ofono_modem *modem)ofono_modem_set_data (modem, data); +/* Set name based on network interface name */ + interface =ofono_modem_get_string (modem,"NetworkInterface" ); +if (interface) +ofono_modem_set_name (modem, interface); +return 0 ; }
the friendly modem name is for devices that do have a friendly name, like Bluetooth headsets. Why do you wanna misuse the interface name here. I am a bit against this, because it leads to speculation and assumptions in userspace programs.
Regards
Marcel