Linux bluetooth development
 help / color / mirror / Atom feed
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 3/6] rap: remove CS default settings from main.conf
Date: Tue, 30 Jun 2026 15:41:55 +0530	[thread overview]
Message-ID: <20260630101158.2239682-4-naga.akella@oss.qualcomm.com> (raw)
In-Reply-To: <20260630101158.2239682-1-naga.akella@oss.qualcomm.com>

role, cs_sync_ant_sel and max_tx_power were configurable in main.conf
and parsed in main.c, but these are per-measurement parameters that
callers supply via StartMeasurement
---
 src/btd.h     |   7 ---
 src/main.c    | 127 +-------------------------------------------------
 src/main.conf |  24 ----------
 3 files changed, 1 insertion(+), 157 deletions(-)

diff --git a/src/btd.h b/src/btd.h
index db2e81239..c84a600d1 100644
--- a/src/btd.h
+++ b/src/btd.h
@@ -94,18 +94,11 @@ struct btd_le_defaults {
 	uint8_t		enable_advmon_interleave_scan;
 };
 
-struct btd_le_bcs {
-	uint8_t role;
-	uint8_t cs_sync_ant_sel;
-	int8_t max_tx_power;
-};
-
 struct btd_defaults {
 	uint16_t	num_entries;
 
 	struct btd_br_defaults br;
 	struct btd_le_defaults le;
-	struct btd_le_bcs bcs;
 };
 
 struct btd_csis {
diff --git a/src/main.c b/src/main.c
index 8aa19a3e3..53f3f784f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -156,12 +156,6 @@ static const char *gatt_options[] = {
 	NULL
 };
 
-static const char *const bcs_options[] = {
-	"Role",
-	"CsSyncAntennaSel",
-	"MaxTxPower",
-	NULL
-};
 
 static const char *csip_options[] = {
 	"SIRK",
@@ -200,7 +194,7 @@ static const struct group_table {
 	{ "CSIS",	csip_options },
 	{ "AVDTP",	avdtp_options },
 	{ "AVRCP",	avrcp_options },
-	{ "ChannelSounding",	bcs_options },
+
 	{ "AdvMon",	advmon_options },
 	{ }
 };
@@ -496,46 +490,6 @@ static bool parse_config_int(GKeyFile *config, const char *group,
 	return true;
 }
 
-static bool parse_config_signed_int(GKeyFile *config, const char *group,
-					const char *key, int8_t *val,
-					long min, long max)
-{
-	char *str = NULL;
-	char *endptr = NULL;
-	long tmp;
-	bool result = false;
-
-	str = g_key_file_get_string(config, group, key, NULL);
-	if (!str)
-		return false;
-
-	tmp = strtol(str, &endptr, 0);
-	if (!endptr || *endptr != '\0') {
-		warn("%s.%s = %s is not integer", group, key, str);
-		goto cleanup;
-	}
-
-	if (tmp < min) {
-		warn("%s.%s = %ld is out of range (< %ld)", group, key, tmp,
-			min);
-		goto cleanup;
-	}
-
-	if (tmp > max) {
-		warn("%s.%s = %ld is out of range (> %ld)", group, key, tmp,
-									max);
-		goto cleanup;
-	}
-
-	if (val)
-		*val = (int8_t) tmp;
-	result = true;
-
-cleanup:
-	g_free(str);
-	return result;
-}
-
 struct config_param {
 	const char * const val_name;
 	void * const val;
@@ -1228,80 +1182,6 @@ static void parse_csis(GKeyFile *config)
 					0, UINT8_MAX);
 }
 
-static bool parse_cs_role(GKeyFile *config, const char *group,
-					const char *key, uint8_t *val)
-{
-	GError *err = NULL;
-	char *str = NULL;
-	char *endptr = NULL;
-	int numeric_val;
-
-	/* Try to read as string first */
-	str = g_key_file_get_string(config, group, key, &err);
-	if (err) {
-		if (err->code != G_KEY_FILE_ERROR_KEY_NOT_FOUND)
-			DBG("%s", err->message);
-		g_error_free(err);
-		return false;
-	}
-
-	DBG("%s.%s = %s", group, key, str);
-
-	/* Check if it's a string value */
-	if (!strcmp(str, "Initiator") || !strcmp(str, "initiator")) {
-		if (val)
-			*val = 1;
-		g_free(str);
-		return true;
-	} else if (!strcmp(str, "Reflector") || !strcmp(str, "reflector")) {
-		if (val)
-			*val = 2;
-		g_free(str);
-		return true;
-	} else if (!strcmp(str, "Both") || !strcmp(str, "both")) {
-		if (val)
-			*val = 3;
-		g_free(str);
-		return true;
-	}
-
-	/* Try to parse as numeric value */
-	numeric_val = strtol(str, &endptr, 0);
-
-	if (!endptr || *endptr != '\0') {
-		warn("%s.%s = %s is not a valid value. "
-			"Expected: 1/Initiator, 2/Reflector, or 3/Both",
-			group, key, str);
-		g_free(str);
-		return false;
-	}
-
-	if (numeric_val < 1 || numeric_val > 3) {
-		warn("%s.%s = %d is out of range. "
-			"Valid values: 1 (Initiator), 2 (Reflector), 3 (Both)",
-			group, key, numeric_val);
-		g_free(str);
-		return false;
-	}
-
-	if (val)
-		*val = numeric_val;
-
-	g_free(str);
-	return true;
-}
-
-static void parse_le_cs_config(GKeyFile *config)
-{
-	parse_cs_role(config, "ChannelSounding", "Role",
-			&btd_opts.defaults.bcs.role);
-	parse_config_u8(config, "ChannelSounding", "CsSyncAntennaSel",
-			&btd_opts.defaults.bcs.cs_sync_ant_sel,
-			0x01, 0xFF);
-	parse_config_signed_int(config, "ChannelSounding",
-			"MaxTxPower", &btd_opts.defaults.bcs.max_tx_power,
-			INT8_MIN, INT8_MAX);
-}
 
 static void parse_avdtp_session_mode(GKeyFile *config)
 {
@@ -1381,7 +1261,6 @@ static void parse_config(GKeyFile *config)
 	parse_csis(config);
 	parse_avdtp(config);
 	parse_avrcp(config);
-	parse_le_cs_config(config);
 	parse_advmon(config);
 }
 
@@ -1433,10 +1312,6 @@ static void init_defaults(void)
 
 	btd_opts.advmon.rssi_sampling_period = 0xFF;
 	btd_opts.csis.encrypt = true;
-
-	btd_opts.defaults.bcs.role = 0x03;
-	btd_opts.defaults.bcs.cs_sync_ant_sel = 0xFF;
-	btd_opts.defaults.bcs.max_tx_power = 0x14;
 }
 
 static void log_handler(const gchar *log_domain, GLogLevelFlags log_level,
diff --git a/src/main.conf b/src/main.conf
index 5846ef92d..d31dd1b8f 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -299,30 +299,6 @@
 # Default = auto
 # Security = auto
 
-[ChannelSounding]
-# Current role of the device
-# Possible values:
-#   1 or "Initiator" - CS Initiator role,
-#   Generally, CS Initiator acts as Client (Gatt role) and Central (Gap role)
-#   2 or "Reflector" - CS Reflector role,
-#   Generally, CS Reflector acts as Server (Gatt role) and Peripheral (Gap role)
-#   3 or "Both"      - Both Initiator and Reflector roles
-# Default: 3 (Both)
-#Role = 3
-
-# Antenna Identifier to be used
-# Possible values:
-# 0x01-0x04 (antenna identifier to be used),
-# 0xFE - Antennas to be used in repetitive order,
-# 0xFF - Host doesn't have recommendation
-# Default: 0xFF (Host doesn't have recommendation)
-#CsSyncAntennaSel = 0xFF
-
-# Maximum Transmit power
-# Possible values: 0x81-0x14 (-127dBm to 20dBm)
-# Default: 0x14 (Max Power possible)
-#MaxTxPower = 0x14
-
 [CSIS]
 # SIRK - Set Identification Resolution Key which is common for all the
 # sets. They SIRK key is used to identify its sets. This can be any
-- 


  parent reply	other threads:[~2026-06-30 10:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30 10:11 [PATCH BlueZ v1 0/6] RAP: Move CS default settings Naga Bhavani Akella
2026-06-30 10:11 ` [PATCH BlueZ v1 1/6] shared: remove default settings params from bt_rap_attach_hci Naga Bhavani Akella
2026-06-30 12:20   ` RAP: Move CS default settings bluez.test.bot
2026-06-30 10:11 ` [PATCH BlueZ v1 2/6] profiles: update bt_rap_attach_hci call to drop default settings args Naga Bhavani Akella
2026-06-30 10:11 ` Naga Bhavani Akella [this message]
2026-06-30 10:11 ` [PATCH BlueZ v1 4/6] shared: replace the wrapper API Naga Bhavani Akella
2026-06-30 10:11 ` [PATCH BlueZ v1 5/6] profiles: replace " Naga Bhavani Akella
2026-06-30 10:11 ` [PATCH BlueZ v1 6/6] shared: remove " 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=20260630101158.2239682-4-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