Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp488399ybb; Fri, 3 Apr 2020 06:38:52 -0700 (PDT) X-Google-Smtp-Source: APiQypJEl37YCQLsdhGbdvstTe2W0WI5ZHk8CQLo67ZuIROi6ik5Tgc3zgHWJpLegsW/JFFQKGAh X-Received: by 2002:a4a:8604:: with SMTP id v4mr6591250ooh.82.1585921132241; Fri, 03 Apr 2020 06:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585921132; cv=none; d=google.com; s=arc-20160816; b=VAxAGwvH7rTgIOnzdjAUvgz5fTBKXXHwruBuF5PRB5xeKsvJZyx6a752l7xpygZoAm EsOE1Zi37HCgk32M4MtmyJeBDUWKNVmcmTN8u6CP12aR0O2L5Y6/OrPAhpeUXRjfFliP L/KJJWkfpRdDsDXByFLJdG7bna5LPAkpQCng4NoSz7OXLgZsPripfOooyAQcvSRMsvTo fq8UcBk7FEZ+nj1U67DyLKx8+IQ/L9e3HyPCzAzUeSrVDeRBVdusX6DxiJ4fv7rRmdwD 4ytX1I+tk8vpJsbcrXsTvRv6TRiG/6KyAWq6nWBWpbDJUwKmwWvH5erJqVig1uGu2x7Y u53w== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=nSWbhqvfY+/Us7kVMx2Qrr6gl+oA8LNK2eayGaO0+bs=; b=UcEdX6wPTJKv3anBBUCsjMChMeQ/jCWakgl79B/xsMK/r/E7Egk7BZ7NIWVCh4VIyV WPOw08cdWRHzrBj+YB+8Dv3bzOPtHDYw8yDAuEPgcgZuzW5zkdaq6Hy1t6PM57gI1j1O lIV7uJPbIc8VBhucDX9FIkUMmW1CcYSwjnilgg6B/LxJKp+qlZWb0Z1VT8y+EFJwBZD+ GgzrmIwDIo4n24Mg6roxz+nfNsewOKjFxmj1uOPdGud4CMMNMAdUTW6IsUfVrJmBhtEL iu6anvJI3U+hSbgW6YEMu08wSrFr5fLKGYD2M7YCFIH5wTAHqxV3peyAx8vR4IOotlOH LzOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="W/jpatMG"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m21si1756496otn.66.2020.04.03.06.38.31; Fri, 03 Apr 2020 06:38:52 -0700 (PDT) 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=pass header.i=@chromium.org header.s=google header.b="W/jpatMG"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390789AbgDCNiU (ORCPT + 99 others); Fri, 3 Apr 2020 09:38:20 -0400 Received: from mail-ua1-f66.google.com ([209.85.222.66]:38885 "EHLO mail-ua1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728023AbgDCNiU (ORCPT ); Fri, 3 Apr 2020 09:38:20 -0400 Received: by mail-ua1-f66.google.com with SMTP id g10so2719936uae.5 for ; Fri, 03 Apr 2020 06:38:17 -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:mime-version :content-transfer-encoding; bh=nSWbhqvfY+/Us7kVMx2Qrr6gl+oA8LNK2eayGaO0+bs=; b=W/jpatMGZE1Al9QN97WIBYl14zACI/s98JBYFNXxEvKL1DGLThQL6pyYafzKyEPQy9 fHaIn647JGi+QSIxLRZAMLIY2s1/Fp9R7qDaabOdp9YhEVk5qwF706E32TWaCgtYAjw8 0Tz9tXyaq0njJdeh67bogfHMAy2nqqIaHlsQc= 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:mime-version :content-transfer-encoding; bh=nSWbhqvfY+/Us7kVMx2Qrr6gl+oA8LNK2eayGaO0+bs=; b=KK6iTEn0iYIoye89Er3/x7IkUgjV8rF/lKSFPRL85W2OblM4aMAj9emAEC3AYzyG3S 5rNa3vjo2DshMRO7sFS+zsKtoN6aVLfh9IrVF+RR1ZVVSINvC6xX1hnp/SAmnSsQLQ8v I8xC4xAsHkPO+LOCQ29PaEzJ3WmF54Nn5ounPCf5ZVkoCjn/QkDBH19oqyp4rQjXJ6Eq wYdPuDJ/dzURIM2i66LY4fwmh0S8hQMVd6gQqPztjS+SmcHv1rfk47hKTNmps1pHcpT0 t4Py1lvokavmRNZ8fmBe7Mh15JB3K9G8vjiLcFMPVqwwPsEOlboK4Ljcj7XkAnncWjl4 P9bQ== X-Gm-Message-State: AGi0PubkiSJtNpBjuGMCsiK9PElGStrAW6pKyq82kX7aThcyQCgEqSYq Ca+05bPuRBV0AD31olb6A4JgX+2/VAQ= X-Received: by 2002:ab0:70a1:: with SMTP id q1mr6428691ual.52.1585921097002; Fri, 03 Apr 2020 06:38:17 -0700 (PDT) Received: from alain.c.googlers.com.com (57.152.190.35.bc.googleusercontent.com. [35.190.152.57]) by smtp.gmail.com with ESMTPSA id t194sm2082580vst.17.2020.04.03.06.38.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 06:38:16 -0700 (PDT) From: Alain Michaud To: linux-bluetooth@vger.kernel.org Cc: Alain Michaud Subject: [PATCH v1] bluetooth:Adding driver and quirk defs for multi-role LE Date: Fri, 3 Apr 2020 13:38:06 +0000 Message-Id: <20200403133806.246918-1-alainm@chromium.org> X-Mailer: git-send-email 2.26.0.292.g33ef6b2f38-goog 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 that concurrent roles are well supported by the controller. 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 | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 3bdec42c9612..22e61a502d40 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -58,6 +58,8 @@ static struct usb_driver btusb_driver; #define BTUSB_CW6622 0x100000 #define BTUSB_MEDIATEK 0x200000 #define BTUSB_WIDEBAND_SPEECH 0x400000 +#define BTUSB_LE_CONCURRENT_ROLES_SUPPORTED \ + 0x800000 static const struct usb_device_id btusb_table[] = { /* Generic Bluetooth USB device */ diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 5f60e135aeb6..b2c76cde7cd4 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h @@ -214,6 +214,14 @@ 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 + * concurrent LE roles are supported. This mechanism is necessary + * as many controllers have been seen has having trouble initiating + * a connectable advertisement after at least one connection in + * central had already been established. + */ + HCI_QUIRK_LE_CONCURRENT_ROLES_SUPPORTED, }; /* HCI device flags */ -- 2.26.0.292.g33ef6b2f38-goog