Commit d4416228 authored by Daniel Gabay's avatar Daniel Gabay Committed by Johannes Berg

wifi: iwlwifi: mvm: fix iwl_mvm_scan_fits() calculation

The calculation should consider also the 6GHz IE's len, fix that.
In addition, in iwl_mvm_sched_scan_start() the scan_fits helper is
called only in case non_psc_incldued is true, but it should be called
regardless, fix that as well.
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.7db825442fd2.I99f4d6587709de02072fd57957ec7472331c6b1d@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent f8a129c1
...@@ -837,8 +837,8 @@ static inline bool iwl_mvm_scan_fits(struct iwl_mvm *mvm, int n_ssids, ...@@ -837,8 +837,8 @@ static inline bool iwl_mvm_scan_fits(struct iwl_mvm *mvm, int n_ssids,
return ((n_ssids <= PROBE_OPTION_MAX) && return ((n_ssids <= PROBE_OPTION_MAX) &&
(n_channels <= mvm->fw->ucode_capa.n_scan_channels) & (n_channels <= mvm->fw->ucode_capa.n_scan_channels) &
(ies->common_ie_len + (ies->common_ie_len +
ies->len[NL80211_BAND_2GHZ] + ies->len[NL80211_BAND_2GHZ] + ies->len[NL80211_BAND_5GHZ] +
ies->len[NL80211_BAND_5GHZ] <= ies->len[NL80211_BAND_6GHZ] <=
iwl_mvm_max_scan_ie_fw_cmd_room(mvm))); iwl_mvm_max_scan_ie_fw_cmd_room(mvm)));
} }
...@@ -3168,18 +3168,16 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm, ...@@ -3168,18 +3168,16 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm,
params.n_channels = j; params.n_channels = j;
} }
if (non_psc_included && if (!iwl_mvm_scan_fits(mvm, req->n_ssids, ies, params.n_channels)) {
!iwl_mvm_scan_fits(mvm, req->n_ssids, ies, params.n_channels)) { ret = -ENOBUFS;
kfree(params.channels); goto out;
return -ENOBUFS;
} }
uid = iwl_mvm_build_scan_cmd(mvm, vif, &hcmd, &params, type); uid = iwl_mvm_build_scan_cmd(mvm, vif, &hcmd, &params, type);
if (uid < 0) {
if (non_psc_included) ret = uid;
kfree(params.channels); goto out;
if (uid < 0) }
return uid;
ret = iwl_mvm_send_cmd(mvm, &hcmd); ret = iwl_mvm_send_cmd(mvm, &hcmd);
if (!ret) { if (!ret) {
...@@ -3197,6 +3195,9 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm, ...@@ -3197,6 +3195,9 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm,
mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_DISABLED; mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_DISABLED;
} }
out:
if (non_psc_included)
kfree(params.channels);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment