Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp542069rdb; Thu, 30 Nov 2023 11:16:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFDPWTHyJ4Z3wvr24nb35ASzZNlQKT2D8ve7hr0pVyShYb6wOetHpCTYb4MmSkyOSzoOc/u X-Received: by 2002:a05:6e02:1bcd:b0:35d:176f:77ed with SMTP id x13-20020a056e021bcd00b0035d176f77edmr9637724ilv.25.1701371786007; Thu, 30 Nov 2023 11:16:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701371785; cv=none; d=google.com; s=arc-20160816; b=gR+cpFdFI2TS1LswlJbTRcajIgPmLQVKXWWOPtUI5hMv4F9WCw+wMtbrFVfLAz+z9d HIFjo0FWo+aRNyXSDrXfcTefU7rsVtD1VWjzWFptUAeG4Zh5ZrQAuPZ4NUVP2sXDaupK s9hQjfszecPPObIboiQLIa3sxEBUW2CSyT32iNk//yiOwMjBIUWL/dkBxpGsY2SBO2wT SHVL+X5vG+ekibgdZTtiX7T4IWvDLKcyv37pUdElQe3DlqMdiJ8NeULCYOapVPR3Qdra lYwuI/DB6dfsCtnwmDm2+tpfYHprbeuEzhcmpjTDjHpSiCZU2V/W4lKSJhokLgnKpNPK jBIQ== 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=DbB470qAjEZR3fkhTwle7wfiLn90Om0RYaccjzAHrzQZLTXTky+Fmo4C+aO3G6IaJp ZlSDfLyOoWz0tF5ONZ7RfZqvjzuKHZjXqEvFDLJFjNnBKgSEsCbCaVDMVALbVwAf/zRG tVO3PRvcifvv8JXouU14eaJj9mMMX4pQL7Ahwsqm9+r33n++VeimlgnFlBNfAfxU3EV0 glvBV65jIy4jYHy2OcNj2ZwW+HJZx3RCd485ugya9GqJUYXko1UA4wBTGVafxzqrgMCV 64grMY27PzmNbcZMO1yul7eU0cS3q8UOauONQZHrH189o67lPmMazAExU8z61vs7jUMu 8WxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Mg6TZbGA; spf=pass (google.com: domain of linux-bluetooth+bounces-314-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-314-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w16-20020a634910000000b005c21fcf96a2si1839279pga.825.2023.11.30.11.16.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:16:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-314-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Mg6TZbGA; spf=pass (google.com: domain of linux-bluetooth+bounces-314-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-314-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 355112818E5 for ; Thu, 30 Nov 2023 19:16:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62F915FF19; Thu, 30 Nov 2023 19:16:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Mg6TZbGA" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52DE610E2 for ; Thu, 30 Nov 2023 11:16:16 -0800 (PST) Received: by mail-qk1-x735.google.com with SMTP id af79cd13be357-77d708e4916so62269785a.3 for ; Thu, 30 Nov 2023 11:16:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701371775; x=1701976575; 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=Mg6TZbGAQa9AOahKnDgfb+QLgUySRei/zhughMHGntRLNIxa7gkhUuCZdWs7wr3Dk5 4/SYwH4F1LQdVVJExI3Ald2O6O6ANL6qw1dAW45NI9qPWJ73VEc4UblNtSM3SrNJc20K emgN3JAFEhr9GE9iibpUqKc5nX5s+LKrK5MBxidUFIXWtmlPD7nWX5rtRhyUtj7baXwY fax/Qi/3iTKsmU4fqE/kOBcm9fRj0owmGieRJwl/6LLkN1Ig07WpThi4ae1oXbOStBAQ xslgfiUr0WDcQnAtwJbF2ZFEUKbCHi8/l0Auh/KJFCja5a57LZT+LnAaAvS5fnJwaj5N YrCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701371775; x=1701976575; 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=gQfPreGV8uO+RTa6mhqTIOSAXHiwZoiKfROP1OdTne7Q1lLifNZx7XzK5pSCUw2Kjw u2XKVco7WSJfQgacvhqtCJEPG1CmcW+1OJiC0gg90YZzTJx07pE9OA8YPdHiu9tVEu2k iCy/55vIqdFwQGKIF4ITuqWwgjIZQ6qiodwjqz5iF7uqgomTmVyyH5BYHZq7pUgyLVrK zvjcDrWguwrGc+x8WC6YUmfqyszYWwzOsDYqD3JFetSHpUX1fW1/roOwV3F6N8fKI7oj WZx0GVV8algrZQ4wUICZiQ8xwhHmq0Yfw6lOusrAVvQOCugTojehlqvwrJ7ouH83xzrm v2Vw== X-Gm-Message-State: AOJu0YzcohQFVs+lavUenHcRUB4NCMgQIrh+6mMWRYX5m9UBrWiigHZd BGmHZU5yD6ZfjkClZtE0f/7H5Qg6+Pn8bw== X-Received: by 2002:a05:620a:24cf:b0:77d:ab2c:3e5d with SMTP id m15-20020a05620a24cf00b0077dab2c3e5dmr17136442qkn.41.1701371774618; Thu, 30 Nov 2023 11:16:14 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id c20-20020a05620a0cf400b0077d9aa74e40sm754552qkj.68.2023.11.30.11.16.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:16:14 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 1/2] shared/lc3: Add QoS definitions Date: Thu, 30 Nov 2023 14:16:11 -0500 Message-ID: <20231130191612.2295021-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