Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3366101ybb; Mon, 6 Apr 2020 07:36:19 -0700 (PDT) X-Google-Smtp-Source: APiQypJQUw82ROM56TF4xCPdpKdBnhc7sCRmDy1fpHyoxypiHOckTFizuzTEq9JuX9z1tiz63K+W X-Received: by 2002:a4a:a442:: with SMTP id w2mr17431314ool.90.1586183778874; Mon, 06 Apr 2020 07:36:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586183778; cv=none; d=google.com; s=arc-20160816; b=eYoGyRzKW0978JY8r6EuehVS5luM5sOzy/M/hxdS0XSBmLU9+pgDcND3p/Q7/nleiu jPwxuhaiYMdfWFrIMtrkLIThVM/sxWkvwX+xXebwTBbGTa4xW20nj/lGWpnM8nO577WZ KIyGzjtvJFxoY5HCXe3oBbOkObwIpgMGbhL2EPZ4bkSwATdBHqgPZ+NkxF4yJ3GnX/ov m2IN/aQeCq/Kujg+YRrG3+8JL07vKb9UWiqx7f4tkibvGoIMLLPFuzLIeV8pM2FBNndL UJuua/+NQZ52bUVCDhNCMCjZZ+KxbTbjjqi1zzZ9JsGJh6FWll12DVLhw3r6XCV7iibO CZ8A== 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=esS10M0t6HYIM0hPFUjRMKJ3QLEoksn3yy41vOUmit0=; b=Oag47q2hyLUcYlshtBXLPXICWw0ioF1gqk8wr0Q9f+uMs/vGuZ0dYAkbXHq+Q9lYQr GcnnbqUU6lBMveIMEFWVLY3dwYmU0RqRKBGbmDRu2NZ0YjYOmG/EOn3qApA8xzX+jWQk qTyTu7sg4js3ZazgHenyzHtgcWDCGhReuBeV0VV+gOiNpcvxlq49DTxf+/+yzrlf+YGi +/BUZOqxNqaBnXhhgq+0KNpaiZhCu3VTO6xrriQ4SGHperBuDiH6CGekEwBQ5OBrgePK egxdUUyvQikUDzKKbD5/6uRbLNvEpkB4Dr+N7CxKZSVrCBPYZzqoAkowvt/MtIwprfwd WEUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=N2LOnEIl; 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 s5si7029397oie.153.2020.04.06.07.35.46; Mon, 06 Apr 2020 07:36:18 -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=N2LOnEIl; 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 S1728684AbgDFOff (ORCPT + 99 others); Mon, 6 Apr 2020 10:35:35 -0400 Received: from mail-ua1-f66.google.com ([209.85.222.66]:34163 "EHLO mail-ua1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728630AbgDFOff (ORCPT ); Mon, 6 Apr 2020 10:35:35 -0400 Received: by mail-ua1-f66.google.com with SMTP id d23so12773uak.1 for ; Mon, 06 Apr 2020 07:35:34 -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=esS10M0t6HYIM0hPFUjRMKJ3QLEoksn3yy41vOUmit0=; b=N2LOnEIlUUmJLWjr7MsJt1q0w4hOjkoPgrghPUxHNrAu6aEojSj+M30iJ24Dcpv6Vt CqGDhsZ9uw0P7bLW9Kpxic/1ArVC/jwkFYwpwY87f2EI/q2tGxRnmlqRKqOSi8A108jI vPJLr8PTKQsGN5ozI6eKa5rfBQBB06sNgrop8= 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=esS10M0t6HYIM0hPFUjRMKJ3QLEoksn3yy41vOUmit0=; b=gUWogy8e/Ut4z4exivbwGiWgRZ8CGZQHEQO8ZZKN6ssKx45/oXKAcq1t9eM7NwILoc l31lzrzRJKTFqugGozg6nqD2dwPBWl4+OggSEhL5J//Z1gpgFlijKI9bAHE8da+hMFkH X430dltrLjN05hl59ahRnB+827KGm+hC/+vwQ36xwd3yWDa7+GPT7edyN6jN0TolViBs LXb20SJczWWBpg5qP5G00Z9hmi5E+XpKrBpltEr3YOuvb5dIk19o1Y6RNHNmqEnVxOr1 DdS7CIPcS1N4sNuFFw7NoV+8VEnET/V150IuoxLmF98FN0CM+YSqOeAD6nLIvAgY9CY2 d4HQ== X-Gm-Message-State: AGi0PuZJoKEzTatDL0HQZ80THzAibEWSp1NxhnGTXCV2zRg/ku3/+xG5 ZKNgNVqY+mRslssQwLr/dGFaR+E+K+c= X-Received: by 2002:ab0:4e96:: with SMTP id l22mr3895197uah.67.1586183733117; Mon, 06 Apr 2020 07:35:33 -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 106sm4410327uai.0.2020.04.06.07.35.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2020 07:35:32 -0700 (PDT) From: Alain Michaud To: linux-bluetooth@vger.kernel.org Cc: Alain Michaud Subject: [PATCH v2] bluetooth:Adding driver and quirk defs for multi-role LE Date: Mon, 6 Apr 2020 14:35:29 +0000 Message-Id: <20200406143529.209076-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 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.0.292.g33ef6b2f38-goog