From: Naga Bhavani Akella <naga.akella@oss.qualcomm.com>
To: linux-bluetooth@vger.kernel.org
Cc: luiz.dentz@gmail.com, quic_mohamull@quicinc.com,
quic_hbandi@quicinc.com, quic_anubhavg@quicinc.com,
Naga Bhavani Akella <naga.akella@oss.qualcomm.com>
Subject: [PATCH BlueZ v1 1/5] rap: Add Channel Sounding parameter types and APIs
Date: Mon, 6 Jul 2026 21:45:59 +0530 [thread overview]
Message-ID: <20260706161603.2744459-2-naga.akella@oss.qualcomm.com> (raw)
In-Reply-To: <20260706161603.2744459-1-naga.akella@oss.qualcomm.com>
Add shared Channel Sounding parameter structures
(bt_rap_le_cs_config, bt_rap_le_cs_frequency and
bt_rap_le_cs_default_settings) for exchanging
CS configuration, frequency, and default settings
between the RAP DBus layer and HCI state machine.
Add getter/setter APIs for CS config, frequency
and default settings, add measurement.
---
Makefile.am | 2 +-
src/shared/cs-types.h | 55 +++++++++++++++++++++++++++++++++++++++++++
src/shared/rap.h | 47 +++++++++++++++++++++++++++---------
3 files changed, 92 insertions(+), 12 deletions(-)
create mode 100644 src/shared/cs-types.h
diff --git a/Makefile.am b/Makefile.am
index 76c4ab5d4..a7b063c6e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -249,7 +249,7 @@ shared_sources = src/shared/io.h src/shared/timeout.h \
src/shared/asha.h src/shared/asha.c \
src/shared/battery.h src/shared/battery.c \
src/shared/uinput.h src/shared/uinput.c \
- src/shared/rap.h src/shared/rap.c
+ src/shared/rap.h src/shared/rap.c src/shared/cs-types.h
if READLINE
diff --git a/src/shared/cs-types.h b/src/shared/cs-types.h
new file mode 100644
index 000000000..62ab643cf
--- /dev/null
+++ b/src/shared/cs-types.h
@@ -0,0 +1,55 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#pragma once
+
+#include <stdint.h>
+
+#define BT_RAP_CS_MAX_CONFIGS 4
+#define BT_RAP_CS_MAX_FREQ_SETS 3
+
+struct bt_rap_le_cs_config {
+ uint8_t num_configs;
+ uint8_t config_id[BT_RAP_CS_MAX_CONFIGS];
+ uint8_t main_mode_type[BT_RAP_CS_MAX_CONFIGS];
+ uint8_t sub_mode_type[BT_RAP_CS_MAX_CONFIGS];
+ uint8_t main_mode_min_steps[BT_RAP_CS_MAX_CONFIGS];
+ uint8_t main_mode_max_steps[BT_RAP_CS_MAX_CONFIGS];
+ uint8_t main_mode_repetition[BT_RAP_CS_MAX_CONFIGS];
+ uint8_t mode0_steps[BT_RAP_CS_MAX_CONFIGS];
+ uint8_t role[BT_RAP_CS_MAX_CONFIGS];
+ uint8_t rtt_types[BT_RAP_CS_MAX_CONFIGS];
+ uint8_t cs_sync_phy[BT_RAP_CS_MAX_CONFIGS];
+ uint8_t channel_map[BT_RAP_CS_MAX_CONFIGS][10];
+ uint8_t channel_map_repetition[BT_RAP_CS_MAX_CONFIGS];
+ uint8_t channel_selection_type[BT_RAP_CS_MAX_CONFIGS];
+ uint8_t channel_shape[BT_RAP_CS_MAX_CONFIGS];
+ uint8_t channel_jump[BT_RAP_CS_MAX_CONFIGS];
+ uint8_t companion_signal_enable[BT_RAP_CS_MAX_CONFIGS];
+};
+
+struct bt_rap_le_cs_frequency {
+ uint8_t num_durations;
+ uint16_t max_procedure_duration[BT_RAP_CS_MAX_FREQ_SETS];
+ uint16_t min_period_between_procedures[BT_RAP_CS_MAX_FREQ_SETS];
+ uint16_t max_period_between_procedures[BT_RAP_CS_MAX_FREQ_SETS];
+ uint16_t max_procedure_count[BT_RAP_CS_MAX_FREQ_SETS];
+ uint8_t min_sub_event_len[BT_RAP_CS_MAX_FREQ_SETS][3];
+ uint8_t max_sub_event_len[BT_RAP_CS_MAX_FREQ_SETS][3];
+ uint8_t tone_antenna_config_selection[BT_RAP_CS_MAX_FREQ_SETS];
+ uint8_t phy[BT_RAP_CS_MAX_FREQ_SETS];
+ uint8_t tx_power_delta[BT_RAP_CS_MAX_FREQ_SETS];
+ uint8_t preferred_peer_antenna[BT_RAP_CS_MAX_FREQ_SETS];
+ uint8_t snr_control_initiator[BT_RAP_CS_MAX_FREQ_SETS];
+ uint8_t snr_control_reflector[BT_RAP_CS_MAX_FREQ_SETS];
+};
+
+struct bt_rap_le_cs_default_settings {
+ uint8_t role;
+ uint8_t cs_sync_ant_sel;
+ int8_t max_tx_power;
+};
diff --git a/src/shared/rap.h b/src/shared/rap.h
index 7bc49f03d..22cb46653 100644
--- a/src/shared/rap.h
+++ b/src/shared/rap.h
@@ -9,8 +9,8 @@
#include <inttypes.h>
#include "src/shared/io.h"
-#include "bluetooth/mgmt.h"
#include "src/shared/hci.h"
+#include "src/shared/cs-types.h"
struct bt_rap;
struct gatt_db;
@@ -189,22 +189,39 @@ bool bt_rap_unregister(unsigned int id);
struct bt_rap *bt_rap_new(struct gatt_db *ldb, struct gatt_db *rdb);
+bool bt_rap_set_cs_config_params(void *hci_sm,
+ const struct bt_rap_le_cs_config *config);
+bool bt_rap_set_cs_freq_params(void *hci_sm,
+ const struct bt_rap_le_cs_frequency *frequency);
+bool bt_rap_set_default_settings_params(void *hci_sm,
+ const struct bt_rap_le_cs_default_settings *s);
+bool bt_rap_get_cs_config_params(void *hci_sm,
+ struct bt_rap_le_cs_config *config);
+bool bt_rap_get_cs_freq_params(void *hci_sm,
+ struct bt_rap_le_cs_frequency *frequency);
+bool bt_rap_get_default_settings_params(void *hci_sm,
+ struct bt_rap_le_cs_default_settings *s);
+/* Distance measurement control */
+bool bt_rap_start_measurement(void *hci_sm, uint16_t conn_handle,
+ uint32_t duration_secs);
+bool bt_rap_stop_measurement(void *hci_sm);
+
/* HCI Raw Channel Approach */
void bt_rap_hci_cs_config_complete_callback(uint16_t length,
- const void *param,
- void *user_data);
+ const void *param,
+ void *user_data);
void bt_rap_hci_cs_sec_enable_complete_callback(uint16_t length,
- const void *param,
- void *user_data);
+ const void *param,
+ void *user_data);
void bt_rap_hci_cs_procedure_enable_complete_callback(uint16_t length,
- const void *param,
- void *user_data);
+ const void *param,
+ void *user_data);
void bt_rap_hci_cs_subevent_result_callback(uint16_t length,
- const void *param,
- void *user_data);
+ const void *param,
+ void *user_data);
void bt_rap_hci_cs_subevent_result_cont_callback(uint16_t length,
- const void *param,
- void *user_data);
+ const void *param,
+ void *user_data);
void *bt_rap_attach_hci(struct bt_rap *rap, struct bt_hci *hci,
uint8_t role, uint8_t cs_sync_ant_sel,
@@ -220,3 +237,11 @@ bool bt_rap_set_conn_hndl(void *hci_sm,
bool is_central);
void bt_rap_clear_conn_handle(void *hci_sm, uint16_t handle);
+
+bool bt_rap_is_procedure_active(void *hci_sm);
+
+void bt_rap_set_timeout_cb(void *hci_sm, void (*func)(void *),
+ void *user_data);
+
+void bt_rap_set_proc_active_cb(void *hci_sm, void (*func)(bool, void *),
+ void *user_data);
--
next prev parent reply other threads:[~2026-07-06 16:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 16:15 [PATCH BlueZ v1 0/5] Add D-Bus and bluetoothctl support for Channel Sounding control Naga Bhavani Akella
2026-07-06 16:15 ` Naga Bhavani Akella [this message]
2026-07-06 17:05 ` bluez.test.bot
2026-07-06 16:16 ` [PATCH BlueZ v1 2/5] src: Register GATT profiles for Channel Sounding reflector Naga Bhavani Akella
2026-07-06 16:16 ` [PATCH BlueZ v1 3/5] doc/org.bluez.ChannelSounding1: Add Used by reference and Examples Naga Bhavani Akella
2026-07-06 20:36 ` Luiz Augusto von Dentz
2026-07-07 7:34 ` Naga Bhavani Akella
2026-07-07 14:43 ` Luiz Augusto von Dentz
2026-07-08 8:52 ` Naga Bhavani Akella
2026-07-08 13:47 ` Luiz Augusto von Dentz
2026-07-06 16:16 ` [PATCH BlueZ v1 4/5] profiles: Add D-Bus Channel Sounding control API Naga Bhavani Akella
2026-07-06 16:16 ` [PATCH BlueZ v1 5/5] client: Add Channel Sounding shell submenu Naga Bhavani Akella
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260706161603.2744459-2-naga.akella@oss.qualcomm.com \
--to=naga.akella@oss.qualcomm.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=quic_anubhavg@quicinc.com \
--cc=quic_hbandi@quicinc.com \
--cc=quic_mohamull@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox