Skip to contentSkip to conversation

hso: Set modem name based on udev network interface name

PATCH In review Benoît Monin 2 participants 2 messages Oct 21, 2010 – Oct 22, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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/udev.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
plugins/udev.c +1 -0
index 737a637..e687c01 100644
@@ -191,6 +191,7 @@ static void add_hso(struct ofono_modem *modem,
        } else if (g_str_equal(subsystem, "net") == TRUE) {
                devnode = get_property(udev_device, "INTERFACE");
                ofono_modem_set_string(modem, NETWORK_INTERFACE, devnode);
+               ofono_modem_set_name(modem, devnode);
        } else {
                return;
        }

--

#1 lore raw

Hi Benoît,

Quoted 11 lines · Benoît Monin

Useful if you have multiple identical modems and you need a way to know which modem you're talking to.

---
 plugins/udev.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
plugins/udev.c +0 -0
index 737a637..e687c01 100644

plugins/udev.c static void add_hso(struct ofono_modem *modem, · line 194

Quoted 4 lines
plugins/udev.c +1 -0
@@ -191,6 +191,7 @@ static void add_hso(struct ofono_modem *modem,
        } else if (g_str_equal(subsystem, "net") == TRUE) {
                devnode = get_property(udev_device, "INTERFACE");
                ofono_modem_set_string(modem, NETWORK_INTERFACE, devnode);
+               ofono_modem_set_name(modem, devnode);

I prefer you do this in plugins/hso and not in udev.

Regards,
-Denis