diff mbox series

[BlueZ,v3,1/8] shared/lc3: Add QoS definitions

Message ID 20231204221527.2990674-1-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ,v3,1/8] shared/lc3: Add QoS definitions | expand

Commit Message

Luiz Augusto von Dentz Dec. 4, 2023, 10:15 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This adds the QoS preset definitions as per BAP specification.
---
 src/shared/lc3.h | 153 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 153 insertions(+)

Comments

patchwork-bot+bluetooth@kernel.org Dec. 5, 2023, 3:40 a.m. UTC | #1
Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Mon,  4 Dec 2023 17:15:20 -0500 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> This adds the QoS preset definitions as per BAP specification.
> ---
>  src/shared/lc3.h | 153 +++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 153 insertions(+)

Here is the summary with links:
  - [BlueZ,v3,1/8] shared/lc3: Add QoS definitions
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=e3d9aad7d6e6
  - [BlueZ,v3,2/8] test-bap: Introduce QoS tests for LC3
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=9c3824db2aa5
  - [BlueZ,v3,3/8] test-bap: Add SCC Config QoS, VS tests
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=f93fec890447
  - [BlueZ,v3,4/8] test-bap: Add SCC Enable tests
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=6f957d3b6c43
  - [BlueZ,v3,5/8] test-bap: Add SCC Disable tests
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=58805e4f28a3
  - [BlueZ,v3,6/8] shared/bap: Fix possible crash when freeing requests
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=f10faf387d7f
  - [BlueZ,v3,7/8] test-bap: Add SCC Release tests
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=5d2277071237
  - [BlueZ,v3,8/8] test-bap: Add SCC Update Metadata tests
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=9b322d3a52a1

You are awesome, thank you!
diff mbox series

Patch

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)