Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp156571lqp; Thu, 4 Apr 2024 09:21:52 -0700 (PDT) X-Forwarded-Encrypted: i=4; AJvYcCX1fMjJLGAUBajvPkyShdN/SUQylk2qUSXwmDwaoNVtSTW+oWB846GzOxnJQhG+1NS2jZa/Pqh3yu4mlwRacZ14qcqlhzvwrU2Xzg6hpw== X-Google-Smtp-Source: AGHT+IFa6Lv5FyGQdJG6c+3xbQ5QlSJ0DkFAegyn2QOEqD2Go8wiKHX7+0z/usgPUCXxSNVYxKm5 X-Received: by 2002:a67:b608:0:b0:478:8119:a040 with SMTP id d8-20020a67b608000000b004788119a040mr2681810vsm.14.1712247712385; Thu, 04 Apr 2024 09:21:52 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1712247712; cv=pass; d=google.com; s=arc-20160816; b=yjK+yv0NHaLH6MM2yukpIKNS8lYKd1005Mlhg0q3KxeezACjB94OVZRTspO2eyLAyg gBFIkNfMtdgbvv4v9PtYIohTS7Tjn4D1ebk3BY2TW00Ip38WTJHGCyQKQBWappYRRxej CwvIP4wwvqCz2vnj4hPy27L6Ap/5tW3wvBuPnQ/+UifpK2gMQQr07ZOHBpET+H2zxTz/ UpGw1s/aUr1QiEqYExQ0eENmUxwd/uKjepakAJNt/h/w25R7equnFEZQXnbriLS7qxnx qAtcdB0jpGwjr6CoWPMlHwklx8DAmiqMLGRkt00Rmsy9M4tn7Ztpcb9Hni10P+3fNPA+ jGdg== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=c988UEDGeh4GGPIv9hvKc2c5Fyqnpd4JgkJjtCU1PmA=; fh=ExGhjNQEFJgRqHmYATVc5UXZbS7abAmaHDitrfHKOuE=; b=EGZbiEIhF3cuNkyIt1TV+0ok/AF4X1GNPIlz0dG+Oeunnl3juxdcBwiolYuFT0oyFU C+DrAeIK00OTwr6vdbvnQqri7seYSKNNOY/1RYz9+WCWUJ2usEPwhPyGvDb6+fJb5eAm sd6x8KXezI55qiDuqKqa2npcOc4Ut2RejcTHBVkOSn8VJFSmjvMmu5F8qYD2NhQ0HS62 JntPviGYfr7x7FDLGh2uQlWa8J/88UkOPbsZmcgsTAu4YrM/5i9O3WyWP1+xKoEae+Zi HtW1A5tW/cmXmeM9e7yCuVdwkcT2SZGKW43iNXnA/6tppSvg3pOuhTyQxVXCUubRctZn JgHQ==; dara=google.com ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@iki.fi header.s=lahtoruutu header.b=nyoelnt1; arc=pass (i=2 spf=pass spfdomain=iki.fi dkim=pass dkdomain=iki.fi); spf=pass (google.com: domain of linux-bluetooth+bounces-3216-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3216-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id eh10-20020a0561022aca00b00479d5dc2174si182421vsb.817.2024.04.04.09.21.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 09:21:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-3216-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@iki.fi header.s=lahtoruutu header.b=nyoelnt1; arc=pass (i=2 spf=pass spfdomain=iki.fi dkim=pass dkdomain=iki.fi); spf=pass (google.com: domain of linux-bluetooth+bounces-3216-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3216-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1AAF41C21F15 for ; Thu, 4 Apr 2024 16:21:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A8CD12AAF2; Thu, 4 Apr 2024 16:21:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b="nyoelnt1" X-Original-To: linux-bluetooth@vger.kernel.org Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D586312BEAB for ; Thu, 4 Apr 2024 16:21:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.185.170.37 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712247696; cv=pass; b=F7dM2+hjGtv8yH+vSk4lCTrx259zmW8ttvGbWfLJjua9hRDG5SJT8MIedLBTP4MHkLrfFtS5ZYCjXLkIeqJ8wKI3KatNFUx5JCbh6ZHTrQi9ji7KRRhXwJ7zqyUTKn2oDdiVxnzZx6bPgEKIsTsxOs93Z8T0eqzYOTRCjZedUZ0= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712247696; c=relaxed/simple; bh=pSoZnBzvRKVGEkj4oImim8hxTBAByeIooYeepWwvo5E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JjPmW0ZTDJs4Eizq4nX+mj9EJ2hSjvs071sxSBhnStU9ZE+mhveTE9GfO25ZVeBYhY52VbBvkqMUakoEgLvI6rS89XMjILcg+2RHpy6aqh6q/OUZ/CmiQRYe29PgjCNxk5l1YvrIrKOfP9EQNZYJISHciE21B/So21FNmFvpwY8= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi; spf=pass smtp.mailfrom=iki.fi; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b=nyoelnt1; arc=pass smtp.client-ip=185.185.170.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iki.fi Received: from monolith.lan (unknown [193.138.7.178]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pav) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4V9RhD5JfVz49Q6L; Thu, 4 Apr 2024 19:21:32 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1712247693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c988UEDGeh4GGPIv9hvKc2c5Fyqnpd4JgkJjtCU1PmA=; b=nyoelnt1Lc5+OxDrqbWHCdwtTRcgvwfyRnxC2G1jUcnR7Sr0RLncIHxgcSsYR6CrT5FYUU sPIO6GqqvI8h9RWV0yQzdLYzaqFW30pNeGDqpteRqUbydT0L9am8gl2vtZnAxLwOlWOzhe g7fvhiJ6x7UhQPqKe+4C2pB0hKg2avNq1YXZPdcxT6luu/+tBjBYSNwxsjK0QFJ7jnDw5g jeCWHbbsAJmX6L+d6PXN5iuUyoHezYPiDZfFkAu0uvs23cUQa9ZsNtpDiI/RsppHhw34Hz irLOmfoxgNmQyOV7WAVcGv+aNFhdLCt62lj7m1gASZ97UHxJAx55qaaUYKmC2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1712247693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c988UEDGeh4GGPIv9hvKc2c5Fyqnpd4JgkJjtCU1PmA=; b=Zu3NuolRvRWiX1xT9u5yQRhWAR6p4JgT/Zcwk7vronTXZwXGhudeFm7SOZZH25qzY5rEBU SQjjuQCDKQx9fb45AqWsfxHwhV3J+RaS37SOLCbMT0AREPOvIPTZ2Wm1aBxmXoD90JlWlN uh6kSQK6RctByXBzb6q90Zklvh/SIDEvWm7gTD3dJBT1s8VG7XJY2Iz+lK+zVtyTlKZH8Z SjZM4ynraw6nKs8twgfhsn/JR48svGr6GuGfwnDuZMYdKlENxYoHkxiCL7DS2ffLKtO+k8 bziNKqp0MWrFqHF/sq/ZWdPtwAFc9ulrTtubTBH6y7FtvyW+He0nHDybYKdT7A== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pav smtp.mailfrom=pav@iki.fi ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1712247693; a=rsa-sha256; cv=none; b=NbO44M6Pthk6v+Iyj2g2KkkkTUiieFW0Vis8lFEPlNDnKPoDejqkbl0FS5zt5r/vy4BfC2 Xd+wsYOsYnYFOqJc8Vuzsa3B036YsrstQdUzmeSuTYvCGl31mUIpusJMhPBNN4SvKRGxQi eDCs6soGaELC19Y9Ohmmd12hTSZSMAGMOf9ZA8njHrhG5bv+Ltz8WCoiuDTa11PQf4l+ee 0DTHXW3zpdX99NAYVyu6pJgxG83EWfEew71MUiQRxcD6UfMC2rZake6pj6CiHxgI4ZxvrF 0NxdPGpr+kj1SykcX8TOTQNO/Vo3FpKhzd6L1ZLTlA6prYX94EpihW4QKDV+Jw== From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ v7 4/7] btdev: set nonzero SCO mtu & max pkt Date: Thu, 4 Apr 2024 19:21:20 +0300 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 d64827fc7..5752a2fb0 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