Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp971962pxb; Sun, 11 Apr 2021 03:28:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfVH3go+UYvWHt/09KM+crS3krFuT+qH5W/63pouBMZ1veQq2uqWvzishZNUNF1CiBs1mB X-Received: by 2002:a63:6d8a:: with SMTP id i132mr21933354pgc.82.1618136890160; Sun, 11 Apr 2021 03:28:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618136890; cv=none; d=google.com; s=arc-20160816; b=kR7A5OiwoGEswCYMcE+spmAsGYW3ikKZnAxqep4ccSdWfsX91E0B+WLE8rTdK93RM+ z7puPA7WF+qrIusIHGetkU39YyF1tR8kRoqQzIsdSlie3kD83AGpVauIJ3KzVXh9tmLY u8twAYe8M7s+d9dTS5MxIQDbiVkMnNoAuo/ljTY2AbpeKiRARZFrNcfJoJcYUjxs8KO6 Cj4GUP3jF/Osa7Tm9ELT5kA+W4LNxUnZ0CpfD7vCM5WRmXxFygWk7o82nHQxbX8vaFjb 2tEgx905nLcBqQOi32bw9HbVQDmQ0rxUg3nO5ZRofaOtCYFhHthdyR5B+wC9G9fgO05N hlfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:cc:to:from; bh=LN0+XEwhHyKEcj20WMvvTQuCnHf6yvDHAwN+/A932Uw=; b=JLBiPUmRc6dYaJWz3sVWu41Zf/yM1CebAxTFvRH0XIY4LY8ifAKbFsoPJcMOZvQ8vX By5BRfs8nw/MSHi/tWsUC2m72ARd8BBrMcMxLjRaaAwggBshjxrdtEnuXBz80+eoAsXc v6NxsQUZe1iwJwI7UbGI1BDNBJ1s/IwVkJv3wuKyw7Nvg9OqASuGADZ9tB+LhuYlt0RP skJz0djX8BU7rn7gL9ziA/5yzQ3+E0Go38mPXtWsG45I0wMyFDeAXnmEEdCLN9hojSuU hooKFYNjvm4BbmjCpJQapPGP3ItEdfDY3x3BIrfHcMG66e4J6UT1xNE1R+E7/RjJERLK sVRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p2si9297939pjt.68.2021.04.11.03.27.57; Sun, 11 Apr 2021 03:28:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235418AbhDKK0M (ORCPT + 99 others); Sun, 11 Apr 2021 06:26:12 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:44542 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235216AbhDKK0L (ORCPT ); Sun, 11 Apr 2021 06:26:11 -0400 Received: from 91-156-6-193.elisa-laajakaista.fi ([91.156.6.193] helo=kveik.lan) by farmhouse.coelho.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lVXHr-000K0H-Nq; Sun, 11 Apr 2021 13:25:53 +0300 From: Luca Coelho To: kvalo@codeaurora.org Cc: luca@coelho.fi, linux-wireless@vger.kernel.org Date: Sun, 11 Apr 2021 13:25:45 +0300 Message-Id: X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210411102545.438654-1-luca@coelho.fi> References: <20210411102545.438654-1-luca@coelho.fi> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on farmhouse.coelho.fi X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, TVD_RCVD_IP autolearn=ham autolearn_force=no version=3.4.5-pre1 Subject: [PATCH 8/8] iwlwifi: mvm: add support for timing measurement Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Krishnanand Prabhu Add support for timing measurement in extended capabilities, used for time synchronization. Signed-off-by: Krishnanand Prabhu Signed-off-by: Luca Coelho --- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 39 +++++++++++++++++-- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 607d5d564928..4e00f8d20788 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -297,13 +297,31 @@ static const u8 he_if_types_ext_capa_sta[] = { [9] = WLAN_EXT_CAPA10_TWT_REQUESTER_SUPPORT, }; -static const struct wiphy_iftype_ext_capab he_iftypes_ext_capa[] = { +static const u8 tm_if_types_ext_capa_sta[] = { + [0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING, + [2] = WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT | + WLAN_EXT_CAPA3_TIMING_MEASUREMENT_SUPPORT, + [7] = WLAN_EXT_CAPA8_OPMODE_NOTIF, + [9] = WLAN_EXT_CAPA10_TWT_REQUESTER_SUPPORT, +}; + +/* + * Additional interface types for which extended capabilities are + * specified separately + */ +static const struct wiphy_iftype_ext_capab add_iftypes_ext_capa[] = { { .iftype = NL80211_IFTYPE_STATION, .extended_capabilities = he_if_types_ext_capa_sta, .extended_capabilities_mask = he_if_types_ext_capa_sta, .extended_capabilities_len = sizeof(he_if_types_ext_capa_sta), }, + { + .iftype = NL80211_IFTYPE_STATION, + .extended_capabilities = tm_if_types_ext_capa_sta, + .extended_capabilities_mask = tm_if_types_ext_capa_sta, + .extended_capabilities_len = sizeof(tm_if_types_ext_capa_sta), + }, }; static int @@ -646,16 +664,29 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) NL80211_EXT_FEATURE_OCE_PROBE_REQ_HIGH_TX_RATE); } + hw->wiphy->iftype_ext_capab = NULL; + hw->wiphy->num_iftype_ext_capab = 0; + if (mvm->nvm_data->sku_cap_11ax_enable && !iwlwifi_mod_params.disable_11ax) { - hw->wiphy->iftype_ext_capab = he_iftypes_ext_capa; - hw->wiphy->num_iftype_ext_capab = - ARRAY_SIZE(he_iftypes_ext_capa); + hw->wiphy->iftype_ext_capab = add_iftypes_ext_capa; + hw->wiphy->num_iftype_ext_capab = ARRAY_SIZE(add_iftypes_ext_capa) - 1; ieee80211_hw_set(hw, SUPPORTS_MULTI_BSSID); ieee80211_hw_set(hw, SUPPORTS_ONLY_HE_MULTI_BSSID); } + if (iwl_fw_lookup_cmd_ver(mvm->fw, DATA_PATH_GROUP, + WNM_80211V_TIMING_MEASUREMENT_CONFIG_CMD, + IWL_FW_CMD_VER_UNKNOWN) == 1) { + IWL_DEBUG_INFO(mvm->trans, "Timing measurement supported\n"); + + hw->wiphy->iftype_ext_capab = add_iftypes_ext_capa + 1; + if (!hw->wiphy->iftype_ext_capab) + hw->wiphy->num_iftype_ext_capab = + hw->wiphy->num_iftype_ext_capab + 1; + } + mvm->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD; #ifdef CONFIG_PM_SLEEP -- 2.31.0