* [PATCH 04/13] cfg80211: export freq_reg_info()
@ 2009-01-16 0:26 Luis R. Rodriguez
2009-01-16 9:14 ` Johannes Berg
0 siblings, 1 reply; 3+ messages in thread
From: Luis R. Rodriguez @ 2009-01-16 0:26 UTC (permalink / raw)
To: linville, johannes, linville; +Cc: Luis R. Rodriguez, linux-wireless
This can be used by drivers on the reg_notifier()
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
include/net/wireless.h | 24 ++++++++++++++++++++++++
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 b724519..232047b 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -422,4 +422,28 @@ extern void wiphy_apply_custom_regulatory(
struct wiphy *wiphy,
const struct ieee80211_regdomain *regd);
+/**
+ * freq_reg_info - get regulatory information for the given frequency
+ * @wiphy: the wiphy for which we want to process this rule for
+ * @center_freq: Frequency in KHz for which we want regulatory information for
+ * @bandwidth: the bandwidth requirement you have in KHz, if you do not have one
+ * you can set this to 0. If this frequency is allowed we then set
+ * this value to the maximum allowed bandwidth.
+ * @reg_rule: the regulatory rule which we have for this frequency
+ *
+ * Use this function to get the regulatory rule for a specific frequency on
+ * a given wireless device. If the device has a specific regulatory domain
+ * it wants to follow we respect that unless a country IE has been received
+ * and processed already.
+ *
+ * Returns 0 if it was able to find a valid regulatory rule which does
+ * apply to the given center_freq otherwise it returns non-zero. It will
+ * also return -ERANGE if we determine the given center_freq does not even have
+ * a regulatory rule for a frequency range in the center_freq's band. See
+ * freq_in_rule_band() for our current definition of a band -- this is purely
+ * subjective and right now its 802.11 specific.
+ */
+extern int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth,
+ const struct ieee80211_reg_rule **reg_rule);
+
#endif /* __NET_WIRELESS_H */
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 4793d22..77e45c7 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -846,29 +846,9 @@ static int freq_reg_info_regd(struct wiphy *wiphy, u32 center_freq,
return !max_bandwidth;
}
+EXPORT_SYMBOL(freq_reg_info);
-/**
- * freq_reg_info - get regulatory information for the given frequency
- * @wiphy: the wiphy for which we want to process this rule for
- * @center_freq: Frequency in KHz for which we want regulatory information for
- * @bandwidth: the bandwidth requirement you have in KHz, if you do not have one
- * you can set this to 0. If this frequency is allowed we then set
- * this value to the maximum allowed bandwidth.
- * @reg_rule: the regulatory rule which we have for this frequency
- *
- * Use this function to get the regulatory rule for a specific frequency on
- * a given wireless device. If the device has a specific regulatory domain
- * it wants to follow we respect that unless a country IE has been received
- * and processed already.
- *
- * Returns 0 if it was able to find a valid regulatory rule which does
- * apply to the given center_freq otherwise it returns non-zero. It will
- * also return -ERANGE if we determine the given center_freq does not even have
- * a regulatory rule for a frequency range in the center_freq's band. See
- * freq_in_rule_band() for our current definition of a band -- this is purely
- * subjective and right now its 802.11 specific.
- */
-static int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth,
+int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth,
const struct ieee80211_reg_rule **reg_rule)
{
return freq_reg_info_regd(wiphy, center_freq,
--
1.6.1.rc3.51.g5832d
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 04/13] cfg80211: export freq_reg_info()
2009-01-16 0:26 [PATCH 04/13] cfg80211: export freq_reg_info() Luis R. Rodriguez
@ 2009-01-16 9:14 ` Johannes Berg
2009-01-16 16:42 ` Luis R. Rodriguez
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2009-01-16 9:14 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: linville, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 342 bytes --]
On Thu, 2009-01-15 at 16:26 -0800, Luis R. Rodriguez wrote:
> @@ -846,29 +846,9 @@ static int freq_reg_info_regd(struct wiphy *wiphy, u32 center_freq,
>
> return !max_bandwidth;
> }
> +EXPORT_SYMBOL(freq_reg_info);
that kinda seems to be in the wrong spot.
I also don't quite understand what you need this for?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 04/13] cfg80211: export freq_reg_info()
2009-01-16 9:14 ` Johannes Berg
@ 2009-01-16 16:42 ` Luis R. Rodriguez
0 siblings, 0 replies; 3+ messages in thread
From: Luis R. Rodriguez @ 2009-01-16 16:42 UTC (permalink / raw)
To: Johannes Berg
Cc: Luis Rodriguez, linville@tuxdriver.com,
linux-wireless@vger.kernel.org
On Fri, Jan 16, 2009 at 01:14:26AM -0800, Johannes Berg wrote:
> On Thu, 2009-01-15 at 16:26 -0800, Luis R. Rodriguez wrote:
>
> > @@ -846,29 +846,9 @@ static int freq_reg_info_regd(struct wiphy *wiphy, u32 center_freq,
> >
> > return !max_bandwidth;
> > }
> > +EXPORT_SYMBOL(freq_reg_info);
>
> that kinda seems to be in the wrong spot.
Ah yeah, but it still works, sure I'll fix, good catch.
> I also don't quite understand what you need this for?
Did you read the ath9k patch?
Luis
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-01-16 16:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-16 0:26 [PATCH 04/13] cfg80211: export freq_reg_info() Luis R. Rodriguez
2009-01-16 9:14 ` Johannes Berg
2009-01-16 16:42 ` Luis R. Rodriguez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).