Skip to content

Commit 15d8ce0

Browse files
Alain Michaudholtmann
authored andcommitted
Bluetooth: le_simult_central_peripheral experimental feature
This patch adds an le_simult_central_peripheral features which allows a clients to determine if the controller is able to support peripheral and central connections separately and at the same time. Signed-off-by: Alain Michaud <alainm@chromium.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 parent b83764f commit 15d8ce0

1 file changed

Lines changed: 23 additions & 2 deletions

File tree

‎net/bluetooth/mgmt.c‎

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3753,27 +3753,48 @@ static const u8 debug_uuid[16] = {
37533753
};
37543754
#endif
37553755

3756+
/* 671b10b5-42c0-4696-9227-eb28d1b049d6 */
3757+
static const u8 simult_central_periph_uuid[16] = {
3758+
0xd6, 0x49, 0xb0, 0xd1, 0x28, 0xeb, 0x27, 0x92,
3759+
0x96, 0x46, 0xc0, 0x42, 0xb5, 0x10, 0x1b, 0x67,
3760+
};
3761+
37563762
static int read_exp_features_info(struct sock *sk, struct hci_dev *hdev,
37573763
void *data, u16 data_len)
37583764
{
3759-
char buf[42];
3765+
char buf[44];
37603766
struct mgmt_rp_read_exp_features_info *rp = (void *)buf;
37613767
u16 idx = 0;
3768+
u32 flags;
37623769

37633770
bt_dev_dbg(hdev, "sock %p", sk);
37643771

37653772
memset(&buf, 0, sizeof(buf));
37663773

37673774
#ifdef CONFIG_BT_FEATURE_DEBUG
37683775
if (!hdev) {
3769-
u32 flags = bt_dbg_get() ? BIT(0) : 0;
3776+
flags = bt_dbg_get() ? BIT(0) : 0;
37703777

37713778
memcpy(rp->features[idx].uuid, debug_uuid, 16);
37723779
rp->features[idx].flags = cpu_to_le32(flags);
37733780
idx++;
37743781
}
37753782
#endif
37763783

3784+
if (hdev) {
3785+
if (test_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks) &&
3786+
(hdev->le_states[4] & 0x08) && /* Central */
3787+
(hdev->le_states[4] & 0x40) && /* Peripheral */
3788+
(hdev->le_states[3] & 0x10)) /* Simultaneous */
3789+
flags = BIT(0);
3790+
else
3791+
flags = 0;
3792+
3793+
memcpy(rp->features[idx].uuid, simult_central_periph_uuid, 16);
3794+
rp->features[idx].flags = cpu_to_le32(flags);
3795+
idx++;
3796+
}
3797+
37773798
rp->feature_count = cpu_to_le16(idx);
37783799

37793800
/* After reading the experimental features information, enable

0 commit comments

Comments
 (0)