From patchwork Thu Apr 23 14:43:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alain Michaud X-Patchwork-Id: 197083 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28826C54FCB for ; Thu, 23 Apr 2020 14:43:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 021CB20781 for ; Thu, 23 Apr 2020 14:43:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="gwyEd2TG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728190AbgDWOnk (ORCPT ); Thu, 23 Apr 2020 10:43:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726380AbgDWOnk (ORCPT ); Thu, 23 Apr 2020 10:43:40 -0400 Received: from mail-ua1-x944.google.com (mail-ua1-x944.google.com [IPv6:2607:f8b0:4864:20::944]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2070EC08E934 for ; Thu, 23 Apr 2020 07:43:40 -0700 (PDT) Received: by mail-ua1-x944.google.com with SMTP id 36so1822220uaf.9 for ; Thu, 23 Apr 2020 07:43:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MRgEfFWldJ+nbPjKrWVW/UCyBRIS5F0risTypuqjZbc=; b=gwyEd2TGkygP5ZI9Mw4tjYV5V1JxsI4x1VuWS8xPhOkkyku/DAFlzUqQoLrQCgd52P qvSyXpjMg7vT2II8tQ8xO+1rBw/I2oORPzN/3Q2epEsL8Zg/bILleJl7tuW8cHcStA6z Tdqbu0Hf5kdaYPjDDy4wV/wfnW2OZRej78C74= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MRgEfFWldJ+nbPjKrWVW/UCyBRIS5F0risTypuqjZbc=; b=dzLRcHrs8oeI/yg1gYaB4T2VBgnteH3DGNMaD1quMUUMsk/j3iu0Wy0WBlkgpJEysN GHvpDfneEPHW57NRzG4kBYGSOOwe3+qiX9nbRWwcgnKXlLXZzguCGUYtgZtJDwLHmQqx Ck8TAfsxWWsLOyMBc6aH3yP9nN30/iXjkEpy3hJGVRzlo6KLZZBr9chXFMUILgBODpqt 11w+s5Psfg6s2h6pFkwvJpJ1Vxx2vTB+MA6eVsxZebQr1UnKWoWrGKbXx8vhnqugKlVQ 8Hx4cJ+733aVuJtkmestdNXtenZH+PWFJQonR6NabBe20B8Is7ucsh727nHnnlvvl9q1 4niw== X-Gm-Message-State: AGi0PuYdW/XXc+GZmLcgKkItPG8YeHlBvk3sPhcW+rCSvtfFiwTDxIge 46Fbw7YlsXWhRcsIZIYPGmtXL5zvKnw= X-Google-Smtp-Source: APiQypLBtVRBs3350Zidyzog6HLIDcHd1Ww8twCeVhSReJRESu4V1eWu2L5nxPlW/x6F6IWw8NEkuw== X-Received: by 2002:a67:ff8d:: with SMTP id v13mr3484101vsq.71.1587653019057; Thu, 23 Apr 2020 07:43:39 -0700 (PDT) Received: from alain.c.googlers.com.com (161.138.243.35.bc.googleusercontent.com. [35.243.138.161]) by smtp.gmail.com with ESMTPSA id d83sm762107vka.34.2020.04.23.07.43.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2020 07:43:38 -0700 (PDT) From: Alain Michaud To: linux-bluetooth@vger.kernel.org Cc: Alain Michaud Subject: [PATCH v3 1/3] bluetooth:Adding driver and quirk defs for multi-role LE Date: Thu, 23 Apr 2020 14:43:27 +0000 Message-Id: <20200423144328.82478-2-alainm@chromium.org> X-Mailer: git-send-email 2.26.1.301.g55bc3eb7cb9-goog In-Reply-To: <20200423144328.82478-1-alainm@chromium.org> References: <20200423144328.82478-1-alainm@chromium.org> MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This change adds the relevant driver and quirk to allow drivers to report the le_states as being trustworthy. This has historically been disabled as controllers did not reliably support this. In particular, this will be used to relax this condition for controllers that have been well tested and reliable. /* Most controller will fail if we try to create new connections * while we have an existing one in slave role. */ if (hdev->conn_hash.le_num_slave > 0) return NULL; Signed-off-by: Alain Michaud --- drivers/bluetooth/btusb.c | 2 +- include/net/bluetooth/hci.h | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 3bdec42c9612..dd27e28d4601 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -58,7 +58,7 @@ static struct usb_driver btusb_driver; #define BTUSB_CW6622 0x100000 #define BTUSB_MEDIATEK 0x200000 #define BTUSB_WIDEBAND_SPEECH 0x400000 - +#define BTUSB_VALID_LE_STATES 0x800000 static const struct usb_device_id btusb_table[] = { /* Generic Bluetooth USB device */ { USB_DEVICE_INFO(0xe0, 0x01, 0x01) }, diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 5f60e135aeb6..25c2e5ee81dc 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h @@ -214,6 +214,15 @@ enum { * This quirk must be set before hci_register_dev is called. */ HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, + + /* When this quirk is set, the controller has validated that + * LE states reported through the HCI_LE_READ_SUPPORTED_STATES are + * valid. This mechanism is necessary as many controllers have + * been seen has having trouble initiating a connectable + * advertisement despite the state combination being reported as + * supported. + */ + HCI_QUIRK_VALID_LE_STATES, }; /* HCI device flags */ From patchwork Thu Apr 23 14:43:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alain Michaud X-Patchwork-Id: 197082 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A08B1C54FCB for ; Thu, 23 Apr 2020 14:43:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7CAD120857 for ; Thu, 23 Apr 2020 14:43:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="e0YXc6jk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728297AbgDWOn4 (ORCPT ); Thu, 23 Apr 2020 10:43:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726380AbgDWOnz (ORCPT ); Thu, 23 Apr 2020 10:43:55 -0400 Received: from mail-ua1-x942.google.com (mail-ua1-x942.google.com [IPv6:2607:f8b0:4864:20::942]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC70AC08E934 for ; Thu, 23 Apr 2020 07:43:54 -0700 (PDT) Received: by mail-ua1-x942.google.com with SMTP id c17so5884784uae.12 for ; Thu, 23 Apr 2020 07:43:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KGjHlHj2yLZ30uJ1TR1oOXoayTLW/J80Sb28kEteyy8=; b=e0YXc6jk4BECICTBKHOujB3/h2gy6FK1YB9/i5hoLOBXzDnjJWx+1bHUufDBDwBLHN oQyVXr2uB83EjqvXhjT4zxGI1vwpIzYXdwlnJMcm4tVHdhTBKwOlX2O8ndU81/4Bw8IY fG1t2DPcXi0HVtPHmbnFtY8HLinIjqrEU2OZU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KGjHlHj2yLZ30uJ1TR1oOXoayTLW/J80Sb28kEteyy8=; b=XbMpgoh9/WEoyD/G/mEg8aQeLJdtdYdbeQifeCjxeoU2E1AetjuNiX/M6ANt1pWPlE 2LGYf97fRr2itGiWsYgoeDRYEOlgL1A1WCKjWfOj6uMViD8dPw5avD97uoIqPTkEY84b nGhdVPaDJx6Txuvy2TfKvX0A2fr+b+pULopkpmwU6EFocWMxmw3VU8Nq1OFk9yjxm2oX NDn7elUH8nMrE2rD/mUfLG98ZtE5E9i0rpP9o+vSmRY0QGvOsvQuvGNriNEwKBk+NQAL gn43ycan2Pf7qS38RJr0ccoVPZNG0R4m+lnfFIb2kZBBakmGwPFOZXkYrLJ3c5KxpAMu /JLA== X-Gm-Message-State: AGi0Pua7Oxulu8hnkBsO8Gv9MndQVxVOJSL7zOUJ9TJYmwYYhfcx0nKW aUhaboi3l+OVuADErivcJbDnMrAQ8lQ= X-Google-Smtp-Source: APiQypLC6nXVkzMgxPJeFkuR51s4MJewdxEKy56D0OznkAs6Sv3D3dACwCKEj/20TlXA6fEnA1AvuQ== X-Received: by 2002:a05:6102:4d:: with SMTP id k13mr3488005vsp.198.1587653033644; Thu, 23 Apr 2020 07:43:53 -0700 (PDT) Received: from alain.c.googlers.com.com (161.138.243.35.bc.googleusercontent.com. [35.243.138.161]) by smtp.gmail.com with ESMTPSA id d83sm762107vka.34.2020.04.23.07.43.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2020 07:43:53 -0700 (PDT) From: Alain Michaud To: linux-bluetooth@vger.kernel.org Cc: Alain Michaud Subject: [PATCH v3 3/3] bluetooth:btusb: Adding support for LE scatternet to Jfp and ThP Date: Thu, 23 Apr 2020 14:43:31 +0000 Message-Id: <20200423144328.82478-4-alainm@chromium.org> X-Mailer: git-send-email 2.26.1.301.g55bc3eb7cb9-goog In-Reply-To: <20200423144328.82478-1-alainm@chromium.org> References: <20200423144328.82478-1-alainm@chromium.org> MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This change adds support for LE scatternet connections to Intel's JfP and ThP controllers. Signed-off-by: Alain Michaud --- drivers/bluetooth/btusb.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index dd27e28d4601..d801c332b85a 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -335,7 +335,8 @@ static const struct usb_device_id blacklist_table[] = { /* Intel Bluetooth devices */ { USB_DEVICE(0x8087, 0x0025), .driver_info = BTUSB_INTEL_NEW | - BTUSB_WIDEBAND_SPEECH }, + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, { USB_DEVICE(0x8087, 0x0026), .driver_info = BTUSB_INTEL_NEW | BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x8087, 0x0029), .driver_info = BTUSB_INTEL_NEW | @@ -348,7 +349,8 @@ static const struct usb_device_id blacklist_table[] = { { USB_DEVICE(0x8087, 0x0aa7), .driver_info = BTUSB_INTEL | BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x8087, 0x0aaa), .driver_info = BTUSB_INTEL_NEW | - BTUSB_WIDEBAND_SPEECH }, + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, /* Other Intel Bluetooth devices */ { USB_VENDOR_AND_INTERFACE_INFO(0x8087, 0xe0, 0x01, 0x01), @@ -3877,6 +3879,9 @@ static int btusb_probe(struct usb_interface *intf, if (id->driver_info & BTUSB_WIDEBAND_SPEECH) set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks); + if (id->driver_info & BTUSB_VALID_LE_STATES) + set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks); + if (id->driver_info & BTUSB_DIGIANSWER) { data->cmdreq_type = USB_TYPE_VENDOR; set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);