Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp304739ybb; Tue, 7 Apr 2020 23:31:31 -0700 (PDT) X-Google-Smtp-Source: APiQypL6zf5X8QUUhr+VMjp4/EroiWaUyqrnysZmBKcVgtw3Ttr9Ws1ELmAnfTcln1TCvVRuoVX3 X-Received: by 2002:a05:6830:314e:: with SMTP id c14mr4681271ots.7.1586327490852; Tue, 07 Apr 2020 23:31:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586327490; cv=none; d=google.com; s=arc-20160816; b=MWvlovgr6aIiKiv0Au/8y7g12Qbjvms0FwUfLRPEr8er3lPtESNUoouRavON307LHG 7aD2lD9sMcXc40LJYQsrlniKl4ZeaJ1sVLLyQamvZzE+AmdcQLT68386fpksDCa108+Z EdoP6QNJWccKrAtr+xND9oR78KxNl89Tcz1+1Oqk2uCwZ9AeBZqvnBsDyHCEEeI/ggS3 4cbfHrk5njmPvK7LE5Q1mz1nwEggQfo58rEP9A1vzb+yG22Bl9xJb4MexRTXMXUOZ+Gl WhDs+KBbElVk5knbusj+bxKgNoqwTc2UwN55EbHvWlIILWyahRITeuj9Xw7S+cCHUvXs RPoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:in-reply-to:to:references:date :subject:mime-version:content-transfer-encoding:from; bh=2QaZt8c1Xk0J6w7rXAt+/xCJIsUlbI7SiaC732MGIn0=; b=LTvJU7q5ZRpYTPZqhD4NcWSPUn6QO0bHFpEO9h+dulFCiTy4KFBIFK+k7JADHnjBUg 1Yi6X+YGiyDFCLfosd0tzKM0AYcGOr9r1yvdupeqCzgjPXzKh33aKyyGWpKy88vRhO3T iBgieS5H9ebpYv8coL/tmoTk1A+5OQElu4a23hZ2HwXMpzEGnALqdZc1klEXIGqY5f9S VzmtEyLvRBC1RSTBbs4joe4rbO9aGVyoubNpvOdbJ+a33MTl+2vT5bF48fxVDmP6V0FU kVBoOHr7Ofqj2xilp+HoiAY9v6jIQUjuffv/vZUYhZJ1mt9o+WKOIT/G6eLsYcwavsJS eMpQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e14si2551453otf.226.2020.04.07.23.31.13; Tue, 07 Apr 2020 23:31:30 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726345AbgDHGaF convert rfc822-to-8bit (ORCPT + 99 others); Wed, 8 Apr 2020 02:30:05 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:59701 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726192AbgDHGaF (ORCPT ); Wed, 8 Apr 2020 02:30:05 -0400 Received: from marcel-macbook.fritz.box (p4FEFC5A7.dip0.t-ipconnect.de [79.239.197.167]) by mail.holtmann.org (Postfix) with ESMTPSA id 82561CECE0 for ; Wed, 8 Apr 2020 08:39:38 +0200 (CEST) From: Marcel Holtmann Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: [PATCH] Bluetooth: Enable LE Enhanced Connection Complete event. Date: Wed, 8 Apr 2020 08:30:03 +0200 References: <20200407232523.1013507-1-marcel@holtmann.org> To: Bluez mailing list In-Reply-To: <20200407232523.1013507-1-marcel@holtmann.org> Message-Id: <201E0449-B5E0-4536-96AA-687F23F8D3A6@holtmann.org> 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, > In case LL Privacy is supported by the controller, it is also a good > idea to use the LE Enhanced Connection Complete event for getting all > information about the new connection and its addresses. > > Signed-off-by: Marcel Holtmann > --- > net/bluetooth/hci_core.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c > index fb210f7ab7ab..d8d543e3dc9f 100644 > --- a/net/bluetooth/hci_core.c > +++ b/net/bluetooth/hci_core.c > @@ -638,6 +638,14 @@ static int hci_init3_req(struct hci_request *req, unsigned long opt) > if (hdev->le_features[0] & HCI_LE_DATA_LEN_EXT) > events[0] |= 0x40; /* LE Data Length Change */ > > + /* If the controller supports LL Privacy feature, enable > + * the corresponding event. > + */ > + if (hdev->le_features[0] & HCI_LE_LL_PRIVACY) > + events[1] |= 0x02; /* LE Enhanced Connection > + * Complete > + */ > + so this is sort of enough to get the events, but they don’t give any extra information if LL Privacy is not used. While the current code handles the non LL Privacy parts of this event, the important local RPA and peer RPA are not handled. Both RPAs (if used) however need to be stored in hci_conn so that SMP can make use of them if needed. Regards Marcel