summaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-01-12 09:21:26 -0800
committerJohan Hedberg <johan.hedberg@intel.com>2015-01-12 21:54:48 +0200
commit48ce62c4fae7e817d9018020345bbe30a6b9c446 (patch)
treee9eb1146960ea45e3e8c610ece36669b065758df /net/bluetooth
parentc2f0f979276fc4911cef5da2fc113f0daeda3ebc (diff)
downloadop-kernel-dev-48ce62c4fae7e817d9018020345bbe30a6b9c446.zip
op-kernel-dev-48ce62c4fae7e817d9018020345bbe30a6b9c446.tar.gz
Bluetooth: Read stored link key information when powering on controller
The information about max stored link keys and current stored link keys should be read at controller initialization. So issue HCI Read Stored Link Key command with BDADDR_ANY and read_all flag set to 0x01 to retrieve this information. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_core.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index ba0d1fd..96572a4 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -731,6 +731,14 @@ static void hci_init3_req(struct hci_request *req, unsigned long opt)
hci_setup_event_mask(req);
+ if (hdev->commands[6] & 0x20) {
+ struct hci_cp_read_stored_link_key cp;
+
+ bacpy(&cp.bdaddr, BDADDR_ANY);
+ cp.read_all = 0x01;
+ hci_req_add(req, HCI_OP_READ_STORED_LINK_KEY, sizeof(cp), &cp);
+ }
+
/* Some Broadcom based Bluetooth controllers do not support the
* Delete Stored Link Key command. They are clearly indicating its
* absence in the bit mask of supported commands.
OpenPOWER on IntegriCloud