aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/wireless.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/wireless.h')
-rw-r--r--include/net/wireless.h68
1 files changed, 63 insertions, 5 deletions
diff --git a/include/net/wireless.h b/include/net/wireless.h
index 21c5d966142d..a42c1562d52b 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -181,12 +181,25 @@ struct ieee80211_supported_band {
181 * struct wiphy - wireless hardware description 181 * struct wiphy - wireless hardware description
182 * @idx: the wiphy index assigned to this item 182 * @idx: the wiphy index assigned to this item
183 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> 183 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name>
184 * @fw_handles_regulatory: tells us the firmware for this device 184 * @custom_regulatory: tells us the driver for this device
185 * has its own regulatory solution and cannot identify the 185 * has its own custom regulatory domain and cannot identify the
186 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled 186 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
187 * we will disregard the first regulatory hint (when the 187 * we will disregard the first regulatory hint (when the
188 * initiator is %REGDOM_SET_BY_CORE). 188 * initiator is %REGDOM_SET_BY_CORE).
189 * @strict_regulatory: tells us the driver for this device will ignore
190 * regulatory domain settings until it gets its own regulatory domain
191 * via its regulatory_hint(). After its gets its own regulatory domain
192 * it will only allow further regulatory domain settings to further
193 * enhance compliance. For example if channel 13 and 14 are disabled
194 * by this regulatory domain no user regulatory domain can enable these
195 * channels at a later time. This can be used for devices which do not
196 * have calibration information gauranteed for frequencies or settings
197 * outside of its regulatory domain.
189 * @reg_notifier: the driver's regulatory notification callback 198 * @reg_notifier: the driver's regulatory notification callback
199 * @regd: the driver's regulatory domain, if one was requested via
200 * the regulatory_hint() API. This can be used by the driver
201 * on the reg_notifier() if it chooses to ignore future
202 * regulatory domain changes caused by other drivers.
190 */ 203 */
191struct wiphy { 204struct wiphy {
192 /* assign these fields before you register the wiphy */ 205 /* assign these fields before you register the wiphy */
@@ -197,7 +210,8 @@ struct wiphy {
197 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ 210 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
198 u16 interface_modes; 211 u16 interface_modes;
199 212
200 bool fw_handles_regulatory; 213 bool custom_regulatory;
214 bool strict_regulatory;
201 215
202 /* If multiple wiphys are registered and you're handed e.g. 216 /* If multiple wiphys are registered and you're handed e.g.
203 * a regular netdev with assigned ieee80211_ptr, you won't 217 * a regular netdev with assigned ieee80211_ptr, you won't
@@ -209,10 +223,13 @@ struct wiphy {
209 struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS]; 223 struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS];
210 224
211 /* Lets us get back the wiphy on the callback */ 225 /* Lets us get back the wiphy on the callback */
212 int (*reg_notifier)(struct wiphy *wiphy, enum reg_set_by setby); 226 int (*reg_notifier)(struct wiphy *wiphy,
227 struct regulatory_request *request);
213 228
214 /* fields below are read-only, assigned by cfg80211 */ 229 /* fields below are read-only, assigned by cfg80211 */
215 230
231 const struct ieee80211_regdomain *regd;
232
216 /* the item in /sys/class/ieee80211/ points to this, 233 /* the item in /sys/class/ieee80211/ points to this,
217 * you need use set_wiphy_dev() (see below) */ 234 * you need use set_wiphy_dev() (see below) */
218 struct device dev; 235 struct device dev;
@@ -361,7 +378,7 @@ ieee80211_get_channel(struct wiphy *wiphy, int freq)
361 */ 378 */
362struct ieee80211_rate * 379struct ieee80211_rate *
363ieee80211_get_response_rate(struct ieee80211_supported_band *sband, 380ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
364 u64 basic_rates, int bitrate); 381 u32 basic_rates, int bitrate);
365 382
366/** 383/**
367 * regulatory_hint - driver hint to the wireless core a regulatory domain 384 * regulatory_hint - driver hint to the wireless core a regulatory domain
@@ -395,4 +412,45 @@ extern void regulatory_hint(struct wiphy *wiphy, const char *alpha2);
395extern void regulatory_hint_11d(struct wiphy *wiphy, 412extern void regulatory_hint_11d(struct wiphy *wiphy,
396 u8 *country_ie, 413 u8 *country_ie,
397 u8 country_ie_len); 414 u8 country_ie_len);
415
416/**
417 * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain
418 * @wiphy: the wireless device we want to process the regulatory domain on
419 * @regd: the custom regulatory domain to use for this wiphy
420 *
421 * Drivers can sometimes have custom regulatory domains which do not apply
422 * to a specific country. Drivers can use this to apply such custom regulatory
423 * domains. This routine must be called prior to wiphy registration. The
424 * custom regulatory domain will be trusted completely and as such previous
425 * default channel settings will be disregarded. If no rule is found for a
426 * channel on the regulatory domain the channel will be disabled.
427 */
428extern void wiphy_apply_custom_regulatory(
429 struct wiphy *wiphy,
430 const struct ieee80211_regdomain *regd);
431
432/**
433 * freq_reg_info - get regulatory information for the given frequency
434 * @wiphy: the wiphy for which we want to process this rule for
435 * @center_freq: Frequency in KHz for which we want regulatory information for
436 * @bandwidth: the bandwidth requirement you have in KHz, if you do not have one
437 * you can set this to 0. If this frequency is allowed we then set
438 * this value to the maximum allowed bandwidth.
439 * @reg_rule: the regulatory rule which we have for this frequency
440 *
441 * Use this function to get the regulatory rule for a specific frequency on
442 * a given wireless device. If the device has a specific regulatory domain
443 * it wants to follow we respect that unless a country IE has been received
444 * and processed already.
445 *
446 * Returns 0 if it was able to find a valid regulatory rule which does
447 * apply to the given center_freq otherwise it returns non-zero. It will
448 * also return -ERANGE if we determine the given center_freq does not even have
449 * a regulatory rule for a frequency range in the center_freq's band. See
450 * freq_in_rule_band() for our current definition of a band -- this is purely
451 * subjective and right now its 802.11 specific.
452 */
453extern int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth,
454 const struct ieee80211_reg_rule **reg_rule);
455
398#endif /* __NET_WIRELESS_H */ 456#endif /* __NET_WIRELESS_H */