From patchwork Wed Nov 30 14:54:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 85881 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp262190qgi; Wed, 30 Nov 2016 06:54:27 -0800 (PST) X-Received: by 10.98.16.132 with SMTP id 4mr34052453pfq.163.1480517667296; Wed, 30 Nov 2016 06:54:27 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31si36262690pli.203.2016.11.30.06.54.27 for ; Wed, 30 Nov 2016 06:54:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932331AbcK3OyW (ORCPT ); Wed, 30 Nov 2016 09:54:22 -0500 Received: from mail-lf0-f44.google.com ([209.85.215.44]:34308 "EHLO mail-lf0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932242AbcK3OyV (ORCPT ); Wed, 30 Nov 2016 09:54:21 -0500 Received: by mail-lf0-f44.google.com with SMTP id o141so148463553lff.1 for ; Wed, 30 Nov 2016 06:54:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6O5ZO4y9CIvoDtLc0QFduQJojrsNwM0l2W3n5rjqKEs=; b=xuUCITE8hHjZnPKmck0AMyR21q007Jyr+f5rqApI5In5ocXpVrnlJsU2iLErKTlihX +0OCF2y7eolXoG9FaynITHIwCGTgFL/RfQH8FL/kBttdggvSAoOfYAvaj6bE5ibY/QjJ F1QDzDGg3w5k3Rc2p6TfrS9VTbWvJEIJoB3NMilXMd3yw/2YU4sNAUZgeqt+Sck3VVP9 Bm4tN+d74NugqnnPxvik4iafnT+8nzKHrGyBQQru7bdkodRoLt6OrQtyYFlMLHwv+ZVu y58HV+7dxd90a00srLgyc/EO9kRg2RPEUnCGU0If57CwcdUTMeD2WA+8XQonnYijTj11 0vcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6O5ZO4y9CIvoDtLc0QFduQJojrsNwM0l2W3n5rjqKEs=; b=JzVvAinPWHbFudeaiYd6ObxyLLsfEn4WuRW+cPj8fmhl9huyEY94WV/QfsYlUP287m YExD/RsLUf4VThPEaf3nAf1IstPoD7MkXsYHFogpmfIyfBfeiXROxOlFuUVt0ucVG0Es XIlVbRBBuMUGJBSXpcjw4RpkeVTS8omGbnZM0ZGONAPt3zK2qqktjdhN6tRzgqav6fOy VSyr6SyEztFPkz4U73xwXyaLnq8rb97EPYK1Nea2QJWsfYlfOHBE9uUrzo80AU/O5oeB CDXqcOeCRGfPrIWqlaSjI4YZJTomV/k0DptQfcLpm+dXushLiUBn0QAd/MdHO34jz3c4 Zf+A== X-Gm-Message-State: AKaTC03GBwDWsMauR5XDWoAWGQmElpn5v4M+BjsrjtIpUYAahdYYjSMkyLyyHAxTSKFb782BRv2D1b0uSp4lMQ== X-Received: by 10.25.208.13 with SMTP id h13mr5418937lfg.66.1480517659452; Wed, 30 Nov 2016 06:54:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.26.148 with HTTP; Wed, 30 Nov 2016 06:54:18 -0800 (PST) In-Reply-To: <1480498971.2363.1.camel@toniob.net> References: <1480481503.2256.4.camel@gmail.com> <1480498971.2363.1.camel@toniob.net> From: Luiz Augusto von Dentz Date: Wed, 30 Nov 2016 16:54:18 +0200 Message-ID: Subject: Re: Continuing the Xbox One Bluetooth controller debugging To: Anthony Bourguignon Cc: Cameron Gutman , "linux-bluetooth@vger.kernel.org" , Vinicius Costa Gomes Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi, On Wed, Nov 30, 2016 at 11:42 AM, Anthony Bourguignon 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 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 --- 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