Linux bluetooth development
 help / color / mirror / Atom feed
From: Simon Mikuda <simon.mikuda@streamunlimited.com>
To: linux-bluetooth@vger.kernel.org
Cc: Simon Mikuda <simon.mikuda@streamunlimited.com>,
	Marcel Holtmann <marcel@holtmann.org>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Subject: [PATCH] Bluetooth: lib: Map Connection Failed to be Established to ETIMEDOUT
Date: Sun, 22 Nov 2026 21:09:47 +0100	[thread overview]
Message-ID: <20261122200947.2780757-1-simon.mikuda@streamunlimited.com> (raw)

Connection Failed to be Established / Synchronization Timeout (0x3e) is
not handled by bt_to_errno() so it is reported to userspace as ENOSYS.

It is the error the controller uses when the first packets of an LE
connection or CIS are not received, and when it cannot synchronize to
a periodic advertising train or BIG in time, i.e. a timeout, so map it
to ETIMEDOUT like Connection Timeout (0x08).

This changes what userspace sees: connect() on an L2CAP LE or ISO (CIS)
socket that fails with 0x3e now reports ETIMEDOUT instead of ENOSYS.
BlueZ iso-tester "ISO Connect - Reject" expects ENOSYS for this case
and needs "iso-tester: Accept ETIMEDOUT for Connection Failed to be
Established" to pass.

Signed-off-by: Simon Mikuda <simon.mikuda@streamunlimited.com>
---
 net/bluetooth/lib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/bluetooth/lib.c b/net/bluetooth/lib.c
index cea21a4c49a0..0f84c397891a 100644
--- a/net/bluetooth/lib.c
+++ b/net/bluetooth/lib.c
@@ -89,6 +89,7 @@ int bt_to_errno(__u16 code)
 		return ENOMEM;
 
 	case 0x08:
+	case 0x3e:
 		return ETIMEDOUT;
 
 	case 0x09:

base-commit: 4fe38719e6738feaa90486e36b0790dd5d960a96
-- 
2.43.0


             reply	other threads:[~2026-11-22 20:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22 20:09 Simon Mikuda [this message]
2026-11-22 22:55 ` Bluetooth: lib: Map Connection Failed to be Established to ETIMEDOUT bluez.test.bot

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=20261122200947.2780757-1-simon.mikuda@streamunlimited.com \
    --to=simon.mikuda@streamunlimited.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.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