@@ -1308,6 +1308,56 @@ int btintel_get_data_path_id(struct hci_dev *hdev)
}
EXPORT_SYMBOL_GPL(btintel_get_data_path_id);
+int btintel_configure_data_path(struct hci_dev *hdev, __u8 type,
+ struct bt_codec *codec)
+{
+ __u8 preset;
+ struct hci_op_configure_data_path *cmd;
+ __u8 buffer[255];
+ struct sk_buff *skb;
+
+ if (type != SCO_LINK && type != ESCO_LINK)
+ return -EINVAL;
+
+ switch (codec->id) {
+ case 0x02:
+ preset = 0x00;
+ break;
+ case 0x05:
+ preset = 0x01;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ cmd = (void *)buffer;
+ cmd->data_path_id = 0x01;
+ cmd->len = 1;
+ cmd->data[0] = preset;
+
+ cmd->direction = 0x00;
+ skb = __hci_cmd_sync(hdev, HCI_CONFIGURE_DATA_PATH, sizeof(*cmd) + 1,
+ cmd, HCI_INIT_TIMEOUT);
+ if (IS_ERR(skb)) {
+ bt_dev_err(hdev, "configure input data path failed (%ld)",
+ PTR_ERR(skb));
+ return PTR_ERR(skb);
+ }
+ kfree_skb(skb);
+
+ cmd->direction = 0x01;
+ skb = __hci_cmd_sync(hdev, HCI_CONFIGURE_DATA_PATH, sizeof(*cmd) + 1,
+ cmd, HCI_INIT_TIMEOUT);
+ if (IS_ERR(skb)) {
+ bt_dev_err(hdev, "configure output data path failed (%ld)",
+ PTR_ERR(skb));
+ return PTR_ERR(skb);
+ }
+ kfree_skb(skb);
+ return 0;
+}
+EXPORT_SYMBOL_GPL(btintel_configure_data_path);
+
MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
MODULE_DESCRIPTION("Bluetooth support for Intel devices ver " VERSION);
MODULE_VERSION(VERSION);
@@ -177,6 +177,8 @@ int btintel_set_debug_features(struct hci_dev *hdev,
const struct intel_debug_features *features);
int btintel_read_offload_usecases(struct hci_dev *hdev);
int btintel_get_data_path_id(struct hci_dev *hdev);
+int btintel_configure_data_path(struct hci_dev *hdev, __u8 type,
+ struct bt_codec *codec);
#else
static inline int btintel_check_bdaddr(struct hci_dev *hdev)
@@ -318,4 +320,10 @@ static int btintel_get_data_path_id(struct hci_dev *hdev)
{
return -EOPNOTSUPP;
}
+
+static int btintel_configure_data_path(struct hci_dev *hdev, __u8 type,
+ struct bt_codec *codec)
+{
+ return -EOPNOTSUPP;
+}
#endif
@@ -4632,6 +4632,7 @@ static int btusb_probe(struct usb_interface *intf,
hdev->set_bdaddr = btintel_set_bdaddr;
hdev->cmd_timeout = btusb_intel_cmd_timeout;
hdev->get_data_path_id = btintel_get_data_path_id;
+ hdev->configure_data_path = btintel_configure_data_path;
set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks);
set_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks);
@@ -1257,6 +1257,14 @@ struct hci_rp_read_local_oob_ext_data {
__u8 rand256[16];
} __packed;
+#define HCI_CONFIGURE_DATA_PATH 0x0c83
+struct hci_op_configure_data_path {
+ __u8 direction;
+ __u8 data_path_id;
+ __u8 len;
+ __u8 data[];
+} __packed;
+
#define HCI_OP_READ_LOCAL_VERSION 0x1001
struct hci_rp_read_local_version {
__u8 status;
@@ -618,6 +618,8 @@ struct hci_dev {
void (*cmd_timeout)(struct hci_dev *hdev);
bool (*prevent_wake)(struct hci_dev *hdev);
int (*get_data_path_id)(struct hci_dev *hdev);
+ int (*configure_data_path)(struct hci_dev *hdev, __u8 type,
+ struct bt_codec *codec);
};
#define HCI_PHY_HANDLE(handle) (handle & 0xff)