wifi: iwlwifi: updates intended for v6.5 2023-06-20
cover wifi: iwlwifi: updates intended for v6.5 2023-06-20
From: Gregory Greenman <[email protected]>
Hi,
This patch set includes iwlwifi patches intended for v6.5.
It contains normal developement, cleanups and bugfixes.
Thanks,
Gregory
Benjamin Berg (1):
wifi: iwlwifi: mvm: send LARI configuration earlier
Emmanuel Grumbach (2):
wifi: iwlwifi: mvm: check the right csa_active
wifi: iwlwifi: mvm: make iwl_mvm_set_fw_mu_edca_params mld aware
Ilan Peer (1):
wifi: iwlwifi: mvm: Add support for scan version 17
Johannes Berg (13):
wifi: iwlwifi: pcie: refactor RB status size calculation
wifi: iwlwifi: pcie: add size assertions
wifi: iwlwifi: nvm: handle EHT/320 MHz regulatory flag
wifi: iwlwifi: mvm: use EHT maximum MPDU length on 2.4 GHz
wifi: iwlwifi: mvm: use min_t() for agg_size
wifi: iwlwifi: mvm: add EHT A-MPDU size exponent support
wifi: iwlwifi: limit EHT capabilities based on PCIe link speed
wifi: iwlwifi: remove disable_dummy_notification
wifi: iwlwifi: mvm: support new flush_sta method
wifi: iwlwifi: mvm: indicate HW decrypt for beacon protection
wifi: iwlwifi: mvm: avoid baid size integer overflow
wifi: iwlwifi: mvm: check only affected links
wifi: iwlwifi: mvm: adjust skip-over-dtim in D3
Miri Korenblit (1):
wifi: iwlwifi: fw: send marker cmd before suspend cmd
Mukesh Sisodiya (1):
wifi: iwlwifi: Add support for new PCI Id
.../net/wireless/intel/iwlwifi/fw/api/scan.h | 28 +++-- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 56 ++++++++- drivers/net/wireless/intel/iwlwifi/fw/dbg.h | 2 + .../net/wireless/intel/iwlwifi/fw/debugfs.c | 22 ---- .../net/wireless/intel/iwlwifi/fw/runtime.h | 6 +- .../net/wireless/intel/iwlwifi/iwl-config.h | 1 - .../wireless/intel/iwlwifi/iwl-nvm-parse.c | 22 +++- .../net/wireless/intel/iwlwifi/iwl-trans.h | 4 + drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 3 +- drivers/net/wireless/intel/iwlwifi/mvm/link.c | 2 +- .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 5 +- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 38 +++++- .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 1 + drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 4 +- .../net/wireless/intel/iwlwifi/mvm/power.c | 7 +- .../net/wireless/intel/iwlwifi/mvm/rs-fw.c | 15 ++- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 9 +- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 113 +++++++++++++----- drivers/net/wireless/intel/iwlwifi/mvm/sf.c | 5 +- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 34 ++++-- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 11 ++ drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 24 ++-- drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 5 +- drivers/net/wireless/intel/iwlwifi/queue/tx.c | 7 ++ 24 files changed, 302 insertions(+), 122 deletions(-)
Signature · 1 line
2.38.1
PATCH 1/19 wifi: iwlwifi: pcie: refactor RB status size calculation
From: Johannes Berg <[email protected]>
We have three places doing this check, and even in slightly different ways (with/without an intermediate). Refactor that to a new small inline function.
--- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 24 ++++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/rx.c +14 -10
@@ -699,17 +699,25 @@ static void iwl_pcie_free_rxq_dma(struct iwl_trans *trans, rxq->used_bd =NULL ; } +static size_t iwl_pcie_rb_stts_size (struct iwl_trans *trans) +{ +bool use_rx_td = (trans->trans_cfg->device_family >= +IWL_DEVICE_FAMILY_AX210 ); + +if (use_rx_td) +return sizeof (__le16); + +return sizeof (struct iwl_rb_status ); +} +static int iwl_pcie_alloc_rxq_dma (struct iwl_trans *trans,struct iwl_rxq *rxq) {struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans); +size_t rb_stts_size =iwl_pcie_rb_stts_size (trans);struct device *dev = trans->dev;int i;int free_size; -bool use_rx_td = (trans->trans_cfg->device_family >= -IWL_DEVICE_FAMILY_AX210 ); -size_t rb_stts_size = use_rx_td ?sizeof (__le16) : -sizeof (struct iwl_rb_status );spin_lock_init (&rxq->lock);if (trans->trans_cfg->mq_rx_supported)
@@ -757,11 +765,9 @@ static int iwl_pcie_alloc_rxq_dma(struct iwl_trans *trans,static int iwl_pcie_rx_alloc (struct iwl_trans *trans) {struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans); +size_t rb_stts_size =iwl_pcie_rb_stts_size (trans);struct iwl_rb_allocator *rba = &trans_pcie->rba;int i, ret; -size_t rb_stts_size = trans->trans_cfg->device_family >= -IWL_DEVICE_FAMILY_AX210 ? -sizeof (__le16) :sizeof (struct iwl_rb_status );if (WARN_ON (trans_pcie->rxq))return -EINVAL ;
@@ -1193,11 +1199,9 @@ int iwl_pcie_gen2_rx_init(struct iwl_trans *trans)void iwl_pcie_rx_free (struct iwl_trans *trans) {struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans); +size_t rb_stts_size =iwl_pcie_rb_stts_size (trans);struct iwl_rb_allocator *rba = &trans_pcie->rba;int i; -size_t rb_stts_size = trans->trans_cfg->device_family >= -IWL_DEVICE_FAMILY_AX210 ? -sizeof (__le16) :sizeof (struct iwl_rb_status );/* * if rxq is NULL, it means that nothing has been allocated,
Signature · 1 line
2.38.1
PATCH 2/19 wifi: iwlwifi: pcie: add size assertions
In reply to [email protected]From: Johannes Berg <[email protected]>
Ensure that the TX command scratch fits into the buffer provided by the first TB. It does, of course, but add some build-time validations in case we touch this code.
--- drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 5 ++++- drivers/net/wireless/intel/iwlwifi/queue/tx.c | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/pcie/tx.c +4 -1
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* -* Copyright (C) 2003-2014, 2018-2021 Intel Corporation +* Copyright (C) 2003-2014, 2018-2021, 2023 Intel Corporation * Copyright (C) 2013-2015 Intel Mobile Communications GmbH * Copyright (C) 2016-2017 Intel Deutschland GmbH */
@@ -1547,6 +1547,9 @@ int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb,/* there must be data left over for TB1 or this code must be changed */ BUILD_BUG_ON (sizeof (struct iwl_tx_cmd ) <IWL_FIRST_TB_SIZE ); +BUILD_BUG_ON (sizeof (struct iwl_cmd_header ) + + offsetofend(struct iwl_tx_cmd, scratch) > +IWL_FIRST_TB_SIZE );/* map the data for TB1 */ tb1_addr = ((u8 *)&dev_cmd->hdr) +IWL_FIRST_TB_SIZE ;
drivers/net/wireless/intel/iwlwifi/queue/tx.c +7 -0
@@ -648,6 +648,13 @@ struct iwl_tfh_tfd *iwl_txq_gen2_build_tfd(struct iwl_trans *trans,/* There must be data left over for TB1 or this code must be changed */ BUILD_BUG_ON (sizeof (struct iwl_tx_cmd_gen2 ) <IWL_FIRST_TB_SIZE ); +BUILD_BUG_ON (sizeof (struct iwl_cmd_header ) + + offsetofend(struct iwl_tx_cmd_gen2, dram_info) > +IWL_FIRST_TB_SIZE ); +BUILD_BUG_ON (sizeof (struct iwl_tx_cmd_gen3 ) <IWL_FIRST_TB_SIZE ); +BUILD_BUG_ON (sizeof (struct iwl_cmd_header ) + + offsetofend(struct iwl_tx_cmd_gen3, dram_info) > +IWL_FIRST_TB_SIZE );memset (tfd,0 ,sizeof (*tfd));
Signature · 1 line
2.38.1
PATCH 3/19 wifi: iwlwifi: mvm: check the right csa_active
In reply to [email protected]From: Emmanuel Grumbach <[email protected]>
When the firmware says that the channel switch is happening, we check that we know about that switch by checking the csa_active bit.
Until now, we checked the bss_conf from the vif instead of taking the bss_conf of the link.
Fix that.
--- drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +4 -1
@@ -1763,6 +1763,7 @@ void iwl_mvm_channel_switch_start_notif(struct iwl_mvm *mvm,u32 id;u8 notif_ver =iwl_fw_lookup_notif_ver (mvm->fw,MAC_CONF_GROUP ,CHANNEL_SWITCH_START_NOTIF ,0 ); +bool csa_active;rcu_read_lock ();
@@ -1778,6 +1779,7 @@ void iwl_mvm_channel_switch_start_notif(struct iwl_mvm *mvm, goto out_unlock; id = mac_id; + csa_active = vif->bss_conf.csa_active; }else {struct iwl_channel_switch_start_notif *notif = (void *)pkt->data;u32 link_id =le32_to_cpu (notif->link_id);
@@ -1789,6 +1791,7 @@ void iwl_mvm_channel_switch_start_notif(struct iwl_mvm *mvm, id = link_id; vif = bss_conf->vif; + csa_active = bss_conf->csa_active; } mvmvif =iwl_mvm_vif_from_mac80211 (vif);
@@ -1828,7 +1831,7 @@ void iwl_mvm_channel_switch_start_notif(struct iwl_mvm *mvm,*/ if (iwl_fw_lookup_notif_ver (mvm->fw,MAC_CONF_GROUP ,CHANNEL_SWITCH_ERROR_NOTIF , -0 ) && !vif->bss_conf.csa_active) { +0 ) && !csa_active) {IWL_DEBUG_INFO (mvm,"Channel Switch was canceled\n" );iwl_mvm_cancel_channel_switch (mvm, vif, id);break ;
Signature · 1 line
2.38.1
PATCH 4/19 wifi: iwlwifi: fw: send marker cmd before suspend cmd
In reply to [email protected]From: Miri Korenblit <[email protected]>
This is needed to sync the times in the FW and driver logs
--- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 56 +++++++++++++++++-- drivers/net/wireless/intel/iwlwifi/fw/dbg.h | 2 + .../net/wireless/intel/iwlwifi/fw/debugfs.c | 22 -------- .../net/wireless/intel/iwlwifi/fw/runtime.h | 6 +- 4 files changed, 58 insertions(+), 28 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/dbg.c +52 -4
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* -* Copyright (C) 2005-2014, 2018-2021 Intel Corporation +* Copyright (C) 2005-2014, 2018-2023 Intel Corporation * Copyright (C) 2013-2015 Intel Mobile Communications GmbH * Copyright (C) 2015-2017 Intel Deutschland GmbH */
@@ -3154,6 +3154,51 @@ static int iwl_fw_dbg_restart_recording(struct iwl_trans *trans,return 0 ; } +int iwl_fw_send_timestamp_marker_cmd (struct iwl_fw_runtime *fwrt) +{ +struct iwl_mvm_marker marker = { + .dw_len =sizeof (struct iwl_mvm_marker ) /4 , + .marker_id =MARKER_ID_SYNC_CLOCK , + }; +struct iwl_host_cmd hcmd = { + .flags =CMD_ASYNC , + .id =WIDE_ID (LONG_GROUP ,MARKER_CMD ), + .dataflags = {}, + }; +struct iwl_mvm_marker_rsp *resp; +int cmd_ver =iwl_fw_lookup_cmd_ver (fwrt->fw, +WIDE_ID (LONG_GROUP ,MARKER_CMD ), +IWL_FW_CMD_VER_UNKNOWN ); +int ret; + +if (cmd_ver ==1 ) { +/* the real timestamp is taken from the ftrace clock +* this is for finding the match between fw and kernel logs +*/ + marker.timestamp =cpu_to_le64 (fwrt->timestamp.seq++); + }else if (cmd_ver ==2 ) { + marker.timestamp =cpu_to_le64 (ktime_get_boottime_ns ()); + }else { +IWL_DEBUG_INFO (fwrt, +"Invalid version of Marker CMD. Ver = %d\n" , + cmd_ver); +return -EINVAL ; + } + + hcmd.data[0 ] = ▮ + hcmd.len[0 ] =sizeof (marker); + + ret =iwl_trans_send_cmd (fwrt->trans, &hcmd); + +if (cmd_ver >1 && hcmd.resp_pkt) { + resp = (void *)hcmd.resp_pkt->data; +IWL_DEBUG_INFO (fwrt,"FW GP2 time: %u\n" , +le32_to_cpu (resp->gp2)); + } + +return ret; +} +void iwl_fw_dbg_stop_restart_recording (struct iwl_fw_runtime *fwrt,struct iwl_fw_dbg_params *params,bool stop)
@@ -3164,12 +3209,15 @@ void iwl_fw_dbg_stop_restart_recording(struct iwl_fw_runtime *fwrt,return ;if (fw_has_capa (&fwrt->fw->ucode_capa, -IWL_UCODE_TLV_CAPA_DBG_SUSPEND_RESUME_CMD_SUPP )) +IWL_UCODE_TLV_CAPA_DBG_SUSPEND_RESUME_CMD_SUPP )) { +if (stop) +iwl_fw_send_timestamp_marker_cmd (fwrt); ret =iwl_fw_dbg_suspend_resume_hcmd (fwrt->trans, stop); -else if (stop) + }else if (stop) {iwl_fw_dbg_stop_recording (fwrt->trans, params); -else + }else { ret =iwl_fw_dbg_restart_recording (fwrt->trans, params); + }#ifdef CONFIG_IWLWIFI_DEBUGFS if (!ret) {if (stop)
drivers/net/wireless/intel/iwlwifi/fw/dbg.h +2 -0
@@ -227,6 +227,8 @@ static inline void iwl_fw_flush_dumps(struct iwl_fw_runtime *fwrt)flush_delayed_work (&fwrt->dump.wks[i].wk); } +int iwl_fw_send_timestamp_marker_cmd (struct iwl_fw_runtime *fwrt); +#ifdef CONFIG_IWLWIFI_DEBUGFS static inline void iwl_fw_cancel_timestamp (struct iwl_fw_runtime *fwrt) {
drivers/net/wireless/intel/iwlwifi/fw/debugfs.c +0 -22
@@ -123,28 +123,6 @@ static const struct file_operations iwl_dbgfs_##name##_ops = { \#define FWRT_DEBUGFS_ADD_FILE (name, parent, mode) \ FWRT_DEBUGFS_ADD_FILE_ALIAS(#name, name, parent, mode) -static int iwl_fw_send_timestamp_marker_cmd (struct iwl_fw_runtime *fwrt) -{ -struct iwl_mvm_marker marker = { - .dw_len =sizeof (struct iwl_mvm_marker ) /4 , - .marker_id =MARKER_ID_SYNC_CLOCK , - -/* the real timestamp is taken from the ftrace clock -* this is for finding the match between fw and kernel logs -*/ - .timestamp =cpu_to_le64 (fwrt->timestamp.seq++), - }; - -struct iwl_host_cmd hcmd = { - .id =MARKER_CMD , - .flags =CMD_ASYNC , - .data[0 ] = &marker, - .len[0 ] =sizeof (marker), - }; - -return iwl_trans_send_cmd (fwrt->trans, &hcmd); -} -static int iwl_dbgfs_enabled_severities_write (struct iwl_fw_runtime *fwrt,char *buf,size_t count) {
drivers/net/wireless/intel/iwlwifi/fw/runtime.h +4 -2
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ /* * Copyright (C) 2017 Intel Deutschland GmbH -* Copyright (C) 2018-2022 Intel Corporation +* Copyright (C) 2018-2023 Intel Corporation */ #ifndef __iwl_fw_runtime_h__#define __iwl_fw_runtime_h__
@@ -146,12 +146,14 @@ struct iwl_fw_runtime {u32 umac_minor; } fw_ver; } dump; -#ifdef CONFIG_IWLWIFI_DEBUGFS struct { +#ifdef CONFIG_IWLWIFI_DEBUGFS struct delayed_work wk;u32 delay; +#endif u64 seq; } timestamp; +#ifdef CONFIG_IWLWIFI_DEBUGFS bool tpc_enabled;#endif /* CONFIG_IWLWIFI_DEBUGFS */ #ifdef CONFIG_ACPI
Signature · 1 line
2.38.1
PATCH 5/19 wifi: iwlwifi: mvm: make iwl_mvm_set_fw_mu_edca_params mld aware
In reply to [email protected]From: Emmanuel Grumbach <[email protected]>
We need to work on the right link there.
--- drivers/net/wireless/intel/iwlwifi/mvm/link.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 10 +++++----- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/link.c +1 -1
@@ -188,7 +188,7 @@ int iwl_mvm_link_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif,/* TODO how to set ndp_fdbk_buff_th_exp? */ -if (iwl_mvm_set_fw_mu_edca_params (mvm, mvmvif, +if (iwl_mvm_set_fw_mu_edca_params (mvm, mvmvif->link[link_id], &cmd.trig_based_txf[0 ])) { flags |=LINK_FLG_MU_EDCA_CW ; flags_mask |=LINK_FLG_MU_EDCA_CW ;
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +5 -5
@@ -2240,7 +2240,7 @@ int iwl_mvm_set_sta_pkt_ext(struct iwl_mvm *mvm,* is enabled or not */ bool iwl_mvm_set_fw_mu_edca_params (struct iwl_mvm *mvm, -struct iwl_mvm_vif *mvmvif, +const struct iwl_mvm_vif_link_info *link_info,struct iwl_he_backoff_conf *trig_based_txf) {int i;
@@ -2248,11 +2248,11 @@ bool iwl_mvm_set_fw_mu_edca_params(struct iwl_mvm *mvm,bool mu_edca_enabled = true;for (i =0 ; i <IEEE80211_NUM_ACS ; i++) { -struct ieee80211_he_mu_edca_param_ac_rec *mu_edca = - &mvmvif->deflink.queue_params[i].mu_edca_param_rec; +const struct ieee80211_he_mu_edca_param_ac_rec *mu_edca = + &link_info->queue_params[i].mu_edca_param_rec;u8 ac =iwl_mvm_mac80211_ac_to_ucode_ac (i); -if (!mvmvif->deflink.queue_params[i].mu_edca) { +if (!link_info->queue_params[i].mu_edca) { mu_edca_enabled = false;break ; }
@@ -2398,7 +2398,7 @@ static void iwl_mvm_cfg_he_sta(struct iwl_mvm *mvm,rcu_read_unlock (); -if (iwl_mvm_set_fw_mu_edca_params (mvm, mvmvif, +if (iwl_mvm_set_fw_mu_edca_params (mvm, &mvmvif->deflink, &sta_ctxt_cmd.trig_based_txf[0 ])) flags |=STA_CTXT_HE_MU_EDCA_CW ;
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +1 -1
@@ -1804,7 +1804,7 @@ void iwl_mvm_set_fw_qos_params(struct iwl_mvm *mvm, struct ieee80211_vif *vif,struct ieee80211_bss_conf *link_conf, struct iwl_ac_qos *ac, __le32 *qos_flags);bool iwl_mvm_set_fw_mu_edca_params (struct iwl_mvm *mvm, -struct iwl_mvm_vif *mvmvif, +const struct iwl_mvm_vif_link_info *link_info,struct iwl_he_backoff_conf *trig_based_txf); void iwl_mvm_set_fw_dtim_tbtt(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct ieee80211_bss_conf *link_conf,
Signature · 1 line
2.38.1
PATCH 6/19 wifi: iwlwifi: nvm: handle EHT/320 MHz regulatory flag
In reply to [email protected]From: Johannes Berg <[email protected]>
Handle the regulatory EHT/320 MHz flags from firmware just like any other flags before it.
--- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +7 -0
@@ -1567,10 +1567,17 @@ static u32 iwl_nvm_get_regdom_bw_flags(const u16 *nvm_chan,if (!reg_capa.allow_160mhz) flags |=NL80211_RRF_NO_160MHZ ; + +if (!reg_capa.allow_320mhz) + flags |=NL80211_RRF_NO_320MHZ ; } +if (reg_capa.disable_11ax) flags |=NL80211_RRF_NO_HE ; +if (reg_capa.disable_11be) + flags |=NL80211_RRF_NO_EHT ; +return flags; }
Signature · 1 line
2.38.1
kernel test robot
build botRe: [PATCH 06/19] wifi: iwlwifi: nvm: handle EHT/320 MHz regulatory flag
kernel test robot noticed the following build errors:
Hi,
kernel test robot noticed the following build errors:
[auto build test ERROR on wireless-next/main]
[also build test ERROR on next-20230620]
[cannot apply to wireless/main linus/master v6.4-rc7]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/gregory-greenman-intel-com/wifi-iwlwifi-pcie-refactor-RB-status-size-calculation/20230620-180624 base: https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main patch link: https://lore.kernel.org/r/20230620125813.2c5e886c08f3.Ibc5c27d973d0590e2dea1f50435f9cf3ba8c2c09%40changeid patch subject: [PATCH 06/19] wifi: iwlwifi: nvm: handle EHT/320 MHz regulatory flag config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20230621/[email protected]/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce: (https://download.01.org/0day-ci/archive/20230621/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c: In function 'iwl_nvm_get_regdom_bw_flags':
>> drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c:1579:26: error: 'NL80211_RRF_NO_EHT' undeclared (first use in this function); did you mean 'NL80211_RRF_NO_HE'?
1579 | flags |= NL80211_RRF_NO_EHT;
| ^~~~~~~~~~~~~~~~~~
| NL80211_RRF_NO_HE drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c:1579:26: note: each undeclared identifier is reported only once for each function it appears in
vim +1579 drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
1516
1517 static u32 iwl_nvm_get_regdom_bw_flags(const u16 *nvm_chan,
1518 int ch_idx, u16 nvm_flags,
1519 struct iwl_reg_capa reg_capa,
1520 const struct iwl_cfg *cfg)
1521 {
1522 u32 flags = NL80211_RRF_NO_HT40;
1523
1524 if (ch_idx < NUM_2GHZ_CHANNELS &&
1525 (nvm_flags & NVM_CHANNEL_40MHZ)) {
1526 if (nvm_chan[ch_idx] <= LAST_2GHZ_HT_PLUS)
1527 flags &= ~NL80211_RRF_NO_HT40PLUS;
1528 if (nvm_chan[ch_idx] >= FIRST_2GHZ_HT_MINUS)
1529 flags &= ~NL80211_RRF_NO_HT40MINUS;
1530 } else if (nvm_flags & NVM_CHANNEL_40MHZ) {
1531 if ((ch_idx - NUM_2GHZ_CHANNELS) % 2 == 0)
1532 flags &= ~NL80211_RRF_NO_HT40PLUS;
1533 else
1534 flags &= ~NL80211_RRF_NO_HT40MINUS;
1535 }
1536
1537 if (!(nvm_flags & NVM_CHANNEL_80MHZ))
1538 flags |= NL80211_RRF_NO_80MHZ;
1539 if (!(nvm_flags & NVM_CHANNEL_160MHZ))
1540 flags |= NL80211_RRF_NO_160MHZ;
1541
1542 if (!(nvm_flags & NVM_CHANNEL_ACTIVE))
1543 flags |= NL80211_RRF_NO_IR;
1544
1545 if (nvm_flags & NVM_CHANNEL_RADAR)
1546 flags |= NL80211_RRF_DFS;
1547
1548 if (nvm_flags & NVM_CHANNEL_INDOOR_ONLY)
1549 flags |= NL80211_RRF_NO_OUTDOOR;
1550
1551 /* Set the GO concurrent flag only in case that NO_IR is set.
1552 * Otherwise it is meaningless
1553 */
1554 if ((nvm_flags & NVM_CHANNEL_GO_CONCURRENT) &&
1555 (flags & NL80211_RRF_NO_IR))
1556 flags |= NL80211_RRF_GO_CONCURRENT;
1557
1558 /*
1559 * reg_capa is per regulatory domain so apply it for every channel
1560 */
1561 if (ch_idx >= NUM_2GHZ_CHANNELS) {
1562 if (!reg_capa.allow_40mhz)
1563 flags |= NL80211_RRF_NO_HT40;
1564
1565 if (!reg_capa.allow_80mhz)
1566 flags |= NL80211_RRF_NO_80MHZ;
1567
1568 if (!reg_capa.allow_160mhz)
1569 flags |= NL80211_RRF_NO_160MHZ;
1570
1571 if (!reg_capa.allow_320mhz)
1572 flags |= NL80211_RRF_NO_320MHZ;
1573 }
1574
1575 if (reg_capa.disable_11ax)
1576 flags |= NL80211_RRF_NO_HE;
1577
1578 if (reg_capa.disable_11be)
> 1579 flags |= NL80211_RRF_NO_EHT; 1580
1581 return flags;
1582 }
1583
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
PATCH 7/19 wifi: iwlwifi: mvm: use EHT maximum MPDU length on 2.4 GHz
In reply to [email protected]From: Johannes Berg <[email protected]>
On 2.4 GHz there's no VHT, so EHT defines its own bits for the maximum MPDU length. Use them when telling firmware about the maximum.
--- drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c +13 -2
@@ -523,6 +523,7 @@ u16 rs_fw_get_max_amsdu_len(struct ieee80211_sta *sta, {const struct ieee80211_sta_vht_cap *vht_cap = &link_sta->vht_cap;const struct ieee80211_sta_ht_cap *ht_cap = &link_sta->ht_cap; +const struct ieee80211_sta_eht_cap *eht_cap = &link_sta->eht_cap;if (WARN_ON_ONCE (!link_conf->chandef.chan))return IEEE80211_MAX_MPDU_LEN_VHT_3895 ;
@@ -537,8 +538,18 @@ u16 rs_fw_get_max_amsdu_len(struct ieee80211_sta *sta,default :return IEEE80211_MAX_MPDU_LEN_VHT_3895 ; } - }else -if (vht_cap->vht_supported) { + }else if (link_conf->chandef.chan->band ==NL80211_BAND_2GHZ && + eht_cap->has_eht) { +switch (u8_get_bits (eht_cap->eht_cap_elem.mac_cap_info[0 ], +IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_MASK )) { +case IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_11454 : +return IEEE80211_MAX_MPDU_LEN_VHT_11454 ; +case IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_7991 : +return IEEE80211_MAX_MPDU_LEN_VHT_7991 ; +default : +return IEEE80211_MAX_MPDU_LEN_VHT_3895 ; + } + }else if (vht_cap->vht_supported) {switch (vht_cap->cap &IEEE80211_VHT_CAP_MAX_MPDU_MASK ) {case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 :return IEEE80211_MAX_MPDU_LEN_VHT_11454 ;
Signature · 1 line
2.38.1
PATCH 8/19 wifi: iwlwifi: mvm: use min_t() for agg_size
In reply to [email protected]From: Johannes Berg <[email protected]>
We can use min_t() for the agg_size and avoid
spelling out the (firmware) limit twice.
--- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +2 -3
@@ -92,9 +92,8 @@ u32 iwl_mvm_get_sta_ampdu_dens(struct ieee80211_link_sta *link_sta, IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK);/* Limit to max A-MPDU supported by FW */ -if (agg_size > (STA_FLG_MAX_AGG_SIZE_4M >>STA_FLG_MAX_AGG_SIZE_SHIFT )) - agg_size = (STA_FLG_MAX_AGG_SIZE_4M >> -STA_FLG_MAX_AGG_SIZE_SHIFT ); + agg_size =min_t (u32, agg_size, +STA_FLG_MAX_AGG_SIZE_4M >>STA_FLG_MAX_AGG_SIZE_SHIFT ); *_agg_size = agg_size;return mpdu_dens;
Signature · 1 line
2.38.1
PATCH 9/19 wifi: iwlwifi: mvm: add EHT A-MPDU size exponent support
In reply to [email protected]From: Johannes Berg <[email protected]>
Add support for reading the EHT MAC capabilities A-MPDU size exponent field, as indicated by the draft spec.
Also clarify the existing code a bit and add comments so it's clearer to understand what's going on here.
--- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 27 +++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +18 -9
@@ -60,22 +60,27 @@ u32 iwl_mvm_get_sta_ampdu_dens(struct ieee80211_link_sta *link_sta,if (WARN_ON (!link_sta))return 0 ; -if (link_sta->ht_cap.ht_supported) +/* Note that we always use only legacy & highest supported PPDUs, so +* of Draft P802.11be D.30 Table 10-12a--Fields used for calculating +* the maximum A-MPDU size of various PPDU types in different bands, +* we only need to worry about the highest supported PPDU type here. +*/ + +if (link_sta->ht_cap.ht_supported) { + agg_size = link_sta->ht_cap.ampdu_factor; mpdu_dens = link_sta->ht_cap.ampdu_density; + } -if (link_conf->chandef.chan->band == -NL80211_BAND_6GHZ ) { +if (link_conf->chandef.chan->band ==NL80211_BAND_6GHZ ) { +/* overwrite HT values on 6 GHz */ mpdu_dens =le16_get_bits (link_sta->he_6ghz_capa.capa,IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START ); agg_size =le16_get_bits (link_sta->he_6ghz_capa.capa,IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP ); }else if (link_sta->vht_cap.vht_supported) { - agg_size = link_sta->vht_cap.cap & -IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK ; - agg_size >>= -IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT ; - }else if (link_sta->ht_cap.ht_supported) { - agg_size = link_sta->ht_cap.ampdu_factor; +/* if VHT supported overwrite HT value */ + agg_size =u32_get_bits (link_sta->vht_cap.cap, +IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK ); }/* D6.0 10.12.2 A-MPDU length limit rules
@@ -91,6 +96,10 @@ u32 iwl_mvm_get_sta_ampdu_dens(struct ieee80211_link_sta *link_sta,u8_get_bits (link_sta->he_cap.he_cap_elem.mac_cap_info[3 ],IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK ); +if (link_sta->eht_cap.has_eht) + agg_size +=u8_get_bits (link_sta->eht_cap.eht_cap_elem.mac_cap_info[1 ], +IEEE80211_EHT_MAC_CAP1_MAX_AMPDU_LEN_MASK ); +/* Limit to max A-MPDU supported by FW */ agg_size =min_t (u32, agg_size,STA_FLG_MAX_AGG_SIZE_4M >>STA_FLG_MAX_AGG_SIZE_SHIFT );
Signature · 1 line
2.38.1
PATCH 10/19 wifi: iwlwifi: limit EHT capabilities based on PCIe link speed
In reply to [email protected]From: Johannes Berg <[email protected]>
If a discrete NIC is connected to a PCIe link hat isn't at least Gen3 (8.0 GT/s), then we cannot sustain 320 MHz traffic, so remove that from EHT capabilities in that case.
While at it, also move setting 320 MHz beamformee to the right place in the code so it's not set while not supporting 320 MHz.
--- .../net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 15 +++++++++++---- drivers/net/wireless/intel/iwlwifi/iwl-trans.h | 4 ++++ drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 9 +++++++++ 3 files changed, 24 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +11 -4
@@ -680,8 +680,7 @@ static const struct ieee80211_sband_iftype_data iwl_he_eht_capa[] = { IEEE80211_EHT_PHY_CAP0_BEAMFORMEE_SS_80MHZ_MASK, .phy_cap_info[1 ] =IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_80MHZ_MASK | -IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_160MHZ_MASK | - IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_320MHZ_MASK, + IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_160MHZ_MASK, .phy_cap_info[3 ] =IEEE80211_EHT_PHY_CAP3_NG_16_SU_FEEDBACK | IEEE80211_EHT_PHY_CAP3_NG_16_MU_FEEDBACK |
@@ -890,6 +889,10 @@ iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans, const struct iwl_fw *fw) {bool is_ap = iftype_data->types_mask &BIT (NL80211_IFTYPE_AP ); +bool no_320; + + no_320 = !trans->trans_cfg->integrated && + trans->pcie_link_speed <PCI_EXP_LNKSTA_CLS_8_0GB ;if (!data->sku_cap_11be_enable || iwlwifi_mod_params.disable_11be) iftype_data->eht_cap.has_eht = false;
@@ -916,8 +919,12 @@ iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans, IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_MASK);break ;case NL80211_BAND_6GHZ : - iftype_data->eht_cap.eht_cap_elem.phy_cap_info[0 ] |= -IEEE80211_EHT_PHY_CAP0_320MHZ_IN_6GHZ ; +if (!no_320) { + iftype_data->eht_cap.eht_cap_elem.phy_cap_info[0 ] |= +IEEE80211_EHT_PHY_CAP0_320MHZ_IN_6GHZ ; + iftype_data->eht_cap.eht_cap_elem.phy_cap_info[1 ] |= +IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_320MHZ_MASK ; + } fallthrough;case NL80211_BAND_5GHZ : iftype_data->he_cap.he_cap_elem.phy_cap_info[0] |=
drivers/net/wireless/intel/iwlwifi/iwl-trans.h +4 -0
@@ -1067,6 +1067,8 @@ struct iwl_trans_txqs {* @iwl_trans_txqs: transport tx queues data. * @mbx_addr_0_step: step address data 0 * @mbx_addr_1_step: step address data 1 +* @pcie_link_speed: current PCIe link speed (%PCI_EXP_LNKSTA_CLS_*), +* only valid for discrete (not integrated) NICs */ struct iwl_trans {bool csme_own;
@@ -1129,6 +1131,8 @@ struct iwl_trans {u32 mbx_addr_0_step;u32 mbx_addr_1_step; +u8 pcie_link_speed; +/* pointer to trans specific struct */ /*Ensure that this pointer will always be aligned to sizeof pointer */ char trans_specific[]__aligned(sizeof(void *)) ;
drivers/net/wireless/intel/iwlwifi/pcie/drv.c +9 -0
@@ -1760,6 +1760,15 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) trans_pcie->num_rx_bufs =RX_QUEUE_SIZE ; } +if (!iwl_trans->trans_cfg->integrated) { +u16 link_status; + +pcie_capability_read_word (pdev,PCI_EXP_LNKSTA , &link_status); + + iwl_trans->pcie_link_speed = +u16_get_bits (link_status,PCI_EXP_LNKSTA_CLS ); + } + ret =iwl_trans_init (iwl_trans);if (ret) goto out_free_trans;
Signature · 1 line
2.38.1
Re: [PATCH 10/19] wifi: iwlwifi: limit EHT capabilities based on PCIe link speed
Quoted 8 lines · On 6/20/23 3:03 AM, [email protected] wrote:
From: Johannes Berg <[email protected]>
If a discrete NIC is connected to a PCIe link hat isn't at least Gen3 (8.0 GT/s), then we cannot sustain 320 MHz traffic, so remove that from EHT capabilities in that case.
While at it, also move setting 320 MHz beamformee to the right place in the code so it's not set while not supporting 320 MHz.
Is there not an advantage to allowing 320Mhz for longer distance connections where signal is relatively weak, so over-all tput would easily fit in lesser pcie bus? Especially on 6E band where the US regdom allows more over-all power when using wider bandwidths?
Thanks,
Ben
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
Re: [PATCH 10/19] wifi: iwlwifi: limit EHT capabilities based on PCIe link speed
Quoted 7 lines · Ben Greear
Quoted 6 lines · On 6/20/23 3:03 AM, [email protected] wrote:
From: Johannes Berg <[email protected]>
If a discrete NIC is connected to a PCIe link hat isn't at least Gen3 (8.0 GT/s), then we cannot sustain 320 MHz traffic, so remove that from EHT capabilities in that case.
Quoted 8 lines
Quoted 2 lines
While at it, also move setting 320 MHz beamformee to the right place in the code so it's not set while not supporting 320 MHz.
Is there not an advantage to allowing 320Mhz for longer distance connections where signal is relatively weak, so over-all tput would easily fit in lesser pcie bus? Especially on 6E band where the US regdom allows more over-all power when using wider bandwidths?
I actually don't know. This surely isn't ideal, but it's the only way to really force the AP to not send too much than the NIC can pass out, and it gets unhappy if it can't.
johannes
Re: [PATCH 10/19] wifi: iwlwifi: limit EHT capabilities based on PCIe link speed
Quoted 17 lines · Johannes Berg
Quoted 7 lines · Ben Greear
Quoted 6 lines · On 6/20/23 3:03 AM, [email protected] wrote:
From: Johannes Berg <[email protected]>
If a discrete NIC is connected to a PCIe link hat isn't at least Gen3 (8.0 GT/s), then we cannot sustain 320 MHz traffic, so remove that from EHT capabilities in that case.
Quoted 8 lines
Quoted 2 lines
While at it, also move setting 320 MHz beamformee to the right place in the code so it's not set while not supporting 320 MHz.
Is there not an advantage to allowing 320Mhz for longer distance connections where signal is relatively weak, so over-all tput would easily fit in lesser pcie bus? Especially on 6E band where the US regdom allows more over-all power when using wider bandwidths?
Quoted 3 lines
I actually don't know. This surely isn't ideal, but it's the only way to really force the AP to not send too much than the NIC can pass out, and it gets unhappy if it can't.
So this is to work around hardware/firmware bug in NIC? If so, that should be mentioned.
I have heard in the past that higher bandwidth works better than higher NSS in a lot of cases, so if HW/FW can be made to deal with floods in unlikely case that the RF is perfect enough to saturate the PCI bus, then I think you should allow 320Mhz even on slower PCI bus configurations.
Thanks,
Ben
Quoted 3 lines
johannes
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
Re: [PATCH 10/19] wifi: iwlwifi: limit EHT capabilities based on PCIe link speed
Quoted 18 lines · Ben Greear
Quoted 17 lines · Johannes Berg
Quoted 15 lines · Ben Greear
Quoted 8 lines · On 6/20/23 3:03 AM, [email protected] wrote:
From: Johannes Berg <[email protected]>
If a discrete NIC is connected to a PCIe link hat isn't at least Gen3 (8.0 GT/s), then we cannot sustain 320 MHz traffic, so remove that from EHT capabilities in that case.
While at it, also move setting 320 MHz beamformee to the right place in the code so it's not set while not supporting 320 MHz.
Is there not an advantage to allowing 320Mhz for longer distance connections where signal is relatively weak, so over-all tput would easily fit in lesser pcie bus? Especially on 6E band where the US regdom allows more over-all power when using wider bandwidths?
Quoted 6 lines
Quoted 3 lines
I actually don't know. This surely isn't ideal, but it's the only way to really force the AP to not send too much than the NIC can pass out, and it gets unhappy if it can't.
So this is to work around hardware/firmware bug in NIC? If so, that should be mentioned.
I'm not sure that's really even a _bug_, it just doesn't have a lot of buffer space inside of it; as far as I know, given how the HW architecture works, the FW doesn't have a lot of options.
Quoted 4 lines
I have heard in the past that higher bandwidth works better than higher NSS in a lot of cases, so if HW/FW can be made to deal with floods in unlikely case that the RF is perfect enough to saturate the PCI bus, then I think you should allow 320Mhz even on slower PCI bus configurations.
Right. I don't think it's likely that the firmware will do, but hey, I can let them know :)
johannes
Re: [PATCH 10/19] wifi: iwlwifi: limit EHT capabilities based on PCIe link speed
śr., 21 cze 2023 o 18:12 Johannes Berg <[email protected]> napisał(a):
Quoted 31 lines · Ben Greear
Quoted 18 lines · Johannes Berg
Quoted 17 lines · Ben Greear
Quoted 15 lines · On 6/20/23 3:03 AM, [email protected] wrote:
Quoted 8 lines
From: Johannes Berg <[email protected]>
If a discrete NIC is connected to a PCIe link hat isn't at least Gen3 (8.0 GT/s), then we cannot sustain 320 MHz traffic, so remove that from EHT capabilities in that case.
While at it, also move setting 320 MHz beamformee to the right place in the code so it's not set while not supporting 320 MHz.
Is there not an advantage to allowing 320Mhz for longer distance connections where signal is relatively weak, so over-all tput would easily fit in lesser pcie bus? Especially on 6E band where the US regdom allows more over-all power when using wider bandwidths?
Quoted 6 lines
Quoted 3 lines
I actually don't know. This surely isn't ideal, but it's the only way to really force the AP to not send too much than the NIC can pass out, and it gets unhappy if it can't.
So this is to work around hardware/firmware bug in NIC? If so, that should be mentioned.
I'm not sure that's really even a _bug_, it just doesn't have a lot of buffer space inside of it; as far as I know, given how the HW architecture works, the FW doesn't have a lot of options.
Quoted 8 lines
Quoted 4 lines
I have heard in the past that higher bandwidth works better than higher NSS in a lot of cases, so if HW/FW can be made to deal with floods in unlikely case that the RF is perfect enough to saturate the PCI bus, then I think you should allow 320Mhz even on slower PCI bus configurations.
Right. I don't think it's likely that the firmware will do, but hey, I can let them know :)
Could we revert this one?
In my noisy env after disarm this check, still get better results for 320 than 160:
janusz@e850:~/github/wifi_tests/tests/remote$ ./run-tests.py -c
cfg-janusz.py -d bpi-r4 -r be200 -t connect_6g_tp
DUT: bpi-r4
REF: be200
RUN check_devices
PASS
START - connect_6g_tp (1/1)
PASS (
(6g/1/EHT320): ping pkt loss ap->sta: 0%, sta->ap: 0%
(6g/1/EHT320): ap->sta: 1453 Mbits/sec, sta->ap: 2097 Mbits/sec
) - 69.055398sjanusz@e850:~/github/wifi_tests/tests/remote$ ./run-tests.py -c
cfg-janusz.py -d bpi-r4 -r be200 -t connect_6g_tp
DUT: bpi-r4
REF: be200
RUN check_devices
PASS
START - connect_6g_tp (1/1)
PASS (
(6g/1/EHT160): ping pkt loss ap->sta: 0%, sta->ap: 0%
(6g/1/EHT160): ap->sta: 1266 Mbits/sec, sta->ap: 1706 Mbits/sec
) - 69.324334s
janusz@e850:~/github/wifi_tests/tests/remote$BR
Janusz
PATCH 11/19 wifi: iwlwifi: remove disable_dummy_notification
In reply to [email protected]From: Johannes Berg <[email protected]>
This struct member is read-only, so can never change away from the default value of zero. Remove the code that's in an if on the value, since it's effectively dead code.
--- drivers/net/wireless/intel/iwlwifi/iwl-config.h | 1 - drivers/net/wireless/intel/iwlwifi/mvm/sf.c | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-config.h +0 -1
@@ -388,7 +388,6 @@ struct iwl_cfg { high_temp:1, mac_addr_from_csr:10, lp_xtal_workaround:1, - disable_dummy_notification:1, apmg_not_supported:1, vht_mu_mimo_supported:1, cdb:1,
drivers/net/wireless/intel/iwlwifi/mvm/sf.c +1 -4
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* -* Copyright (C) 2013-2014, 2018-2019, 2022 Intel Corporation +* Copyright (C) 2013-2014, 2018-2019, 2022-2023 Intel Corporation * Copyright (C) 2013-2014 Intel Mobile Communications GmbH */ #include "mvm.h"
@@ -180,9 +180,6 @@ static int iwl_mvm_sf_config(struct iwl_mvm *mvm, struct ieee80211_sta *sta, };int ret =0 ; -if (mvm->cfg->disable_dummy_notification) - sf_cmd.state |=cpu_to_le32 (SF_CFG_DUMMY_NOTIF_OFF ); -/* * If an associated AP sta changed its antenna configuration, the state * will remain FULL_ON but SF parameters need to be reconsidered.
Signature · 1 line
2.38.1
PATCH 12/19 wifi: iwlwifi: mvm: send LARI configuration earlier
In reply to [email protected]From: Benjamin Berg <[email protected]>
Sending the LARI configuration may trigger calibration, which can have undesired side effects. Move the command to be send earlier (before the phy contexts are registered) to avoid unintended side effects.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +2 -1
@@ -1566,6 +1566,8 @@ int iwl_mvm_up(struct iwl_mvm *mvm) goto error; } +iwl_mvm_lari_cfg (mvm); +/* Init RSS configuration */ ret =iwl_configure_rxq (&mvm->fwrt);if (ret)
@@ -1676,7 +1678,6 @@ int iwl_mvm_up(struct iwl_mvm *mvm)if (ret) goto error; -iwl_mvm_lari_cfg (mvm);/* * RTNL is not taken during Ct-kill, but we don't need to scan/Tx * anyway, so don't init MCC.
Signature · 1 line
2.38.1
PATCH 13/19 wifi: iwlwifi: Add support for new PCI Id
In reply to [email protected]From: Mukesh Sisodiya <[email protected]>
Add support for the PCI Id 51F1 without IMR support.
--- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/intel/iwlwifi/pcie/drv.c +2 -0
@@ -495,6 +495,7 @@ static const struct pci_device_id iwl_hw_card_ids[] = { {IWL_PCI_DEVICE(0x7AF0, PCI_ANY_ID, iwl_so_trans_cfg)}, {IWL_PCI_DEVICE(0x51F0, PCI_ANY_ID, iwl_so_long_latency_trans_cfg)}, {IWL_PCI_DEVICE(0x51F1, PCI_ANY_ID, iwl_so_long_latency_imr_trans_cfg)}, + {IWL_PCI_DEVICE(0x51F1, PCI_ANY_ID, iwl_so_long_latency_trans_cfg)}, {IWL_PCI_DEVICE(0x54F0, PCI_ANY_ID, iwl_so_long_latency_trans_cfg)}, {IWL_PCI_DEVICE(0x7F70, PCI_ANY_ID, iwl_so_trans_cfg)},
@@ -544,6 +545,7 @@ static const struct iwl_dev_info iwl_dev_info_table[] = {IWL_DEV_INFO (0x51F0 ,0x1551 , iwl9560_2ac_cfg_soc, iwl9560_killer_1550i_160_name),IWL_DEV_INFO (0x51F0 ,0x1691 , iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690s_name),IWL_DEV_INFO (0x51F0 ,0x1692 , iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690i_name), +IWL_DEV_INFO (0x51F1 ,0x1692 , iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690i_name),IWL_DEV_INFO (0x54F0 ,0x1691 , iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690s_name),IWL_DEV_INFO (0x54F0 ,0x1692 , iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690i_name), IWL_DEV_INFO(0x7A70, 0x1691, iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690s_name),
Signature · 1 line
2.38.1
PATCH 14/19 wifi: iwlwifi: mvm: support new flush_sta method
In reply to [email protected]From: Johannes Berg <[email protected]>
For iwlwifi this is simple to implement, and on newer hardware it's an improvement since we have per-station queues.
--- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 25 +++++++++++++++++++ .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 1 + drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 ++ 3 files changed, 28 insertions(+)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +25 -0
@@ -5652,6 +5652,30 @@ void iwl_mvm_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,iwl_trans_wait_tx_queues_empty (mvm->trans, msk); } +void iwl_mvm_mac_flush_sta (struct ieee80211_hw *hw,struct ieee80211_vif *vif, +struct ieee80211_sta *sta) +{ +struct iwl_mvm *mvm =IWL_MAC80211_GET_MVM (hw); +int i; + +mutex_lock (&mvm->mutex); +for (i =0 ; i < mvm->fw->ucode_capa.num_stations; i++) { +struct iwl_mvm_sta *mvmsta; +struct ieee80211_sta *tmp; + + tmp =rcu_dereference_protected (mvm->fw_id_to_mac_id[i], +lockdep_is_held (&mvm->mutex)); +if (tmp != sta) +continue ; + + mvmsta =iwl_mvm_sta_from_mac80211 (sta); + +if (iwl_mvm_flush_sta (mvm, mvmsta, false)) +IWL_ERR (mvm,"flush request fail\n" ); + } +mutex_unlock (&mvm->mutex); +} +int iwl_mvm_mac_get_survey (struct ieee80211_hw *hw,int idx,struct survey_info *survey) {
@@ -6204,6 +6228,7 @@ const struct ieee80211_ops iwl_mvm_hw_ops = { .mgd_complete_tx = iwl_mvm_mac_mgd_complete_tx, .mgd_protect_tdls_discover = iwl_mvm_mac_mgd_protect_tdls_discover, .flush = iwl_mvm_mac_flush, + .flush_sta = iwl_mvm_mac_flush_sta, .sched_scan_start = iwl_mvm_mac_sched_scan_start, .sched_scan_stop = iwl_mvm_mac_sched_scan_stop, .set_key = iwl_mvm_mac_set_key,
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +1 -0
@@ -1149,6 +1149,7 @@ const struct ieee80211_ops iwl_mvm_mld_hw_ops = { .mgd_complete_tx = iwl_mvm_mac_mgd_complete_tx, .mgd_protect_tdls_discover = iwl_mvm_mac_mgd_protect_tdls_discover, .flush = iwl_mvm_mac_flush, + .flush_sta = iwl_mvm_mac_flush_sta, .sched_scan_start = iwl_mvm_mac_sched_scan_start, .sched_scan_stop = iwl_mvm_mac_sched_scan_stop, .set_key = iwl_mvm_mac_set_key,
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +2 -0
@@ -2659,6 +2659,8 @@ void iwl_mvm_mac_mgd_complete_tx(struct ieee80211_hw *hw, struct ieee80211_prep_tx_info *info);void iwl_mvm_mac_flush (struct ieee80211_hw *hw,struct ieee80211_vif *vif,u32 queues,bool drop); +void iwl_mvm_mac_flush_sta (struct ieee80211_hw *hw,struct ieee80211_vif *vif, +struct ieee80211_sta *sta); int iwl_mvm_mac_sched_scan_start(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct cfg80211_sched_scan_request *req,
Signature · 1 line
2.38.1
PATCH 15/19 wifi: iwlwifi: mvm: indicate HW decrypt for beacon protection
In reply to [email protected]From: Johannes Berg <[email protected]>
We've already done the 'decryption' here, so tell
mac80211 it need not do it again.
--- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +6 -3
@@ -279,7 +279,8 @@ static void iwl_mvm_get_signal_strength(struct iwl_mvm *mvm,static int iwl_mvm_rx_mgmt_prot (struct ieee80211_sta *sta,struct ieee80211_hdr *hdr,struct iwl_rx_mpdu_desc *desc, -u32 status) +u32 status, +struct ieee80211_rx_status *stats) {struct iwl_mvm_sta *mvmsta;struct iwl_mvm_vif *mvmvif;
@@ -308,8 +309,10 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,/* good cases */ if (likely (status &IWL_RX_MPDU_STATUS_MIC_OK && - !(status &IWL_RX_MPDU_STATUS_REPLAY_ERROR ))) + !(status &IWL_RX_MPDU_STATUS_REPLAY_ERROR ))) { + stats->flag |=RX_FLAG_DECRYPTED ;return 0 ; + }if (!sta)return -1 ;
@@ -378,7 +381,7 @@ static int iwl_mvm_rx_crypto(struct iwl_mvm *mvm, struct ieee80211_sta *sta,if (unlikely (ieee80211_is_mgmt (hdr->frame_control) && !ieee80211_has_protected (hdr->frame_control))) -return iwl_mvm_rx_mgmt_prot (sta, hdr, desc, status); +return iwl_mvm_rx_mgmt_prot (sta, hdr, desc, status, stats);if (!ieee80211_has_protected (hdr->frame_control) || (status & IWL_RX_MPDU_STATUS_SEC_MASK) ==
Signature · 1 line
2.38.1
PATCH 16/19 wifi: iwlwifi: mvm: avoid baid size integer overflow
In reply to [email protected]From: Johannes Berg <[email protected]>
Roee reported various hard-to-debug crashes with pings in EHT aggregation scenarios. Enabling KASAN showed that we access the BAID allocation out of bounds, and looking at the code a bit shows that since the reorder buffer entry (struct iwl_mvm_reorder_buf_entry) is 128 bytes if debug such as lockdep is enabled, then staring from an agg size 512 we overflow the size calculation, and allocate a much smaller structure than we should, causing slab corruption once we initialize this.
Fix this by simply using u32 instead of u16.
--- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +1 -1
@@ -2885,7 +2885,7 @@ int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta, }if (iwl_mvm_has_new_rx_api (mvm) && start) { -u16 reorder_buf_size = buf_size *sizeof (baid_data->entries[0 ]); +u32 reorder_buf_size = buf_size *sizeof (baid_data->entries[0 ]);/* sparse doesn't like the __align() so don't check */ #ifndef __CHECKER__
Signature · 1 line
2.38.1
PATCH 17/19 wifi: iwlwifi: mvm: check only affected links
In reply to [email protected]From: Johannes Berg <[email protected]>
When hostapd starts up, it may start up with only one link while the other is still scanning for overlapping BSSes. A station might start to connect at this point, but we run into this warning instead. Since there's no need to check for _all_ links, restrict the check to just the affected links that the STA will be using.
--- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +2 -1
@@ -3836,6 +3836,7 @@ int iwl_mvm_mac_sta_state_common(struct ieee80211_hw *hw,struct iwl_mvm *mvm =IWL_MAC80211_GET_MVM (hw);struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif);struct iwl_mvm_sta *mvm_sta =iwl_mvm_sta_from_mac80211 (sta); +struct ieee80211_link_sta *link_sta;unsigned int link_id;int ret;
@@ -3877,7 +3878,7 @@ int iwl_mvm_mac_sta_state_common(struct ieee80211_hw *hw,mutex_lock (&mvm->mutex);/* this would be a mac80211 bug ... but don't crash */ -for_each_mvm_vif_valid_link (mvmvif, link_id) { +for_each_sta_active_link (vif, sta, link_sta, link_id) {if (WARN_ON_ONCE (!mvmvif->link[link_id]->phy_ctxt)) {mutex_unlock (&mvm->mutex); return test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED,
Signature · 1 line
2.38.1
PATCH 18/19 wifi: iwlwifi: mvm: adjust skip-over-dtim in D3
In reply to [email protected]From: Johannes Berg <[email protected]>
The current formula can skip both too much and not enough time, given the +1 (where the comment about firmware is wrong). Adjust the formula accordingly.
--- drivers/net/wireless/intel/iwlwifi/mvm/power.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/power.c +3 -4
@@ -327,12 +327,11 @@ static void iwl_mvm_power_config_skip_dtim(struct iwl_mvm *mvm,if (WARN_ON (!dtimper_tu))return ; -/* configure skip over dtim up to 306TU - 314 msec */ - skip =max_t (u8,1 ,306 / dtimper_tu); +/* configure skip over dtim up to 900 TU DTIM interval */ + skip =max_t (u8,1 ,900 / dtimper_tu); } -/* the firmware really expects "look at every X DTIMs", so add 1 */ - cmd->skip_dtim_periods =1 + skip; + cmd->skip_dtim_periods = skip; cmd->flags |=cpu_to_le16 (POWER_FLAGS_SKIP_OVER_DTIM_MSK ); }
Signature · 1 line
2.38.1
PATCH 19/19 wifi: iwlwifi: mvm: Add support for scan version 17
In reply to [email protected]From: Ilan Peer <[email protected]>
Add support for scan request command version 17, which supports specifying the maximal EIRP PSD value that can be used for probe request transmission on a given channel.
--- .../net/wireless/intel/iwlwifi/fw/api/scan.h | 28 +++-- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 113 +++++++++++++----- 2 files changed, 99 insertions(+), 42 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/scan.h +18 -10
@@ -727,8 +727,10 @@ enum iwl_umac_scan_general_params_flags2 {* @iter_interval: interval between two scan iterations on one channel. */ struct iwl_scan_channel_cfg_umac { +#define IWL_CHAN_CFG_FLAGS_BAND_POS 30__le32 flags; -/* Both versions are of the same size, so use a union without adjusting + +/* All versions are of the same size, so use a union without adjusting * the command size later */ union {
@@ -746,6 +748,12 @@ struct iwl_scan_channel_cfg_umac {* SCAN_CHANNEL_CONFIG_API_S_VER_3 * SCAN_CHANNEL_CONFIG_API_S_VER_4 */ +struct { +u8 channel_num; +u8 psd_20; +u8 iter_count; +u8 iter_interval; + } v5;/* SCAN_CHANNEL_CONFIG_API_S_VER_5 */ }; } __packed;
@@ -982,7 +990,7 @@ struct iwl_scan_channel_params_v4 {SCAN_CHANNEL_PARAMS_API_S_VER_5 */ /** -* struct iwl_scan_channel_params_v6 +* struct iwl_scan_channel_params_v7 * @flags: channel flags &enum iwl_scan_channel_flags * @count: num of channels in scan request * @n_aps_override: override the number of APs the FW uses to calculate dwell
@@ -992,7 +1000,7 @@ struct iwl_scan_channel_params_v4 {* @channel_config: array of explicit channel configurations * for 2.4Ghz and 5.2Ghz bands */ -struct iwl_scan_channel_params_v6 { +struct iwl_scan_channel_params_v7 {u8 flags;u8 count;u8 n_aps_override[2 ];
@@ -1070,16 +1078,16 @@ struct iwl_scan_req_params_v12 {/** * struct iwl_scan_req_params_v16 * @general_params: &struct iwl_scan_general_params_v11 -* @channel_params: &struct iwl_scan_channel_params_v6 +* @channel_params: &struct iwl_scan_channel_params_v7 * @periodic_params: &struct iwl_scan_periodic_parms_v1 * @probe_params: &struct iwl_scan_probe_params_v4 */ -struct iwl_scan_req_params_v16 { +struct iwl_scan_req_params_v17 {struct iwl_scan_general_params_v11 general_params; -struct iwl_scan_channel_params_v6 channel_params; +struct iwl_scan_channel_params_v7 channel_params;struct iwl_scan_periodic_parms_v1 periodic_params;struct iwl_scan_probe_params_v4 probe_params; -} __packed;/* SCAN_REQUEST_PARAMS_API_S_VER_16, *_VER_15 and *_VER_14 */ +} __packed;/* SCAN_REQUEST_PARAMS_API_S_VER_17 - 14 */ /** * struct iwl_scan_req_umac_v12
@@ -1099,11 +1107,11 @@ struct iwl_scan_req_umac_v12 {* @ooc_priority: out of channel priority - &enum iwl_scan_priority * @scan_params: scan parameters */ -struct iwl_scan_req_umac_v16 { +struct iwl_scan_req_umac_v17 {__le32 uid;__le32 ooc_priority; -struct iwl_scan_req_params_v16 scan_params; -} __packed;/* SCAN_REQUEST_CMD_UMAC_API_S_VER_16, *_VER_15 and *_VER_14 */ +struct iwl_scan_req_params_v17 scan_params; +} __packed;/* SCAN_REQUEST_CMD_UMAC_API_S_VER_17 - 14 */ /** * struct iwl_umac_scan_abort
drivers/net/wireless/intel/iwlwifi/mvm/scan.c +81 -32
230 lines not on this page · raw message
Signature · 1 line
2.38.1
kernel test robot
build botRe: [PATCH 19/19] wifi: iwlwifi: mvm: Add support for scan version 17
kernel test robot noticed the following build errors:
Hi,
kernel test robot noticed the following build errors:
[auto build test ERROR on wireless-next/main]
[also build test ERROR on next-20230620]
[cannot apply to wireless/main linus/master v6.4-rc7]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/gregory-greenman-intel-com/wifi-iwlwifi-pcie-refactor-RB-status-size-calculation/20230620-180624 base: https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main patch link: https://lore.kernel.org/r/20230620125813.0a41c847d450.I0c9b45cc3eb39d44c75d3bdca84f0a91fdad1fa1%40changeid patch subject: [PATCH 19/19] wifi: iwlwifi: mvm: Add support for scan version 17 config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20230621/[email protected]/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce: (https://download.01.org/0day-ci/archive/20230621/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
drivers/net/wireless/intel/iwlwifi/mvm/scan.c: In function 'iwl_mvm_umac_scan_cfg_channels_v7_6g':
>> drivers/net/wireless/intel/iwlwifi/mvm/scan.c:1754:29: error: 'IEEE80211_RNR_TBTT_PARAMS_PSD_RESERVED' undeclared (first use in this function); did you mean 'IEEE80211_RNR_TBTT_PARAMS_SAME_SSID'?
1754 | s8 psd_20 = IEEE80211_RNR_TBTT_PARAMS_PSD_RESERVED;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| IEEE80211_RNR_TBTT_PARAMS_SAME_SSID
drivers/net/wireless/intel/iwlwifi/mvm/scan.c:1754:29: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/net/wireless/intel/iwlwifi/mvm/scan.c:1792:57: error: 'struct cfg80211_scan_6ghz_params' has no member named 'psd_20'
1792 | tmp_psd_20 = scan_6ghz_params[j].psd_20;
| ^
drivers/net/wireless/intel/iwlwifi/mvm/scan.c: In function 'iwl_mvm_scan_umac_fill_ch_p_v7':
drivers/net/wireless/intel/iwlwifi/mvm/scan.c:2443:41: error: 'IEEE80211_RNR_TBTT_PARAMS_PSD_RESERVED' undeclared (first use in this function); did you mean 'IEEE80211_RNR_TBTT_PARAMS_SAME_SSID'?
2443 | IEEE80211_RNR_TBTT_PARAMS_PSD_RESERVED;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| IEEE80211_RNR_TBTT_PARAMS_SAME_SSIDvim +1754 drivers/net/wireless/intel/iwlwifi/mvm/scan.c
1730
1731 /* TODO: this function can be merged with iwl_mvm_scan_umac_fill_ch_p_v7 */
1732 static u32
1733 iwl_mvm_umac_scan_cfg_channels_v7_6g(struct iwl_mvm *mvm,
1734 struct iwl_mvm_scan_params *params,
1735 u32 n_channels,
1736 struct iwl_scan_probe_params_v4 *pp,
1737 struct iwl_scan_channel_params_v7 *cp,
1738 enum nl80211_iftype vif_type,
1739 u32 version)
1740 {
1741 int i;
1742 struct cfg80211_scan_6ghz_params *scan_6ghz_params =
1743 params->scan_6ghz_params;
1744 u32 ch_cnt;
1745
1746 for (i = 0, ch_cnt = 0; i < params->n_channels; i++) {
1747 struct iwl_scan_channel_cfg_umac *cfg =
1748 &cp->channel_config[ch_cnt];
1749
1750 u32 s_ssid_bitmap = 0, bssid_bitmap = 0, flags = 0;
1751 u8 j, k, s_max = 0, b_max = 0, n_used_bssid_entries;
1752 bool force_passive, found = false, allow_passive = true,
1753 unsolicited_probe_on_chan = false, psc_no_listen = false;
> 1754 s8 psd_20 = IEEE80211_RNR_TBTT_PARAMS_PSD_RESERVED;
1755
1756 /*
1757 * Avoid performing passive scan on non PSC channels unless the
1758 * scan is specifically a passive scan, i.e., no SSIDs
1759 * configured in the scan command.
1760 */
1761 if (!cfg80211_channel_is_psc(params->channels[i]) &&
1762 !params->n_6ghz_params && params->n_ssids)
1763 continue;
1764
1765 cfg->v1.channel_num = params->channels[i]->hw_value;
1766 if (version < 17)
1767 cfg->v2.band = PHY_BAND_6;
1768 else
1769 cfg->flags |= cpu_to_le32(PHY_BAND_6 <<
1770 IWL_CHAN_CFG_FLAGS_BAND_POS);
1771
1772 cfg->v5.iter_count = 1;
1773 cfg->v5.iter_interval = 0;
1774
1775 /*
1776 * The optimize the scan time, i.e., reduce the scan dwell time
1777 * on each channel, the below logic tries to set 3 direct BSSID
1778 * probe requests for each broadcast probe request with a short
1779 * SSID.
1780 * TODO: improve this logic
1781 */
1782 n_used_bssid_entries = 3;
1783 for (j = 0; j < params->n_6ghz_params; j++) {
1784 s8 tmp_psd_20;
1785
1786 if (!(scan_6ghz_params[j].channel_idx == i))
1787 continue;
1788
1789 /* Use the highest PSD value allowed as advertised by
1790 * APs for this channel
1791 */
> 1792 tmp_psd_20 = scan_6ghz_params[j].psd_20; 1793 if (tmp_psd_20 !=
1794 IEEE80211_RNR_TBTT_PARAMS_PSD_RESERVED &&
1795 (psd_20 ==
1796 IEEE80211_RNR_TBTT_PARAMS_PSD_RESERVED ||
1797 psd_20 < tmp_psd_20))
1798 psd_20 = tmp_psd_20;
1799
1800 found = false;
1801 unsolicited_probe_on_chan |=
1802 scan_6ghz_params[j].unsolicited_probe;
1803 psc_no_listen |= scan_6ghz_params[j].psc_no_listen;
1804
1805 for (k = 0; k < pp->short_ssid_num; k++) {
1806 if (!scan_6ghz_params[j].unsolicited_probe &&
1807 le32_to_cpu(pp->short_ssid[k]) ==
1808 scan_6ghz_params[j].short_ssid) {
1809 /* Relevant short SSID bit set */
1810 if (s_ssid_bitmap & BIT(k)) {
1811 found = true;
1812 break;
1813 }
1814
1815 /*
1816 * Use short SSID only to create a new
1817 * iteration during channel dwell or in
1818 * case that the short SSID has a
1819 * matching SSID, i.e., scan for hidden
1820 * APs.
1821 */
1822 if (n_used_bssid_entries >= 3) {
1823 s_ssid_bitmap |= BIT(k);
1824 s_max++;
1825 n_used_bssid_entries -= 3;
1826 found = true;
1827 break;
1828 } else if (pp->direct_scan[k].len) {
1829 s_ssid_bitmap |= BIT(k);
1830 s_max++;
1831 found = true;
1832 allow_passive = false;
1833 break;
1834 }
1835 }
1836 }
1837
1838 if (found)
1839 continue;
1840
1841 for (k = 0; k < pp->bssid_num; k++) {
1842 if (!memcmp(&pp->bssid_array[k],
1843 scan_6ghz_params[j].bssid,
1844 ETH_ALEN)) {
1845 if (!(bssid_bitmap & BIT(k))) {
1846 bssid_bitmap |= BIT(k);
1847 b_max++;
1848 n_used_bssid_entries++;
1849 }
1850 break;
1851 }
1852 }
1853 }
1854
1855 if (cfg80211_channel_is_psc(params->channels[i]) &&
1856 psc_no_listen)
1857 flags |= IWL_UHB_CHAN_CFG_FLAG_PSC_CHAN_NO_LISTEN;
1858
1859 if (unsolicited_probe_on_chan)
1860 flags |= IWL_UHB_CHAN_CFG_FLAG_UNSOLICITED_PROBE_RES;
1861
1862 /*
1863 * In the following cases apply passive scan:
1864 * 1. Non fragmented scan:
1865 * - PSC channel with NO_LISTEN_FLAG on should be treated
1866 * like non PSC channel
1867 * - Non PSC channel with more than 3 short SSIDs or more
1868 * than 9 BSSIDs.
1869 * - Non PSC Channel with unsolicited probe response and
1870 * more than 2 short SSIDs or more than 6 BSSIDs.
1871 * - PSC channel with more than 2 short SSIDs or more than
1872 * 6 BSSIDs.
1873 * 3. Fragmented scan:
1874 * - PSC channel with more than 1 SSID or 3 BSSIDs.
1875 * - Non PSC channel with more than 2 SSIDs or 6 BSSIDs.
1876 * - Non PSC channel with unsolicited probe response and
1877 * more than 1 SSID or more than 3 BSSIDs.
1878 */
1879 if (!iwl_mvm_is_scan_fragmented(params->type)) {
1880 if (!cfg80211_channel_is_psc(params->channels[i]) ||
1881 flags & IWL_UHB_CHAN_CFG_FLAG_PSC_CHAN_NO_LISTEN) {
1882 force_passive = (s_max > 3 || b_max > 9);
1883 force_passive |= (unsolicited_probe_on_chan &&
1884 (s_max > 2 || b_max > 6));
1885 } else {
1886 force_passive = (s_max > 2 || b_max > 6);
1887 }
1888 } else if (cfg80211_channel_is_psc(params->channels[i])) {
1889 force_passive = (s_max > 1 || b_max > 3);
1890 } else {
1891 force_passive = (s_max > 2 || b_max > 6);
1892 force_passive |= (unsolicited_probe_on_chan &&
1893 (s_max > 1 || b_max > 3));
1894 }
1895 if ((allow_passive && force_passive) ||
1896 (!(bssid_bitmap | s_ssid_bitmap) &&
1897 !cfg80211_channel_is_psc(params->channels[i])))
1898 flags |= IWL_UHB_CHAN_CFG_FLAG_FORCE_PASSIVE;
1899 else
1900 flags |= bssid_bitmap | (s_ssid_bitmap << 16);
1901
1902 cfg->flags |= cpu_to_le32(flags);
1903 if (version >= 17)
1904 cfg->v5.psd_20 = psd_20;
1905
1906 ch_cnt++;
1907 }
1908
1909 if (params->n_channels > ch_cnt)
1910 IWL_DEBUG_SCAN(mvm,
1911 "6GHz: reducing number channels: (%u->%u)\n",
1912 params->n_channels, ch_cnt);
1913
1914 return ch_cnt;
1915 }
1916
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki