diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-01-22 18:05:45 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 16:01:14 -0500 |
commit | 34f573473a659f8c2727d8d408e17b241900c28e (patch) | |
tree | eac19f7cdfb2f26b956d0fe4dc488de5eeec0c6b | |
parent | 1fa25e413659f943dfec65da2abe713d566c7fdf (diff) |
cfg80211: export freq_reg_info()
This can be used by drivers on the reg_notifier()
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | include/net/wireless.h | 24 | ||||
-rw-r--r-- | net/wireless/reg.c | 24 |
2 files changed, 26 insertions, 22 deletions
diff --git a/include/net/wireless.h b/include/net/wireless.h index c5538b923afb..f68602eb4160 100644 --- a/include/net/wireless.h +++ b/include/net/wireless.h | |||
@@ -418,4 +418,28 @@ extern void wiphy_apply_custom_regulatory( | |||
418 | struct wiphy *wiphy, | 418 | struct wiphy *wiphy, |
419 | const struct ieee80211_regdomain *regd); | 419 | const struct ieee80211_regdomain *regd); |
420 | 420 | ||
421 | /** | ||
422 | * freq_reg_info - get regulatory information for the given frequency | ||
423 | * @wiphy: the wiphy for which we want to process this rule for | ||
424 | * @center_freq: Frequency in KHz for which we want regulatory information for | ||
425 | * @bandwidth: the bandwidth requirement you have in KHz, if you do not have one | ||
426 | * you can set this to 0. If this frequency is allowed we then set | ||
427 | * this value to the maximum allowed bandwidth. | ||
428 | * @reg_rule: the regulatory rule which we have for this frequency | ||
429 | * | ||
430 | * Use this function to get the regulatory rule for a specific frequency on | ||
431 | * a given wireless device. If the device has a specific regulatory domain | ||
432 | * it wants to follow we respect that unless a country IE has been received | ||
433 | * and processed already. | ||
434 | * | ||
435 | * Returns 0 if it was able to find a valid regulatory rule which does | ||
436 | * apply to the given center_freq otherwise it returns non-zero. It will | ||
437 | * also return -ERANGE if we determine the given center_freq does not even have | ||
438 | * a regulatory rule for a frequency range in the center_freq's band. See | ||
439 | * freq_in_rule_band() for our current definition of a band -- this is purely | ||
440 | * subjective and right now its 802.11 specific. | ||
441 | */ | ||
442 | extern int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth, | ||
443 | const struct ieee80211_reg_rule **reg_rule); | ||
444 | |||
421 | #endif /* __NET_WIRELESS_H */ | 445 | #endif /* __NET_WIRELESS_H */ |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 0d6059502b40..d663795d6944 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -833,29 +833,9 @@ static int freq_reg_info_regd(struct wiphy *wiphy, | |||
833 | 833 | ||
834 | return !max_bandwidth; | 834 | return !max_bandwidth; |
835 | } | 835 | } |
836 | EXPORT_SYMBOL(freq_reg_info); | ||
836 | 837 | ||
837 | /** | 838 | int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth, |
838 | * freq_reg_info - get regulatory information for the given frequency | ||
839 | * @wiphy: the wiphy for which we want to process this rule for | ||
840 | * @center_freq: Frequency in KHz for which we want regulatory information for | ||
841 | * @bandwidth: the bandwidth requirement you have in KHz, if you do not have one | ||
842 | * you can set this to 0. If this frequency is allowed we then set | ||
843 | * this value to the maximum allowed bandwidth. | ||
844 | * @reg_rule: the regulatory rule which we have for this frequency | ||
845 | * | ||
846 | * Use this function to get the regulatory rule for a specific frequency on | ||
847 | * a given wireless device. If the device has a specific regulatory domain | ||
848 | * it wants to follow we respect that unless a country IE has been received | ||
849 | * and processed already. | ||
850 | * | ||
851 | * Returns 0 if it was able to find a valid regulatory rule which does | ||
852 | * apply to the given center_freq otherwise it returns non-zero. It will | ||
853 | * also return -ERANGE if we determine the given center_freq does not even have | ||
854 | * a regulatory rule for a frequency range in the center_freq's band. See | ||
855 | * freq_in_rule_band() for our current definition of a band -- this is purely | ||
856 | * subjective and right now its 802.11 specific. | ||
857 | */ | ||
858 | static int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth, | ||
859 | const struct ieee80211_reg_rule **reg_rule) | 839 | const struct ieee80211_reg_rule **reg_rule) |
860 | { | 840 | { |
861 | return freq_reg_info_regd(wiphy, center_freq, | 841 | return freq_reg_info_regd(wiphy, center_freq, |