Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp472981ybt; Wed, 1 Jul 2020 03:02:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUrz+aW9dH5ogIqy4XiHq8iO0qpCimp301E4qnq1hwi+GsmrcHQ6j5hifja3ToPmQIjDs/ X-Received: by 2002:a50:9f22:: with SMTP id b31mr28570364edf.24.1593597721342; Wed, 01 Jul 2020 03:02:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593597721; cv=none; d=google.com; s=arc-20160816; b=GrlURRAtmE9eDRDV8oWlw/fUmTpwYyI/BDdtvSbe/vdz7/YHyfMVVsZpXYunbPPuAq +PgE8LSFb6PaO2jkbspcc7Z99Vs7gKHw3Fgowhw6A7zX/ArGjrDYMoOZ5rHnAJJk2d9a el0I7XGTiVuM2q6O0Ww7QLqyPp7lQB0L7dbIU+ZfOTRyFpthJAV08LA4sV77FC4dJivo 2SM6NzFt6mRun/MpBHdNbwbbvzVnwOId11N4kF+2R9Ngg/dd9ga50EeK2kuCCaaeyQR7 16LxFWHqKF8CVJ0LJOng/hrjGIxizMRfqf9du/Hx9jBRrvUtyjPNaqROLiATEp+PyalQ ahlg== 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=vkjx5T9Sq5IYIs+S7efhCR5KF66qOJdP9PWteN5i6Lo=; b=NDvyqO5ifYcW+0oc6aUxqqDSjMLItMLpcWOKylRMIm62Ag8pWkOOkYoN9VXOu+oZHp zKlEfHqikK8kBtTHwvJHnDYZzc4mfY59vaal0uJWob166yHTkWcmjCHNmKgOqPbo5bak TUMYnIWzSfdZqJaHKBgcWQmwADMslSDmI0i50CR+ziEcRlbm8+3m8gNFpe0aoCdZdxig Rhs5pb+V2E4wzVYPg7uWYynbsJUraQoUZ34r2quNmjkJqyzp3P5UhUuXMPRaxIwMRNXe +dKCdpXLCQrIgr7BHzl8t6cvCvczcEoh/ARs8hK9JKZSwbNPyFAo7ZcEi7qU2qMwr+zy Wr8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IQpaKIjk; 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 h16si1462104ejx.446.2020.07.01.03.01.37; Wed, 01 Jul 2020 03:02:01 -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=IQpaKIjk; 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 S1729693AbgGAKBd (ORCPT + 99 others); Wed, 1 Jul 2020 06:01:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725440AbgGAKBc (ORCPT ); Wed, 1 Jul 2020 06:01:32 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1E50C061755 for ; Wed, 1 Jul 2020 03:01:32 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id f16so433651pjt.0 for ; Wed, 01 Jul 2020 03:01:32 -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=vkjx5T9Sq5IYIs+S7efhCR5KF66qOJdP9PWteN5i6Lo=; b=IQpaKIjkCKXiUJiPwiiS/vQiL0VViTB8EJ4zSEitaRCCIv1GmJZO0TvqeIiwjZSxA+ aUEHwJXYWc+TvF0abTyLbPr/HrdA0yMVgzfabd4nZqJizQnLd3GMAJSk9k55gJ324pQV lskhYX3IP58lwLaQOyryQluWrCk5hMbDO4reJzhlgUeEjke5Ia0dR5mceMDUYjS4jRkI h5QqsUVFyTmRmbW4wtF9+LVmWO6J1YjqhCaBLsLRrA+RwXZDtJ7tDWKWBCfI4D3nFbOo GwufLsMnn1nYOofrnuF2TeFo+iEHvopeqVst+QCZfICd0pSbU/IVmbYE5QVoRG81DNou /E7g== 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=vkjx5T9Sq5IYIs+S7efhCR5KF66qOJdP9PWteN5i6Lo=; b=lLNEYaZDl8Qlv3Pr3kVz2vG4HO+n7iX49BBcq2CBWrSuqAijeAgVXvJdJwN4sUKyuv Oy1FRuCTYZUJPI71yZxT+VRqil1kkxuC7xO/J6LnEBZQeVybFvbJQ5rLoUWheJV3GZbV X+yY1B+NpVX6WjgxwqgzONAkmmpGQex/atkdREvF2l2NL35TUSM5/oONJobL8c3GOFCK NKmAGDjE+bMfYN4wC65DrxxJYfwy8OSdUJ173ZQiFG1iaO65g7jHGd6Hl2DdO7T1Quda VqTPHWLZRKvA/CisMCYQG4rL6AhpBEMnUOAw4v7yrJfGPIrE8KAoGPvUAtRyIVtbiVHY WBlQ== X-Gm-Message-State: AOAM5314HzO2Tc5JaOAA3LgSBr9+WDZOd2ZRhBFyoDZL5xlWhA+S4dnA n0kzyANRx2ijgFz2huJ5Gk/5s9Blg6AJDA== X-Received: by 2002:a17:90a:e602:: with SMTP id j2mr23767397pjy.200.1593597692090; Wed, 01 Jul 2020 03:01:32 -0700 (PDT) Received: from nsathish-Latitude-7480.iind.intel.com ([192.55.55.43]) by smtp.gmail.com with ESMTPSA id d37sm5381961pgd.18.2020.07.01.03.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jul 2020 03:01:31 -0700 (PDT) From: Sathish Narasimman X-Google-Original-From: Sathish Narasimman To: linux-bluetooth@vger.kernel.org Cc: Sathish Narasimman Subject: [PATCH v3 7/8] Bluetooth: Enable RPA Timeout Date: Wed, 1 Jul 2020 15:34:31 +0530 Message-Id: <20200701100432.28038-8-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200701100432.28038-1-sathish.narasimman@intel.com> References: <20200701100432.28038-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 604a411a9b8f..b496d5395bd3 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