@@ -32,6 +32,11 @@ struct cmd_write_boot_params {
u8 fw_build_yy;
} __packed;
+struct intel_offload_usecases {
+ __u8 status;
+ __u8 preset[8];
+} __packed;
+
int btintel_check_bdaddr(struct hci_dev *hdev)
{
struct hci_rp_read_bd_addr *bda;
@@ -1272,6 +1277,29 @@ int btintel_set_debug_features(struct hci_dev *hdev,
}
EXPORT_SYMBOL_GPL(btintel_set_debug_features);
+int btintel_read_offload_usecases(struct hci_dev *hdev)
+{
+ struct sk_buff *skb;
+ struct intel_offload_usecases *usecases;
+
+ skb = __hci_cmd_sync(hdev, 0xfc86, 0, NULL, HCI_INIT_TIMEOUT);
+ if (IS_ERR(skb)) {
+ bt_dev_err(hdev, "Reading offload usecases failed (%ld)",
+ PTR_ERR(skb));
+ return PTR_ERR(skb);
+ }
+ usecases = (void *)skb->data;
+ if (usecases->status)
+ goto error;
+
+ if (usecases->preset[0] & 0x03)
+ set_bit(HCI_QUIRK_HFP_OFFLOAD_CODECS_SUPPORTED, &hdev->quirks);
+error:
+ kfree_skb(skb);
+ return 0;
+}
+EXPORT_SYMBOL_GPL(btintel_read_offload_usecases);
+
MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
MODULE_DESCRIPTION("Bluetooth support for Intel devices ver " VERSION);
MODULE_VERSION(VERSION);
@@ -175,6 +175,7 @@ int btintel_read_debug_features(struct hci_dev *hdev,
struct intel_debug_features *features);
int btintel_set_debug_features(struct hci_dev *hdev,
const struct intel_debug_features *features);
+int btintel_read_offload_usecases(struct hci_dev *hdev);
#else
static inline int btintel_check_bdaddr(struct hci_dev *hdev)
@@ -307,4 +308,8 @@ static inline int btintel_set_debug_features(struct hci_dev *hdev,
return -EOPNOTSUPP;
}
+static int btintel_read_offload_usecases(struct hci_dev *hdev)
+{
+ return -EOPNOTSUPP;
+}
#endif
@@ -2993,6 +2993,8 @@ static int btusb_setup_intel_newgen(struct hci_dev *hdev)
/* Set DDC mask for available debug features */
btintel_set_debug_features(hdev, &features);
+ btintel_read_offload_usecases(hdev);
+
/* Read the Intel version information after loading the FW */
err = btintel_read_version_tlv(hdev, &version);
if (err)
@@ -246,6 +246,13 @@ enum {
* HCI after resume.
*/
HCI_QUIRK_NO_SUSPEND_NOTIFIER,
+
+ /* When this quirk is set, then controller supports offload codecs
+ * for HFP.
+ * This quirk can be set before hci_register_dev is called or
+ * during the hdev->setup vendor callback.
+ */
+ HCI_QUIRK_HFP_OFFLOAD_CODECS_SUPPORTED,
};
/* HCI device flags */