Skip to content

Commit

Permalink
general-bluetooth-add-new-quirk(:1)
Browse files Browse the repository at this point in the history
Original-Subject: Bluetooth: Add new quirk for broken local ext features max_page
Some adapters (e.g. RTL8723CS) advertise that they have more than
2 pages for local ext features, but they don't support any features
declared in these pages. RTL8723CS reports max_page = 2 and declares
support for sync train and secure connection, but it responds with
either garbage or with error in status on corresponding commands.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
X-Armbian: Patch-File: general-bluetooth-add-new-quirk
X-Armbian: Patch-File-Counter: 1
X-Armbian: Patch-Rel-Directory: patch/kernel/archive/rockchip64-6.1
X-Armbian: Patch-Type: kernel
X-Armbian: Patch-Root-Type: core
X-Armbian: Patch-Sub-Type: common
X-Armbian: Original-Subject: Bluetooth: Add new quirk for broken local ext features max_page
  • Loading branch information
Vasily Khoruzhick authored and Armbian AutoPatcher committed Nov 1, 2018
1 parent 6459b3e commit 63932b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions include/net/bluetooth/hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@ enum {
*/
HCI_QUIRK_NO_SUSPEND_NOTIFIER,

/* When this quirk is set, max_page for local extended features
* is set to 1, even if controller reports higher number. Some
* controllers (e.g. RTL8723CS) report more pages, but they
* don't actually support features declared there.
*/
HCI_QUIRK_BROKEN_LOCAL_EXT_FTR_MAX_PAGE,

/*
* When this quirk is set, LE tx power is not queried on startup
* and the min/max tx power values default to HCI_TX_POWER_INVALID.
Expand Down
4 changes: 3 additions & 1 deletion net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,9 @@ static u8 hci_cc_read_local_ext_features(struct hci_dev *hdev, void *data,
if (rp->status)
return rp->status;

if (hdev->max_page < rp->max_page)
if (!test_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FTR_MAX_PAGE,
&hdev->quirks) &&
hdev->max_page < rp->max_page)
hdev->max_page = rp->max_page;

if (rp->page < HCI_MAX_PAGES)
Expand Down

0 comments on commit 63932b4

Please sign in to comment.