aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-02-22 08:47:48 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-23 06:06:59 -0500
commit54d04dbbb933e8a49429d602b847e367782267e9 (patch)
tree7fcac1ce7a0059a975e3789ecee3efb66c93707c
parentc80da27e868f6ffbe1c6588937aa4e7aeab21dec (diff)
Bluetooth: Explicitly clear EIR data upon hci_dev setup
Some controllers preserve their EIR data even after a reset so we need to explicitly clear this during the device setup procedure. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--net/bluetooth/hci_event.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 240dc1640c04..3476d5c7b02d 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -557,10 +557,19 @@ static void hci_setup(struct hci_dev *hdev)
557 if (hdev->hci_ver > BLUETOOTH_VER_1_1) 557 if (hdev->hci_ver > BLUETOOTH_VER_1_1)
558 hci_send_cmd(hdev, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL); 558 hci_send_cmd(hdev, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL);
559 559
560 if (hdev->features[6] & LMP_SIMPLE_PAIR && 560 if (hdev->features[6] & LMP_SIMPLE_PAIR) {
561 test_bit(HCI_SSP_ENABLED, &hdev->dev_flags)) { 561 if (test_bit(HCI_SSP_ENABLED, &hdev->dev_flags)) {
562 u8 mode = 0x01; 562 u8 mode = 0x01;
563 hci_send_cmd(hdev, HCI_OP_WRITE_SSP_MODE, sizeof(mode), &mode); 563 hci_send_cmd(hdev, HCI_OP_WRITE_SSP_MODE,
564 sizeof(mode), &mode);
565 } else {
566 struct hci_cp_write_eir cp;
567
568 memset(hdev->eir, 0, sizeof(hdev->eir));
569 memset(&cp, 0, sizeof(cp));
570
571 hci_send_cmd(hdev, HCI_OP_WRITE_EIR, sizeof(cp), &cp);
572 }
564 } 573 }
565 574
566 if (hdev->features[3] & LMP_RSSI_INQ) 575 if (hdev->features[3] & LMP_RSSI_INQ)