btdev: Add support for Configure Data Path
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 2 Mar 2021 23:09:13 +0000 (15:09 -0800)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:34 +0000 (19:08 +0530)
> HCI Event: Command Complete (0x0e) plen 68
      Read Local Supported Commands (0x04|0x0002) ncmd 1
        Status: Success (0x00)
        Commands: 169 entries
...
          Configure Data Path (Octet 45 - Bit 5)

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
emulator/btdev.c

index 3d0d422..93c038e 100755 (executable)
@@ -4677,6 +4677,20 @@ static int cmd_read_local_ctrl_delay(struct btdev *dev, const void *data,
        return 0;
 }
 
+static int cmd_config_data_path(struct btdev *dev, const void *data,
+                                       uint8_t len)
+{
+       const struct bt_hci_cmd_config_data_path *cmd = data;
+       uint8_t status = BT_HCI_ERR_SUCCESS;
+
+       if (cmd->id > 0x05)
+               status = BT_HCI_ERR_INVALID_PARAMETERS;
+
+       cmd_complete(dev, BT_HCI_CMD_CONFIG_DATA_PATH, &status, sizeof(status));
+
+       return 0;
+}
+
 #define CMD_LE_52 \
        CMD(BT_HCI_CMD_LE_READ_BUFFER_SIZE_V2, cmd_read_size_v2, NULL), \
        CMD(BT_HCI_CMD_LE_READ_ISO_TX_SYNC, cmd_read_iso_tx_sync, NULL), \
@@ -4705,7 +4719,9 @@ static int cmd_read_local_ctrl_delay(struct btdev *dev, const void *data,
        CMD(BT_HCI_CMD_READ_LOCAL_CODECS_V2, cmd_read_local_codecs_v2, NULL), \
        CMD(BT_HCI_CMD_READ_LOCAL_CODEC_CAPS, cmd_read_local_codec_caps, \
                                        NULL), \
-       CMD(BT_HCI_CMD_READ_LOCAL_CTRL_DELAY, cmd_read_local_ctrl_delay, NULL)
+       CMD(BT_HCI_CMD_READ_LOCAL_CTRL_DELAY, cmd_read_local_ctrl_delay, \
+                                       NULL), \
+       CMD(BT_HCI_CMD_CONFIG_DATA_PATH, cmd_config_data_path, NULL)
 
 static const struct btdev_cmd cmd_le_5_2[] = {
        CMD_COMMON_ALL,
@@ -4742,6 +4758,7 @@ static void set_le_52_commands(struct btdev *btdev)
        btdev->commands[45] |= 0x04;    /* Read Local Supported Codecs v2 */
        btdev->commands[45] |= 0x08;    /* Read Local Supported Codecs Caps */
        btdev->commands[45] |= 0x10;    /* Read Local Supported Ctrl Delay */
+       btdev->commands[45] |= 0x20;    /* Config Data Path */
        btdev->cmds = cmd_le_5_2;
 }