public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* Renaming hci interfaces with udev
@ 2009-07-28  8:37 Andrej Rosano
  2009-07-28 11:31 ` Marcel Holtmann
  2009-07-28 11:34 ` Bastien Nocera
  0 siblings, 2 replies; 5+ messages in thread
From: Andrej Rosano @ 2009-07-28  8:37 UTC (permalink / raw)
  To: linux-bluetooth

Hi,
I would like to change the default name of bluetooth interfaces (hci0, hci1, ...)
using udev rules.

While with wlan usb dongles it works with the line:
    KERNEL=="wlan*", NAME="foo0"
the analogous for the bt:
    KERNEL=="hci*", NAME="foo0"
doesn't work, while
    KERNEL=="hci*", RUN+="/usr/bin/touch /tmp/foo"
works.

I'm using kernel 2.6.30.1, udev 125 and bluez 4.46.

Regards,
Andrej

-- 
Andrej Rosano                                               <andrejro@gmail.com>
0x7B470744                    E5DF 7810 AD63 A215 2D0E  AF56 53C7 A2CB 7B47 0744

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

* Re: Renaming hci interfaces with udev
  2009-07-28  8:37 Renaming hci interfaces with udev Andrej Rosano
@ 2009-07-28 11:31 ` Marcel Holtmann
  2009-07-28 11:34 ` Bastien Nocera
  1 sibling, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2009-07-28 11:31 UTC (permalink / raw)
  To: Andrej Rosano; +Cc: linux-bluetooth

Hi Andrej,

> I would like to change the default name of bluetooth interfaces (hci0, hci1, ...)
> using udev rules.
> 
> While with wlan usb dongles it works with the line:
>     KERNEL=="wlan*", NAME="foo0"
> the analogous for the bt:
>     KERNEL=="hci*", NAME="foo0"
> doesn't work, while
>     KERNEL=="hci*", RUN+="/usr/bin/touch /tmp/foo"
> works.
> 
> I'm using kernel 2.6.30.1, udev 125 and bluez 4.46.

we don't support renaming HCI devices. However feel free to send a
kernel patch to enable it.

Regards

Marcel



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

* Re: Renaming hci interfaces with udev
  2009-07-28  8:37 Renaming hci interfaces with udev Andrej Rosano
  2009-07-28 11:31 ` Marcel Holtmann
@ 2009-07-28 11:34 ` Bastien Nocera
  2009-07-28 12:05   ` Andrej Rosano
  1 sibling, 1 reply; 5+ messages in thread
From: Bastien Nocera @ 2009-07-28 11:34 UTC (permalink / raw)
  To: Andrej Rosano; +Cc: linux-bluetooth

On Tue, 2009-07-28 at 10:37 +0200, Andrej Rosano wrote:
> Hi,
> I would like to change the default name of bluetooth interfaces (hci0, hci1, ...)
> using udev rules.

Could I ask why you want to do that?


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

* Re: Renaming hci interfaces with udev
  2009-07-28 11:34 ` Bastien Nocera
@ 2009-07-28 12:05   ` Andrej Rosano
  2009-07-28 12:22     ` Marcel Holtmann
  0 siblings, 1 reply; 5+ messages in thread
From: Andrej Rosano @ 2009-07-28 12:05 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: linux-bluetooth

On Tue, Jul 28, 2009 at 12:34:38PM +0100, Bastien Nocera wrote:
> On Tue, 2009-07-28 at 10:37 +0200, Andrej Rosano wrote:
> > Hi,
> > I would like to change the default name of bluetooth interfaces (hci0, hci1, ...)
> > using udev rules.
> 
> Could I ask why you want to do that?

I have more than one bt dongle connected to the box and I would like to assign always
the same bluetooth name (the one set with hciconfig hciX name ...), ex:

the one with BD_ADDR=xx:yy:zz:00:00:01  ->  foo
the one with BD_ADDR=xx:yy:zz:00:00:02  ->  bar
...


If one could use the udev persistent rules like with ethernet interfaces:

ACTION=="add", KERNEL=="hci*", ATTR{address}=="xx:yy:zz:00:00:01", NAME="hci0"
ACTION=="add", KERNEL=="hci*", ATTR{address}=="xx:yy:zz:00:00:02", NAME="hci1"
...

and then set the appropriate bluetooth name:

hciconfig hci0 name foo
hciconfig hci1 name bar
...

Currently I am using a script to do that.

Regards,
Andrej

-- 
Andrej Rosano                                               <andrejro@gmail.com>
0x7B470744                    E5DF 7810 AD63 A215 2D0E  AF56 53C7 A2CB 7B47 0744

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

* Re: Renaming hci interfaces with udev
  2009-07-28 12:05   ` Andrej Rosano
@ 2009-07-28 12:22     ` Marcel Holtmann
  0 siblings, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2009-07-28 12:22 UTC (permalink / raw)
  To: Andrej Rosano; +Cc: Bastien Nocera, linux-bluetooth

Hi Andrej,

> > > I would like to change the default name of bluetooth interfaces (hci0, hci1, ...)
> > > using udev rules.
> > 
> > Could I ask why you want to do that?
> 
> I have more than one bt dongle connected to the box and I would like to assign always
> the same bluetooth name (the one set with hciconfig hciX name ...), ex:
> 
> the one with BD_ADDR=xx:yy:zz:00:00:01  ->  foo
> the one with BD_ADDR=xx:yy:zz:00:00:02  ->  bar
> ...
> 
> 
> If one could use the udev persistent rules like with ethernet interfaces:
> 
> ACTION=="add", KERNEL=="hci*", ATTR{address}=="xx:yy:zz:00:00:01", NAME="hci0"
> ACTION=="add", KERNEL=="hci*", ATTR{address}=="xx:yy:zz:00:00:02", NAME="hci1"
> ...
> 
> and then set the appropriate bluetooth name:
> 
> hciconfig hci0 name foo
> hciconfig hci1 name bar
> ...
> 
> Currently I am using a script to do that.

and actually bluetoothd is doing that for you no matter what the device
name is. You just have to set the name once using the D-Bus interface.

Regards

Marcel



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

end of thread, other threads:[~2009-07-28 12:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-28  8:37 Renaming hci interfaces with udev Andrej Rosano
2009-07-28 11:31 ` Marcel Holtmann
2009-07-28 11:34 ` Bastien Nocera
2009-07-28 12:05   ` Andrej Rosano
2009-07-28 12:22     ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox