Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1005664ybg; Wed, 3 Jun 2020 21:08:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwTyTmqusnIZkQQGQhINWdid6BcXx64zRtzaU3ilTJCRly3pB8rGSiKhUq0z5sHGdWnUuE X-Received: by 2002:a17:906:264a:: with SMTP id i10mr2269602ejc.210.1591243737892; Wed, 03 Jun 2020 21:08:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591243737; cv=none; d=google.com; s=arc-20160816; b=TCy4VMt4MZBEmelA1IFdu4nFUNegkzYJolhA7VPN1oAFaO5W9ggI41HiJ0dzXyAazY D4ecGRpXVTLzEVJ3isn4ZZufACR5kfcOSfRfMzQj5uqPYc/gPeo2xREkF/o2E+VeIb+k keQiWtjZbgR4yHrK1+7DYJh/VhtcIi8UE1Yyjnfgtxr+zWwakg0aiJxp2Vy2fE+JIbM4 7Q6uevbw3+Af4/2gPUVihQ5rGNGreiIXj23kW3qaMpltJ7xkhYgOnV6ZxaZrECJkGxwq Wo2/oVHdfNe0W2trzN/2wBMehV1aZsT6hI1BBjw+f5P9mvugcTED9lKHVx9GXo6lUGSt Gp/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=BU6ReF+CfuG1LTcepLVvODsTNk13vMQXVhPfvRTtwpU=; b=E8iaO8TaTsUI3LxE6lVxPDcj9+rpGYmm9jBcFzHDvQpOzQW5jh0pu5+IDiySUUIsMj 7epyE67Gr0YnSCCnDpsHwe2p1QGWeqoBiv5UBka5Rv8K9pvS3MRayM4kSSpADZudpVIm 7hzMLUIJtSkCjS1P3xVHX3Fwdqa27d6ifT3s7JBnM2wY8N7VaJckKRC8GI/wZGHdeTyz oiYtAMHkwXgJ7bTVTkDrr0HSUGcvEaHywWhVddjLYq/ttJRPJFUeNwigOpWjuEdELBQA pmRpMvMMdFTP5uhtm84W4ai22NjMu5OF/a5T9W8sYu9T23uNWo+plVQexUOmxqtpfIOX BxrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gAS9QwEP; 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 c9si897559edx.597.2020.06.03.21.08.34; Wed, 03 Jun 2020 21:08:57 -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=gAS9QwEP; 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 S1726146AbgFDEFz (ORCPT + 99 others); Thu, 4 Jun 2020 00:05:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725767AbgFDEFy (ORCPT ); Thu, 4 Jun 2020 00:05:54 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BA2AC03E96D for ; Wed, 3 Jun 2020 21:05:54 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id q16so1618312plr.2 for ; Wed, 03 Jun 2020 21:05:54 -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; bh=BU6ReF+CfuG1LTcepLVvODsTNk13vMQXVhPfvRTtwpU=; b=gAS9QwEPbm1XfGhdu+25w0d8AYeYGso/wq0qpJNDr5q5nYqBLoAXJ8JlF6FEb3Dziw DF9HlGThPZZZpuH0wd6CtiIcts0obs7EO91P0l79LdMp+ZwZFOUdzBFMfh/6XkWL8dGS gCoqy4mhXfXdutRF1ntD1Pw/m4y9DQprzFBjybSUOVCYz5ivGa4foNmzL35S1gj+2EMi riRXHzix0JJPxY9xGkVBfqYN4zxPCAK/DbzeIsVeOhhCJoTmiTz7rIVShV5UdL0wO8gz t4PiA1nx9g8s05qKRUKvdSS1eoZovCc23uXk4Qil3XYTSnhAwTIbmgdih10arIEdIBQx 6XLQ== 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; bh=BU6ReF+CfuG1LTcepLVvODsTNk13vMQXVhPfvRTtwpU=; b=l4MGbZyGLRVUlFzAe1NN426zb/IsDfwq3PZ3JF7TOpCqEE4BLjniYeBDc+fHlTci1K NwyxwOlF/+6D5cuvA8laIUIGExu1X07vw4IihALRg/TFr+pkYsR8R26nbqqxHrV/aPlv /0Q+o8s+PcINYkF8zkdyVcAQBoXyac9PF7jX/G+bfAAKkFJaC1gvdoICXvVOypi8eGuX 59JKv2eKh41DvIS7iB+CxBEk6g9Q8ncJh0Y+NKy4/teldSHpJhi5CG31Y34/YInLoxlG nSQa+L4C7NBDjjygnhnEPBZvyXI604iuGwH4s09n3Smn73cmawIaXMWh0fe13UV6nlDV gk9g== X-Gm-Message-State: AOAM531pxjQpgkVxfzkqb+IxBfP9zNwulB3Gkk4quq9k6QHhPN3StBE+ U/DDuoO4L5ZSH5S5lVw1FlZeU0Ck9mY= X-Received: by 2002:a17:90a:b949:: with SMTP id f9mr3421630pjw.79.1591243553969; Wed, 03 Jun 2020 21:05:53 -0700 (PDT) Received: from nsathish-Latitude-7480.iind.intel.com ([134.134.137.77]) by smtp.gmail.com with ESMTPSA id w190sm3098898pfw.35.2020.06.03.21.05.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2020 21:05:53 -0700 (PDT) From: Sathish Narasimman X-Google-Original-From: Sathish Narasimman To: linux-bluetooth@vger.kernel.org Cc: Sathish Narasimman Subject: [PATCH v2 7/7] Bluetooth: Enable RPA Timeout Date: Thu, 4 Jun 2020 09:39:16 +0530 Message-Id: <20200604040916.13495-1-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.17.1 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 1165dfea56a9..12005fbe6e09 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 f4ceda1f1454..67e1434c3f31 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -763,6 +763,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