2022-09-13 10:04:47

by Hilda Wu

[permalink] [raw]
Subject: [PATCH v2 1/3] Bluetooth: btrtl: Add btrealtek data struct

From: Hilda Wu <[email protected]>

This patch adds a data structure for btrealtek object, and the
definition of vendor behavior flags. It also adds macros to set/test/get
the flags.

Signed-off-by: Hilda Wu <[email protected]>
---
Changes in v2:
- Set the proper priv_size to hci_alloc_dev_priv().
- Separate commits for functions.
---
---
drivers/bluetooth/btrtl.h | 22 ++++++++++++++++++++++
drivers/bluetooth/btusb.c | 3 +++
2 files changed, 25 insertions(+)

diff --git a/drivers/bluetooth/btrtl.h b/drivers/bluetooth/btrtl.h
index 2c441bda390a..e2c99684799a 100644
--- a/drivers/bluetooth/btrtl.h
+++ b/drivers/bluetooth/btrtl.h
@@ -47,6 +47,28 @@ struct rtl_vendor_config {
struct rtl_vendor_config_entry entry[];
} __packed;

+enum {
+ REALTEK_WBS_FILTER,
+ REALTEK_ALT6_CONTINUOUS_TX_CHIP,
+
+ __REALTEK_NUM_FLAGS,
+};
+
+struct btrealtek_data {
+ DECLARE_BITMAP(flags, __REALTEK_NUM_FLAGS);
+};
+
+#define btrealtek_set_flag(hdev, nr) \
+ do { \
+ struct btrealtek_data *realtek = hci_get_priv((hdev)); \
+ set_bit((nr), realtek->flags); \
+ } while (0)
+
+#define btrealtek_get_flag(hdev) \
+ (((struct btrealtek_data *)hci_get_priv(hdev))->flags)
+
+#define btrealtek_test_flag(hdev, nr) test_bit((nr), btrealtek_get_flag(hdev))
+
#if IS_ENABLED(CONFIG_BT_RTL)

struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev,
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index c3daba17de7f..4c3aed89ff05 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -3749,6 +3749,9 @@ static int btusb_probe(struct usb_interface *intf,
/* Override the rx handlers */
data->recv_event = btusb_recv_event_intel;
data->recv_bulk = btusb_recv_bulk_intel;
+ } else if (id->driver_info & BTUSB_REALTEK) {
+ /* Allocate extra space for Realtek device */
+ priv_size += sizeof(struct btrealtek_data);
}

data->recv_acl = hci_recv_frame;
--
2.17.1


2022-09-13 11:25:18

by bluez.test.bot

[permalink] [raw]
Subject: RE: Bluetooth: Add btrealtek data struct and improve SCO sound quality of RTK chips

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=676514

---Test result---

Test Summary:
CheckPatch PASS 5.12 seconds
GitLint FAIL 2.46 seconds
SubjectPrefix PASS 1.94 seconds
BuildKernel PASS 34.34 seconds
BuildKernel32 PASS 30.14 seconds
Incremental Build with patchesPASS 56.77 seconds
TestRunner: Setup PASS 501.76 seconds
TestRunner: l2cap-tester PASS 16.63 seconds
TestRunner: iso-tester PASS 15.66 seconds
TestRunner: bnep-tester PASS 6.21 seconds
TestRunner: mgmt-tester PASS 100.91 seconds
TestRunner: rfcomm-tester PASS 9.78 seconds
TestRunner: sco-tester PASS 9.30 seconds
TestRunner: smp-tester PASS 9.38 seconds
TestRunner: userchan-tester PASS 6.41 seconds

Details
##############################
Test: GitLint - FAIL - 2.46 seconds
Run gitlint with rule in .gitlint
[v2,3/3] Bluetooth: btsub: Ignore zero length of USB packets on ALT 6 for the specific chip model of Realtek devices
1: T1 Title exceeds max length (116>80): "[v2,3/3] Bluetooth: btsub: Ignore zero length of USB packets on ALT 6 for the specific chip model of Realtek devices"




---
Regards,
Linux Bluetooth