Skip to content

Commit 109e319

Browse files
holtmannjhedberg
authored andcommitted
Bluetooth: Read list of local codecs supported by the controller
If the Bluetooth controller supports Read Local Supported Codecs command, then issue it during initialization so that the list of codecs is known. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
1 parent 32333ed commit 109e319

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

‎include/net/bluetooth/hci.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,8 @@ struct hci_rp_read_data_block_size {
10741074
__le16 num_blocks;
10751075
} __packed;
10761076

1077+
#define HCI_OP_READ_LOCAL_CODECS 0x100b
1078+
10771079
#define HCI_OP_READ_PAGE_SCAN_ACTIVITY 0x0c1b
10781080
struct hci_rp_read_page_scan_activity {
10791081
__u8 status;

‎net/bluetooth/hci_core.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,6 +1686,10 @@ static void hci_init4_req(struct hci_request *req, unsigned long opt)
16861686
if (hdev->commands[22] & 0x04)
16871687
hci_set_event_mask_page_2(req);
16881688

1689+
/* Read local codec list if the HCI command is supported */
1690+
if (hdev->commands[29] & 0x20)
1691+
hci_req_add(req, HCI_OP_READ_LOCAL_CODECS, 0, NULL);
1692+
16891693
/* Check for Synchronization Train support */
16901694
if (lmp_sync_train_capable(hdev))
16911695
hci_req_add(req, HCI_OP_READ_SYNC_TRAIN_PARAMS, 0, NULL);

0 commit comments

Comments
 (0)