@@ -3812,6 +3812,10 @@ static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb,
hci_cc_le_read_transmit_power(hdev, skb);
break;
+ case MSFT_OP_AVDTP:
+ msft_cc_avdtp(hdev, skb);
+ break;
+
default:
BT_DBG("%s opcode 0x%4.4x", hdev->name, *opcode);
break;
@@ -99,7 +99,6 @@ struct msft_data {
__u8 filter_enabled;
};
-#define MSFT_OP_AVDTP 0xfc1e
struct msft_cp_avdtp {
__u8 sub_opcode;
__u8 len;
@@ -121,6 +120,13 @@ struct msft_cp_avdtp_open {
__u8 caps[0];
} __packed;
+struct msft_rp_avdtp_open {
+ __u8 status;
+ __u8 sub_opcode;
+ __le16 avdtp_handle;
+ __u8 audio_intf_param_cnt;
+} __packed;
+
static int __msft_add_monitor_pattern(struct hci_dev *hdev,
struct adv_monitor *monitor);
static int __msft_remove_monitor(struct hci_dev *hdev,
@@ -916,3 +922,52 @@ int msft_avdtp_cmd(struct hci_dev *hdev, struct l2cap_chan *chan,
fail:
return err;
}
+
+static void msft_cc_avdtp_open(struct hci_dev *hdev, struct sk_buff *skb)
+{
+ struct msft_rp_avdtp_open *rp;
+ struct msft_cp_avdtp_open *sent;
+ struct hci_conn *hconn;
+
+ if (skb->len < sizeof(*rp))
+ return;
+
+ rp = (void *)skb->data;
+
+ sent = hci_sent_cmd_data(hdev, MSFT_OP_AVDTP);
+
+ hconn = hci_conn_hash_lookup_handle(hdev, le16_to_cpu(sent->handle));
+
+ if (!hconn)
+ return;
+
+ /* wake up the task waiting on avdtp handle */
+}
+
+void msft_cc_avdtp(struct hci_dev *hdev, struct sk_buff *skb)
+{
+ void *sent;
+ __u8 status;
+
+ if (skb->len < 2)
+ return;
+
+ status = skb->data[0];
+
+ bt_dev_dbg(hdev, "status 0x%2.2x", status);
+
+ sent = hci_sent_cmd_data(hdev, MSFT_OP_AVDTP);
+ if (!sent)
+ return;
+
+ switch (skb->data[1]) {
+ case MSFT_OP_AVDTP_OPEN:
+ msft_cc_avdtp_open(hdev, skb);
+ break;
+
+ default:
+ bt_dev_err(hdev, "Invalid MSFT sub opcode 0x%2.2x",
+ skb->data[1]);
+ break;
+ }
+}
@@ -10,6 +10,8 @@
#define MSFT_FEATURE_MASK_CURVE_VALIDITY BIT(4)
#define MSFT_FEATURE_MASK_CONCURRENT_ADV_MONITOR BIT(5)
+#define MSFT_OP_AVDTP 0xfc1e
+
#if IS_ENABLED(CONFIG_BT_MSFTEXT)
bool msft_monitor_supported(struct hci_dev *hdev);
@@ -80,3 +82,4 @@ static inline bool msft_curve_validity(struct hci_dev *hdev)
int msft_avdtp_cmd(struct hci_dev *hdev, struct l2cap_chan *chan,
sockptr_t optval, int optlen);
+void msft_cc_avdtp(struct hci_dev *hdev, struct sk_buff *skb);