ath9k: merge chainmask fix from r24657
[openwrt-10.03/.git] / package / mac80211 / patches / 340-pending_regulatory_fixes.patch
1 --- a/drivers/net/wireless/ath/regd.c
2 +++ b/drivers/net/wireless/ath/regd.c
3 @@ -342,6 +342,14 @@ int ath_reg_notifier_apply(struct wiphy 
4         /* We always apply this */
5         ath_reg_apply_radar_flags(wiphy);
6  
7 +       /*
8 +        * This would happen when we have sent a custom regulatory request
9 +        * a world regulatory domain and the scheduler hasn't yet processed
10 +        * any pending requests in the queue.
11 +        */
12 +       if (!request)
13 +               return 0;
14 +
15         switch (request->initiator) {
16         case NL80211_REGDOM_SET_BY_DRIVER:
17         case NL80211_REGDOM_SET_BY_CORE:
18 --- a/include/net/cfg80211.h
19 +++ b/include/net/cfg80211.h
20 @@ -1417,7 +1417,9 @@ struct ieee80211_txrx_stypes {
21  
22  /**
23   * struct wiphy - wireless hardware description
24 - * @reg_notifier: the driver's regulatory notification callback
25 + * @reg_notifier: the driver's regulatory notification callback,
26 + *     note that if your driver uses wiphy_apply_custom_regulatory()
27 + *     the reg_notifier's request can be passed as NULL
28   * @regd: the driver's regulatory domain, if one was requested via
29   *     the regulatory_hint() API. This can be used by the driver
30   *     on the reg_notifier() if it chooses to ignore future
31 --- a/net/wireless/reg.c
32 +++ b/net/wireless/reg.c
33 @@ -662,7 +662,8 @@ static int freq_reg_info_regd(struct wip
34          * Follow the driver's regulatory domain, if present, unless a country
35          * IE has been processed or a user wants to help complaince further
36          */
37 -       if (last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
38 +       if (!custom_regd &&
39 +           last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
40             last_request->initiator != NL80211_REGDOM_SET_BY_USER &&
41             wiphy->regd)
42                 regd = wiphy->regd;