From: Gregory Greenman <gregory.greenman@xxxxxxxxx> This field is used only for host TLC, so it can reside inside the corresponding lq_sta struct. Also, TLC lq_sta is cleared in iwl_mvm_rs_rate_init() upon association, but max_agg_bufsize is set earlier in iwl_mvm_sta_init(). Thus, place this field in the persistent part of lq_sta to retain its value. Signed-off-by: Gregory Greenman <gregory.greenman@xxxxxxxxx> --- drivers/net/wireless/intel/iwlwifi/mvm/rs.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/rs.h | 6 ++++-- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 11 ++++++----- drivers/net/wireless/intel/iwlwifi/mvm/sta.h | 2 -- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rs.c b/drivers/net/wireless/intel/iwlwifi/mvm/rs.c index 161a32929848..ab82965bc0f4 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rs.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rs.c @@ -3607,7 +3607,7 @@ static void rs_fill_lq_cmd(struct iwl_mvm *mvm, num_of_ant(initial_rate->ant) == 1) lq_cmd->single_stream_ant_msk = initial_rate->ant; - lq_cmd->agg_frame_cnt_limit = mvmsta->max_agg_bufsize; + lq_cmd->agg_frame_cnt_limit = lq_sta->pers.max_agg_bufsize; /* * In case of low latency, tell the firmware to leave a frame in the diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rs.h b/drivers/net/wireless/intel/iwlwifi/mvm/rs.h index c3145cb8f354..f99603b0f693 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rs.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rs.h @@ -1,10 +1,9 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /****************************************************************************** * - * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2015 Intel Mobile Communications GmbH * Copyright(c) 2017 Intel Deutschland GmbH - * Copyright(c) 2018 - 2019 Intel Corporation + * Copyright (C) 2003 - 2014, 2018 - 2022 Intel Corporation *****************************************************************************/ #ifndef __rs_h__ @@ -204,6 +203,7 @@ struct rs_rate { /** * struct iwl_lq_sta_rs_fw - rate and related statistics for RS in FW * @last_rate_n_flags: last rate reported by FW + * @max_agg_bufsize: the maximal size of the AGG buffer for this station * @sta_id: the id of the station #ifdef CONFIG_MAC80211_DEBUGFS * @dbg_fixed_rate: for debug, use fixed rate if not 0 @@ -353,6 +353,7 @@ struct iwl_lq_sta { /* last tx rate_n_flags */ u32 last_rate_n_flags; + /* packets destined for this STA are aggregated */ u8 is_agg; @@ -371,6 +372,7 @@ struct iwl_lq_sta { u8 chains; s8 chain_signal[IEEE80211_MAX_CHAINS]; s8 last_rssi; + u16 max_agg_bufsize; struct rs_rate_stats tx_stats[RS_COLUMN_COUNT][IWL_RATE_COUNT]; struct iwl_mvm *drv; spinlock_t lock; /* for races in reinit/update table */ diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c index 9a3a7eabded8..db6a3419bd31 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c @@ -1719,10 +1719,10 @@ int iwl_mvm_sta_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif, rcu_assign_pointer(mvm_sta->link[0], &mvm_sta->deflink); if (!mvm->trans->trans_cfg->gen2) - mvm_sta->max_agg_bufsize = + mvm_sta->deflink.lq_sta.rs_drv.pers.max_agg_bufsize = LINK_QUAL_AGG_FRAME_LIMIT_DEF; else - mvm_sta->max_agg_bufsize = + mvm_sta->deflink.lq_sta.rs_drv.pers.max_agg_bufsize = LINK_QUAL_AGG_FRAME_LIMIT_GEN2_DEF; } @@ -3258,10 +3258,11 @@ int iwl_mvm_sta_tx_agg_oper(struct iwl_mvm *mvm, struct ieee80211_vif *vif, * for each station. Therefore, use the minimum of all the * aggregation sessions and our default value. */ - mvmsta->max_agg_bufsize = - min(mvmsta->max_agg_bufsize, buf_size); + mvmsta->deflink.lq_sta.rs_drv.pers.max_agg_bufsize = + min(mvmsta->deflink.lq_sta.rs_drv.pers.max_agg_bufsize, + buf_size); mvmsta->deflink.lq_sta.rs_drv.lq.agg_frame_cnt_limit = - mvmsta->max_agg_bufsize; + mvmsta->deflink.lq_sta.rs_drv.pers.max_agg_bufsize; IWL_DEBUG_HT(mvm, "Tx aggregation enabled on ra = %pM tid = %d\n", sta->addr, tid); diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.h b/drivers/net/wireless/intel/iwlwifi/mvm/sta.h index 824d12047019..625e1dfd47a2 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.h @@ -355,7 +355,6 @@ struct iwl_mvm_link_sta { * @mac_id_n_color: the MAC context this station is linked to * @tid_disable_agg: bitmap: if bit(tid) is set, the fw won't send ampdus for * tid. - * @max_agg_bufsize: the maximal size of the AGG buffer for this station * @sta_type: station type * @sta_state: station state according to enum %ieee80211_sta_state * @bt_reduced_txpower: is reduced tx power enabled for this station @@ -406,7 +405,6 @@ struct iwl_mvm_sta { u32 tfd_queue_msk; u32 mac_id_n_color; u16 tid_disable_agg; - u16 max_agg_bufsize; u8 sta_type; enum ieee80211_sta_state sta_state; bool bt_reduced_txpower; -- 2.38.1