Linux bluetooth development
 help / color / mirror / Atom feed
From: raghu447 <raghavendra.rao@collabora.com>
To: linux-bluetooth@vger.kernel.org
Cc: raghavendra <raghavendra.rao@collabora.com>
Subject: [BlueZ PATCH 3/3] shared/mcp: Notify unsupported RFU opcodes
Date: Mon, 31 Aug 2026 11:41:44 +0530	[thread overview]
Message-ID: <20260831061144.7767-4-raghavendra.rao@collabora.com> (raw)
In-Reply-To: <20260831061144.7767-1-raghavendra.rao@collabora.com>

From: raghavendra <raghavendra.rao@collabora.com>

This is needed to Pass PTS GMCS/SR/SPE/BI-01-C test.
---
 src/shared/mcp.c |  4 +++-
 unit/test-mcp.c  | 14 ++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/shared/mcp.c b/src/shared/mcp.c
index a954869b0..583ae40dc 100644
--- a/src/shared/mcp.c
+++ b/src/shared/mcp.c
@@ -324,6 +324,7 @@ static void write_media_cp(struct gatt_db_attribute *attrib,
 	int ret = 0;
 	int32_t arg = 0;
 	uint8_t op;
+	bool rfu_op = false;
 	bool ok = false;
 
 	if (offset) {
@@ -337,6 +338,7 @@ static void write_media_cp(struct gatt_db_attribute *attrib,
 	}
 
 	rsp.op = op;
+	rfu_op = !op;
 
 	cmd = mcs_get_command(op);
 	if (!cmd || !(cmd->support & mcs_get_supported(mcs))) {
@@ -370,7 +372,7 @@ respond:
 							ret, rsp.result);
 
 	gatt_db_attribute_write_result(attrib, id, ret);
-	if (!rsp.op)
+	if (!rsp.op && !rfu_op)
 		return;
 
 	/* Make state transition immediately if command was successful and has
diff --git a/unit/test-mcp.c b/unit/test-mcp.c
index 6331c6c99..21997915d 100644
--- a/unit/test-mcp.c
+++ b/unit/test-mcp.c
@@ -2057,6 +2057,19 @@ static void testgroup_sr_mcp(void)
 }
 
 
+#define GMCS_SR_SPE_BI_01_C \
+	WRITE_NORESP_CHRC(CP, 0x00), \
+	NOTIFY_CHRC(CP, 0x00, 0x02 /* not supp */)
+
+static void testgroup_sr_spe(void)
+{
+	define_test("GMCS/SR/SPE/BI-01-C [Media Control Point - Opcode not "
+							"Supported]",
+		test_setup_server, test_server,
+		&cfg_sggit_gmcs, GMCS_SR_SPE_BI_01_C);
+}
+
+
 static void sr_spn_value(struct test_data *data, struct iovec *buf, size_t size,
 								uint16_t uuid)
 {
@@ -2132,6 +2145,7 @@ int main(int argc, char *argv[])
 	testgroup_cl_extra();
 	testgroup_sr_sggit();
 	testgroup_sr_mcp();
+	testgroup_sr_spe();
 	testgroup_sr_spn();
 
 	return tester_run();

  parent reply	other threads:[~2026-08-31  6:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31  6:11 [BlueZ PATCH 0/3] Add MCS fast seek and track position write raghu447
2026-08-31  6:11 ` [BlueZ PATCH 1/3] profiles/audio: Support MCS fast seeking raghu447
2026-09-02 15:31   ` Luiz Augusto von Dentz
2026-08-31  6:11 ` [BlueZ PATCH 2/3] profiles/audio: Support MCS track position writes raghu447
2026-09-02 15:35   ` Luiz Augusto von Dentz
2026-09-03  8:19     ` Bastien Nocera
2026-09-04 16:53       ` [PATCH 0/4] Add MCS fast seek and track position write support raghu447
2026-09-04 16:53         ` [PATCH 1/4] profiles/audio: Support MCS track position writes raghu447
2026-09-04 17:51           ` Add MCS fast seek and track position write support bluez.test.bot
2026-09-04 16:53         ` [PATCH 2/4] profiles/audio: Support MCS fast seeking raghu447
2026-09-04 16:53         ` [PATCH 3/4] shared/mcp: Notify unsupported RFU opcodes raghu447
2026-09-04 16:53         ` [PATCH 4/4] unit/test-mcp: Test unsupported RFU opcode raghu447
2026-09-04 20:20         ` [PATCH 0/4] Add MCS fast seek and track position write support patchwork-bot+bluetooth
2026-08-31  6:11 ` raghu447 [this message]
2026-09-02 15:36   ` [BlueZ PATCH 3/3] shared/mcp: Notify unsupported RFU opcodes Luiz Augusto von Dentz

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=20260831061144.7767-4-raghavendra.rao@collabora.com \
    --to=raghavendra.rao@collabora.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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