From a13513b090eb80afce1c57e9758a0599766a750c Mon Sep 17 00:00:00 2001 From: nbd Date: Sat, 18 Dec 2010 02:21:21 +0000 Subject: [PATCH] mac80211: merge pending regulatory fixes git-svn-id: svn://svn.openwrt.org/openwrt/branches/backfire@24658 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../340-pending_regulatory_fixes.patch | 42 +++++++++++++++++++ .../patches/404-ath_regd_optional.patch | 2 +- .../patches/540-ath9k_disable_hw_rfkill.patch | 4 +- 3 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 package/mac80211/patches/340-pending_regulatory_fixes.patch diff --git a/package/mac80211/patches/340-pending_regulatory_fixes.patch b/package/mac80211/patches/340-pending_regulatory_fixes.patch new file mode 100644 index 000000000..4fdb2067c --- /dev/null +++ b/package/mac80211/patches/340-pending_regulatory_fixes.patch @@ -0,0 +1,42 @@ +--- a/drivers/net/wireless/ath/regd.c ++++ b/drivers/net/wireless/ath/regd.c +@@ -342,6 +342,14 @@ int ath_reg_notifier_apply(struct wiphy + /* We always apply this */ + ath_reg_apply_radar_flags(wiphy); + ++ /* ++ * This would happen when we have sent a custom regulatory request ++ * a world regulatory domain and the scheduler hasn't yet processed ++ * any pending requests in the queue. ++ */ ++ if (!request) ++ return 0; ++ + switch (request->initiator) { + case NL80211_REGDOM_SET_BY_DRIVER: + case NL80211_REGDOM_SET_BY_CORE: +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -1417,7 +1417,9 @@ struct ieee80211_txrx_stypes { + + /** + * struct wiphy - wireless hardware description +- * @reg_notifier: the driver's regulatory notification callback ++ * @reg_notifier: the driver's regulatory notification callback, ++ * note that if your driver uses wiphy_apply_custom_regulatory() ++ * the reg_notifier's request can be passed as NULL + * @regd: the driver's regulatory domain, if one was requested via + * the regulatory_hint() API. This can be used by the driver + * on the reg_notifier() if it chooses to ignore future +--- a/net/wireless/reg.c ++++ b/net/wireless/reg.c +@@ -662,7 +662,8 @@ static int freq_reg_info_regd(struct wip + * Follow the driver's regulatory domain, if present, unless a country + * IE has been processed or a user wants to help complaince further + */ +- if (last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && ++ if (!custom_regd && ++ last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && + last_request->initiator != NL80211_REGDOM_SET_BY_USER && + wiphy->regd) + regd = wiphy->regd; diff --git a/package/mac80211/patches/404-ath_regd_optional.patch b/package/mac80211/patches/404-ath_regd_optional.patch index 9bda94b03..9e44359a1 100644 --- a/package/mac80211/patches/404-ath_regd_optional.patch +++ b/package/mac80211/patches/404-ath_regd_optional.patch @@ -33,7 +33,7 @@ if (!wiphy->bands[IEEE80211_BAND_5GHZ]) return; -@@ -449,6 +461,10 @@ ath_regd_init_wiphy(struct ath_regulator +@@ -457,6 +469,10 @@ ath_regd_init_wiphy(struct ath_regulator { const struct ieee80211_regdomain *regd; diff --git a/package/mac80211/patches/540-ath9k_disable_hw_rfkill.patch b/package/mac80211/patches/540-ath9k_disable_hw_rfkill.patch index 83cd9a1ce..a74ea0da9 100644 --- a/package/mac80211/patches/540-ath9k_disable_hw_rfkill.patch +++ b/package/mac80211/patches/540-ath9k_disable_hw_rfkill.patch @@ -82,7 +82,7 @@ if (!ath9k_hw_private_ops(ah)->restore_chainmask) --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -1406,7 +1406,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st +@@ -1402,7 +1402,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st ath9k_hw_init_qos(ah); if (ah->caps.hw_caps & ATH9K_HW_CAP_RFSILENT) @@ -93,7 +93,7 @@ --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h -@@ -576,7 +576,6 @@ struct ath_hw_private_ops { +@@ -581,7 +581,6 @@ struct ath_hw_private_ops { void (*set_delta_slope)(struct ath_hw *ah, struct ath9k_channel *chan); bool (*rfbus_req)(struct ath_hw *ah); void (*rfbus_done)(struct ath_hw *ah); -- 2.35.1