Commit eae3fda5 authored by Daniel Gabay's avatar Daniel Gabay Committed by Wen Zhiwei
Browse files

wifi: iwlwifi: mvm: fix iwl_mvm_max_scan_ie_fw_cmd_room()

stable inclusion
from stable-v6.6.53
commit 8587a0ed5f0725fe8258a761cd29baffd316c7a4
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAZ0GM

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8587a0ed5f0725fe8258a761cd29baffd316c7a4



--------------------------------

[ Upstream commit 916a5d9c5354c426220a0a6533a5e8ea1287d6ea ]

Driver creates also the WFA TPC element, consider that in the
calculation.

Signed-off-by: default avatarDaniel Gabay <daniel.gabay@intel.com>
Reviewed-by: default avatarIlan Peer <ilan.peer@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20240825191257.e710ce446b7f.I2715c6742e9c3d160e2ba41bc4b35de370d2ce34@changeid


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarWen Zhiwei <wenzhiwei@kylinos.cn>
parent ef34a28a
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@
/* Number of iterations on the channel for mei filtered scan */
#define IWL_MEI_SCAN_NUM_ITER	5U

#define WFA_TPC_IE_LEN	9

struct iwl_mvm_scan_timing_params {
	u32 suspend_time;
	u32 max_out_time;
@@ -296,8 +298,8 @@ static int iwl_mvm_max_scan_ie_fw_cmd_room(struct iwl_mvm *mvm)

	max_probe_len = SCAN_OFFLOAD_PROBE_REQ_SIZE;

	/* we create the 802.11 header and SSID element */
	max_probe_len -= 24 + 2;
	/* we create the 802.11 header SSID element and WFA TPC element */
	max_probe_len -= 24 + 2 + WFA_TPC_IE_LEN;

	/* DS parameter set element is added on 2.4GHZ band if required */
	if (iwl_mvm_rrm_scan_needed(mvm))
@@ -724,8 +726,6 @@ static u8 *iwl_mvm_copy_and_insert_ds_elem(struct iwl_mvm *mvm, const u8 *ies,
	return newpos;
}

#define WFA_TPC_IE_LEN	9

static void iwl_mvm_add_tpc_report_ie(u8 *pos)
{
	pos[0] = WLAN_EID_VENDOR_SPECIFIC;