Hi,
This patch set includes iwlwifi patches intended for v6.11. It contains
a few features, bugfixes and cleanups.
Thanks,
Miri
Avraham Stern (6):
wifi: iwlwifi: mvm: add an option to use ptp clock for rx timestamp
wifi: iwlwifi: mvm: initiator: move setting target flags into a function
wifi: iwlwifi: mvm: initiator: move setting the sta_id into a function
wifi: iwlwifi: mvm: modify iwl_mvm_ftm_set_secured_ranging() parameters
wifi: iwlwifi: mvm: add support for version 14 of the range request command
wifi: iwlwifi: mvm: add support for version 10 of the responder config command
Avri Altman (1):
wifi: iwlwifi: mvm: Enable p2p low latency
Johannes Berg (4):
wifi: iwlwifi: mvm: report 64-bit radiotap timestamp
wifi: iwlwifi: mvm: handle TPE advertised by AP
wifi: iwlwifi: mvm: use only beacon BSS load for active links
wifi: iwlwifi: mvm: show full firmware ID in debugfs
Miri Korenblit (9):
wifi: iwlwifi: mvm: remove IWL_MVM_USE_NSSN_SYNC
wifi: iwlwifi: mvm: move a constant to constants.h
wifi: iwlwifi: mvm: Remove debug related code
wifi: iwlwifi: mvm: add debug data for MPDU counting
wifi: iwlwifi: mvm: declare band variable in the scope
wifi: iwlwifi: mvm: fix a wrong comment
wifi: iwlwifi: remove redundant prints
wifi: iwlwifi: move amsdu_size parsing to iwlwifi
wifi: iwlwifi: move Bz and Gl iwl_dev_info entries
.../wireless/intel/iwlwifi/fw/api/location.h | 157 +++++++++++
.../wireless/intel/iwlwifi/iwl-modparams.h | 21 +-
.../wireless/intel/iwlwifi/iwl-nvm-parse.c | 5 +-
.../wireless/intel/iwlwifi/mvm/constants.h | 5 +-
.../net/wireless/intel/iwlwifi/mvm/debugfs.c | 8 +-
.../intel/iwlwifi/mvm/ftm-initiator.c | 256 +++++++++++++-----
.../intel/iwlwifi/mvm/ftm-responder.c | 15 +-
drivers/net/wireless/intel/iwlwifi/mvm/link.c | 14 +-
.../net/wireless/intel/iwlwifi/mvm/mac80211.c | 13 +-
.../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 57 +++-
.../net/wireless/intel/iwlwifi/mvm/mld-sta.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 9 +
drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 22 +-
drivers/net/wireless/intel/iwlwifi/mvm/rx.c | 3 +
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 10 +
drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 3 +
.../wireless/intel/iwlwifi/mvm/tests/links.c | 4 +-
drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 54 ++--
18 files changed, 519 insertions(+), 139 deletions(-)
--
2.34.1
From: Avraham Stern <[email protected]>
Move setting the target's sta_id (and related flags) into a function
to support different versions of the target struct.
This is done as preparation for moving to the new range request
version.
Signed-off-by: Avraham Stern <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
---
.../intel/iwlwifi/mvm/ftm-initiator.c | 55 ++++++++++---------
1 file changed, 30 insertions(+), 25 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
index 98b1bbfc84bc..8596e6f7d1dc 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
@@ -431,9 +431,6 @@ iwl_mvm_ftm_put_target_v2(struct iwl_mvm *mvm,
return 0;
}
-#define FTM_PUT_FLAG(flag) (target->initiator_ap_flags |= \
- cpu_to_le32(IWL_INITIATOR_AP_FLAGS_##flag))
-
#define FTM_SET_FLAG(flag) (*flags |= \
cpu_to_le32(IWL_INITIATOR_AP_FLAGS_##flag))
@@ -525,21 +522,10 @@ iwl_mvm_ftm_put_target_v4(struct iwl_mvm *mvm,
return 0;
}
-static int
-iwl_mvm_ftm_put_target(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
- struct cfg80211_pmsr_request_peer *peer,
- struct iwl_tof_range_req_ap_entry_v6 *target)
+static int iwl_mvm_ftm_set_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
+ struct cfg80211_pmsr_request_peer *peer,
+ u8 *sta_id, __le32 *flags)
{
- int ret;
-
- ret = iwl_mvm_ftm_target_chandef_v2(mvm, peer, &target->channel_num,
- &target->format_bw,
- &target->ctrl_ch_position);
- if (ret)
- return ret;
-
- iwl_mvm_ftm_put_target_common(mvm, peer, target);
-
if (vif->cfg.assoc) {
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct ieee80211_sta *sta;
@@ -551,8 +537,8 @@ iwl_mvm_ftm_put_target(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
if (memcmp(peer->addr, link_conf->bssid, ETH_ALEN))
continue;
- target->sta_id = mvmvif->link[link_id]->ap_sta_id;
- sta = rcu_dereference(mvm->fw_id_to_mac_id[target->sta_id]);
+ *sta_id = mvmvif->link[link_id]->ap_sta_id;
+ sta = rcu_dereference(mvm->fw_id_to_mac_id[*sta_id]);
if (WARN_ON_ONCE(IS_ERR_OR_NULL(sta))) {
rcu_read_unlock();
return PTR_ERR_OR_ZERO(sta);
@@ -560,23 +546,42 @@ iwl_mvm_ftm_put_target(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
if (sta->mfp && (peer->ftm.trigger_based ||
peer->ftm.non_trigger_based))
- FTM_PUT_FLAG(PMF);
+ FTM_SET_FLAG(PMF);
break;
}
rcu_read_unlock();
#ifdef CONFIG_IWLWIFI_DEBUGFS
if (mvmvif->ftm_unprotected) {
- target->sta_id = IWL_MVM_INVALID_STA;
- target->initiator_ap_flags &=
- ~cpu_to_le32(IWL_INITIATOR_AP_FLAGS_PMF);
+ *sta_id = IWL_MVM_INVALID_STA;
+ *flags &= ~cpu_to_le32(IWL_INITIATOR_AP_FLAGS_PMF);
}
-
#endif
} else {
- target->sta_id = IWL_MVM_INVALID_STA;
+ *sta_id = IWL_MVM_INVALID_STA;
}
+ return 0;
+}
+
+static int
+iwl_mvm_ftm_put_target(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
+ struct cfg80211_pmsr_request_peer *peer,
+ struct iwl_tof_range_req_ap_entry_v6 *target)
+{
+ int ret;
+
+ ret = iwl_mvm_ftm_target_chandef_v2(mvm, peer, &target->channel_num,
+ &target->format_bw,
+ &target->ctrl_ch_position);
+ if (ret)
+ return ret;
+
+ iwl_mvm_ftm_put_target_common(mvm, peer, target);
+
+ iwl_mvm_ftm_set_sta(mvm, vif, peer, &target->sta_id,
+ &target->initiator_ap_flags);
+
/*
* TODO: Beacon interval is currently unknown, so use the common value
* of 100 TUs.
--
2.34.1
From: Avraham Stern <[email protected]>
Add a debugfs option to use the ptp clock time for rx device
timestamps. This can be useful to e.g. synchronize multiple NICs or
reporting the timestamp in the system clock instead of gp2.
Signed-off-by: Avraham Stern <[email protected]>
Reviewed-by: Greenman, Gregory <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
---
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 3 +++
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 3 +++
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 8 ++++++++
3 files changed, 14 insertions(+)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
index 7e7153220fd7..1504cbec69c9 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
@@ -2450,6 +2450,9 @@ void iwl_mvm_dbgfs_register(struct iwl_mvm *mvm)
debugfs_create_file("mem", 0600, mvm->debugfs_dir, mvm,
&iwl_dbgfs_mem_ops);
+ debugfs_create_bool("rx_ts_ptp", 0600, mvm->debugfs_dir,
+ &mvm->rx_ts_ptp);
+
/*
* Create a symlink with mac80211. It will be removed when mac80211
* exists (before the opmode exists which removes the target.)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 9e967b9cb015..f3d9b8355c6b 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -1309,6 +1309,9 @@ struct iwl_mvm {
struct iwl_phy_specific_cfg phy_filters;
#endif
+ /* report rx timestamp in ptp clock time */
+ bool rx_ts_ptp;
+
unsigned long last_6ghz_passive_scan_jiffies;
unsigned long last_reset_or_resume_time_jiffies;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
index 0f78a9ef5240..34a0f524262a 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
@@ -1954,6 +1954,14 @@ static void iwl_mvm_rx_fill_status(struct iwl_mvm *mvm,
iwl_mvm_decode_lsig(skb, phy_data);
rx_status->device_timestamp = phy_data->gp2_on_air_rise;
+
+ if (mvm->rx_ts_ptp && mvm->monitor_on) {
+ u64 adj_time =
+ iwl_mvm_ptp_get_adj_time(mvm, phy_data->gp2_on_air_rise * NSEC_PER_USEC);
+
+ rx_status->device_timestamp = div64_u64(adj_time, NSEC_PER_USEC);
+ }
+
rx_status->freq = ieee80211_channel_to_frequency(phy_data->channel,
rx_status->band);
iwl_mvm_get_signal_strength(mvm, rx_status, rate_n_flags,
--
2.34.1
From: Johannes Berg <[email protected]>
The firmware prefix is unused today, but it might still be
useful to have some information. Since the prefix will get
the intel/ directory in some cases, replace the prefix by
the full FW id which has all the information.
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
---
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
index 1504cbec69c9..cb164b733cb3 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
@@ -754,7 +754,6 @@ static ssize_t iwl_dbgfs_fw_ver_read(struct file *file, char __user *user_buf,
struct iwl_mvm *mvm = file->private_data;
char *buff, *pos, *endpos;
static const size_t bufsz = 1024;
- char _fw_name_pre[FW_NAME_PRE_BUFSIZE];
int ret;
buff = kmalloc(bufsz, GFP_KERNEL);
@@ -764,8 +763,8 @@ static ssize_t iwl_dbgfs_fw_ver_read(struct file *file, char __user *user_buf,
pos = buff;
endpos = pos + bufsz;
- pos += scnprintf(pos, endpos - pos, "FW prefix: %s\n",
- iwl_drv_get_fwname_pre(mvm->trans, _fw_name_pre));
+ pos += scnprintf(pos, endpos - pos, "FW id: %s\n",
+ mvm->fwrt.fw->fw_version);
pos += scnprintf(pos, endpos - pos, "FW: %s\n",
mvm->fwrt.fw->human_readable);
pos += scnprintf(pos, endpos - pos, "Device: %s\n",
--
2.34.1
The code that is parsing the amsdu_size module parameter and mapping it
to the corresponding Rx buffer size is common to all opmodes.
Move it into a function in iwlwifi, as preparation to a new op mode we
are working on.
Signed-off-by: Miri Korenblit <[email protected]>
Reviewed-by: Johannes Berg <[email protected]>
---
.../wireless/intel/iwlwifi/iwl-modparams.h | 21 ++++++++++++++++++-
drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 19 +----------------
2 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h b/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h
index 1cf26ab4f488..21eabfc3ffc8 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
- * Copyright (C) 2005-2014, 2018-2022 Intel Corporation
+ * Copyright (C) 2005-2014, 2018-2022, 2024 Intel Corporation
*/
#ifndef __iwl_modparams_h__
#define __iwl_modparams_h__
@@ -106,4 +106,23 @@ static inline bool iwl_enable_tx_ampdu(void)
return true;
}
+/* Verify amsdu_size module parameter and convert it to a rxb size */
+static inline enum iwl_amsdu_size
+iwl_amsdu_size_to_rxb_size(void)
+{
+ switch (iwlwifi_mod_params.amsdu_size) {
+ case IWL_AMSDU_8K:
+ return IWL_AMSDU_8K;
+ case IWL_AMSDU_12K:
+ return IWL_AMSDU_12K;
+ default:
+ pr_err("%s: Unsupported amsdu_size: %d\n", KBUILD_MODNAME,
+ iwlwifi_mod_params.amsdu_size);
+ fallthrough;
+ case IWL_AMSDU_DEF:
+ case IWL_AMSDU_4K:
+ return IWL_AMSDU_4K;
+ }
+}
+
#endif /* #__iwl_modparams_h__ */
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index ed9487062093..85178fe1b7ea 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -1373,24 +1373,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
trans_cfg.no_reclaim_cmds = no_reclaim_cmds;
trans_cfg.n_no_reclaim_cmds = ARRAY_SIZE(no_reclaim_cmds);
- switch (iwlwifi_mod_params.amsdu_size) {
- case IWL_AMSDU_DEF:
- trans_cfg.rx_buf_size = IWL_AMSDU_4K;
- break;
- case IWL_AMSDU_4K:
- trans_cfg.rx_buf_size = IWL_AMSDU_4K;
- break;
- case IWL_AMSDU_8K:
- trans_cfg.rx_buf_size = IWL_AMSDU_8K;
- break;
- case IWL_AMSDU_12K:
- trans_cfg.rx_buf_size = IWL_AMSDU_12K;
- break;
- default:
- pr_err("%s: Unsupported amsdu_size: %d\n", KBUILD_MODNAME,
- iwlwifi_mod_params.amsdu_size);
- trans_cfg.rx_buf_size = IWL_AMSDU_4K;
- }
+ trans_cfg.rx_buf_size = iwl_amsdu_size_to_rxb_size();
trans->wide_cmd_header = true;
trans_cfg.bc_table_dword =
--
2.34.1