aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c
diff options
context:
space:
mode:
authorTova Mussai <tova.mussai@intel.com>2019-07-04 14:34:54 +0300
committerLuca Coelho <luciano.coelho@intel.com>2019-09-06 15:31:22 +0300
commitdd36a507c806165c0f725413ee2e24c41d8a520d (patch)
tree4993039c07a9636805edb0c152bab227c466c34e /drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c
parentiwlwifi: allocate bigger nvm data in case of UHB (diff)
downloadlinux-dev-dd36a507c806165c0f725413ee2e24c41d8a520d.tar.xz
linux-dev-dd36a507c806165c0f725413ee2e24c41d8a520d.zip
iwlwifi: mvm: look for the first supported channel when add/remove phy ctxt
Can't rely that band 2.4 is always supported by the NIC and use the first channel in this band for the phy ctxt. Instead, look for the first channel in the first band that is supported Signed-off-by: Tova Mussai <tova.mussai@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c
index 86e40bae57e3..0243dbe8ac49 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c
@@ -289,8 +289,17 @@ void iwl_mvm_phy_ctxt_unref(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt)
if (ctxt->ref == 0) {
struct ieee80211_channel *chan;
struct cfg80211_chan_def chandef;
+ struct ieee80211_supported_band *sband = NULL;
+ enum nl80211_band band = NL80211_BAND_2GHZ;
+
+ while (!sband && band < NUM_NL80211_BANDS)
+ sband = mvm->hw->wiphy->bands[band++];
+
+ if (WARN_ON(!sband))
+ return;
+
+ chan = &sband->channels[0];
- chan = &mvm->hw->wiphy->bands[NL80211_BAND_2GHZ]->channels[0];
cfg80211_chandef_create(&chandef, chan, NL80211_CHAN_NO_HT);
iwl_mvm_phy_ctxt_changed(mvm, ctxt, &chandef, 1, 1);
}