Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54d04dbb authored by Johan Hedberg's avatar Johan Hedberg
Browse files

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: default avatarJohan Hedberg <johan.hedberg@intel.com>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent c80da27e
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -557,10 +557,19 @@ static void hci_setup(struct hci_dev *hdev)
	if (hdev->hci_ver > BLUETOOTH_VER_1_1)
		hci_send_cmd(hdev, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL);

	if (hdev->features[6] & LMP_SIMPLE_PAIR &&
				test_bit(HCI_SSP_ENABLED, &hdev->dev_flags)) {
	if (hdev->features[6] & LMP_SIMPLE_PAIR) {
		if (test_bit(HCI_SSP_ENABLED, &hdev->dev_flags)) {
			u8 mode = 0x01;
		hci_send_cmd(hdev, HCI_OP_WRITE_SSP_MODE, sizeof(mode), &mode);
			hci_send_cmd(hdev, HCI_OP_WRITE_SSP_MODE,
							sizeof(mode), &mode);
		} else {
			struct hci_cp_write_eir cp;

			memset(hdev->eir, 0, sizeof(hdev->eir));
			memset(&cp, 0, sizeof(cp));

			hci_send_cmd(hdev, HCI_OP_WRITE_EIR, sizeof(cp), &cp);
		}
	}

	if (hdev->features[3] & LMP_RSSI_INQ)