Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp362568ybz; Wed, 15 Apr 2020 10:07:17 -0700 (PDT) X-Google-Smtp-Source: APiQypKeVp1VPw/fuqyDSDubH1jiNRlgSWJYz/VY/U6+y/6+7zNOsGV2SvRMMsTny7inT3zntEDP X-Received: by 2002:a05:6402:356:: with SMTP id r22mr5856589edw.3.1586970437107; Wed, 15 Apr 2020 10:07:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586970437; cv=none; d=google.com; s=arc-20160816; b=LTItyyoS2XXBviRcfuRHksC1j0uoX4Y/r7qoKoRgrjrFAXP34jht87JEpcYBMG3XFw 0P4ZRf2UFvwM6wf5Cw6xNw9tH8XItNrkjQKsBCooj5k7Z9ps4IrHVXuXJ/+5oxmQu1Zc co9mUk0gQ/91AhHDaNXl8jF5S6zp2fTr8ZH8reHIX0HgpwLBcJrzqbnnTJRpG6lJdX6H 9vj9RQmJNGBVuVx6cGYJ4EUc5REHTGSsXX1/bfRcEKHTqhqKvDVtJOaIJr3/fyXis9J+ eY/SGU7DV5kiwOf+Utf8o7QFMwD4606WuVnNFP5RYGhbElFXDEyZ38GjXZzZDNFdie0y LSGw== 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=xSsIr3hD68dVWwc8nsP6XPqg6Vy2SdKZ22RZtiZQHh0=; b=na+stZYJb8fqkP3rn5b7/p7jmkN3bjsOI7OuU5cf3VRl7L7VbYR5JP1RmYFb4wzro0 2NRKt5E+WgwLag5wj6XEQjo91AH0Ya+WnG/RbLTZH6WYHZguo2YsA/f6LrGNmV4wcWsD ciS7uzcuwDuRw+Pznxh/8ZevRtfd/Gb6+e3FW/ZFLCgVyS/S1DhUJJIgEA4hKbN5Akv2 Jv3BCdzXm12pu9aWKc6Gyt6q45p4sWI3blNeshlS1OloCsgaNjAvtBLeMg2bk8tFT5pg jw0j2Nh6jBqy1lcOIHeHdAsidN1eYot/tAzxjo1E5zXb0iaiFBTIuFXdCL4JC7rEnpaY pOWg== 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 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 jr23si10243584ejb.316.2020.04.15.10.06.28; Wed, 15 Apr 2020 10:07:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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: best guess record for 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 S2406174AbgDNG5p convert rfc822-to-8bit (ORCPT + 99 others); Tue, 14 Apr 2020 02:57:45 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:41155 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406131AbgDNG5o (ORCPT ); Tue, 14 Apr 2020 02:57:44 -0400 Received: from marcel-macbook.fritz.box (p4FEFC5A7.dip0.t-ipconnect.de [79.239.197.167]) by mail.holtmann.org (Postfix) with ESMTPSA id 8062ECECDB; Tue, 14 Apr 2020 09:07:17 +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 3/4] Bluetooth: Enable LE Enhanced Connection Complete event. From: Marcel Holtmann In-Reply-To: Date: Tue, 14 Apr 2020 08:57:40 +0200 Cc: Bluez mailing list Content-Transfer-Encoding: 8BIT Message-Id: <9573B8CA-FE0B-4A9C-9773-0B21A2FA8D2E@holtmann.org> References: <6b6ecbf19559cb16793d7ef3e96c1181a32b4df5.1586412226.git.marcel@holtmann.org> To: Sathish Narasimman 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 Sathish, >> 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 >> --- >> include/net/bluetooth/hci.h | 1 + >> net/bluetooth/hci_core.c | 8 ++++++++ >> 2 files changed, 9 insertions(+) >> >> diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h >> index ff42d05b3e72..1da8cec8e210 100644 >> --- a/include/net/bluetooth/hci.h >> +++ b/include/net/bluetooth/hci.h >> @@ -460,6 +460,7 @@ enum { >> #define HCI_LE_SLAVE_FEATURES 0x08 >> #define HCI_LE_PING 0x10 >> #define HCI_LE_DATA_LEN_EXT 0x20 >> +#define HCI_LE_LL_PRIVACY 0x40 >> #define HCI_LE_EXT_SCAN_POLICY 0x80 >> #define HCI_LE_PHY_2M 0x01 >> #define HCI_LE_PHY_CODED 0x08 >> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c >> index 589c4085499c..0d726d59a492 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 >> + */ >> + >> /* If the controller supports Extended Scanner Filter >> * Policies, enable the correspondig event. >> */ >> -- >> 2.25.2 >> > https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/tree/net/bluetooth/hci_core.c#n717 > > I see LE Enhanced Connection complete event is enabled here. I see. However LE Enhanced Connection complete event has been added for LL Privacy and not for Extended Advertising. The current setting of the event needs to be removed. If you look at the difference on what the event is adding compared to the legacy one, you see it is only about RPAs. Regards Marcel