Linux bluetooth development
 help / color / mirror / Atom feed
From: Sebastian <seb.witt@googlemail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Sebastian <seb.witt@googlemail.com>,
	"Claude Opus 5.5" <noreply@anthropic.com>
Subject: [PATCH v2 2/4] main.conf: Add LongReportMap option to [Input]
Date: Mon, 30 Nov 2026 21:45:54 +0100	[thread overview]
Message-ID: <20261130204556.357834-3-seb.witt@googlemail.com> (raw)
In-Reply-To: <20261130204556.357834-1-seb.witt@googlemail.com>

Add an option to accept HID over GATT Report Maps longer than the 512
octets an attribute value may have, as exposed by some non-compliant
devices. It defaults to true, as other operating systems accept them,
or to false when Testing is enabled so the limit is enforced for
qualification.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---
 src/btd.h     |  5 +++++
 src/main.c    | 20 ++++++++++++++++++++
 src/main.conf |  7 +++++++
 3 files changed, 32 insertions(+)

diff --git a/src/btd.h b/src/btd.h
index 9bf310271..378c567c3 100644
--- a/src/btd.h
+++ b/src/btd.h
@@ -126,6 +126,10 @@ struct btd_avrcp_opts {
 	bool		volume_category;
 };
 
+struct btd_input_opts {
+	bool		long_report_map;
+};
+
 struct btd_advmon_opts {
 	uint8_t		rssi_sampling_period;
 };
@@ -172,6 +176,7 @@ struct btd_opts {
 
 	struct btd_avdtp_opts avdtp;
 	struct btd_avrcp_opts avrcp;
+	struct btd_input_opts input;
 
 	uint8_t		key_size;
 
diff --git a/src/main.c b/src/main.c
index 3a051c5a4..888fe42f6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -185,6 +185,11 @@ static const char *avrcp_options[] = {
 	NULL
 };
 
+static const char *input_options[] = {
+	"LongReportMap",
+	NULL
+};
+
 static const char *advmon_options[] = {
 	"RSSISamplingPeriod",
 	NULL
@@ -210,6 +215,7 @@ static const struct group_table {
 	{ "CSIS",	csip_options },
 	{ "AVDTP",	avdtp_options },
 	{ "AVRCP",	avrcp_options },
+	{ "Input",	input_options },
 	{ "ChannelSounding",	bcs_options },
 	{ "AdvMon",	advmon_options },
 	{ "HDT",	hdt_options },
@@ -1400,6 +1406,17 @@ static void parse_avrcp(GKeyFile *config)
 		&btd_opts.avrcp.volume_category);
 }
 
+static void parse_input(GKeyFile *config)
+{
+	/* Cap the Report Map to 512 octets by default when testing, e.g.
+	 * for qualification.
+	 */
+	btd_opts.input.long_report_map = !btd_opts.testing;
+
+	parse_config_bool(config, "Input", "LongReportMap",
+				&btd_opts.input.long_report_map);
+}
+
 static void parse_advmon(GKeyFile *config)
 {
 	parse_config_u8(config, "AdvMon", "RSSISamplingPeriod",
@@ -1457,6 +1474,7 @@ static void parse_config(GKeyFile *config)
 	parse_csis(config);
 	parse_avdtp(config);
 	parse_avrcp(config);
+	parse_input(config);
 	parse_le_cs_config(config);
 	parse_advmon(config);
 	parse_hdt(config);
@@ -1514,6 +1532,8 @@ static void init_defaults(void)
 	btd_opts.avrcp.volume_without_target = false;
 	btd_opts.avrcp.volume_category = true;
 
+	btd_opts.input.long_report_map = true;
+
 	btd_opts.advmon.rssi_sampling_period = 0xFF;
 	btd_opts.csis.encrypt = true;
 
diff --git a/src/main.conf b/src/main.conf
index c9906148d..451a5281f 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -419,6 +419,13 @@
 # notifications.
 #VolumeCategory = true
 
+[Input]
+# Accept HID over GATT Report Maps longer than the 512 octets an attribute
+# value may have, as exposed by some non-compliant devices, which other
+# operating systems accept as well.
+# Defaults to true, or false when Testing is enabled.
+#LongReportMap = true
+
 [Policy]
 #
 # The ReconnectUUIDs defines the set of remote services that should try
-- 
2.56.1


  parent reply	other threads:[~2026-11-30 20:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CABBYNZ+GNO-eVNC5B_4SqCdHOE+OHmXUaW0NwStd_BsbUzx35A@mail.gmail.com>
2026-11-30 20:45 ` [PATCH v2 0/4] Accept HoG Report Map longer than 512 octets Sebastian
2026-11-30 20:45   ` [PATCH v2 1/4] shared/gatt-client: Add bt_gatt_client_read_long_value_max_len Sebastian
2026-11-30 20:45   ` Sebastian [this message]
2026-11-30 20:45   ` [PATCH v2 3/4] shared/hog: Add bt_hog_set_long_report_map Sebastian
2026-11-30 20:45   ` [PATCH v2 4/4] input/hog: Accept Report Map longer than 512 octets Sebastian

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=20261130204556.357834-3-seb.witt@googlemail.com \
    --to=seb.witt@googlemail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=noreply@anthropic.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