Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1299665ybh; Thu, 23 Jul 2020 05:38:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8SfUojotktD0RllMoazTKnRiHl0uIanrqohIAPlUW4cDcR/VbBmt06uNd23MrESRBF85e X-Received: by 2002:a17:906:f20d:: with SMTP id gt13mr269295ejb.117.1595507906836; Thu, 23 Jul 2020 05:38:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595507906; cv=none; d=google.com; s=arc-20160816; b=wqrnwRLX2fSQeWoFmWZ04orSjuuLRc0/YjI9uHJ1X7Uc1SyeZx2CXRAMsXu7KqAhP3 sgBmkarB71C2NbPoCfGc2+4fz0ybyJgjS6AyzExwExL3Ex7WVCoDruI8P8BNd1fW/Jhx hopQPNf4gqKeCn/lruWflxqGq9Ta/Uz4GwyrZ4Z1+puohrVP85oL8e6EarFoL9KyZX7S B3F1cnv5nOgNIxSGhiZTVt3Kx6yVKEHgSpLNNBmZLW1zfSaDcABoXMxjocfGoE2Q7ry8 Won2PxVuMDwzdCFVtN1X1zy7ACMdzoIv62K+VzagSOPhThFQ67Z1Gh3gxQsbDhAwQy7M 8MEg== 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=PK9IFrqGA8tYf+eWNXSfj5UIMsffCcBtO2fOhU2TTN4=; b=xhpKbPaBipWzB9XxP60ByWRGR8gIUwnUlHwlF/AocevTnyVS8f920qQyDYPOvzPb4m rgjrJEI7hNO6RuFTUIOw6I1JnVzEOYFTT4mGXGlew6gz1Rnr6wkp3rKoFRQdGUvj/R4R szdK/R70zLDfMkPy0lm6MYokyHJM2RUhM4MmhTvr1SfOPx+FOWpcmGqSde4uDNniOwem 9C+DAzuLvOr6tvcH+sljyyAs8HawJTEkGLtdnR6PJLx15rjLIrtvfRPiGI3cywg1uSp1 kVfmE65BUC7vmYpzbL7zLE87PWEXFdduJsRVhJS5mTVgazx9vx32MCaUaCFhekOEgY1O ijVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dFRzsf1d; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id dn21si1918921edb.48.2020.07.23.05.38.02; Thu, 23 Jul 2020 05:38:26 -0700 (PDT) Received-SPF: pass (google.com: 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dFRzsf1d; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 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 S1728818AbgGWMff (ORCPT + 99 others); Thu, 23 Jul 2020 08:35:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726109AbgGWMff (ORCPT ); Thu, 23 Jul 2020 08:35:35 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44600C0619DC for ; Thu, 23 Jul 2020 05:35:35 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id md7so3001651pjb.1 for ; Thu, 23 Jul 2020 05:35:35 -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=PK9IFrqGA8tYf+eWNXSfj5UIMsffCcBtO2fOhU2TTN4=; b=dFRzsf1dtJ5p3hfGbld7FnwiV7O43cPZARtjXsGsdizh1lJyrpqfrGxBUbiNOnTvqT 9/Pn56r33XsbHvFLfBBmLtnUXF3rfyhMDnzUG4Svu+h8CsdQAvU4zxDP0dsEzNPpOBeo au4WPYmWQ5T++DmrKur/z+rJxYYc7Fo6A38oVHQfdb9d8XS8ZPEmB+cuFQWbIiyud2C6 +PnIMn9b4PVz7M9oM2QChdLr9Oy9yU/sH2WQzyLTaFebu4yq02sXUIDjsjVT68EerR1p EZen6NzAzCL4DdyIHfDzxmX2BqKtO+bnKtCQRu0fjM3CcY/1KmbZuLmuNecPQXqQ77Vb Zj2w== 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=PK9IFrqGA8tYf+eWNXSfj5UIMsffCcBtO2fOhU2TTN4=; b=lItbP/XdrV9Wy0U3MwknDLV2ls/DjrUtlbsHbkfjo8jldYGPbXZc5e+iemcxHMSFwE 3cD2PzEX+OQXhw0GW/o1vbnOOeOzuxWq8YpEBOdmiL96JZvHf8IoXtZ/rAoh9/xROB+k FLdBfmXVnNqNti/HnsUj286dNKwLXIABZWdTE4Mz5BV/freywpifrZ44JgWA+hxoCkUG fiK1RqZvyamVwHe+uX0q/8Ow4uQx4AAWpbbS+tjmACr+dCZYQ0+icACycqNP56SMtxkt gZHmE5kFVz+vwW9v1sIsMWX54ZgDA419Laa6EQ+yjKSexdTHDZKOdTOpPWfPPaksGyZq 3i9A== X-Gm-Message-State: AOAM532bUbdSvMI9eddl/M82EDtngtNFnPYmOkn9NDBIFw0K9b7nLHf6 txNHuW/+GF2JSxfJK9rNAMidxspi2MDwNA== X-Received: by 2002:a17:90a:c295:: with SMTP id f21mr214701pjt.208.1595507734661; Thu, 23 Jul 2020 05:35:34 -0700 (PDT) Received: from nsathish-Latitude-7480.iind.intel.com ([192.55.54.42]) by smtp.gmail.com with ESMTPSA id z11sm2849823pfr.71.2020.07.23.05.35.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 05:35:34 -0700 (PDT) From: Sathish Narasimman X-Google-Original-From: Sathish Narasimman To: linux-bluetooth@vger.kernel.org Cc: Sathish Narasimman Subject: [PATCH v5 7/8] Bluetooth: Enable RPA Timeout Date: Thu, 23 Jul 2020 18:09:02 +0530 Message-Id: <20200723123903.29337-7-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200723123903.29337-1-sathish.narasimman@intel.com> References: <20200723123903.29337-1-sathish.narasimman@intel.com> Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Enable RPA timeout during bluetooth initialization. The RPA timeout value is used from hdev, which initialized from debug_fs Signed-off-by: Sathish Narasimman --- include/net/bluetooth/hci.h | 2 ++ net/bluetooth/hci_core.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index abab8b5981a7..4ff2fc4498f3 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h @@ -1637,6 +1637,8 @@ struct hci_rp_le_read_resolv_list_size { #define HCI_OP_LE_SET_ADDR_RESOLV_ENABLE 0x202d +#define HCI_OP_LE_SET_RPA_TIMEOUT 0x202e + #define HCI_OP_LE_READ_MAX_DATA_LEN 0x202f struct hci_rp_le_read_max_data_len { __u8 status; diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 4af208b82138..2030536cc5d8 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -762,6 +762,14 @@ static int hci_init3_req(struct hci_request *req, unsigned long opt) hci_req_add(req, HCI_OP_LE_CLEAR_RESOLV_LIST, 0, NULL); } + if (hdev->commands[35] & 0x40) { + __le16 rpa_timeout = cpu_to_le16(hdev->rpa_timeout); + + /* Set RPA timeout */ + hci_req_add(req, HCI_OP_LE_SET_RPA_TIMEOUT, 2, + &rpa_timeout); + } + if (hdev->le_features[0] & HCI_LE_DATA_LEN_EXT) { /* Read LE Maximum Data Length */ hci_req_add(req, HCI_OP_LE_READ_MAX_DATA_LEN, 0, NULL); -- 2.17.1