Commit 12788133 authored by Pedro Nishiyama's avatar Pedro Nishiyama Committed by Luiz Augusto von Dentz
Browse files

Bluetooth: Add quirk for broken READ_PAGE_SCAN_TYPE



Some fake controllers cannot be initialized because they return a smaller
report than expected for READ_PAGE_SCAN_TYPE.

Signed-off-by: default avatarPedro Nishiyama <nishiyama.pedro@gmail.com>
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
parent ff26b2dd
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -362,6 +362,14 @@ enum {
	 * This quirk must be set before hci_register_dev is called.
	 */
	HCI_QUIRK_BROKEN_READ_VOICE_SETTING,

	/* When this quirk is set, the HCI_OP_READ_PAGE_SCAN_TYPE command is
	 * skipped. This is required for a subset of the CSR controller clones
	 * which erroneously claim to support it.
	 *
	 * This quirk must be set before hci_register_dev is called.
	 */
	HCI_QUIRK_BROKEN_READ_PAGE_SCAN_TYPE,
};

/* HCI device flags */
+2 −1
Original line number Diff line number Diff line
@@ -4132,7 +4132,8 @@ static int hci_read_page_scan_type_sync(struct hci_dev *hdev)
	 * support the Read Page Scan Type command. Check support for
	 * this command in the bit mask of supported commands.
	 */
	if (!(hdev->commands[13] & 0x01))
	if (!(hdev->commands[13] & 0x01) ||
	    test_bit(HCI_QUIRK_BROKEN_READ_PAGE_SCAN_TYPE, &hdev->quirks))
		return 0;

	return __hci_cmd_sync_status(hdev, HCI_OP_READ_PAGE_SCAN_TYPE,