diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2015-01-12 12:21:28 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2015-01-12 14:56:06 -0500 |
commit | a93661203641eb5e8aa9bbed8d9689e5d5dbe6b1 (patch) | |
tree | 06e0ddaff0ff7c08ba49b608cfa3f2a65d686ba1 /net/bluetooth | |
parent | 039d4e410c06ed446566105a0a1c6ce9cad6b56b (diff) |
Bluetooth: Process result of HCI Delete Stored Link Key command
When the HCI Delete Stored Link Key command completes, then update the
value of current stored keys 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/bluetooth')
-rw-r--r-- | net/bluetooth/hci_event.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index b1580daede13..a58845e98921 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -232,6 +232,22 @@ static void hci_cc_read_stored_link_key(struct hci_dev *hdev, | |||
232 | } | 232 | } |
233 | } | 233 | } |
234 | 234 | ||
235 | static void hci_cc_delete_stored_link_key(struct hci_dev *hdev, | ||
236 | struct sk_buff *skb) | ||
237 | { | ||
238 | struct hci_rp_delete_stored_link_key *rp = (void *)skb->data; | ||
239 | |||
240 | BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); | ||
241 | |||
242 | if (rp->status) | ||
243 | return; | ||
244 | |||
245 | if (rp->num_keys <= hdev->stored_num_keys) | ||
246 | hdev->stored_num_keys -= rp->num_keys; | ||
247 | else | ||
248 | hdev->stored_num_keys = 0; | ||
249 | } | ||
250 | |||
235 | static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb) | 251 | static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb) |
236 | { | 252 | { |
237 | __u8 status = *((__u8 *) skb->data); | 253 | __u8 status = *((__u8 *) skb->data); |
@@ -2736,6 +2752,10 @@ static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
2736 | hci_cc_read_stored_link_key(hdev, skb); | 2752 | hci_cc_read_stored_link_key(hdev, skb); |
2737 | break; | 2753 | break; |
2738 | 2754 | ||
2755 | case HCI_OP_DELETE_STORED_LINK_KEY: | ||
2756 | hci_cc_delete_stored_link_key(hdev, skb); | ||
2757 | break; | ||
2758 | |||
2739 | case HCI_OP_WRITE_LOCAL_NAME: | 2759 | case HCI_OP_WRITE_LOCAL_NAME: |
2740 | hci_cc_write_local_name(hdev, skb); | 2760 | hci_cc_write_local_name(hdev, skb); |
2741 | break; | 2761 | break; |