linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kiran K <kiran.k@intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: ravishankar.srivatsa@intel.com, chethan.tumkur.narayan@intel.com,
	luiz.von.dentz@intel.com, Kiran K <kiran.k@intel.com>
Subject: [PATCH v4 11/14] Bluetooth: Implment MSFT avdtp start command
Date: Fri, 19 Nov 2021 13:50:24 +0530	[thread overview]
Message-ID: <20211119082027.12809-11-kiran.k@intel.com> (raw)
In-Reply-To: <20211119082027.12809-1-kiran.k@intel.com>

In a2dp offload use case, after sending L2CAP AVDTP
start command, controller needs to sent MSFT avdtp start
command to trigger to let know the controller to start
streaming audio data. Allow BlueZ daemon to send
MSFT avdtp start command via setsockopt.

Signed-off-by: Kiran K <kiran.k@intel.com>
Reviewed-by: Chethan T N <chethan.tumkur.narayan@intel.com>
Reviewed-by: Srivatsa Ravishankar <ravishankar.srivatsa@intel.com>
---
 net/bluetooth/msft.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/net/bluetooth/msft.c b/net/bluetooth/msft.c
index aca5cac7a87f..e3f7503070a6 100644
--- a/net/bluetooth/msft.c
+++ b/net/bluetooth/msft.c
@@ -127,6 +127,12 @@ struct msft_rp_avdtp_open {
 	__u8    audio_intf_param_cnt;
 } __packed;
 
+#define MSFT_OP_AVDTP_START			0x09
+struct msft_cp_avdtp_start {
+	u8	sub_opcode;
+	__le16	avdtp_handle;
+} __packed;
+
 static int __msft_add_monitor_pattern(struct hci_dev *hdev,
 				      struct adv_monitor *monitor);
 static int __msft_remove_monitor(struct hci_dev *hdev,
@@ -884,6 +890,19 @@ static int msft_avdtp_open(struct hci_dev *hdev,
 	return err;
 }
 
+static int msft_avdtp_start(struct hci_dev *hdev, struct sock *sk)
+{
+	struct msft_cp_avdtp_start cmd;
+
+	if (!bt_sk(sk)->avdtp_handle)
+		return -EBADFD;
+
+	cmd.sub_opcode = MSFT_OP_AVDTP_START;
+	cmd.avdtp_handle = cpu_to_le16(bt_sk(sk)->avdtp_handle);
+
+	return hci_send_cmd(hdev, MSFT_OP_AVDTP, sizeof(cmd), &cmd);
+}
+
 int msft_avdtp_cmd(struct hci_dev *hdev, struct l2cap_chan *chan,
 		   sockptr_t optval, int optlen,
 		   struct sock *sk)
@@ -918,6 +937,10 @@ int msft_avdtp_cmd(struct hci_dev *hdev, struct l2cap_chan *chan,
 		err = msft_avdtp_open(hdev, chan, cmd, sk);
 		break;
 
+	case MSFT_OP_AVDTP_START:
+		err = msft_avdtp_start(hdev, sk);
+		break;
+
 	default:
 		err = -EINVAL;
 		bt_dev_err(hdev, "Invalid MSFT avdtp sub opcode = 0x%2.2x",
@@ -975,6 +998,9 @@ void msft_cc_avdtp(struct hci_dev *hdev, struct sk_buff *skb)
 		msft_cc_avdtp_open(hdev, skb);
 		break;
 
+	case MSFT_OP_AVDTP_START:
+		break;
+
 	default:
 		bt_dev_err(hdev, "Invalid MSFT sub opcode 0x%2.2x",
 			   skb->data[1]);
-- 
2.17.1


  parent reply	other threads:[~2021-11-19  8:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19  8:20 [PATCH v4 01/14] Bluetooth: Refactor code to read supported codecs in getsockopt Kiran K
2021-11-19  8:20 ` [PATCH v4 02/14] Bluetooth: Support reading of codecs supported over l2cap socket Kiran K
2021-11-19  8:20 ` [PATCH v4 03/14] Bluetooth: btintel: cache offload use case data Kiran K
2021-11-19  8:20 ` [PATCH v4 04/14] Bluetooth: Pass transport type in get_data_path_id Kiran K
2021-11-23 23:43   ` Luiz Augusto von Dentz
2021-11-19  8:20 ` [PATCH v4 05/14] Bluetooth: btintel: Add support to fetch data path id for a2dp offload Kiran K
2021-11-23 23:49   ` Luiz Augusto von Dentz
2021-11-19  8:20 ` [PATCH v4 06/14] Bluetooth: Remove unused member in struct hci_vnd_codec_v2 Kiran K
2021-11-23 23:52   ` Luiz Augusto von Dentz
2021-11-19  8:20 ` [PATCH v4 07/14] Bluetooth: Read Output codec capabilities Kiran K
2021-11-19  8:20 ` [PATCH v4 08/14] Bluetooth: Implement MSFT avdtp open command Kiran K
2021-11-24  1:26   ` Luiz Augusto von Dentz
2021-11-19  8:20 ` [PATCH v4 09/14] Bluetooth: Handle MSFT avdtp open event Kiran K
2021-11-19  8:20 ` [PATCH v4 10/14] " Kiran K
2021-11-19  8:20 ` Kiran K [this message]
2021-11-19  8:20 ` [PATCH v4 12/14] Bluetooth: Implment MSFT avdtp suspend command Kiran K
2021-11-19  8:20 ` [PATCH v4 13/14] Bluetooth: Implment MSFT avdtp close command Kiran K
2021-11-19  8:20 ` [PATCH v4 14/14] Bluetooth: Add MSFT a2dp offload codec under experimental flag Kiran K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211119082027.12809-11-kiran.k@intel.com \
    --to=kiran.k@intel.com \
    --cc=chethan.tumkur.narayan@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.von.dentz@intel.com \
    --cc=ravishankar.srivatsa@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).