From: Arik Nemtsov Date: Mon, 29 Aug 2016 09:37:35 +0000 (+0300) Subject: mac80211: TDLS: don't require beaconing for AP BW X-Git-Tag: v5.15~12891^2~45^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=554d072e7bc3e56de5893c8181110a547b2062c9;p=platform%2Fkernel%2Flinux-starfive.git mac80211: TDLS: don't require beaconing for AP BW Stop downgrading TDLS chandef when reaching the AP BW. The AP provides the necessary regulatory protection in this case. This fixes https://bugzilla.kernel.org/show_bug.cgi?id=153961, which reported an infinite loop here. Reported-by: Kamil Toman Signed-off-by: Arik Nemtsov Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c index b5d28f1..afca7d1 100644 --- a/net/mac80211/tdls.c +++ b/net/mac80211/tdls.c @@ -333,10 +333,11 @@ ieee80211_tdls_chandef_vht_upgrade(struct ieee80211_sub_if_data *sdata, if (!uc.center_freq1) return; - /* proceed to downgrade the chandef until usable or the same */ + /* proceed to downgrade the chandef until usable or the same as AP BW */ while (uc.width > max_width || - !cfg80211_reg_can_beacon_relax(sdata->local->hw.wiphy, &uc, - sdata->wdev.iftype)) + (uc.width > sta->tdls_chandef.width && + !cfg80211_reg_can_beacon_relax(sdata->local->hw.wiphy, &uc, + sdata->wdev.iftype))) ieee80211_chandef_downgrade(&uc); if (!cfg80211_chandef_identical(&uc, &sta->tdls_chandef)) {