aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index a3552929a21d..5107248af7fb 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3400,6 +3400,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata,
3400 3400
3401 ret = 0; 3401 ret = 0;
3402 3402
3403out:
3403 while (!cfg80211_chandef_usable(sdata->local->hw.wiphy, chandef, 3404 while (!cfg80211_chandef_usable(sdata->local->hw.wiphy, chandef,
3404 IEEE80211_CHAN_DISABLED)) { 3405 IEEE80211_CHAN_DISABLED)) {
3405 if (WARN_ON(chandef->width == NL80211_CHAN_WIDTH_20_NOHT)) { 3406 if (WARN_ON(chandef->width == NL80211_CHAN_WIDTH_20_NOHT)) {
@@ -3408,14 +3409,13 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata,
3408 goto out; 3409 goto out;
3409 } 3410 }
3410 3411
3411 ret = chandef_downgrade(chandef); 3412 ret |= chandef_downgrade(chandef);
3412 } 3413 }
3413 3414
3414 if (chandef->width != vht_chandef.width) 3415 if (chandef->width != vht_chandef.width)
3415 sdata_info(sdata, 3416 sdata_info(sdata,
3416 "local regulatory prevented using AP HT/VHT configuration, downgraded\n"); 3417 "capabilities/regulatory prevented using AP HT/VHT configuration, downgraded\n");
3417 3418
3418out:
3419 WARN_ON_ONCE(!cfg80211_chandef_valid(chandef)); 3419 WARN_ON_ONCE(!cfg80211_chandef_valid(chandef));
3420 return ret; 3420 return ret;
3421} 3421}
@@ -3529,8 +3529,11 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
3529 */ 3529 */
3530 ret = ieee80211_vif_use_channel(sdata, &chandef, 3530 ret = ieee80211_vif_use_channel(sdata, &chandef,
3531 IEEE80211_CHANCTX_SHARED); 3531 IEEE80211_CHANCTX_SHARED);
3532 while (ret && chandef.width != NL80211_CHAN_WIDTH_20_NOHT) 3532 while (ret && chandef.width != NL80211_CHAN_WIDTH_20_NOHT) {
3533 ifmgd->flags |= chandef_downgrade(&chandef); 3533 ifmgd->flags |= chandef_downgrade(&chandef);
3534 ret = ieee80211_vif_use_channel(sdata, &chandef,
3535 IEEE80211_CHANCTX_SHARED);
3536 }
3534 return ret; 3537 return ret;
3535} 3538}
3536 3539