diff mbox series

[v3,1/3] Bluetooth: btrtl: Add btrealtek data struct

Message ID 20220929114426.4413-2-hildawu@realtek.com (mailing list archive)
State Superseded
Headers show
Series Bluetooth: Add btrealtek data struct and improve SCO sound quality of RTK chips | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/checkpatch success Checkpatch PASS
tedd_an/gitlint success Gitlint PASS
tedd_an/subjectprefix success PASS
tedd_an/buildkernel success Build Kernel PASS
tedd_an/buildkernel32 success Build Kernel32 PASS
tedd_an/incremental_build success Pass
tedd_an/testrunnersetup success Test Runner Setup PASS
tedd_an/testrunnerl2cap-tester success Total: 40, Passed: 40 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunneriso-tester success Total: 55, Passed: 55 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnerbnep-tester success Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnermgmt-tester success Total: 494, Passed: 494 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnerrfcomm-tester success Total: 11, Passed: 11 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersco-tester success Total: 12, Passed: 12 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnerioctl-tester success Total: 28, Passed: 28 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersmp-tester success Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunneruserchan-tester success Total: 4, Passed: 4 (100.0%), Failed: 0, Not Run: 0

Commit Message

Hilda Wu Sept. 29, 2022, 11:44 a.m. UTC
From: Hilda Wu <hildawu@realtek.com>

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 <hildawu@realtek.com>
---
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(+)

Comments

bluez.test.bot@gmail.com Sept. 29, 2022, 12:11 p.m. UTC | #1
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
diff mbox series

Patch

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;