Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1885783ybz; Thu, 23 Apr 2020 07:44:51 -0700 (PDT) X-Google-Smtp-Source: APiQypJePfTiL5sphuUDMXhlIKbgFetVrlHYX++S6AqUSS55cOkl9NwpgkjJ2VvA4I2UwajtBBoA X-Received: by 2002:a05:6402:b4c:: with SMTP id bx12mr3056689edb.247.1587653091431; Thu, 23 Apr 2020 07:44:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587653091; cv=none; d=google.com; s=arc-20160816; b=KKtl0oDn13ZP9XFHKoGeLX+yh0ybyc2U6+qWLHNfzprb5ToRjBLISeiLu+EVt6ueLZ +g8TLNTHv/KdePyMJ00JJusNcB7A+twIH3cqhveI3UYyN6y+yUVxh34KLocFxKKPYrpF p5GeGjDRGoQlC8IREfatxE0pxEk4p7iXIBVXsYRMBAHrHKUwrxMYD8DkXABJlkxlPNtj PZs4S/ttAuoxEyyGCBzLkE9kZ2VNa8tudSJ4g+hMU6vNzoxhqlsc399zVD6LVNIB9Kwm Ml0CajiTlCGpluJRAUBS3jJrlAERUSp+nNBRKWHmn8OQazNMEycnTHJmWVP8zB2LIkC/ ISyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MRgEfFWldJ+nbPjKrWVW/UCyBRIS5F0risTypuqjZbc=; b=IVd/6vVsD4Xu7XfHvZCqnZm8LBNRCS/93Nk2j07djubnqe5+1lhyL7u3mJAAPCAWVf sy4+sUGSkd/dcLLlQK6eWXRsb8IGwby8U1xuVIatG7fhMz3kctwhFYxbEEY9KGNW2sLn 6zUZfswAmLiTKbhgwNH7rsksWuokMZ2IJPk5epLW2PmViwgp6CTwPa5vkArfTxsQ4FfU vrpP3fllKuO2yf2DPawgFopYhZdbzOEAIiBxKed84946CUxhkI09OP6ZyTphg6vabbJs EezoczU5rEH090toD5N3n5N9TfqHzgBuDkZ59CP9ewlfEtDIOELwAT+zTaoGQx2aySvO mOFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gwyEd2TG; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u3si1277655edp.525.2020.04.23.07.44.27; Thu, 23 Apr 2020 07:44:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gwyEd2TG; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726963AbgDWOnk (ORCPT + 99 others); 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-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 Content-Transfer-Encoding: 8bit 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 */ -- 2.26.1.301.g55bc3eb7cb9-goog