Re: Continuing the Xbox One Bluetooth controller debugging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Wed, Nov 30, 2016 at 11:42 AM, Anthony Bourguignon
<contact@xxxxxxxxxx> wrote:
> Le mardi 29 novembre 2016 à 20:51 -0800, Cameron Gutman a écrit :
>> Hi,
>>
>> I'm interesting in continuing the debugging of the Xbox One S
>> controller's issues with the BlueZ stack (original report [0]).
>> I confirmed the issue still affects v4.9-rc7. I've also tried
>> Vinicius's patch from [1] applied on v4.9-rc7 without success.
>>
>> The controller is updated with the latest firmware and connects
>> reliably to (at least) macOS Sierra, Windows 10 14393, Android
>> 6.0.1, 7.0, and 7.1.1 (including devices using 3.10 and 3.18
>> based kernels).
>>
>> I'm happy to collect logs, test other patches, etc.
>
> Steam has made a patch referencing the xbox one S controller :
> https://github.com/ValveSoftware/steamlink-sdk/commit/d6afa93787217033a0f0f5db5f557b252c36260e#diff-
> 45ba5a41f43606276c9bf9018eed43c2
>
> You should check this.

That is a big hammer, instead I was thinking in just ignoring the
Unknown option since basic mode is default, so please check with the
following patch.

-- 
Luiz Augusto von Dentz
From c7e471a082d6fc3cbff42f6e194f64d791a9b1c5 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
Date: Wed, 30 Nov 2016 16:45:13 +0200
Subject: [PATCH] Bluetooth: L2CAP: Ignore Unknown option error for basic mode

Some devices send Unknown option in case it only support basic mode
which will cause the channel the be disconnect, so instead the code
now just check if the Unknown option is RFC and the channel mode is
basic and ignore the error.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
---
 net/bluetooth/l2cap_core.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 74abc53..c0ddace 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -4206,6 +4206,17 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn,
 			if (result != L2CAP_CONF_SUCCESS)
 				goto done;
 			break;
+	}
+
+	case L2CAP_CONF_UNKNOWN:
+		/* Ignore unkwown option for RFC in case of basic mode as it
+		 * is considered the default mode:
+		 * BLUETOOTH SPECIFICATION Version 4.2 [Vol 3, Part A] page 96:
+		 * The Basic L2CAP mode is the default.
+		 */
+		if (rsp->data == L2CAP_CONF_RFC &&
+		    chan->mode == L2CAP_MODE_BASIC) {
+			break;
 		}
 
 	default:
-- 
2.9.3


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux