2022-09-29 11:52:13

by Hilda Wu

[permalink] [raw]
Subject: [PATCH v3 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 v3:
- Update private flag.

Changes in v2:
- Set the proper priv_size to hci_alloc_dev_priv().
- Separate commits for functions.
---
---
drivers/bluetooth/btrtl.h | 21 +++++++++++++++++++++
drivers/bluetooth/btusb.c | 3 +++
2 files changed, 24 insertions(+)

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

+enum {
+ 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-29 12:22:22

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=681879

---Test result---

Test Summary:
CheckPatch PASS 4.94 seconds
GitLint FAIL 2.88 seconds
SubjectPrefix FAIL 1.93 seconds
BuildKernel PASS 44.62 seconds
BuildKernel32 PASS 40.86 seconds
Incremental Build with patchesPASS 75.88 seconds
TestRunner: Setup PASS 694.33 seconds
TestRunner: l2cap-tester PASS 21.50 seconds
TestRunner: iso-tester PASS 22.09 seconds
TestRunner: bnep-tester PASS 8.42 seconds
TestRunner: mgmt-tester PASS 137.38 seconds
TestRunner: rfcomm-tester PASS 13.29 seconds
TestRunner: sco-tester PASS 12.30 seconds
TestRunner: ioctl-tester PASS 14.72 seconds
TestRunner: smp-tester PASS 12.54 seconds
TestRunner: userchan-tester PASS 9.03 seconds

Details
##############################
Test: GitLint - FAIL - 2.88 seconds
Run gitlint with rule in .gitlint
[v3,2/3] Bluetooth: btusb: Workaround for spotty SCO quality
18: B1 Line exceeds max length (85>80): " - Additional info: The comparison of btrtl_usb_recv_isoc here is for invalid handle,"
19: B1 Line exceeds max length (91>80): " the invalid handle shouldn't appear. So we try to find out the rule and filter out this."

[v3,3/3] Bluetooth:btsub:Ignore zero length of USB packets on ALT 6 for specific chip
1: T1 Title exceeds max length (85>80): "[v3,3/3] Bluetooth:btsub:Ignore zero length of USB packets on ALT 6 for specific chip"
15: B1 Line exceeds max length (86>80): " - For ignore_usb_alt6_packet_flow, manage the common flag by the vendor private flag."


##############################
Test: SubjectPrefix - FAIL - 1.93 seconds
Check subject contains "Bluetooth" prefix
"Bluetooth: " is not specified in the subject



---
Regards,
Linux Bluetooth