linux/net/bluetooth
Ulisses Furquim fc50744c1e Bluetooth: Fix registering hci with duplicate name
When adding HCI devices hci_register_dev assigns the same name
hci1 for subsequently added AMP devices.

...
[ 6958.381886] sysfs: cannot create duplicate filename
       '/devices/virtual/bluetooth/hci1
...

We assume id starts with the number we'll try to add the new device
and keep iterating until we find the proper place. The only difference
is we start with 0 for BR/EDR device and 1 for AMP devices (thus AMP
devices will never receive register as index 0). Then every hdev->id in
the _ordered_ list <= to the id we want we increment id and move the
variable head. In the end we'll have id as the first available one and
head is where you need to add hdev after to keep the list ordered.

Reported-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Ulisses Furquim <ulisses@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2012-05-09 01:40:38 -03:00
..
bnep Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
cmtp Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
hidp Bluetooth: Use kernel int types instead of ones from stdint.h 2012-02-27 12:34:39 +02:00
rfcomm Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
Kconfig Bluetooth: Fix Kconfig help description 2012-02-29 18:50:25 +02:00
Makefile Bluetooth: Always compile SCO and L2CAP in Bluetooth Core 2011-12-21 02:21:08 -02:00
af_bluetooth.c Bluetooth: silence lockdep warning 2012-02-15 13:09:26 +02:00
hci_conn.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
hci_core.c Bluetooth: Fix registering hci with duplicate name 2012-05-09 01:40:38 -03:00
hci_event.c Bluetooth: mgmt: Fix missing connect failed event for LE 2012-05-09 00:41:38 -03:00
hci_sock.c Merge branch 'x86-x32-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-03-29 18:12:23 -07:00
hci_sysfs.c Bluetooth: trivial: Correct types 2012-05-09 00:41:31 -03:00
l2cap_core.c Bluetooth: Don't distribute keys in case of Encryption Failure 2012-05-09 01:40:36 -03:00
l2cap_sock.c Bluetooth: Split error handling for L2CAP listen sockets 2012-05-09 01:40:37 -03:00
lib.c Bluetooth: Add logging functions bt_info and bt_err 2012-02-17 11:33:17 +02:00
mgmt.c Bluetooth: mgmt: Fix address type while loading Long Term Key 2012-05-09 01:40:33 -03:00
sco.c Bluetooth: Remove not needed status parameter 2012-05-09 01:40:37 -03:00
smp.c Bluetooth: Correct ediv in SMP 2012-05-09 00:41:30 -03:00