Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp285007ybz; Tue, 21 Apr 2020 09:00:51 -0700 (PDT) X-Google-Smtp-Source: APiQypJEzb/4bXVLHi3EKUBU9E7Wtm0RfLA1sygOXDWxQPozLdy6yAxmJc3w8540vh+UFtPQh0Gm X-Received: by 2002:a17:906:3da:: with SMTP id c26mr22017279eja.290.1587484851553; Tue, 21 Apr 2020 09:00:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587484851; cv=none; d=google.com; s=arc-20160816; b=s5lP2arPEb6T2qzuvqYvmJd1YhDuT7zgPPU+IE+CnBGacie//qlhJp75FE0tfFtzb2 zAjGfVOkk6cIJYQX/7SaQyMHTX2frCi0AF3JfqzrPbkJTzEPilhG0LESpnhjASBrawL5 fLeb67DNAYsI/8EMq/JC323/MbAewNi6ZvbZg8MDcaCsdauIJiSBRFL3mawmEOuix/ET MLbKPakMf9Xr+/w4YVJroazHU3cF7vJe2csoBbj8tcZub6OYyszvHAdkFRIk0ysn7T3p NM/+HVXBEwKXWLy7G9kNEa3+O+4ZiE3ax5Qw1YVtUeYU8YGioM8DATv26DgVrdIQeTRq 0XqQ== 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=WVLhk3qBJhnBi/9vrqqekEbzdW066YS/KOQ9rGCKgJxinL7tphsB7xRFWFLPmM/YHY i+VmyI4ZERqxcKShKdvF2ICDB0a9APyDDR/s6q5rhAaDXRQfmJm5uMKBz01BpA3Jkfxv yr3D4LPwceCLWXSmx5RJwBUWqRbi+0LyL3M1AjLzN5s/K/SxUwrYGJ+yj7iXTchgwn/b r9dRQHzw3/HpS3QSTcmbVW0qNHHgjraA/L4WGg+I7zq7dOTittlLBDcryBJd5sQermJ6 oWNToPcMQPlSPU3f/1CyvUhYmqbuLZc7plntyaJDeVXznY3P6mZwjgIowwOzK6E/8sPE pXpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="bf/h90z2"; 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 b21si1708232edj.146.2020.04.21.09.00.22; Tue, 21 Apr 2020 09:00: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="bf/h90z2"; 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 S1725987AbgDUQAP (ORCPT + 99 others); Tue, 21 Apr 2020 12:00:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725930AbgDUQAP (ORCPT ); Tue, 21 Apr 2020 12:00:15 -0400 Received: from mail-vs1-xe43.google.com (mail-vs1-xe43.google.com [IPv6:2607:f8b0:4864:20::e43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CC3DC061A10 for ; Tue, 21 Apr 2020 09:00:15 -0700 (PDT) Received: by mail-vs1-xe43.google.com with SMTP id o3so8752364vsd.4 for ; Tue, 21 Apr 2020 09:00:15 -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=bf/h90z2UtECKe04PdPSLo3xFI9UibHSNhf8MnnbBStOGjK4qsZvkfvYkNEazSPnIB 7F9fPigAVR0PZi+8VA8WBSYXEy2UJaFv+UYSNHs+NmvIavRpE1nEAICR100/5ROJeXqL +0NLMUCXKiqul20JXA/X6ijivap1AreLMt+xs= 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=D+vu4PRHo6hAc1T7hnkag0rS9SkZSRfQFAa2fkE937UoCQD4BRelii6SHcLbLiEt16 sNdpcdn0SThZGeHmyBQ87WdvwFaIV8KCxv13FZ0bgzpplpbOl14/LG1PbFottskr5f5T MYfyfbxtbRdY2ZSCRhjvXRIbKrvYgJoxIxKUvEatT20Tjt0qk+ll6Ag+/qLWaaSgZtDz M0WJtoXrp5lEJ/SnYQf/gK5xu1U1rJDbZ0hfLMAc5SVqnEVmEq+CVnzn1TwcvJAyJCxq nruha1gPNJZsgPOvndJYkTEra4/ArjttyKvwae3TXiPePOCpZ2peL/pHAsf5waN9YTuQ +sHA== X-Gm-Message-State: AGi0PuaTs+YlDWx2EPHaKWbet9Ynq2juiEtRyscvRZUcodptyB+5EapY zbtfNsGIwR7qaKgKZKhR1tOyM0epCnA= X-Received: by 2002:a67:f1c3:: with SMTP id v3mr15140907vsm.119.1587484813164; Tue, 21 Apr 2020 09:00:13 -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 h16sm840074vkc.44.2020.04.21.09.00.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 09:00:12 -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: Tue, 21 Apr 2020 15:59:53 +0000 Message-Id: <20200421155954.137391-2-alainm@chromium.org> X-Mailer: git-send-email 2.26.1.301.g55bc3eb7cb9-goog In-Reply-To: <20200421155954.137391-1-alainm@chromium.org> References: <20200421155954.137391-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