Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp485467ybh; Wed, 18 Mar 2020 03:43:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu7yIhz83JPHbDrkUvJ7qoXQ77GiagmxlbzfMkPQnva+LayhzFHxQVygppb6g8XncFr0QTx X-Received: by 2002:aca:534d:: with SMTP id h74mr2494060oib.173.1584528190561; Wed, 18 Mar 2020 03:43:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584528190; cv=none; d=google.com; s=arc-20160816; b=waJV3eqW85GBFa7mGJkrbE85KFsKwjlpqzZSXal3/812tYJbv8G4Y7EW3b1JX9f+Fk aNZCOXjjrjKwKWFdrmsZmrQxZ2VV5W2n7yWGlMW2yitIMBacyPB8Txj9Vl5t50MM1b8G 1R3vQrPcV3stBy17vYv/RxMgeifySNj9XQfVl4S81DHLVVG4uQVYCe8ZdA6MY1dfemgB UONMmMiq6ZQxa1VTO/XDGqtTZl0OqDcH7wcD3giLEPW93mYOnJsZgEkC7mUI39hKyEVC d8A2eSIiQ0By/nOD84Id+c37OqgoxN+rDpU/6I80fJGSUi6u8oXxXplNut/kzyUBYM2A dD9g== 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=rYxhc43xkggB4xGTSelORTjHYxbxujALDvH3+JW7qIo=; b=TI6wiGePsFNowTaIXZ1lyYP+z8bLKou/WYr2U4OpjX9jphaKRnueq9ZZUUFsI5M6y6 9aI/7mL/D6/MLYcDgdNPsWQGl6Hu4tWbTHJh7kbvOxsYu8hIkbnILC9rlxD7V+3IqnH/ dNFMmDrCeQjWepOmvaPmIz8sXW27xkYhgesjk40jgmz5/+CwSzviIT+GOklFB3p08OdS b31ZMmS/jSxAmN3R+AHotRyJChUoAQlrT8Cy26vMzwbGh3Uu2O7Wi7VZ5FkncI8zDPoc h1X1SxrPNArrvxBLmkkhPExmQKTjQibGrxPWEpFYUpV4j16V+HuMrPNpf7mgHilkUhVb dk6g== 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 i133si3177978oih.80.2020.03.18.03.42.52; Wed, 18 Mar 2020 03:43:10 -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 S1727324AbgCRKms convert rfc822-to-8bit (ORCPT + 99 others); Wed, 18 Mar 2020 06:42:48 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:40432 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726486AbgCRKms (ORCPT ); Wed, 18 Mar 2020 06:42:48 -0400 Received: from marcel-macbook.fritz.box (p4FEFC5A7.dip0.t-ipconnect.de [79.239.197.167]) by mail.holtmann.org (Postfix) with ESMTPSA id 0B77ACECF2; Wed, 18 Mar 2020 11:52:17 +0100 (CET) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: [PATCH 1/7] Bluetooth: LL Privacy Delete Store Resolving list From: Marcel Holtmann In-Reply-To: <20200312100754.3445-2-sathish.narasimman@intel.com> Date: Wed, 18 Mar 2020 11:42:46 +0100 Cc: linux-bluetooth , Chethan T N , Sathish Narsimman Content-Transfer-Encoding: 8BIT Message-Id: References: <20200312100754.3445-1-sathish.narasimman@intel.com> <20200312100754.3445-2-sathish.narasimman@intel.com> To: Sathish Narsimman X-Mailer: Apple Mail (2.3608.60.0.2.5) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Sathish, > This patch help to delte the resolving list stored in the BT > Controller w.r.t BD_ADDR. > > Signed-off-by: Sathish Narsimman > --- > include/net/bluetooth/hci.h | 1 + > include/net/bluetooth/hci_core.h | 2 ++ > net/bluetooth/hci_request.c | 33 ++++++++++++++++++++++++++++++++ > 3 files changed, 36 insertions(+) > > diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h > index 5f60e135aeb6..352bc43940ff 100644 > --- a/include/net/bluetooth/hci.h > +++ b/include/net/bluetooth/hci.h > @@ -457,6 +457,7 @@ enum { > #define HCI_LE_DATA_LEN_EXT 0x20 > #define HCI_LE_PHY_2M 0x01 > #define HCI_LE_PHY_CODED 0x08 > +#define HCI_LE_LL_PRIVACY 0x40 > #define HCI_LE_EXT_ADV 0x10 > #define HCI_LE_EXT_SCAN_POLICY 0x80 > #define HCI_LE_PHY_2M 0x01 > diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h > index d4e28773d378..5f04ef88da35 100644 > --- a/include/net/bluetooth/hci_core.h > +++ b/include/net/bluetooth/hci_core.h > @@ -1657,6 +1657,8 @@ void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __le64 rand, > > void hci_copy_identity_address(struct hci_dev *hdev, bdaddr_t *bdaddr, > u8 *bdaddr_type); > +void hci_req_del_from_resolving_list(struct hci_dev *hdev, u8 addr_type, > + bdaddr_t *bdaddr); > > #define SCO_AIRMODE_MASK 0x0003 > #define SCO_AIRMODE_CVSD 0x0000 > diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c > index bf83179ab9d1..f4bbd3b79210 100644 > --- a/net/bluetooth/hci_request.c > +++ b/net/bluetooth/hci_request.c > @@ -885,6 +885,39 @@ static void hci_req_start_scan(struct hci_request *req, u8 type, u16 interval, > } > } > > +void hci_req_del_from_resolving_list(struct hci_dev *hdev, u8 addr_type, bdaddr_t *bdaddr) > +{ > + struct hci_cp_le_del_from_resolv_list cp; > + struct hci_request req; > + struct bdaddr_list_with_irk *irk; > + > + BT_DBG(""); > + > + /* Nothing to be done if LL privacy is not supported */ > + if ( !(hdev->le_features[0] & HCI_LE_LL_PRIVACY) ) > + return; > + > + if ( !hci_dev_test_flag(hdev, HCI_LL_RPA_RESOLUTION) && > + ( hci_dev_test_flag(hdev, HCI_LE_ADV) || > + hci_dev_test_flag(hdev, HCI_LE_SCAN) || > + hci_lookup_le_connect(hdev) ) ) > + return; please don’t invent your own coding style. Follow the netdev convention. Regards Marcel