All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: luca@coelho.fi, linux-wireless@vger.kernel.org
Subject: [PATCH 8/8] iwlwifi: mvm: add support for timing measurement
Date: Sun, 11 Apr 2021 13:25:45 +0300	[thread overview]
Message-ID: <iwlwifi.20210411132130.f95c0cfd50f7.I15ab8fc214edc35f1f362006a9e1a22b89e7ed8e@changeid> (raw)
In-Reply-To: <20210411102545.438654-1-luca@coelho.fi>

From: Krishnanand Prabhu <krishnanand.prabhu@intel.com>

Add support for timing measurement in extended capabilities, used for
time synchronization.

Signed-off-by: Krishnanand Prabhu <krishnanand.prabhu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 .../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


  parent reply	other threads:[~2021-04-11 10:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-11 10:25 [PATCH 0/8] iwlwifi: updates intended for v5.13 2021-04-11-2 Luca Coelho
2021-04-11 10:25 ` [PATCH 1/8] iwlwifi: mvm: don't disconnect immediately if we don't hear beacons after CSA Luca Coelho
2021-04-12 10:27   ` Luca Coelho
2021-04-11 10:25 ` [PATCH 2/8] iwlwifi: mvm: don't WARN if we can't remove a time event Luca Coelho
2021-04-11 10:25 ` [PATCH 3/8] iwlwifi: bump FW API to 63 for AX devices Luca Coelho
2021-04-11 10:25 ` [PATCH 4/8] iwlwifi: trans/pcie: defer transport initialisation Luca Coelho
2021-04-11 10:25 ` [PATCH 5/8] iwlwifi: fw: print out trigger delay when collecting data Luca Coelho
2021-04-11 10:25 ` [PATCH 6/8] iwlwifi: pcie: Change ma product string name Luca Coelho
2021-04-11 10:25 ` [PATCH 7/8] iwlwifi: dbg: disable ini debug in 9000 family and below Luca Coelho
2021-04-11 10:25 ` Luca Coelho [this message]
2021-04-11 10:30   ` [PATCH 8/8] iwlwifi: mvm: add support for timing measurement Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=iwlwifi.20210411132130.f95c0cfd50f7.I15ab8fc214edc35f1f362006a9e1a22b89e7ed8e@changeid \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.