Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp346253ybh; Thu, 12 Mar 2020 03:09:47 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtBMIFfoDHyX/RD2MMmhIMOm1q4f1hmyz2y7JnKJmoOwJty24Z61xyTKfUfPHyxTojYZ0VO X-Received: by 2002:a4a:dd03:: with SMTP id m3mr3454383oou.25.1584007787419; Thu, 12 Mar 2020 03:09:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584007787; cv=none; d=google.com; s=arc-20160816; b=lywkqbJNpCuTzue6wrhgwkk9ZCfrxj7wvHb5SiBpGwT4Gl9Bp1CAq8PvMb5g9AGCdo cOAnmtFQgyMKRq5uBOx3A9JmdooYi+fzILRE+3z0zPc8nF4Hc4xyLURF51OoUNa24iFs zJx3IeWujmNQdM8zbYmumbj2ongjTshv9ScDTy/9N7S7titp8GP94arvW8VV8WpZHDX4 pa1JxoXj3tMUJfsWNGIPH5WyM3T+xrREDDRF4t7fXB3XaN0KrwTAPqRmjnp0PLZVO3b/ BEG+obqKKurqrGZyZ7fGbLg6h/VPVOA156c2vZpDQ/jp09uodrW+CuD9Im1tAk0bt0Pt I1uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=3YDtsZFvd+LPTd0Sd0anKk1uRn89slB36yxlIFn11go=; b=XpQsEz9woP2hrz1GQG0/xuTeG0szSrzuZAKuA5cLikyW3mZeMtO6tXAnLrlq9OB9C5 odGwcYu7Fvk4QU87CHzFIAZk0/dOErmonR+DIn2edyxpMH3NODlmuPWYyizj3Of7upWx lKxJAE6YA6g8oZ2mtnWSy7AJyBOhyFB+4k0NI5hfWhCAy9TeeT6UJjMgPg+Sb/SV6q0P kgraQiMHejhRhQkYYcmpbI4qjWxLksngJZIyjnBUpZSDXXyQgFe1OZd51RV+6654DDZq f6CUKBxra37NuWM1ZnmRsu9GihGC81k3I+3IG6zkiAZSjF/AWLlz4jJ5BXzi/RXEcRsl ideA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jdQTkCBG; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k3si2541802oib.82.2020.03.12.03.09.34; Thu, 12 Mar 2020 03:09:47 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jdQTkCBG; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726000AbgCLKGv (ORCPT + 99 others); Thu, 12 Mar 2020 06:06:51 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:43596 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726705AbgCLKGv (ORCPT ); Thu, 12 Mar 2020 06:06:51 -0400 Received: by mail-pg1-f194.google.com with SMTP id u12so2825019pgb.10 for ; Thu, 12 Mar 2020 03:06:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3YDtsZFvd+LPTd0Sd0anKk1uRn89slB36yxlIFn11go=; b=jdQTkCBGhoVnBa+vbD/hrrTmZNBq1rDe3VTL/ZHKxOrp7gykKpuEvh6XGyY7e4gS6L Umj0OHpaCI6rN7RkOMoe1Boi9I7cTesnDsN7R7OS8orNIvh5dbGo262/4q2U1t46qOJM gLkHyNnu+u4ZoTVN1PVCpJPzMPTrmRFNxC20wEXdpLtELx6JPhe+g/83qgvAH+XzVqM+ nNhGCGKxDoqb81CFWqQpR+dwtTFNc8AU5AVN9AQaCyN6SdwrCVozDSf0RRcboggcZTkM YpDM30x8hMR0CtzRPiEq1cHFuQ0D4vhiVqoMP9Hu/8omS/38GXTPCHmbgyBNzUp0CsI4 0fUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3YDtsZFvd+LPTd0Sd0anKk1uRn89slB36yxlIFn11go=; b=huHvNJLUAxwPPijEVEfmzvAUyFiR2foQ1EcnQVw37c5lPiJ/8prFn9ioBm3+D/uioN u4PZv8Pghsa0siPo54nrIcBPHuBYojCi0ueyCFgdFZqPn8mnPPiIPTTCe/KWeTTXP9sj IuyR2Yl3fd1aYYIEEAy0rtjwzvg67DrG6ieTVCzML6kODmdQUv7AEzA0hZN5+d9Hwc2T 2SEeTHyq8X8GjRe51Y055DlNGsmroFbBua8ONJ6/JhBmeAQPTe2kgsdxgAGvaP7TT9xX xYLkEICV1bHbrw1TQwcfUAlf71rvaFQK5w5ynE+O9VMfRbdBokP1geAvZzenD2ueVrqt 3eEw== X-Gm-Message-State: ANhLgQ1vT9qQXPilZEGsElMHtxIZpYY4C+wJu76WsvZdZVX3mtVSt44f 0B1JIrFgVoQXbJkRyh/4vFPSfcOuLu8= X-Received: by 2002:a63:4912:: with SMTP id w18mr6865770pga.122.1584007609629; Thu, 12 Mar 2020 03:06:49 -0700 (PDT) Received: from nsathish-Latitude-7480.iind.intel.com ([192.55.55.45]) by smtp.gmail.com with ESMTPSA id e9sm10578295pfl.179.2020.03.12.03.06.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 03:06:48 -0700 (PDT) From: Sathish Narsimman X-Google-Original-From: Sathish Narsimman To: linux-bluetooth@vger.kernel.org, nsathish41@gmail.com Cc: chethan.tumkur.narayan@intel.com, Sathish Narsimman Subject: [PATCH 1/7] Bluetooth: LL Privacy Delete Store Resolving list Date: Thu, 12 Mar 2020 15:37:48 +0530 Message-Id: <20200312100754.3445-2-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200312100754.3445-1-sathish.narasimman@intel.com> References: <20200312100754.3445-1-sathish.narasimman@intel.com> Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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; + + /* If the device is not present in resolving list + * no need to send HCI command. + */ + irk = hci_bdaddr_list_lookup_with_irk(&hdev->le_resolv_list, bdaddr, addr_type); + if (!irk) + return; + + hci_req_init(&req, hdev); + cp.bdaddr_type = addr_type; + bacpy(&cp.bdaddr, bdaddr); + + hci_req_add(&req, HCI_OP_LE_DEL_FROM_RESOLV_LIST, sizeof(cp), &cp); + hci_req_run(&req, NULL); +} + void hci_req_add_le_passive_scan(struct hci_request *req) { struct hci_dev *hdev = req->hdev; -- 2.17.1