Commit 6851a0c2 authored by Christian Eggers's avatar Christian Eggers Committed by Luiz Augusto von Dentz
Browse files

Bluetooth: hci_dev: replace 'quirks' integer by 'quirk_flags' bitmap



The 'quirks' member already ran out of bits on some platforms some time
ago. Replace the integer member by a bitmap in order to have enough bits
in future. Replace raw bit operations by accessor macros.

Fixes: ff26b2dd ("Bluetooth: Add quirk for broken READ_VOICE_SETTING")
Fixes: 12788133 ("Bluetooth: Add quirk for broken READ_PAGE_SCAN_TYPE")
Suggested-by: default avatarPauli Virtanen <pav@iki.fi>
Tested-by: default avatarIvan Pravdin <ipravdin.official@gmail.com>
Signed-off-by: default avatarKiran K <kiran.k@intel.com>
Signed-off-by: default avatarChristian Eggers <ceggers@arri.de>
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
parent cdee6a44
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -670,7 +670,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
	hdev->flush = bfusb_flush;
	hdev->send  = bfusb_send_frame;

	set_bit(HCI_QUIRK_BROKEN_LOCAL_COMMANDS, &hdev->quirks);
	hci_set_quirk(hdev, HCI_QUIRK_BROKEN_LOCAL_COMMANDS);

	if (hci_register_dev(hdev) < 0) {
		BT_ERR("Can't register HCI device");
+1 −1
Original line number Diff line number Diff line
@@ -398,7 +398,7 @@ static int bpa10x_probe(struct usb_interface *intf,
	hdev->send     = bpa10x_send_frame;
	hdev->set_diag = bpa10x_set_diag;

	set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
	hci_set_quirk(hdev, HCI_QUIRK_RESET_ON_CLOSE);

	err = hci_register_dev(hdev);
	if (err < 0) {
+4 −4
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ int btbcm_check_bdaddr(struct hci_dev *hdev)
		if (btbcm_set_bdaddr_from_efi(hdev) != 0) {
			bt_dev_info(hdev, "BCM: Using default device address (%pMR)",
				    &bda->bdaddr);
			set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
			hci_set_quirk(hdev, HCI_QUIRK_INVALID_BDADDR);
		}
	}

@@ -467,7 +467,7 @@ static int btbcm_print_controller_features(struct hci_dev *hdev)

	/* Read DMI and disable broken Read LE Min/Max Tx Power */
	if (dmi_first_match(disable_broken_read_transmit_power))
		set_bit(HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, &hdev->quirks);
		hci_set_quirk(hdev, HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER);

	return 0;
}
@@ -706,7 +706,7 @@ int btbcm_finalize(struct hci_dev *hdev, bool *fw_load_done, bool use_autobaud_m

	btbcm_check_bdaddr(hdev);

	set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
	hci_set_quirk(hdev, HCI_QUIRK_STRICT_DUPLICATE_FILTER);

	return 0;
}
@@ -769,7 +769,7 @@ int btbcm_setup_apple(struct hci_dev *hdev)
		kfree_skb(skb);
	}

	set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
	hci_set_quirk(hdev, HCI_QUIRK_STRICT_DUPLICATE_FILTER);

	return 0;
}
+14 −14
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ int btintel_check_bdaddr(struct hci_dev *hdev)
	if (!bacmp(&bda->bdaddr, BDADDR_INTEL)) {
		bt_dev_err(hdev, "Found Intel default device address (%pMR)",
			   &bda->bdaddr);
		set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
		hci_set_quirk(hdev, HCI_QUIRK_INVALID_BDADDR);
	}

	kfree_skb(skb);
@@ -2027,7 +2027,7 @@ static int btintel_download_fw(struct hci_dev *hdev,
	 */
	if (!bacmp(&params->otp_bdaddr, BDADDR_ANY)) {
		bt_dev_info(hdev, "No device address configured");
		set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
		hci_set_quirk(hdev, HCI_QUIRK_INVALID_BDADDR);
	}

download:
@@ -2295,7 +2295,7 @@ static int btintel_prepare_fw_download_tlv(struct hci_dev *hdev,
		 */
		if (!bacmp(&ver->otp_bd_addr, BDADDR_ANY)) {
			bt_dev_info(hdev, "No device address configured");
			set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
			hci_set_quirk(hdev, HCI_QUIRK_INVALID_BDADDR);
		}
	}

@@ -3435,9 +3435,9 @@ static int btintel_setup_combined(struct hci_dev *hdev)
	}

	/* Apply the common HCI quirks for Intel device */
	set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
	set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks);
	set_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks);
	hci_set_quirk(hdev, HCI_QUIRK_STRICT_DUPLICATE_FILTER);
	hci_set_quirk(hdev, HCI_QUIRK_SIMULTANEOUS_DISCOVERY);
	hci_set_quirk(hdev, HCI_QUIRK_NON_PERSISTENT_DIAG);

	/* Set up the quality report callback for Intel devices */
	hdev->set_quality_report = btintel_set_quality_report;
@@ -3475,8 +3475,8 @@ static int btintel_setup_combined(struct hci_dev *hdev)
			 */
			if (!btintel_test_flag(hdev,
					       INTEL_ROM_LEGACY_NO_WBS_SUPPORT))
				set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
					&hdev->quirks);
				hci_set_quirk(hdev,
					      HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED);

			err = btintel_legacy_rom_setup(hdev, &ver);
			break;
@@ -3491,11 +3491,11 @@ static int btintel_setup_combined(struct hci_dev *hdev)
			 *
			 * All Legacy bootloader devices support WBS
			 */
			set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
				&hdev->quirks);
			hci_set_quirk(hdev,
				      HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED);

			/* These variants don't seem to support LE Coded PHY */
			set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks);
			hci_set_quirk(hdev, HCI_QUIRK_BROKEN_LE_CODED);

			/* Setup MSFT Extension support */
			btintel_set_msft_opcode(hdev, ver.hw_variant);
@@ -3571,10 +3571,10 @@ static int btintel_setup_combined(struct hci_dev *hdev)
		 *
		 * All Legacy bootloader devices support WBS
		 */
		set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
		hci_set_quirk(hdev, HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED);

		/* These variants don't seem to support LE Coded PHY */
		set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks);
		hci_set_quirk(hdev, HCI_QUIRK_BROKEN_LE_CODED);

		/* Setup MSFT Extension support */
		btintel_set_msft_opcode(hdev, ver.hw_variant);
@@ -3600,7 +3600,7 @@ static int btintel_setup_combined(struct hci_dev *hdev)
		 *
		 * All TLV based devices support WBS
		 */
		set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
		hci_set_quirk(hdev, HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED);

		/* Setup MSFT Extension support */
		btintel_set_msft_opcode(hdev,
+4 −4
Original line number Diff line number Diff line
@@ -2081,9 +2081,9 @@ static int btintel_pcie_setup_internal(struct hci_dev *hdev)
	}

	/* Apply the common HCI quirks for Intel device */
	set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
	set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks);
	set_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks);
	hci_set_quirk(hdev, HCI_QUIRK_STRICT_DUPLICATE_FILTER);
	hci_set_quirk(hdev, HCI_QUIRK_SIMULTANEOUS_DISCOVERY);
	hci_set_quirk(hdev, HCI_QUIRK_NON_PERSISTENT_DIAG);

	/* Set up the quality report callback for Intel devices */
	hdev->set_quality_report = btintel_set_quality_report;
@@ -2123,7 +2123,7 @@ static int btintel_pcie_setup_internal(struct hci_dev *hdev)
		 *
		 * All TLV based devices support WBS
		 */
		set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
		hci_set_quirk(hdev, HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED);

		/* Setup MSFT Extension support */
		btintel_set_msft_opcode(hdev,
Loading