All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH v2 6/6] emulator: Add support for LE Remove ISO Data Path
Date: Thu, 23 Apr 2020 14:55:01 -0700	[thread overview]
Message-ID: <20200423215501.427266-6-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20200423215501.427266-1-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This implements support for LE Remove ISO Data Path command.
---
 emulator/btdev.c | 25 +++++++++++++++++++++++++
 monitor/bt.h     |  2 +-
 monitor/packet.c |  2 +-
 3 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 1b3ad6442..46d71d77e 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -2508,6 +2508,7 @@ static void default_cmd(struct btdev *btdev, uint16_t opcode,
 	const struct bt_hci_le_scan_phy *lsp;
 	const struct bt_hci_cmd_le_set_ext_scan_enable *lsese;
 	const struct bt_hci_cmd_le_reject_cis *lrcis;
+	const struct bt_hci_cmd_le_remove_iso_path *lerip;
 	struct bt_hci_rsp_read_default_link_policy rdlp;
 	struct bt_hci_rsp_read_stored_link_key rslk;
 	struct bt_hci_rsp_write_stored_link_key wslk;
@@ -3907,6 +3908,30 @@ static void default_cmd(struct btdev *btdev, uint16_t opcode,
 
 		break;
 
+	case BT_HCI_CMD_LE_REMOVE_ISO_PATH:
+		if (btdev->type != BTDEV_TYPE_BREDRLE52)
+			goto unsupported;
+
+		lerip = data;
+		status = BT_HCI_ERR_SUCCESS;
+
+		if (!btdev->conn || le16_to_cpu(lerip->handle) != ISO_HANDLE)
+			status = BT_HCI_ERR_UNKNOWN_CONN_ID;
+
+		switch (lerip->direction) {
+		case 0x00:
+			btdev->le_iso_path[0] = 0x00;
+			break;
+		case 0x01:
+			btdev->le_iso_path[1] = 0x00;
+			break;
+		default:
+			status = BT_HCI_ERR_INVALID_PARAMETERS;
+		}
+
+		cmd_complete(btdev, opcode, &status, sizeof(status));
+		break;
+
 	case BT_HCI_CMD_LE_SET_HOST_FEATURE:
 		if (btdev->type != BTDEV_TYPE_BREDRLE52)
 			goto unsupported;
diff --git a/monitor/bt.h b/monitor/bt.h
index 39ca1e39a..32ea10ca4 100644
--- a/monitor/bt.h
+++ b/monitor/bt.h
@@ -2780,7 +2780,7 @@ struct bt_hci_cmd_le_setup_iso_path {
 #define BT_HCI_BIT_LE_REMOVE_ISO_PATH		BT_HCI_CMD_BIT(43, 4)
 struct bt_hci_cmd_le_remove_iso_path {
 	uint16_t handle;
-	uint8_t  path_dir;
+	uint8_t  direction;
 } __attribute__ ((packed));
 
 #define BT_HCI_CMD_LE_ISO_TX_TEST		0x2070
diff --git a/monitor/packet.c b/monitor/packet.c
index 777a52205..5d8709c42 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -8118,7 +8118,7 @@ static void le_remove_iso_path_cmd(const void *data, uint8_t size)
 	const struct bt_hci_cmd_le_remove_iso_path *cmd = data;
 
 	print_field("Connection Handle: %d", le16_to_cpu(cmd->handle));
-	print_iso_dir("Data Path Direction", cmd->path_dir);
+	print_iso_dir("Data Path Direction", cmd->direction);
 }
 
 static void le_req_peer_sca_cmd(const void *data, uint8_t size)
-- 
2.25.3


  parent reply	other threads:[~2020-04-23 21:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23 21:54 [PATCH v2 1/6] monitor: Remove use of base defines for 5.2 Luiz Augusto von Dentz
2020-04-23 21:54 ` [PATCH v2 2/6] monitor: Add decoding support for HCI LE Set Host Feature Luiz Augusto von Dentz
2020-04-23 21:54 ` [PATCH v2 3/6] emulator: Fix version number of ISO related features Luiz Augusto von Dentz
2020-04-23 21:54 ` [PATCH v2 4/6] emulator: Add support for LE Set Host Feature Luiz Augusto von Dentz
2020-04-23 21:55 ` [PATCH v2 5/6] emulator: Add support for LE Setup ISO Data Path Luiz Augusto von Dentz
2020-04-23 21:55 ` Luiz Augusto von Dentz [this message]
2020-04-24 17:50 ` [PATCH v2 1/6] monitor: Remove use of base defines for 5.2 Luiz Augusto von Dentz

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=20200423215501.427266-6-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.