All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pauli Virtanen <pav@iki.fi>
To: linux-bluetooth@vger.kernel.org
Cc: Pauli Virtanen <pav@iki.fi>
Subject: [PATCH BlueZ v2 4/9] btdev: set nonzero SCO mtu & max pkt
Date: Thu, 14 Mar 2024 20:21:13 +0200	[thread overview]
Message-ID: <ff805dc6468162d0e319cc600dac349e20d34dc4.1710440408.git.pav@iki.fi> (raw)
In-Reply-To: <cover.1710440408.git.pav@iki.fi>

Set nonzero max pkt count, so that kernel can transmit data.
The request & accept/reject flow is not emulated yet.
---
 emulator/btdev.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 0ad6b2793..a63136fad 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -148,6 +148,8 @@ struct btdev {
 	uint8_t  feat_page_2[8];
 	uint16_t acl_mtu;
 	uint16_t acl_max_pkt;
+	uint16_t sco_mtu;
+	uint16_t sco_max_pkt;
 	uint16_t iso_mtu;
 	uint16_t iso_max_pkt;
 	uint8_t  country_code;
@@ -653,9 +655,9 @@ static int cmd_read_buffer_size(struct btdev *dev, const void *data,
 
 	rsp.status = BT_HCI_ERR_SUCCESS;
 	rsp.acl_mtu = cpu_to_le16(dev->acl_mtu);
-	rsp.sco_mtu = 0;
+	rsp.sco_mtu = cpu_to_le16(dev->sco_mtu);
 	rsp.acl_max_pkt = cpu_to_le16(dev->acl_max_pkt);
-	rsp.sco_max_pkt = cpu_to_le16(0);
+	rsp.sco_max_pkt = cpu_to_le16(dev->sco_max_pkt);
 
 	cmd_complete(dev, BT_HCI_CMD_READ_BUFFER_SIZE, &rsp, sizeof(rsp));
 
@@ -2764,6 +2766,8 @@ static int cmd_enhanced_setup_sync_conn_complete(struct btdev *dev,
 		goto done;
 	}
 
+	/* TODO: HCI_Connection_Request connection flow */
+
 	cc.status = BT_HCI_ERR_SUCCESS;
 	memcpy(cc.bdaddr, conn->link->dev->bdaddr, 6);
 
@@ -7173,6 +7177,9 @@ struct btdev *btdev_create(enum btdev_type type, uint16_t id)
 	btdev->acl_mtu = 192;
 	btdev->acl_max_pkt = 1;
 
+	btdev->sco_mtu = 72;
+	btdev->sco_max_pkt = 1;
+
 	btdev->iso_mtu = 251;
 	btdev->iso_max_pkt = 1;
 	btdev->big_handle = 0xff;
-- 
2.44.0


  parent reply	other threads:[~2024-03-14 18:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-14 18:21 [PATCH BlueZ v2 0/9] tests: add TX timestamping tests Pauli Virtanen
2024-03-14 18:21 ` [PATCH BlueZ v2 1/9] lib: add BT_SCM_ERROR and BT_NO_ERRQUEUE_POLL Pauli Virtanen
2024-03-14 19:20   ` tests: add TX timestamping tests bluez.test.bot
2024-03-14 18:21 ` [PATCH BlueZ v2 2/9] iso-tester: Add tests for TX timestamping Pauli Virtanen
2024-03-14 18:21 ` [PATCH BlueZ v2 3/9] l2cap-tester: Add test " Pauli Virtanen
2024-03-14 18:21 ` Pauli Virtanen [this message]
2024-03-14 18:21 ` [PATCH BlueZ v2 5/9] sco-tester: add TX timestamping test Pauli Virtanen
2024-03-14 18:21 ` [PATCH BlueZ v2 6/9] shared/tester: run test with given name Pauli Virtanen
2024-03-14 18:21 ` [PATCH BlueZ v2 7/9] bthost: handle client L2CAP conn in LE credit based mode Pauli Virtanen
2024-03-14 18:21 ` [PATCH BlueZ v2 8/9] l2cap-tester: add tests for LE Client read/write/tx-timestamping Pauli Virtanen
2024-03-14 18:21 ` [PATCH BlueZ v2 9/9] iso-tester: add test for BT_NO_ERRQUEUE_POLL Pauli Virtanen

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=ff805dc6468162d0e319cc600dac349e20d34dc4.1710440408.git.pav@iki.fi \
    --to=pav@iki.fi \
    --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.