Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp748686ybh; Sun, 12 Jul 2020 23:18:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzL+bixUS1RlZ2XoPbXiCmPh3esplVu+2c8ntOMefDy9tWZLpsWyGmeA3ZfklQcEdTuUJ7D X-Received: by 2002:aa7:d4ca:: with SMTP id t10mr89670153edr.244.1594621137763; Sun, 12 Jul 2020 23:18:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594621137; cv=none; d=google.com; s=arc-20160816; b=iPcXmZNRXnUNo+fOPbmXd9B+iYe35vnaKfYrhyRXJSaSJnUdKJHGWu0M2xlza1yVSW 7VW9Rxo/rkJ5hFtBUFYmMLzvGCOJqXHRNXnVLnWqM7/jV1TH5VMUU/S97MBBrcRnVqAA X51otdHSIhibSxgIiBqNrGcNc6v+6T1m9ET2VWmJyMJUp/JZUmrc4Obv0+v+y/0Ob3J3 4xlGoL/6M0/L19UFJcUvGTAEV9nGljTPA6gU5haVBFW+UxSfnU9bUsn+ppHrQqASmtud 8dCo+OofFPUPIeTI5MOVw/A1u14K3mBX8BMRlZ97mmbpzHlkqsd33RpWQnKq/o5/fMyR cFMQ== 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=K89jqEIZ3EbcNK+N2vzz8rZIER2kR68J/XtmnPTmJpYo2HfJzMUWj8RudHav4m6I3N 3d+J08O7oLVB+SJ5i7ry123Wz2ejTUWccb4ZLby5gKxPeHCzyX4Fcr3LWlev2suwHNC4 dLD/LjX2ZSSjEGt9Jco3B1dlRv2r53nS74e22fpLic0i2qF/ZwtMsVGTVzwCY44p09DR vbzUa95xmyml0shXrJiwB+qSH+I4UqU9BTmaqflCpIUvlgka7Q5X4CbKgc6/oTH/SxGQ mr4x2Umrz35Yi9OVyCuJnMSl+Il9Iel1z6Dz7kbad3Je5DksDUN1y3p7o4c7kiAJQVqD pYvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PYtuEI24; 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 cw28si9071863edb.424.2020.07.12.23.18.34; Sun, 12 Jul 2020 23:18: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=PYtuEI24; 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 S1727890AbgGMGSa (ORCPT + 99 others); Mon, 13 Jul 2020 02:18:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725804AbgGMGSa (ORCPT ); Mon, 13 Jul 2020 02:18:30 -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 8EA8CC061794 for ; Sun, 12 Jul 2020 23:18:30 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id j20so5563790pfe.5 for ; Sun, 12 Jul 2020 23:18:30 -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=PYtuEI24SUiceyjMGvP8DZ9fcw4kzUoqVdCJIl22dOi89C/ex/cniSYZpVA7KQixZG fY7OKc2Gr67Ho/vjnGI1+z3O+Vbsu/H8Etl81ziYf4MTFSqNCeml4SM20StY0T0vUO7h 63Bk5qiYquUOi69iuqbI/CChpvpXDscIFmOQCHX2EjJVq1e0eUfJbjcXLVs6T6EHAhiB Io2LtaNgBGF3ZuEjo9QbSeyuxJoR2txATJbgzZt+smMZ03DR+Y2emcwP/pt6ctl8gA62 nt02/TdUg3XDcSSpa/hsDJYOtVvbguU8AuLW3b8xBWF1eyWAmAAKgLqTFjIUjwhIuj6u JlLA== 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=iBVQ24+U2kgNLnWcCwx+XrYyHhkNbGwuWSIBB+MqGHLgue0og36s6qqtOvExzUqkrN /65Dio2T/5ATHEDCHsxzg1FAckBLdtjSc+lLmIj8G06PFDIwkFOH+5sGgh9W+NzzNxzp alQ62XQRmUVrYNUgOcrbbjwjuwyAGHdL5UTqgRzlcGkWyus/9JrxrsyfOnYm+EtWDHzB WLufa4xz7DVLTZa4gvKWRd7hcN3iGxM6VlAL4eo3rz3Ts67BtgYuXcCZZ1p2ECc0uiQk wdh6aGIccCJmRStvVB6AxCQK6JMLc3WmirW3SuvaVxK5+AR6wsVQ22gx6wn5/rHa7ULG hMWw== X-Gm-Message-State: AOAM532GeoWXNtAI+hMp8mpH72z7jmtYnG44yVUb/avNtvj2Mo9tUb2S 5D/nKEPKpoGfJGgZ5Bpm94iv8Je6r693TQ== X-Received: by 2002:a63:6744:: with SMTP id b65mr48189679pgc.42.1594621109882; Sun, 12 Jul 2020 23:18:29 -0700 (PDT) Received: from nsathish-Latitude-7480.iind.intel.com (jfdmzpr04-ext.jf.intel.com. [134.134.137.73]) by smtp.gmail.com with ESMTPSA id 204sm13096371pfx.3.2020.07.12.23.18.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jul 2020 23:18:29 -0700 (PDT) From: Sathish Narasimman X-Google-Original-From: Sathish Narasimman To: linux-bluetooth@vger.kernel.org Cc: Marcel Holtmann , Sathish Narsimman Subject: [PATCH v4 1/8] Bluetooth: Translate additional address type correctly Date: Mon, 13 Jul 2020 11:52:06 +0530 Message-Id: <20200713062213.3692-2-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200713062213.3692-1-sathish.narasimman@intel.com> References: <20200713062213.3692-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