Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp744433ybh; Sun, 12 Jul 2020 23:09:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKW9GkAX1iEAkbg9scVXcofNbkwwzycaOQfu24voMFamB2e9W4kst7aJ2E2RFs3nEqzku7 X-Received: by 2002:a05:6402:1250:: with SMTP id l16mr91430990edw.362.1594620555985; Sun, 12 Jul 2020 23:09:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594620555; cv=none; d=google.com; s=arc-20160816; b=GbRUGyZ0wcwA1Tnda2W7Bg4kMOFUXjo7XrR+2igqxDthrmQsBlK/lh8Eym+uNM+1ZC ydq7fxe9oameMXIN0bjFKuhvhnnQtoAPYLvQfzJHqEnyU8LzHBNVrfCQGUdDtIoNOg5Z bNrdYzA6LfG+VA7ns/OS5wyz6F3uF3quJn5GJgWFZrlGTxixpjpoaW9kDdbBkgU9RJhD EdeXhKlPm/W9QdSXB4jpJQJCOUq4PwGbtACf709qVWJDKsFDEmenfrQMOprwM+FiMIf7 laLPr6ns7FiL6qJ+KcGjTCjpoSThyOQnotnjdoOQk3bxk5SfFBOiAkUjYnnkz9guIqL4 Z70Q== 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=xSub10RztAkAVkR7dQ1tuib+ohmh4r9LyvxXZPcSzms=; b=HR71Xx/Y5DGrNcRWpCO35yTpMtd98Tnk4KX8c6v2+cCkN93dpl2SD+7wgBGIjiKUxv tGp4dhEMTsifuDgJ9Bz4HXw1ceaMjLGPZjr4H54xbCXABdqEo2qRU5Y688E+mIzRuRbz oNvvpIOkcN/0sbpUwxLQ522UCvqDE7PuSVrlUaJZJT+MwjP4j8ZDIuZQth/aMiLNMBSG Tyb2O7Ci2NqV1SQMnI7wfQ2tvDFGkXjQejo/eezTGdXTVUFQdRUbjr2mxoWVyL3wj6Xm XwP2VHfjecdC/DwVw4P+OjIGz0U5jo6J1/yjbLA9PR4ycNNGBXlSDYtdM4wowSmPgyUh EbFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CPd7Sm4T; 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 h27si9051691ejd.184.2020.07.12.23.08.43; Sun, 12 Jul 2020 23:09:15 -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=CPd7Sm4T; 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 S1728979AbgGMGIf (ORCPT + 99 others); Mon, 13 Jul 2020 02:08:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726571AbgGMGIf (ORCPT ); Mon, 13 Jul 2020 02:08:35 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68D4FC061794 for ; Sun, 12 Jul 2020 23:08:35 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id z5so5577067pgb.6 for ; Sun, 12 Jul 2020 23:08: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=xSub10RztAkAVkR7dQ1tuib+ohmh4r9LyvxXZPcSzms=; b=CPd7Sm4TlRPWYosX9tW/r3dPGBy0AvY3Bh/M6+lf1lmsS1eV1GJJxepMVj+lgInh3G uMfGUDlI5jh8grnmG+h1wUxqNSule4RZkHwTAvDn+QZKridnb8Es9BBcMbB+zq6ffM/m 7LOo8Z5ZLWrTHQmrDo7uQoAAFUFqAIQDLdMxLJHalBIqkyGoIwb4L38oHx5XIr57GTss z17BE5cEHrL/5njPAd9jO1GlvQ9+yq7MTpvSlc8Sfo5YMdjmeRmG1kX5AXuZ8FKzt5Xh Qio+ITndxr1IS0NWdWX1/SPGTx8NyOSLuH4JCTpefswlmiAdcnECMUsOBCvg6eMT7vQ0 hG7w== 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=xSub10RztAkAVkR7dQ1tuib+ohmh4r9LyvxXZPcSzms=; b=DvXSLy6J1hOeQUHBS2oFfK0sC6iyQs/0vMGUaCpK03FuAB3zm6eU6wUux25Na0u02n L7on3STheFYdHf3XAkdm/1UTMbxADJggCBsqKAYNjuttkjobELJQSfsJy9PGyY3SR7Cc zrBrxOP8jMjD5/oa59cVUCcaD07osU+7m83rwc2qqznsA7H5ZyRAmydtDvWo+CXiwf0q eeqRAlU+iTKIEuve7dL9M9aXofgbbJuXvZjYtDMsqEBGjEuh1MQ+vsaOQR3B/9w3L0RK ROyedp7/Vc4OivuiCdi1+nQY+ZC9QqcjXagPVHpA3hAUDyCarmJPZcPOMxWIxB7tAnFy lWmA== X-Gm-Message-State: AOAM531OFgLOrHqC98eaEfJoAyVVys1GLXQRFlULvOLSXzofFBQMzMCC 1STjx92tAR46YHOTGzECuCRRDOvKrBwsCA== X-Received: by 2002:aa7:858c:: with SMTP id w12mr53777378pfn.143.1594620514778; Sun, 12 Jul 2020 23:08:34 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jul 2020 23:08:34 -0700 (PDT) From: Sathish Narasimman X-Google-Original-From: Sathish Narasimman To: linux-bluetooth@vger.kernel.org Cc: Marcel Holtmann , Sathish Narsimman Subject: [PATCH 1/8] Bluetooth: Translate additional address type correctly Date: Mon, 13 Jul 2020 11:42:13 +0530 Message-Id: <20200713061220.3252-2-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 From: Marcel Holtmann When using controller based address resolution, then the new address types 0x02 and 0x03 are used. These types need to be converted back into either public address or random address types. Signed-off-by: Marcel Holtmann Signed-off-by: Sathish Narsimman --- include/net/bluetooth/hci.h | 6 ++++-- net/bluetooth/hci_core.c | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 1f18f71363e9..abab8b5981a7 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h @@ -2268,8 +2268,10 @@ struct hci_ev_le_conn_complete { #define LE_EXT_ADV_SCAN_RSP 0x0008 #define LE_EXT_ADV_LEGACY_PDU 0x0010 -#define ADDR_LE_DEV_PUBLIC 0x00 -#define ADDR_LE_DEV_RANDOM 0x01 +#define ADDR_LE_DEV_PUBLIC 0x00 +#define ADDR_LE_DEV_RANDOM 0x01 +#define ADDR_LE_DEV_PUBLIC_RESOLVED 0x02 +#define ADDR_LE_DEV_RANDOM_RESOLVED 0x03 #define HCI_EV_LE_ADVERTISING_REPORT 0x02 struct hci_ev_le_advertising_info { diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 6509f785dd14..4af208b82138 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -3290,6 +3290,15 @@ struct hci_conn_params *hci_pend_le_action_lookup(struct list_head *list, { struct hci_conn_params *param; + switch (addr_type) { + case ADDR_LE_DEV_PUBLIC_RESOLVED: + addr_type = ADDR_LE_DEV_PUBLIC; + break; + case ADDR_LE_DEV_RANDOM_RESOLVED: + addr_type = ADDR_LE_DEV_RANDOM; + break; + } + list_for_each_entry(param, list, action) { if (bacmp(¶m->addr, addr) == 0 && param->addr_type == addr_type) -- 2.17.1