Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1066716pxk; Fri, 25 Sep 2020 05:30:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwr5vmFkdl46glC9pUFdll+bdOdF/VpIjVL6ai//X9+cqJUoTXZwdntfOwUZZAAY2PUmfqa X-Received: by 2002:a17:906:b784:: with SMTP id dt4mr2629220ejb.376.1601037011210; Fri, 25 Sep 2020 05:30:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601037011; cv=none; d=google.com; s=arc-20160816; b=Ex/6imPopjP0+skM4D7//sBb95Gqq4+aJ3+xGL37TUHoKQvSfDLEdHCdUrbh3oiB37 5/7pl5oppFs2K4oQprdDjIxpx03D+ziNxg0iQ6/9UEgTen2uUn2vhP6S/ZlkCh302Qpn NhQ2ZaQK1lR6heCYEqxedIC+04eQYvJlxUu+QtGfizqgzwqfb0ORU+BqagSuAsJNH6hk R6Tc3aCOIJQ7W06CZ8F4niuoVs5uP99lXjIvi8fGZ83m7SQuGrzLuu8JXms/6LplvIY6 NfXeagbaGIvHrwLUbuWWFWZHnBDs+JDM1SWKBR8pp05yac5/b04XTXs2nlKa69eUw5DR Q1Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=b6h9h7KGCgp2Fmjt8/xk5iaXlAGfTMxsta23UpCu97s=; b=npLpkx/6LAaVSYhinJk584A87xD/Rg/W83MYmKw1J0Gv/8DCl3n6TB734Kd/jpnZnB fJx7Xz/9gO2lUTr1eDam/N5ZXIVAw9QBGXCmjMhF7n4yefDOLB+kwYJAQkzPJonV9+o9 uPd6/mFm4z1fGQNcw6OVyNazL0PGRwN/I29OUoVl9a7jLC4JS1n/yx1KakROYAqAEl+0 Je52yrwW7mFkha80j5dMKhMvOFJb143kfXTQNx+bkGdeKDsatoYbw0UVbr/ZoGFdOhbF ge3cT5cQ5XSRnUqBTX83sldNUJBOm04vsGQZ+XOF2cqyAoxA70Teg4+FcFkPzo9BZ5SF Ffuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eApvrKwI; 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 b5si1705827ejq.317.2020.09.25.05.29.34; Fri, 25 Sep 2020 05:30:11 -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=eApvrKwI; 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 S1728171AbgIYM1G (ORCPT + 99 others); Fri, 25 Sep 2020 08:27:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726368AbgIYM1G (ORCPT ); Fri, 25 Sep 2020 08:27:06 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FCBBC0613CE for ; Fri, 25 Sep 2020 05:27:06 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id w7so3027282pfi.4 for ; Fri, 25 Sep 2020 05:27:06 -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=b6h9h7KGCgp2Fmjt8/xk5iaXlAGfTMxsta23UpCu97s=; b=eApvrKwIc2nxuMN0p5iMYtBA5BQfZv2BR1n4pXSiLZhDYMv0XGobc0iBkBbtEhA2aW TaXXbC3J7XYW4LtSBEfNYWMRRhvkLvZyO847541HtPmIFSwxGjiYuF9gDvi3nv+7Z2wG rQ5Bs4iZyeEwnevF8UAttBsobuPkwvBWn/fodOvzo2gejKQEVQZdi7qWmHy72Hu79y2f 4uerRkuvde/D0JN4ITijIrt6M0g2VEFKxnBEkKIbcwGsClMx162DSF7cARvuph3AUR4a ontwwXSQb7TXDz72uZoBGYsHu1pqSaqcklfDneDGJt5pFs+fUjsokD4bBsMrpIT3kxub yKDA== 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=b6h9h7KGCgp2Fmjt8/xk5iaXlAGfTMxsta23UpCu97s=; b=tOYHbMvfhkDK6e/ujlDD3EkOLPNRxE1pzljeF1OC3+qbYAhI7J0QuCTYuyaZ/dc7WI zFiv/81h1rHlsoXc2gtlcfEgoY4wQ/Qo8vF1Kmr+PvT0kDgQJd0WGAVNUAXftk8uk9gK jP1TXL+y0K4kloSukCO9p46UojDpTpU0V7rb+rxbIlkRV4j2pPth3UIcoo1aAuuwF6La eCXaEoe4f8VhV6OifS+31skilAiICeuGbC9h+LjOC7Y5gQTDDXg9tBgJiOX3gsRgX0ec gJwEjN3i5lAPmQC9+QjdZk3Atn1Fffxa/a9TYzUacGQzXvLu3J58ztocKgj4OY4+YdSC Klfg== X-Gm-Message-State: AOAM532JR+pmJzM9kf22zBBzypoP3pI/elBCjY7XoO3UcFs6MtlERjVQ YLH99xmSdClqN5Tjje7p0xvtN/4a2kxphiYE X-Received: by 2002:aa7:9518:0:b029:142:2501:35e3 with SMTP id b24-20020aa795180000b0290142250135e3mr3754128pfp.67.1601036825541; Fri, 25 Sep 2020 05:27:05 -0700 (PDT) Received: from nsathish-Latitude-7480.iind.intel.com ([134.134.139.76]) by smtp.gmail.com with ESMTPSA id a27sm2775956pfk.52.2020.09.25.05.27.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 05:27:04 -0700 (PDT) From: Sathish Narasimman X-Google-Original-From: Sathish Narasimman To: linux-bluetooth@vger.kernel.org Cc: chethan.tumkur.narayan@intel.com, ravishankar.srivatsa@intel.com, kiran.k@intel.com, Sathish Narasimman Subject: [PATCH] Bluetooth: Fix - update own_addr_type if ll_privacy supported Date: Fri, 25 Sep 2020 18:02:15 +0530 Message-Id: <20200925123215.15569-1-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org During system powercycle when trying to get the random address hci_get_random_address set own_addr_type as 0x01. In which if we enable ll_privacy it is supposed to be 0x03. Signed-off-by: Sathish Narasimman --- net/bluetooth/hci_request.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c index d2b06f5c9380..6f12bab4d2fa 100644 --- a/net/bluetooth/hci_request.c +++ b/net/bluetooth/hci_request.c @@ -1885,7 +1885,13 @@ int hci_get_random_address(struct hci_dev *hdev, bool require_privacy, if (use_rpa) { int to; - *own_addr_type = ADDR_LE_DEV_RANDOM; + /* If Controller supports LL Privacy use own address type is + * 0x03 + */ + if (use_ll_privacy(hdev)) + *own_addr_type = ADDR_LE_DEV_RANDOM_RESOLVED; + else + *own_addr_type = ADDR_LE_DEV_RANDOM; if (adv_instance) { if (!adv_instance->rpa_expired && -- 2.17.1