aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-01-13 01:47:22 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2015-01-14 03:02:21 -0500
commit36f260ceff9d2a3ac53882eec941a1424719f2a6 (patch)
treeeb68ffa8048cdc1ffcf22f0575c99e14ad06085a /net/bluetooth
parent97307f51d7ce676661acef7af8a01eb11b3560c0 (diff)
Bluetooth: Move Delete Stored Link Key to 4th phase of initialization
This moves the execution of Delete Stored Link Key command to the hci_init4_req phase. No actual code has been changed. The command is just executed at a later stage of the initialization. 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.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 96572a48948e..c04197347c90 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -739,29 +739,6 @@ static void hci_init3_req(struct hci_request *req, unsigned long opt)
739 hci_req_add(req, HCI_OP_READ_STORED_LINK_KEY, sizeof(cp), &cp); 739 hci_req_add(req, HCI_OP_READ_STORED_LINK_KEY, sizeof(cp), &cp);
740 } 740 }
741 741
742 /* Some Broadcom based Bluetooth controllers do not support the
743 * Delete Stored Link Key command. They are clearly indicating its
744 * absence in the bit mask of supported commands.
745 *
746 * Check the supported commands and only if the the command is marked
747 * as supported send it. If not supported assume that the controller
748 * does not have actual support for stored link keys which makes this
749 * command redundant anyway.
750 *
751 * Some controllers indicate that they support handling deleting
752 * stored link keys, but they don't. The quirk lets a driver
753 * just disable this command.
754 */
755 if (hdev->commands[6] & 0x80 &&
756 !test_bit(HCI_QUIRK_BROKEN_STORED_LINK_KEY, &hdev->quirks)) {
757 struct hci_cp_delete_stored_link_key cp;
758
759 bacpy(&cp.bdaddr, BDADDR_ANY);
760 cp.delete_all = 0x01;
761 hci_req_add(req, HCI_OP_DELETE_STORED_LINK_KEY,
762 sizeof(cp), &cp);
763 }
764
765 if (hdev->commands[5] & 0x10) 742 if (hdev->commands[5] & 0x10)
766 hci_setup_link_policy(req); 743 hci_setup_link_policy(req);
767 744
@@ -853,6 +830,29 @@ static void hci_init4_req(struct hci_request *req, unsigned long opt)
853{ 830{
854 struct hci_dev *hdev = req->hdev; 831 struct hci_dev *hdev = req->hdev;
855 832
833 /* Some Broadcom based Bluetooth controllers do not support the
834 * Delete Stored Link Key command. They are clearly indicating its
835 * absence in the bit mask of supported commands.
836 *
837 * Check the supported commands and only if the the command is marked
838 * as supported send it. If not supported assume that the controller
839 * does not have actual support for stored link keys which makes this
840 * command redundant anyway.
841 *
842 * Some controllers indicate that they support handling deleting
843 * stored link keys, but they don't. The quirk lets a driver
844 * just disable this command.
845 */
846 if (hdev->commands[6] & 0x80 &&
847 !test_bit(HCI_QUIRK_BROKEN_STORED_LINK_KEY, &hdev->quirks)) {
848 struct hci_cp_delete_stored_link_key cp;
849
850 bacpy(&cp.bdaddr, BDADDR_ANY);
851 cp.delete_all = 0x01;
852 hci_req_add(req, HCI_OP_DELETE_STORED_LINK_KEY,
853 sizeof(cp), &cp);
854 }
855
856 /* Set event mask page 2 if the HCI command for it is supported */ 856 /* Set event mask page 2 if the HCI command for it is supported */
857 if (hdev->commands[22] & 0x04) 857 if (hdev->commands[22] & 0x04)
858 hci_set_event_mask_page_2(req); 858 hci_set_event_mask_page_2(req);