summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_sock.c
diff options
context:
space:
mode:
authorMarcel Holtmann2014-07-02 21:30:54 +0200
committerMarcel Holtmann2014-07-03 17:42:58 +0200
commit0602a8adc3ce3f592d03df426c92d1f36229403c (patch)
tree543da00ab4591166495a485e9344191839c59029 /net/bluetooth/hci_sock.c
parentBluetooth: Introduce unconfigured controller state (diff)
downloadkernel-qcow2-linux-0602a8adc3ce3f592d03df426c92d1f36229403c.tar.gz
kernel-qcow2-linux-0602a8adc3ce3f592d03df426c92d1f36229403c.tar.xz
kernel-qcow2-linux-0602a8adc3ce3f592d03df426c92d1f36229403c.zip
Bluetooth: Add support for Unconfigured Index Added events
When a controller is in unconfigured state it is currently hidden from the management interface. This change now announces the new controller with an Unconfigured Index Added event and allows clients to easily detect the controller. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_sock.c')
-rw-r--r--net/bluetooth/hci_sock.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index db9610323d4d..ba13ad8e25c6 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -453,8 +453,7 @@ static int hci_sock_release(struct socket *sock)
if (hdev) {
if (hci_pi(sk)->channel == HCI_CHANNEL_USER) {
- if (!test_bit(HCI_UNCONFIGURED, &hdev->dev_flags))
- mgmt_index_added(hdev);
+ mgmt_index_added(hdev);
clear_bit(HCI_USER_CHANNEL, &hdev->dev_flags);
hci_dev_close(hdev->id);
}
@@ -706,14 +705,12 @@ static int hci_sock_bind(struct socket *sock, struct sockaddr *addr,
goto done;
}
- if (!test_bit(HCI_UNCONFIGURED, &hdev->dev_flags))
- mgmt_index_removed(hdev);
+ mgmt_index_removed(hdev);
err = hci_dev_open(hdev->id);
if (err) {
clear_bit(HCI_USER_CHANNEL, &hdev->dev_flags);
- if (!test_bit(HCI_UNCONFIGURED, &hdev->dev_flags))
- mgmt_index_added(hdev);
+ mgmt_index_added(hdev);
hci_dev_put(hdev);
goto done;
}