Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1329893ybb; Wed, 8 Apr 2020 23:08:41 -0700 (PDT) X-Google-Smtp-Source: APiQypJmHuGkkoN47cROcFWtIcEH1CqBCuyYoip+FW+bBzts857P1zawlWysREbgMuYwqk0ayLda X-Received: by 2002:a4a:e08b:: with SMTP id w11mr2647826oos.62.1586412520879; Wed, 08 Apr 2020 23:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586412520; cv=none; d=google.com; s=arc-20160816; b=ncCCjIyYw38CtUqWXpiBg2lvJyWUN7fp/yjfU6AQCZJ6yj9s8yJu9CpruP8sccAaYU Jwt2BERFsIDYMPfZMxILEfPT9sxr/Mxv0/VkzCm+EQnqoJlXi8Bw/AiqjVK0IitK9Utj juZtdl1qSVj1mRgk8JBNI6VBD7uj5W7HCuvmNEzRN9sGQsURrd4cJ4HJhMHTLo2oNAHl 5GQjfl3arEwBmxnrYPqGn/IWi0HuyKGdQVZwITeqKbqrdgJIOUwALyCbgHMvEdVLWm4x iPm2Rw981fgdyWarVjRlkVHmvnRoILVpRjiNlpJzpqOx/f1NC7MJz1lfdN37sS+YJqwp uxlA== 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 :references:in-reply-to:message-id:date:subject:to:from; bh=pKWcBxtP/Tuq8NOcbiXVjNuexvxVCDiwheEmhuQFElc=; b=Jbeqv+UtP1SHKFx+4NSYtoqV6rscQf/T2b9hEnU5gjFZu09ndQlaCAEoNcCP2mALmH CLLL+d51n2uu0AJ9K7FOa1rfbC3WaDDv3Fk/ZBwZsRXYiGb9FUCnzdosG2i1F8yzJtei 1ZN7x/+CpJRp/Wwt9qYjDUqgfT4FQYSNQn2h2KbtQb+/MxNFZ4jtNaPOX/VjFsTPseJq aWnbrAQxNQsFH1KSI+dvoOR3xA5k1tneu0wrPt1a+1NLKcWnTKflxsIe0/5l4p5QyDgr OFL0oVCuKahuyB2+XLlWGST7M0XNBItxHzqlBqdNUWoaq6kzho4RqtibRQ7ly716DKdG GpNA== 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 i17si593064oto.218.2020.04.08.23.08.26; Wed, 08 Apr 2020 23:08:40 -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 S1725828AbgDIGFz (ORCPT + 99 others); Thu, 9 Apr 2020 02:05:55 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:58834 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726534AbgDIGFz (ORCPT ); Thu, 9 Apr 2020 02:05:55 -0400 Received: from localhost.localdomain (p4FEFC5A7.dip0.t-ipconnect.de [79.239.197.167]) by mail.holtmann.org (Postfix) with ESMTPSA id D759DCECF5 for ; Thu, 9 Apr 2020 08:15:29 +0200 (CEST) From: Marcel Holtmann To: linux-bluetooth@vger.kernel.org Subject: [PATCH 3/4] Bluetooth: Enable LE Enhanced Connection Complete event. Date: Thu, 9 Apr 2020 08:05:49 +0200 Message-Id: <6b6ecbf19559cb16793d7ef3e96c1181a32b4df5.1586412226.git.marcel@holtmann.org> X-Mailer: git-send-email 2.25.2 In-Reply-To: References: 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 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