Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp3016912rdb; Mon, 4 Dec 2023 14:15:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IFYFQro76WP8bQxTQ19J73wk1X20E9mLmQRAdzHfK0IMD5wv3jhpInbLI1fIkvFeThJxry2 X-Received: by 2002:a1c:7507:0:b0:40b:5e21:e281 with SMTP id o7-20020a1c7507000000b0040b5e21e281mr2530107wmc.110.1701728142390; Mon, 04 Dec 2023 14:15:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701728142; cv=none; d=google.com; s=arc-20160816; b=jDCgis09B/DA6wjuM++3TSOsobGVLzI1kczhpor+/9TC3lx4ChFIUseN0rcQRIwX9q 4yU+YQSr6tIlcVmARUsNXALMPMAqUf4/F+JTM//4UP9NxRD5IJGhgrh+YbolGyA/4E6f rH8yltG2ydouNgRnG4JX10svjZV840/WoUEAINWI9RAuWv/5kAFmhWau/b44A5/nNFfu HOSUigoMhlr5ONLTDyolfi4miGSWcv7fJdGeVkZwgi9ZOw990MnhBxe1rUVjcSc2Lj5C V9mK5253lVcsuAKM3xTC8MIvLcF0C0wbkQDwdPgXjcrrQB96S5J1KttcPKpfySQ1mSqZ /+pA== ARC-Message-Signature: i=1; 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:message-id:date:subject:to:from :dkim-signature; bh=4h6ikY50jNdfv+t4SGoqzVG8MtRln2TReTJFy2w9zG8=; fh=4lGQI6056MBa4/oovMyIYaKLn+Wz/24RGvUivMmQP8E=; b=qFrjkx+zoTW1+zLE0PbJY/RsVPySMNlWGluWxtyKKEm4rHzhpLHwxglk965Qi9JBpc MkV18D4O0Es/21D4v/ObrkdKv0zDtTLKrB1LCJuFmHrZ1O7xeZMLDDtxrFnkYPhTzFHx Lnz3w3Qk3nG0l8fMuBlVQiC+7VsSMVD1DVWCHJpViue3+bh5jwXu5SVwh4myFauE7SPK VicoHQ28UyQyZikdPngk2fZ+bhHoFEJJbdOjiReREjvB2Qm1oAag/sKVTIKKTGsb6q8X SXTJpi3dAWbGnHd1PWwCsy9JhDOJqkMlbMeEspMJetji0u6mRFwuPuva/dc+LlK3xa92 ZBYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZPyCoU59; spf=pass (google.com: domain of linux-bluetooth+bounces-376-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-376-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id lt11-20020a170906fa8b00b009fef4061d43si4803193ejb.654.2023.12.04.14.15.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 14:15:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-376-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=@gmail.com header.s=20230601 header.b=ZPyCoU59; spf=pass (google.com: domain of linux-bluetooth+bounces-376-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-376-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 2853B1F2132E for ; Mon, 4 Dec 2023 22:15:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 641AF3A8CF; Mon, 4 Dec 2023 22:15:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZPyCoU59" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-vs1-xe2d.google.com (mail-vs1-xe2d.google.com [IPv6:2607:f8b0:4864:20::e2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0C1A11F for ; Mon, 4 Dec 2023 14:15:31 -0800 (PST) Received: by mail-vs1-xe2d.google.com with SMTP id ada2fe7eead31-4649299d0a0so452118137.2 for ; Mon, 04 Dec 2023 14:15:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701728130; x=1702332930; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=4h6ikY50jNdfv+t4SGoqzVG8MtRln2TReTJFy2w9zG8=; b=ZPyCoU59VEW5jOte+AxyorIl9PMtBjZZfKd5Bh+epsWsKJ39/u4j7EHF4EEZEZ3J4J XUElAtJVJ7PvHtIkqxLHzU9tsVBJMf+A/HE7TzJ51+OiXxHf0kTsr95zV078z1oecPu8 fnhDv1NhEZvVcrfpiTu8BtH5UxJMD5oUAoh/skMMQDSVs5eg0o3n3YNn4wwEOFlp3Blj 3QvzzjIipYw5/fb+O5jI4kI4mTaYoxCcRFfDihXpyFvYAQL2nOpvw09X60b7TAo/NDIo Pr7ItjrzUGrcliATAfkR8hJ8TQxrC+kMKs23bfo928ckcmxJkIGUGy/i2hZkS+tnXlxR uGzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701728130; x=1702332930; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4h6ikY50jNdfv+t4SGoqzVG8MtRln2TReTJFy2w9zG8=; b=EU15Y2G29hOPdZflAxziNl43FTumlOUWCe/HqB6pP4591nIyC088Pg6met2jGRXmwZ u7CLfzVzCqPQCUQxOueCrA6xKApoY5I/TsehfrVMaV5g4QT12WKCBbgTYzhQ8muO3gCi GHu3AKNXIH5DrLUiDYQniw8PI2Dk6r9jjYpe9xvcS4c+hVL0bjjnqUtSw6UNNF4sFRFF w4tUZHJhOdB4T9JfoA18e3kokru1JrrRvFgcRF31pPaEcJW+GDQWisCCGvc7wAq26SVi qnFHG5fuPAhZQkQnoz6f9IknucCgTWepax4vg8SwA1kYVse+zZTGeR9VgT0HOVuXpNNa g0PQ== X-Gm-Message-State: AOJu0YxUwiG0z66ALsYlT68H7LRZGoRNRi4+q1BMb1Bsrpx8Wyckv/GK Zd+zbBhn+oGLgJIVi/SKvNY+JoBL8W4= X-Received: by 2002:a05:6102:302e:b0:464:6793:7fd1 with SMTP id v14-20020a056102302e00b0046467937fd1mr2476464vsa.33.1701728129929; Mon, 04 Dec 2023 14:15:29 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id bl13-20020a056102508d00b0044d4e63aa03sm1136612vsb.25.2023.12.04.14.15.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 14:15:29 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v3 1/8] shared/lc3: Add QoS definitions Date: Mon, 4 Dec 2023 17:15:20 -0500 Message-ID: <20231204221527.2990674-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Luiz Augusto von Dentz This adds the QoS preset definitions as per BAP specification. --- src/shared/lc3.h | 153 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) diff --git a/src/shared/lc3.h b/src/shared/lc3.h index ae193f9e2fa7..e6b043699bc1 100644 --- a/src/shared/lc3.h +++ b/src/shared/lc3.h @@ -155,3 +155,156 @@ #define LC3_CONFIG_48_6 \ LC3_CONFIG_48(LC3_CONFIG_DURATION_10, 155u) + +#define LC3_QOS_UNFRAMED 0x00 +#define LC3_QOS_FRAMED 0x01 + +#define LC3_QOS_UCAST(_frame, _pd, _t_lat, _interval, _lat, _sdu, _rtn) \ +{ \ + .ucast.cig_id = 0x00, \ + .ucast.cis_id = 0x00, \ + .ucast.delay = _pd, \ + .ucast.target_latency = _t_lat, \ + .ucast.io_qos.interval = _interval, \ + .ucast.io_qos.latency = _lat, \ + .ucast.io_qos.sdu = _sdu, \ + .ucast.io_qos.phy = BT_BAP_CONFIG_PHY_2M, \ + .ucast.io_qos.rtn = _rtn, \ +} + +#define LC3_QOS_UCAST_7_5_UNFRAMED(_pd, _t_lat, _lat, _sdu, _rtn) \ + LC3_QOS_UCAST(LC3_QOS_UNFRAMED, _pd, _t_lat, 7500u, _lat, _sdu, _rtn) + +#define LC3_QOS_UCAST_10_UNFRAMED(_pd, _t_lat, _lat, _sdu, _rtn) \ + LC3_QOS_UCAST(LC3_QOS_UNFRAMED, _pd, _t_lat, 10000u, _lat, _sdu, _rtn) + +#define LC3_QOS_UCAST_FRAMED(_pd, _t_lat, _interval, _lat, _sdu, _rtn) \ + LC3_QOS_UCAST(LC3_QOS_FRAMED, _pd, _t_lat, _interval, _lat, _sdu, _rtn) + +#define LC3_QOS_8_1_1 \ + LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 8u, 26u, 2u) + +#define LC3_QOS_8_1_2 \ + LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 75u, 26u, 13u) + +#define LC3_QOS_8_2_1 \ + LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 10u, 30u, 2u) + +#define LC3_QOS_8_2_2 \ + LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 95u, 30u, 13u) + +#define LC3_QOS_16_1_1 \ + LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 8u, 30u, 2u) + +#define LC3_QOS_16_1_2 \ + LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 75u, 30u, 13u) + +#define LC3_QOS_16_2_1 \ + LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 10u, 40u, 2u) + +#define LC3_QOS_16_2_2 \ + LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 95u, 40u, 13u) + +#define LC3_QOS_24_1_1 \ + LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 8u, 45u, 2u) + +#define LC3_QOS_24_1_2 \ + LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 75u, 45u, 13u) + +#define LC3_QOS_24_2_1 \ + LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 10u, 60u, 2u) + +#define LC3_QOS_24_2_2 \ + LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 95u, 60u, 13u) + +#define LC3_QOS_32_1_1 \ + LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 8u, 60u, 2u) + +#define LC3_QOS_32_1_2 \ + LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 75u, 60u, 13u) + +#define LC3_QOS_32_2_1 \ + LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 10u, 80u, 2u) + +#define LC3_QOS_32_2_2 \ + LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 95u, 80u, 13u) + +#define LC3_QOS_44_1_1 \ + LC3_QOS_UCAST_FRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 8163u, 24u, 98u, 5u) + +#define LC3_QOS_44_1_2 \ + LC3_QOS_UCAST_FRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 8163u, 80u, 98u, 13u) + +#define LC3_QOS_44_2_1 \ + LC3_QOS_UCAST_FRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 10884u, 31u, 130u, 5u) + +#define LC3_QOS_44_2_2 \ + LC3_QOS_UCAST_FRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 10884u, 85u, 130u, 13u) + +#define LC3_QOS_48_1_1 \ + LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 15u, 75u, 5u) + +#define LC3_QOS_48_1_2 \ + LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 75u, 75u, 13u) + +#define LC3_QOS_48_2_1 \ + LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 20u, 100u, 5u) + +#define LC3_QOS_48_2_2 \ + LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 95u, 100u, 13u) + +#define LC3_QOS_48_3_1 \ + LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 15u, 90u, 5u) + +#define LC3_QOS_48_3_2 \ + LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 75u, 90u, 13u) + +#define LC3_QOS_48_4_1 \ + LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 20u, 120u, 5u) + +#define LC3_QOS_48_4_2 \ + LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 100u, 120u, 13u) + +#define LC3_QOS_48_5_1 \ + LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 15u, 117u, 5u) + +#define LC3_QOS_48_5_2 \ + LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 75u, 117u, 13u) + +#define LC3_QOS_48_6_1 \ + LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 20u, 155u, 5u) + +#define LC3_QOS_48_6_2 \ + LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + 100u, 155u, 13u) -- 2.43.0