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>
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index db96103..ba13ad8 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -453,8 +453,7 @@
 
 	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 @@
 			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;
 		}