提交 edd3896b 编写于 作者: M Marcel Holtmann

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: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
上级 0602a8ad
...@@ -642,3 +642,5 @@ struct mgmt_ev_new_conn_param { ...@@ -642,3 +642,5 @@ struct mgmt_ev_new_conn_param {
} __packed; } __packed;
#define MGMT_EV_UNCONF_INDEX_ADDED 0x001d #define MGMT_EV_UNCONF_INDEX_ADDED 0x001d
#define MGMT_EV_UNCONF_INDEX_REMOVED 0x001e
...@@ -119,6 +119,7 @@ static const u16 mgmt_events[] = { ...@@ -119,6 +119,7 @@ static const u16 mgmt_events[] = {
MGMT_EV_DEVICE_REMOVED, MGMT_EV_DEVICE_REMOVED,
MGMT_EV_NEW_CONN_PARAM, MGMT_EV_NEW_CONN_PARAM,
MGMT_EV_UNCONF_INDEX_ADDED, MGMT_EV_UNCONF_INDEX_ADDED,
MGMT_EV_UNCONF_INDEX_REMOVED,
}; };
#define CACHE_TIMEOUT msecs_to_jiffies(2 * 1000) #define CACHE_TIMEOUT msecs_to_jiffies(2 * 1000)
...@@ -5395,7 +5396,10 @@ void mgmt_index_removed(struct hci_dev *hdev) ...@@ -5395,7 +5396,10 @@ void mgmt_index_removed(struct hci_dev *hdev)
mgmt_pending_foreach(0, hdev, cmd_status_rsp, &status); mgmt_pending_foreach(0, hdev, cmd_status_rsp, &status);
mgmt_event(MGMT_EV_INDEX_REMOVED, hdev, NULL, 0, NULL); if (test_bit(HCI_UNCONFIGURED, &hdev->dev_flags))
mgmt_event(MGMT_EV_UNCONF_INDEX_REMOVED, hdev, NULL, 0, NULL);
else
mgmt_event(MGMT_EV_INDEX_REMOVED, hdev, NULL, 0, NULL);
} }
/* This function requires the caller holds hdev->lock */ /* This function requires the caller holds hdev->lock */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册