hci_core: Buggy handling of HCI_SETUP flag in mgmt API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

While working on the nokia BT driver, I found a strange bug in
bluetooth core support. If the driver's setup routine fails,
a hci0 interface is created with status DOWN, which looks ok.
The management interface is not happy, though:

n950# btmgmt info ; btmgmt config
Index list with 0 items
Unconfigured index list with 0 items

It becomes even more interesting, if I do "hciconfig hci0 up"
(the setup routine only failed due to FW not yet being available
during early boot). At that point btmgmt still fails:

n950# btmgmt info; btmgmt config
Index list with 0 items
Unconfigured index list with 0 items

But the device is up and running from hciconfig's perspective
and hcitool can be used to scan for devices.

I added a few debug prints to the management interface and the
problem is, that HCI_SETUP flag is never cleared, when initial
setup fails. This should be easily reproducible by adding this
to any BT driver's setup routine:

static bool fail = true;
if (fail) {
    fail = false;
    return -ENOENT;
}

I'm not sure about the correct solution to fix this. Initially I
thought the flag just needs to be cleared in the path used by
"hciconfig up". But this would mean, that such a device cannot be
enabled using the management API (since HCI_SETUP would be set
until its cleared by hciconfig).

-- Sebastian

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux