Diff between 3a5df1fc39df5bab54c9efae31e17744d9b8e9a8 and 61850ffc9624d175af2a55b82a37060ea4bfd4d0

Changed Files

File Additions Deletions Status
monitor/bt.h +5 -0 modified
monitor/packet.c +35 -1 modified

Full Patch

diff --git a/monitor/bt.h b/monitor/bt.h
index 572c497..5914041 100644
--- a/monitor/bt.h
+++ b/monitor/bt.h
@@ -770,6 +770,11 @@ struct bt_hci_cmd_write_sync_flow_control {
 	uint8_t  enable;
 } __attribute__ ((packed));
 
+#define BT_HCI_CMD_SET_HOST_FLOW_CONTROL	0x0c31
+struct bt_hci_cmd_set_host_flow_control {
+	uint8_t  enable;
+} __attribute__ ((packed));
+
 #define BT_HCI_CMD_HOST_BUFFER_SIZE		0x0c33
 struct bt_hci_cmd_host_buffer_size {
 	uint16_t acl_mtu;
diff --git a/monitor/packet.c b/monitor/packet.c
index 0d967de..07028e7 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -805,6 +805,31 @@ static void print_sync_flow_control(uint8_t enable)
 	print_field("Flow control: %s (0x%2.2x)", str, enable);
 }
 
+static void print_host_flow_control(uint8_t enable)
+{
+	const char *str;
+
+	switch (enable) {
+	case 0x00:
+		str = "Off";
+		break;
+	case 0x01:
+		str = "ACL Data Packets";
+		break;
+	case 0x02:
+		str = "Synchronous Data Packets";
+		break;
+	case 0x03:
+		str = "ACL and Synchronous Data Packets";
+		break;
+	default:
+		str = "Reserved";
+		break;
+	}
+
+	print_field("Flow control: %s (0x%2.2x)", str, enable);
+}
+
 static void print_voice_setting(uint16_t setting)
 {
 	print_field("Setting: 0x%4.4x", btohs(setting));
@@ -3787,6 +3812,13 @@ static void write_sync_flow_control_cmd(const void *data, uint8_t size)
 	print_sync_flow_control(cmd->enable);
 }
 
+static void set_host_flow_control_cmd(const void *data, uint8_t size)
+{
+	const struct bt_hci_cmd_set_host_flow_control *cmd = data;
+
+	print_host_flow_control(cmd->enable);
+}
+
 static void host_buffer_size_cmd(const void *data, uint8_t size)
 {
 	const struct bt_hci_cmd_host_buffer_size *cmd = data;
@@ -5142,7 +5174,9 @@ static const struct opcode_data opcode_table[] = {
 	{ 0x0c2f,  84, "Write Sync Flow Control Enable",
 				write_sync_flow_control_cmd, 1, true,
 				status_rsp, 1, true },
-	{ 0x0c31,  85, "Set Host Controller To Host Flow" },
+	{ 0x0c31,  85, "Set Controller To Host Flow Control",
+				set_host_flow_control_cmd, 1, true,
+				status_rsp, 1, true },
 	{ 0x0c33,  86, "Host Buffer Size",
 				host_buffer_size_cmd, 7, true,
 				status_rsp, 1, true },