Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp940615ybz; Wed, 22 Apr 2020 10:36:42 -0700 (PDT) X-Google-Smtp-Source: APiQypI7rTfWRDw9YxFqREEDSJbnnEosjd8q2nf2UlQ8X1NARBiVjwWpDtzh+GClfzZWFYfNwV2V X-Received: by 2002:a17:906:27d1:: with SMTP id k17mr26198311ejc.134.1587577002456; Wed, 22 Apr 2020 10:36:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587577002; cv=none; d=google.com; s=arc-20160816; b=k5y3TJ5aiTvNweg+rDeWhBqT9Rph2/QQxC36e+4keex8f6tWWD8BJChV5UvbqfnPjQ bIKkOVJUls0W+mZzlDRzCIWc2UQB5ZAoIzE+AIuWi691PvL+MIkjemd0VhZPy9yU+QR/ TL62f01XQQj+UppcN/Eqcrzagt0udQyBHN9nIDyapbWBig/CHb8YEhxQEQiliLC9PhLB I7Gl2WhrhdZ8QfQNC6GzEIh8o3EROmDkKm/XaUEXJf5G3DBZ9pwRMs53LZJpa7n0LCxh t9KC1sftIFEUvXSxVLjitu6sd3KSTqnCMA/aX54E2Wsi3KUuUANa510LhDWmanP73yA5 iCYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=bhassUSmKwE2XL7iejB7FzEhC/Y0DNxXblx+6guBDwk=; b=N/vFODwZ1G4g0teaz0ftuQJmH+4xv7Jx8fgTBpnth8AHeylXy6MZdi5TShIXBN6L9w DNKUohIFwr9XLMLeATIixwOE31RUwY6vU+iGjpT/ueEZU4c2OoQqT0l9YH4Qb3ekbYTJ JAq02gav+9f6LcqmCEuJpoD5TYcvwTcYcLEkY3y1OlPFOQBRF2yMKaE37Dayfuk49mW6 XrYyWsnhHXfBS8hx/A5NEkR6FjtzNVzGrhIJ8S7tflITuH6l88wkCTXlLT0ZZxyBWy8T o1FQx3i7GJZxejdKZY0vwchTDTe6eIFfaU7jJRwR6IiMMpXk6oxwnIRSg0nDRkuA62Cm OJQQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r28si1801898edw.570.2020.04.22.10.36.18; Wed, 22 Apr 2020 10:36:42 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726363AbgDVRgF convert rfc822-to-8bit (ORCPT + 99 others); Wed, 22 Apr 2020 13:36:05 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:34739 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbgDVRgF (ORCPT ); Wed, 22 Apr 2020 13:36:05 -0400 Received: from [192.168.1.91] (p4FEFC5A7.dip0.t-ipconnect.de [79.239.197.167]) by mail.holtmann.org (Postfix) with ESMTPSA id DFB79CECFD; Wed, 22 Apr 2020 19:45:41 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: [PATCH v3 2/3] bluetooth:allow scatternet connections if supported. From: Marcel Holtmann In-Reply-To: <20200421155954.137391-3-alainm@chromium.org> Date: Wed, 22 Apr 2020 19:36:03 +0200 Cc: linux-bluetooth@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <4FD88B61-D457-467F-975D-84C7202271D6@holtmann.org> References: <20200421155954.137391-1-alainm@chromium.org> <20200421155954.137391-3-alainm@chromium.org> To: Alain Michaud X-Mailer: Apple Mail (2.3608.80.23.2.2) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Alain, > This change allows scatternet connections to be created if the > controller reports support and the HCI_QUIRK_VALID_LE_STATES indicates > that the reported LE states can be trusted. > > Signed-off-by: Alain Michaud > --- > > net/bluetooth/hci_event.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c > index 0a591be8b0ae..34cd98a1d370 100644 > --- a/net/bluetooth/hci_event.c > +++ b/net/bluetooth/hci_event.c > @@ -5245,7 +5245,9 @@ static struct hci_conn *check_pending_le_conn(struct hci_dev *hdev, > /* 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) > + if (hdev->conn_hash.le_num_slave > 0 && > + (hdev->quirks & HCI_QUIRK_VALID_LE_STATES) == 0 || please use test_bit() here. > + !(hdev->le_states[3] & 0x10)) > return NULL; Regards Marcel