Skip to content

Commit 5b35594

Browse files
hildawurVudentz
authored andcommitted
Bluetooth: btrtl: Add btrealtek data struct
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]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent dc65b4b commit 5b35594

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

drivers/bluetooth/btrtl.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,27 @@ struct rtl_vendor_config {
4747
struct rtl_vendor_config_entry entry[];
4848
} __packed;
4949

50+
enum {
51+
REALTEK_ALT6_CONTINUOUS_TX_CHIP,
52+
53+
__REALTEK_NUM_FLAGS,
54+
};
55+
56+
struct btrealtek_data {
57+
DECLARE_BITMAP(flags, __REALTEK_NUM_FLAGS);
58+
};
59+
60+
#define btrealtek_set_flag(hdev, nr) \
61+
do { \
62+
struct btrealtek_data *realtek = hci_get_priv((hdev)); \
63+
set_bit((nr), realtek->flags); \
64+
} while (0)
65+
66+
#define btrealtek_get_flag(hdev) \
67+
(((struct btrealtek_data *)hci_get_priv(hdev))->flags)
68+
69+
#define btrealtek_test_flag(hdev, nr) test_bit((nr), btrealtek_get_flag(hdev))
70+
5071
#if IS_ENABLED(CONFIG_BT_RTL)
5172

5273
struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev,

drivers/bluetooth/btusb.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3808,6 +3808,9 @@ static int btusb_probe(struct usb_interface *intf,
38083808
/* Override the rx handlers */
38093809
data->recv_event = btusb_recv_event_intel;
38103810
data->recv_bulk = btusb_recv_bulk_intel;
3811+
} else if (id->driver_info & BTUSB_REALTEK) {
3812+
/* Allocate extra space for Realtek device */
3813+
priv_size += sizeof(struct btrealtek_data);
38113814
}
38123815

38133816
data->recv_acl = hci_recv_frame;

0 commit comments

Comments
 (0)