brcmsmac: use channel flags to restrict OFDM
brcmsmac cannot call freq_reg_info() during channel changes as it does not hold cfg80211_lock, and as a result it generates a lockdep warning. freq_reg_info() is being used to determine whether OFDM is allowed on the current channel, so we can avoid the errant call by using the new IEEE80211_CHAN_NO_OFDM for this purpose instead. Reported-by: Josh Boyer <jwboyer@redhat.com> Signed-off-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
8c1057e43c
commit
7f38e5bc93
@@ -382,9 +382,7 @@ brcms_c_channel_set_chanspec(struct brcms_cm_info *wlc_cm, u16 chanspec,
|
|||||||
{
|
{
|
||||||
struct brcms_c_info *wlc = wlc_cm->wlc;
|
struct brcms_c_info *wlc = wlc_cm->wlc;
|
||||||
struct ieee80211_channel *ch = wlc->pub->ieee_hw->conf.channel;
|
struct ieee80211_channel *ch = wlc->pub->ieee_hw->conf.channel;
|
||||||
const struct ieee80211_reg_rule *reg_rule;
|
|
||||||
struct txpwr_limits txpwr;
|
struct txpwr_limits txpwr;
|
||||||
int ret;
|
|
||||||
|
|
||||||
brcms_c_channel_reg_limits(wlc_cm, chanspec, &txpwr);
|
brcms_c_channel_reg_limits(wlc_cm, chanspec, &txpwr);
|
||||||
|
|
||||||
@@ -393,8 +391,7 @@ brcms_c_channel_set_chanspec(struct brcms_cm_info *wlc_cm, u16 chanspec,
|
|||||||
);
|
);
|
||||||
|
|
||||||
/* set or restore gmode as required by regulatory */
|
/* set or restore gmode as required by regulatory */
|
||||||
ret = freq_reg_info(wlc->wiphy, ch->center_freq, 0, ®_rule);
|
if (ch->flags & IEEE80211_CHAN_NO_OFDM)
|
||||||
if (!ret && (reg_rule->flags & NL80211_RRF_NO_OFDM))
|
|
||||||
brcms_c_set_gmode(wlc, GMODE_LEGACY_B, false);
|
brcms_c_set_gmode(wlc, GMODE_LEGACY_B, false);
|
||||||
else
|
else
|
||||||
brcms_c_set_gmode(wlc, wlc->protection->gmode_user, false);
|
brcms_c_set_gmode(wlc, wlc->protection->gmode_user, false);
|
||||||
|
@@ -121,7 +121,8 @@ static struct ieee80211_channel brcms_2ghz_chantable[] = {
|
|||||||
IEEE80211_CHAN_NO_HT40PLUS),
|
IEEE80211_CHAN_NO_HT40PLUS),
|
||||||
CHAN2GHZ(14, 2484,
|
CHAN2GHZ(14, 2484,
|
||||||
IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_IBSS |
|
IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_IBSS |
|
||||||
IEEE80211_CHAN_NO_HT40PLUS | IEEE80211_CHAN_NO_HT40MINUS)
|
IEEE80211_CHAN_NO_HT40PLUS | IEEE80211_CHAN_NO_HT40MINUS |
|
||||||
|
IEEE80211_CHAN_NO_OFDM)
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct ieee80211_channel brcms_5ghz_nphy_chantable[] = {
|
static struct ieee80211_channel brcms_5ghz_nphy_chantable[] = {
|
||||||
|
Reference in New Issue
Block a user