All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] hso: Set modem name based on udev network interface name
@ 2010-10-25  9:13 =?unknown-8bit?q?Beno=C3=AEt?= Monin
  2010-10-25 11:17 ` Marcel Holtmann
  0 siblings, 1 reply; 7+ messages in thread
From: =?unknown-8bit?q?Beno=C3=AEt?= Monin @ 2010-10-25  9:13 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1174 bytes --]

Hi Denis,

> 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(-)

diff --git a/plugins/hso.c b/plugins/hso.c
index 055c63b..a9fb1ba 100644
--- a/plugins/hso.c
+++ b/plugins/hso.c
@@ -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;
 }

--

^ permalink raw reply related	[flat|nested] 7+ messages in thread
* Re: [PATCH] hso: Set modem name based on udev network interface name
@ 2010-10-25 11:35 =?unknown-8bit?q?Beno=C3=AEt?= Monin
  2010-10-25 12:15 ` Marcel Holtmann
  0 siblings, 1 reply; 7+ messages in thread
From: =?unknown-8bit?q?Beno=C3=AEt?= Monin @ 2010-10-25 11:35 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1228 bytes --]

Hi Marcel,

> De : Marcel Holtmann
> 
> Hi Benoit,
> 
> 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.
> 
Maybe I should give some details of what I'm trying to achieve. The
device we're building has 2 identical modems with fixed position on
USB. We also have the possibility to drive their power supply
independently and to swap the sim cards.

I need a way to know which one is modem A and which one is modem B
and I have no easy way of knowing the modem serial number or the
sim subscriber id beforehand. With an udev rule, I can easily set
a fixed name for the network interface of each modem. But under
ofono, I can't tell which modem is which. That's why I added this
"not-so-friendly" name.

Is there a way of knowing which physical modem ofono is refering to ?
I recognize that our case may not be the most common and I understand
that you don't want to abuse the Name property. Maybe exposing the
NetworkInterface as a modem property would be ok ? or exposing
a PhysicalName ?

--
Benoît.

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH] hso: Set modem name based on udev network interface name
@ 2010-10-21  8:26 =?unknown-8bit?q?Beno=C3=AEt?= Monin
  2010-10-22 15:39 ` Denis Kenzior
  0 siblings, 1 reply; 7+ messages in thread
From: =?unknown-8bit?q?Beno=C3=AEt?= Monin @ 2010-10-21  8:26 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 740 bytes --]

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(-)

diff --git a/plugins/udev.c b/plugins/udev.c
index 737a637..e687c01 100644
--- a/plugins/udev.c
+++ b/plugins/udev.c
@@ -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;
        }
--

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-11-07 20:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-25  9:13 [PATCH] hso: Set modem name based on udev network interface name =?unknown-8bit?q?Beno=C3=AEt?= Monin
2010-10-25 11:17 ` Marcel Holtmann
  -- strict thread matches above, loose matches on Subject: below --
2010-10-25 11:35 =?unknown-8bit?q?Beno=C3=AEt?= Monin
2010-10-25 12:15 ` Marcel Holtmann
2010-11-07 20:32   ` =?unknown-8bit?q?Beno=C3=AEt?= Monin
2010-10-21  8:26 =?unknown-8bit?q?Beno=C3=AEt?= Monin
2010-10-22 15:39 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.