2022-10-05 08:45:23

by Hilda Wu

[permalink] [raw]
Subject: [PATCH v4 1/2] 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 v4:
- Since the original 0002 patch has no dependency with this 0001 patch.
So let the 0002 patch submit another.

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 271963805a38..4243936c0583 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -3755,6 +3755,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-10-05 09:29:02

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

---Test result---

Test Summary:
CheckPatch PASS 3.08 seconds
GitLint FAIL 1.68 seconds
SubjectPrefix PASS 1.21 seconds
BuildKernel PASS 39.08 seconds
BuildKernel32 PASS 35.06 seconds
Incremental Build with patchesPASS 58.68 seconds
TestRunner: Setup PASS 581.82 seconds
TestRunner: l2cap-tester PASS 19.08 seconds
TestRunner: iso-tester PASS 19.65 seconds
TestRunner: bnep-tester PASS 7.43 seconds
TestRunner: mgmt-tester PASS 118.61 seconds
TestRunner: rfcomm-tester PASS 11.81 seconds
TestRunner: sco-tester PASS 10.97 seconds
TestRunner: ioctl-tester PASS 12.64 seconds
TestRunner: smp-tester PASS 10.99 seconds
TestRunner: userchan-tester PASS 7.79 seconds

Details
##############################
Test: GitLint - FAIL - 1.68 seconds
Run gitlint with rule in .gitlint
[v4,2/2] Bluetooth: btusb: Ignore zero length of USB packets on ALT 6 for specific chip
1: T1 Title exceeds max length (87>80): "[v4,2/2] Bluetooth: btusb: Ignore zero length of USB packets on ALT 6 for specific chip"




---
Regards,
Linux Bluetooth