Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp744658ybh; Sun, 12 Jul 2020 23:09:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzM5bDPj4iw7IpWxVZ500MJcq7hSza40ZlF+h3yOD4YNCXt4SB5Nl3RpQdFl72e3bs2cM5K X-Received: by 2002:a17:906:4f09:: with SMTP id t9mr71161607eju.110.1594620582361; Sun, 12 Jul 2020 23:09:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594620582; cv=none; d=google.com; s=arc-20160816; b=pLTGY4O2OxRvIX7H9bcszhu9pr9ff6nG9N6uel4I/YOkSKeXE1d/T/TVEBVKo0YTHP rcLWZ0urqftxtjSLC+MqjT+unNV4bEO8yt8TvPcm4Zr/UF5RTaL5WSL+JdkkAfeoXnBf L5CxSPU8bbXYysOa7U6hUlkAkHR7dlyOYivcBWAKgepZLWGGtdskjqZvt9eOC27ByX+o 06HWG0LgZUa/m3QixqWUVDiLMxl3dhJkSlbu8ppbmSHidrd9B+5M7ikMVp3NzoohFrhG aXdIPDneD60+/k4vIVxTvms/iUmb2Y8SEjOQvImwMfZ5/9FwP+O/nQbnwjeqVIbWDnm/ s0hA== 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=KP5X2OWK+NX3Fm0wr9h5R56UOwC1eGL9nhb9ve/6xBLcoHC78hJCM7S8YsR0EBplLq acDSRYwo8hinJ1DZs4UZ5D/Upq9fr/xQ7BA1MnysV7zcMDbkCwO8uAU0pS/m9CWtcOje 6nJrbqwHOU3O2xNsfRbN5DwKOWoA5WYJCjRxZKJomXR0KRsPPOSo9Vr0CBYqzdOVzfsr DpOBFwa2ASaPCePDl4+SJaRx3Ip2KEM2ao4NbUFs1QGi0AjM7MPp3zt84wAZ00R2yP28 Ou01W53+TO8xTGXms0z0MC5IIO14yI91aCiyXIlRhY58ooiu0vDcsbd9jo9USZZgOJK7 zOPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mSGENNWu; 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 mb7si8423115ejb.316.2020.07.12.23.09.18; Sun, 12 Jul 2020 23:09:42 -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=mSGENNWu; 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 S1729064AbgGMGIz (ORCPT + 99 others); Mon, 13 Jul 2020 02:08:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726571AbgGMGIz (ORCPT ); Mon, 13 Jul 2020 02:08:55 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B13FC061794 for ; Sun, 12 Jul 2020 23:08:55 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id m16so3856788pls.5 for ; Sun, 12 Jul 2020 23:08:55 -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=mSGENNWuz+5DFcCC++eo64EguI3yOMGm+wbneGECzOF+p3uN2wnjo82+pBQDToUzOq glUk9u3mTEWocdjxMo41FNifcAmUveljzUTvjSvLgQmN64evIJZdyLY93Uy++YGXRFWc iOn9I5Daktdi0Zn3NJoj7W0SV4glqhfgdb3NlFRiEl4GeTfBJvvLe6plxy6aqc5aGuBx emMCW0DU/F4bJV5Pn9qkTixAta17IsJjOTWskH5Ra6XM9snQ5k1m3OXx+99Oyheg4BZW OMEEwAk4jZqyWTMPJit+rPUcKCoWJHznO7oTw/eB5vr0/foUbcUigz5snvWiziBfyrKu yT9w== 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=NmSuAuztgRWvO9Jtz/CWtbfTuGfut/AMbEj53YSmj9Q4psZas56eg7Odu6Z2MuJ8R+ 8Wbn4kuKvN5w6JLxmN4ez5jPqbKyNxW8aayqebm9euAhVH8tjPW7v+Uh/XWwUxPM1sQ/ /8jf31SuNAZl+l2B38l//6dfQKKlWOzjN188VLpRwvvLtb8hC72xxnllCVzksP2yjAwl PysC0ksTteoGZU48jxyAOQu52+SogGUkJ2kBKFSBxnmy8CQF4g5lVCFXDFsRj3KkKcFk Kxy6tA6vaSqdrJtv+o+nAbwFPHUh4IfHjDgKMx8lkG7bvRtAASUESuc6ub5hGQGm3fCp Jk0g== X-Gm-Message-State: AOAM5317LATQWkN4di7Mu3+qbZUJ6XaiRdBMh+tN+6DvOT/WG7lj9jZL qm0g+vOV1WE71GCxJNCYEi6591nnGfhQiw== X-Received: by 2002:a17:90b:33c5:: with SMTP id lk5mr18743064pjb.181.1594620534693; Sun, 12 Jul 2020 23:08:54 -0700 (PDT) Received: from nsathish-Latitude-7480.iind.intel.com ([192.55.54.40]) by smtp.gmail.com with ESMTPSA id e5sm12787172pjy.26.2020.07.12.23.08.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jul 2020 23:08:54 -0700 (PDT) From: Sathish Narasimman X-Google-Original-From: Sathish Narasimman To: linux-bluetooth@vger.kernel.org Cc: Sathish Narasimman Subject: [PATCH 7/8] Bluetooth: Enable RPA Timeout Date: Mon, 13 Jul 2020 11:42:19 +0530 Message-Id: <20200713061220.3252-8-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200713061220.3252-1-sathish.narasimman@intel.com> References: <20200713061220.3252-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