Skip to content

Commit

Permalink
Bluetooth: Read stored link key information when powering on controller
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marcel Holtmann authored and Johan Hedberg committed Jan 12, 2015
1 parent c2f0f97 commit 48ce62c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 48ce62c

Please sign in to comment.