aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-07-02 15:30:55 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 11:42:58 -0400
commitedd3896bc41059fc064c4ec76da004a57203d88e (patch)
tree444c38b0653352c05b81ffcc915ac419ac826e55
parent0602a8adc3ce3f592d03df426c92d1f36229403c (diff)
Bluetooth: Add support for Unconfigured Index Removed events
When a controller in an unconfigured state gets removed, then send Unconfigured Index Removed events. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r--include/net/bluetooth/mgmt.h2
-rw-r--r--net/bluetooth/mgmt.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 7da29fd748d8..651993213bd9 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -642,3 +642,5 @@ struct mgmt_ev_new_conn_param {
642} __packed; 642} __packed;
643 643
644#define MGMT_EV_UNCONF_INDEX_ADDED 0x001d 644#define MGMT_EV_UNCONF_INDEX_ADDED 0x001d
645
646#define MGMT_EV_UNCONF_INDEX_REMOVED 0x001e
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index ab70d5858db9..1a78d26b0049 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -119,6 +119,7 @@ static const u16 mgmt_events[] = {
119 MGMT_EV_DEVICE_REMOVED, 119 MGMT_EV_DEVICE_REMOVED,
120 MGMT_EV_NEW_CONN_PARAM, 120 MGMT_EV_NEW_CONN_PARAM,
121 MGMT_EV_UNCONF_INDEX_ADDED, 121 MGMT_EV_UNCONF_INDEX_ADDED,
122 MGMT_EV_UNCONF_INDEX_REMOVED,
122}; 123};
123 124
124#define CACHE_TIMEOUT msecs_to_jiffies(2 * 1000) 125#define CACHE_TIMEOUT msecs_to_jiffies(2 * 1000)
@@ -5395,7 +5396,10 @@ void mgmt_index_removed(struct hci_dev *hdev)
5395 5396
5396 mgmt_pending_foreach(0, hdev, cmd_status_rsp, &status); 5397 mgmt_pending_foreach(0, hdev, cmd_status_rsp, &status);
5397 5398
5398 mgmt_event(MGMT_EV_INDEX_REMOVED, hdev, NULL, 0, NULL); 5399 if (test_bit(HCI_UNCONFIGURED, &hdev->dev_flags))
5400 mgmt_event(MGMT_EV_UNCONF_INDEX_REMOVED, hdev, NULL, 0, NULL);
5401 else
5402 mgmt_event(MGMT_EV_INDEX_REMOVED, hdev, NULL, 0, NULL);
5399} 5403}
5400 5404
5401/* This function requires the caller holds hdev->lock */ 5405/* This function requires the caller holds hdev->lock */