Received: by 2002:a05:7208:3003:b0:81:def:69cd with SMTP id f3csp4189067rba; Tue, 2 Apr 2024 09:43:32 -0700 (PDT) X-Forwarded-Encrypted: i=4; AJvYcCX7XhQM+biS3/sfHKO1lTQtlsDZrVoUZql+bTCmDyHa+9fnk9fjezlh6K7taWcO4YzxoSXYVlMzyPrdlRh+asbiQiPbKwjxeFoSUyIsyw== X-Google-Smtp-Source: AGHT+IHQrxPeXl7dyb+llbbSDhdRq0wwKIX3BLdEih69EHQ6Hnlk0LYa3onB30/V1WrOySq8plhF X-Received: by 2002:a17:906:3912:b0:a4e:d5d:8fd6 with SMTP id f18-20020a170906391200b00a4e0d5d8fd6mr174609eje.60.1712076212285; Tue, 02 Apr 2024 09:43:32 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1712076212; cv=pass; d=google.com; s=arc-20160816; b=QgGbejK8LeL3mrwIELM1lWHqD+aTZp0GDHR9W4PmZEan92sP7Dcn1o3hpmEkZIWLP9 3V2Gb5Rg5gVIgJtScsO+om6U5fYu0u9s1Unq8xmgxSSA8G0pt8+jq5ajqgPPv5852Qpb KwdcOESXfi2t4gf/3umrVHvhRUrwP7LIqUJtATOq92+kzspEF3ov8HTMhq+j1zrGSjaK dwzWjgrIVOYH+MiubHaTKUWDm2VhCqVM8Td1cQ696EDjSQWjIuxqY58DeSGzpMXKAUfu l/vHq3a1A9phyPDOurW89xdTVMIFfcRYEJ4dpz7QVajmzQS4cCiynFE6Z9SoUsOUXGMY eUBg== 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=EMCfKk9RH++FCunQyWDEpkYQewc5l2UzI2FcSnTVpG4=; fh=ExGhjNQEFJgRqHmYATVc5UXZbS7abAmaHDitrfHKOuE=; b=f5XZZNoc00C/7UuRUUTHlS70I5E5nF6O9HKBMxvAGyc7qe+xPUVszB8/ps0OQ0N9it 2igztzOx7z/ptViVfKITiKr7hJtA4i6FMaeDJ3a2UKj0wJLbhf8/URjSCGOSerxjgJli aBWCfs+DAfsbnRVfbN8V1W4XU9vKvuVC6NE+L53JNMTpVbaykBYxlyRfNLOoOoj0rqY5 jB4bhHPmQHF/vO6R9RRVEBK+YsIGJO471bKM1KyHeqS3nFKCyBCkWRvQEsbxK8jOQJ8q lj+t6XipLn61phHdjFNlj+VM9kkXgkkcSSwt3rCNESVvoa0i5khSwRk3lsewsyqSOrrx 93LA==; dara=google.com ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@iki.fi header.s=meesny header.b=nkUftqxr; arc=pass (i=2 spf=pass spfdomain=iki.fi dkim=pass dkdomain=iki.fi); spf=pass (google.com: domain of linux-bluetooth+bounces-3090-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3090-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id j20-20020a1709062a1400b00a47103b1f7esi5860662eje.212.2024.04.02.09.43.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 09:43:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-3090-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@iki.fi header.s=meesny header.b=nkUftqxr; arc=pass (i=2 spf=pass spfdomain=iki.fi dkim=pass dkdomain=iki.fi); spf=pass (google.com: domain of linux-bluetooth+bounces-3090-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3090-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 11DF51F2227A for ; Tue, 2 Apr 2024 16:43:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2029B15A48E; Tue, 2 Apr 2024 16:43:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=iki.fi header.i=@iki.fi header.b="nkUftqxr" X-Original-To: linux-bluetooth@vger.kernel.org Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.201]) (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 C2BBA2AD1E for ; Tue, 2 Apr 2024 16:43:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=195.140.195.201 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712076197; cv=pass; b=iHnTHjQkBQ05t4MjRCp6GZHvHAr5thZikt0ZAmVeLeOft7/hYBxfHOIdMwk5aslw/Bzlqa80lvHP0MQixMf7RYFoPwilBwlGpJEiniJ84ZIv4SvXFNAHRFZq1CD7qf35RqDLiweGFGqAokFG9h/1IwGoehleO/u1k0BIFLeqBkQ= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712076197; c=relaxed/simple; bh=TY2fqdnHm/1qXm5oAZeAZQByaO0VJhMajIR2AvaXsms=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OUYf0XZ+bNkIMRkp0nU+iTzNAV2GNVrNE3F91pN3rEfa/NIAcg1D8BHzAwhRJnvjcAIVor91Pp3pPz3x9/tUk7LRUVSxFr1+x0vrYSeif0aFU/MH56WxO+VC6BmA/Wwv8zizRH8NfVqJBGmNLlqTrcLzw5O25g1NutcAn6XUQ08= 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 (1024-bit key) header.d=iki.fi header.i=@iki.fi header.b=nkUftqxr; arc=pass smtp.client-ip=195.140.195.201 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 meesny.iki.fi (Postfix) with ESMTPSA id 4V8DG94WHsz106F; Tue, 2 Apr 2024 19:43:13 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1712076194; 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=EMCfKk9RH++FCunQyWDEpkYQewc5l2UzI2FcSnTVpG4=; b=nkUftqxrrmKlKf+U0VSQRUrSQyZsiUmNAgYToMzXr3OEEMgdnRbLVA9S8wdG1lAJZ1V+8A A4yXmMFoMkmL4H5dae0YMfjRl3gBlW2+bJ+Bw+TXQnfH5R2DQHYs5SOqAO9fNJ0uycb3Ex DbZqnebcerwKOQ7iDKZs7yMTNRKsYfY= ARC-Seal: i=1; s=meesny; d=iki.fi; t=1712076194; a=rsa-sha256; cv=none; b=A+3xwxGG1O9dDgt77O5EyRRvEi93g+DchPEmmVhmYnZ9TZT6zf4ZVwpFGA5mluvk1XS0Dd cu1GVv3Sx+Rq93hVWRx/FgFzHmPXkJlJxMGayMboIe5RJO5WYOhDuc4JK1p9QY8OXqJmUm 1cM8qwr7neoUl3yo/Oq7LWPJ7qCJGF8= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pav smtp.mailfrom=pav@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1712076194; 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=EMCfKk9RH++FCunQyWDEpkYQewc5l2UzI2FcSnTVpG4=; b=pocCNu/BgOvLhwWa+HWCwyvjhtaRGuNuq3tAmZwJHmFLs08ZR7gbtP2h2PAWy5k3icewTF /xL2CMPpON0rgqmVjqHMcompzPeWnqxhiLd8trPIkfsSxnRu/fWOMmCgBzf6SuazHCN+xz m+qtSzpdzbcuTSp6ZuvMh8Kp7RG+2VE= From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ v3 4/8] btdev: set nonzero SCO mtu & max pkt Date: Tue, 2 Apr 2024 19:43:01 +0300 Message-ID: <8d177d78fb0aa7edcc2be9a849953f68c078591f.1712076170.git.pav@iki.fi> 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 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