diff options
| author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2026-05-26 12:43:42 -0400 |
|---|---|---|
| committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2026-05-27 15:29:15 -0400 |
| commit | 1b75eb35f32ea8df92c18db9805c0b527e52a51e (patch) | |
| tree | c33b668656ff6772778bdd40fe28e099dbb0686f /net | |
| parent | 3c2c428f25e25d18a496d7b04926451cb03652aa (diff) | |
| download | linux-next-history-1b75eb35f32ea8df92c18db9805c0b527e52a51e.tar.gz | |
Bluetooth: hci_sync: Add support for HCI_LE_Set_Host_Feature [v2]
This adds support for using HCI_LE_Set_Host_Feature [v2] instead of v1
if LL Extented Features is supported and the controller supports the
command.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'net')
| -rw-r--r-- | net/bluetooth/hci_sync.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index aff8562a8690d..b7014774864c6 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -4583,11 +4583,33 @@ static int hci_set_le_support_sync(struct hci_dev *hdev) sizeof(cp), &cp, HCI_CMD_TIMEOUT); } +/* LE Set Host Feature V2 */ +static int hci_le_set_host_feature_v2_sync(struct hci_dev *hdev, u16 bit, + u8 value) +{ + struct hci_cp_le_set_host_feature_v2 cp; + + memset(&cp, 0, sizeof(cp)); + + /* Connected Isochronous Channels (Host Support) */ + cp.bit_number = cpu_to_le16(bit); + cp.bit_value = value; + + return __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_HOST_FEATURE_V2, + sizeof(cp), &cp, HCI_CMD_TIMEOUT); +} + /* LE Set Host Feature */ -static int hci_le_set_host_feature_sync(struct hci_dev *hdev, u8 bit, u8 value) +static int hci_le_set_host_feature_sync(struct hci_dev *hdev, u16 bit, u8 value) { struct hci_cp_le_set_host_feature cp; + if (ll_ext_feature_capable(hdev) && hdev->commands[47] & BIT(4)) + return hci_le_set_host_feature_v2_sync(hdev, bit, value); + + if (bit > 255) + return 0; + memset(&cp, 0, sizeof(cp)); /* Connected Isochronous Channels (Host Support) */ |
