diff --git a/brcmsmac-use-channel-flags-to-restrict-OFDM.patch b/brcmsmac-use-channel-flags-to-restrict-OFDM.patch new file mode 100644 index 000000000..979b44014 --- /dev/null +++ b/brcmsmac-use-channel-flags-to-restrict-OFDM.patch @@ -0,0 +1,54 @@ +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 +Signed-off-by: Seth Forshee +--- + drivers/net/wireless/brcm80211/brcmsmac/channel.c | 5 +---- + .../net/wireless/brcm80211/brcmsmac/mac80211_if.c | 3 ++- + 2 files changed, 3 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/brcm80211/brcmsmac/channel.c +index 9a4c63f..7ed7d75 100644 +--- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c ++++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c +@@ -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 ieee80211_channel *ch = wlc->pub->ieee_hw->conf.channel; +- const struct ieee80211_reg_rule *reg_rule; + struct txpwr_limits txpwr; +- int ret; + + 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 */ +- ret = freq_reg_info(wlc->wiphy, ch->center_freq, 0, ®_rule); +- if (!ret && (reg_rule->flags & NL80211_RRF_NO_OFDM)) ++ if (ch->flags & IEEE80211_CHAN_NO_OFDM) + brcms_c_set_gmode(wlc, GMODE_LEGACY_B, false); + else + brcms_c_set_gmode(wlc, wlc->protection->gmode_user, false); +diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +index 9e79d47..192ad5c 100644 +--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c ++++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +@@ -121,7 +121,8 @@ static struct ieee80211_channel brcms_2ghz_chantable[] = { + IEEE80211_CHAN_NO_HT40PLUS), + CHAN2GHZ(14, 2484, + 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[] = { +-- +1.7.9.5 + diff --git a/cfg80211-add-channel-flag-to-prohibit-OFDM-operation.patch b/cfg80211-add-channel-flag-to-prohibit-OFDM-operation.patch new file mode 100644 index 000000000..b4840942d --- /dev/null +++ b/cfg80211-add-channel-flag-to-prohibit-OFDM-operation.patch @@ -0,0 +1,53 @@ +Currently the only way for wireless drivers to tell whether or not OFDM +is allowed on the current channel is to check the regulatory +information. However, this requires hodling cfg80211_mutex, which is not +visible to the drivers. + +Other regulatory restrictions are provided as flags in the channel +definition, so let's do similarly with OFDM. This patch adds a new flag, +IEEE80211_CHAN_NO_OFDM, to tell drivers that OFDM on a channel is not +allowed. This flag is set on any channels for which regulatory indicates +that OFDM is prohibited. + +Signed-off-by: Seth Forshee +--- + include/net/cfg80211.h | 2 ++ + net/wireless/reg.c | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h +index 493fa0c..3d254e1 100644 +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -96,6 +96,7 @@ enum ieee80211_band { + * is not permitted. + * @IEEE80211_CHAN_NO_HT40MINUS: extension channel below this channel + * is not permitted. ++ * @IEEE80211_CHAN_NO_OFDM: OFDM is not allowed on this channel. + */ + enum ieee80211_channel_flags { + IEEE80211_CHAN_DISABLED = 1<<0, +@@ -104,6 +105,7 @@ enum ieee80211_channel_flags { + IEEE80211_CHAN_RADAR = 1<<3, + IEEE80211_CHAN_NO_HT40PLUS = 1<<4, + IEEE80211_CHAN_NO_HT40MINUS = 1<<5, ++ IEEE80211_CHAN_NO_OFDM = 1<<6, + }; + + #define IEEE80211_CHAN_NO_HT40 \ +diff --git a/net/wireless/reg.c b/net/wireless/reg.c +index 2303ee7..0f3a8a1 100644 +--- a/net/wireless/reg.c ++++ b/net/wireless/reg.c +@@ -680,6 +680,8 @@ static u32 map_regdom_flags(u32 rd_flags) + channel_flags |= IEEE80211_CHAN_NO_IBSS; + if (rd_flags & NL80211_RRF_DFS) + channel_flags |= IEEE80211_CHAN_RADAR; ++ if (rd_flags & NL80211_RRF_NO_OFDM) ++ channel_flags |= IEEE80211_CHAN_NO_OFDM; + return channel_flags; + } + +-- +1.7.9.5 + diff --git a/kernel.spec b/kernel.spec index ff2a7c74a..11c189c7c 100644 --- a/kernel.spec +++ b/kernel.spec @@ -62,7 +62,7 @@ Summary: The Linux kernel # For non-released -rc kernels, this will be appended after the rcX and # gitX tags, so a 3 here would become part of release "0.rcX.gitX.3" # -%global baserelease 1 +%global baserelease 2 %global fedora_build %{baserelease} # base_sublevel is the kernel version we're starting with and patching @@ -743,6 +743,9 @@ Patch22001: selinux-apply-different-permission-to-ptrace-child.patch #rhbz 836742 Patch22059: uvcvideo-Reset-bytesused-field-when-recycling-erroneous-buffer.patch +Patch22062: cfg80211-add-channel-flag-to-prohibit-OFDM-operation.patch +Patch22063: brcmsmac-use-channel-flags-to-restrict-OFDM.patch + # END OF PATCH DEFINITIONS %endif @@ -1431,6 +1434,9 @@ ApplyPatch selinux-apply-different-permission-to-ptrace-child.patch #rhbz 836742 ApplyPatch uvcvideo-Reset-bytesused-field-when-recycling-erroneous-buffer.patch +ApplyPatch cfg80211-add-channel-flag-to-prohibit-OFDM-operation.patch +ApplyPatch brcmsmac-use-channel-flags-to-restrict-OFDM.patch + # END OF PATCH APPLICATIONS %endif @@ -2288,6 +2294,9 @@ fi # ||----w | # || || %changelog +* Thu Aug 02 2012 Josh Boyer +- Add two patches from Seth Forshee to fix brcmsmac backtrace + * Thu Aug 02 2012 Josh Boyer - 3.6.0-0.rc0.git9.1 - Linux v3.5-9139-g1a9b499