aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-01-12 12:21:25 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2015-01-12 14:54:16 -0500
commitc2f0f979276fc4911cef5da2fc113f0daeda3ebc (patch)
tree93c0f3f3982bd2f560624a41e5860062b86d50ef /net
parentcb9627806ce898c436dc74252718e4a757b33bc3 (diff)
Bluetooth: Handle command complete event for HCI Read Stored Link Keys
When the HCI Read Stored Link Keys command completes it gives useful information of the current stored keys and maximum keys a controller can actually store. So process this event and store these information in hci_dev structure. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_event.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 0881efd0ad2d..b1580daede13 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -214,6 +214,24 @@ static void hci_cc_reset(struct hci_dev *hdev, struct sk_buff *skb)
214 hci_bdaddr_list_clear(&hdev->le_white_list); 214 hci_bdaddr_list_clear(&hdev->le_white_list);
215} 215}
216 216
217static void hci_cc_read_stored_link_key(struct hci_dev *hdev,
218 struct sk_buff *skb)
219{
220 struct hci_rp_read_stored_link_key *rp = (void *)skb->data;
221 struct hci_cp_read_stored_link_key *sent;
222
223 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status);
224
225 sent = hci_sent_cmd_data(hdev, HCI_OP_READ_STORED_LINK_KEY);
226 if (!sent)
227 return;
228
229 if (!rp->status && sent->read_all == 0x01) {
230 hdev->stored_max_keys = rp->max_keys;
231 hdev->stored_num_keys = rp->num_keys;
232 }
233}
234
217static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb) 235static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb)
218{ 236{
219 __u8 status = *((__u8 *) skb->data); 237 __u8 status = *((__u8 *) skb->data);
@@ -2714,6 +2732,10 @@ static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
2714 hci_cc_reset(hdev, skb); 2732 hci_cc_reset(hdev, skb);
2715 break; 2733 break;
2716 2734
2735 case HCI_OP_READ_STORED_LINK_KEY:
2736 hci_cc_read_stored_link_key(hdev, skb);
2737 break;
2738
2717 case HCI_OP_WRITE_LOCAL_NAME: 2739 case HCI_OP_WRITE_LOCAL_NAME:
2718 hci_cc_write_local_name(hdev, skb); 2740 hci_cc_write_local_name(hdev, skb);
2719 break; 2741 break;