iwlwifi: mvm: move only to an enabled channel
During disassociation we're decreasing the phy's ref count. If the ref count becomes 0, we're configuring the phy ctxt to the default channel (the lowest channel which the device can operate on). Currently we're not checking whether the the default channel is enabled or not. Fix it by configuring the phy ctxt to the lowest channel which is enabled. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20220210181930.03f281b6a6bc.I5b63d43ec41996d599e6f37ec3f32e878b3e405e@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
This commit is contained in:
parent
26de4c8b02
commit
e04135c077
@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2012-2014, 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2012-2014, 2018-2022 Intel Corporation
|
||||
* Copyright (C) 2013-2014 Intel Mobile Communications GmbH
|
||||
* Copyright (C) 2017 Intel Deutschland GmbH
|
||||
*/
|
||||
@ -345,19 +345,32 @@ void iwl_mvm_phy_ctxt_unref(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt)
|
||||
* otherwise we might not be able to reuse this phy.
|
||||
*/
|
||||
if (ctxt->ref == 0) {
|
||||
struct ieee80211_channel *chan;
|
||||
struct ieee80211_channel *chan = NULL;
|
||||
struct cfg80211_chan_def chandef;
|
||||
struct ieee80211_supported_band *sband = NULL;
|
||||
enum nl80211_band band = NL80211_BAND_2GHZ;
|
||||
struct ieee80211_supported_band *sband;
|
||||
enum nl80211_band band;
|
||||
int channel;
|
||||
|
||||
while (!sband && band < NUM_NL80211_BANDS)
|
||||
sband = mvm->hw->wiphy->bands[band++];
|
||||
for (band = NL80211_BAND_2GHZ; band < NUM_NL80211_BANDS; band++) {
|
||||
sband = mvm->hw->wiphy->bands[band];
|
||||
|
||||
if (WARN_ON(!sband))
|
||||
if (!sband)
|
||||
continue;
|
||||
|
||||
for (channel = 0; channel < sband->n_channels; channel++)
|
||||
if (!(sband->channels[channel].flags &
|
||||
IEEE80211_CHAN_DISABLED)) {
|
||||
chan = &sband->channels[channel];
|
||||
break;
|
||||
}
|
||||
|
||||
if (chan)
|
||||
break;
|
||||
}
|
||||
|
||||
if (WARN_ON(!chan))
|
||||
return;
|
||||
|
||||
chan = &sband->channels[0];
|
||||
|
||||
cfg80211_chandef_create(&chandef, chan, NL80211_CHAN_NO_HT);
|
||||
iwl_mvm_phy_ctxt_changed(mvm, ctxt, &chandef, 1, 1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user