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.h86
1 files changed, 80 insertions, 6 deletions
diff --git a/include/net/wireless.h b/include/net/wireless.h
index 21c5d966142d..64a76208580c 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -69,6 +69,9 @@ enum ieee80211_channel_flags {
69 * @band: band this channel belongs to. 69 * @band: band this channel belongs to.
70 * @max_antenna_gain: maximum antenna gain in dBi 70 * @max_antenna_gain: maximum antenna gain in dBi
71 * @max_power: maximum transmission power (in dBm) 71 * @max_power: maximum transmission power (in dBm)
72 * @beacon_found: helper to regulatory code to indicate when a beacon
73 * has been found on this channel. Use regulatory_hint_found_beacon()
74 * to enable this, this is is useful only on 5 GHz band.
72 * @orig_mag: internal use 75 * @orig_mag: internal use
73 * @orig_mpwr: internal use 76 * @orig_mpwr: internal use
74 */ 77 */
@@ -80,6 +83,7 @@ struct ieee80211_channel {
80 u32 flags; 83 u32 flags;
81 int max_antenna_gain; 84 int max_antenna_gain;
82 int max_power; 85 int max_power;
86 bool beacon_found;
83 u32 orig_flags; 87 u32 orig_flags;
84 int orig_mag, orig_mpwr; 88 int orig_mag, orig_mpwr;
85}; 89};
@@ -181,12 +185,26 @@ struct ieee80211_supported_band {
181 * struct wiphy - wireless hardware description 185 * struct wiphy - wireless hardware description
182 * @idx: the wiphy index assigned to this item 186 * @idx: the wiphy index assigned to this item
183 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> 187 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name>
184 * @fw_handles_regulatory: tells us the firmware for this device 188 * @custom_regulatory: tells us the driver for this device
185 * has its own regulatory solution and cannot identify the 189 * has its own custom regulatory domain and cannot identify the
186 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled 190 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
187 * we will disregard the first regulatory hint (when the 191 * we will disregard the first regulatory hint (when the
188 * initiator is %REGDOM_SET_BY_CORE). 192 * initiator is %REGDOM_SET_BY_CORE).
193 * @strict_regulatory: tells us the driver for this device will ignore
194 * regulatory domain settings until it gets its own regulatory domain
195 * via its regulatory_hint(). After its gets its own regulatory domain
196 * it will only allow further regulatory domain settings to further
197 * enhance compliance. For example if channel 13 and 14 are disabled
198 * by this regulatory domain no user regulatory domain can enable these
199 * channels at a later time. This can be used for devices which do not
200 * have calibration information gauranteed for frequencies or settings
201 * outside of its regulatory domain.
189 * @reg_notifier: the driver's regulatory notification callback 202 * @reg_notifier: the driver's regulatory notification callback
203 * @regd: the driver's regulatory domain, if one was requested via
204 * the regulatory_hint() API. This can be used by the driver
205 * on the reg_notifier() if it chooses to ignore future
206 * regulatory domain changes caused by other drivers.
207 * @signal_type: signal type reported in &struct cfg80211_bss.
190 */ 208 */
191struct wiphy { 209struct wiphy {
192 /* assign these fields before you register the wiphy */ 210 /* assign these fields before you register the wiphy */
@@ -197,7 +215,13 @@ struct wiphy {
197 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ 215 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
198 u16 interface_modes; 216 u16 interface_modes;
199 217
200 bool fw_handles_regulatory; 218 bool custom_regulatory;
219 bool strict_regulatory;
220
221 enum cfg80211_signal_type signal_type;
222
223 int bss_priv_size;
224 u8 max_scan_ssids;
201 225
202 /* If multiple wiphys are registered and you're handed e.g. 226 /* If multiple wiphys are registered and you're handed e.g.
203 * a regular netdev with assigned ieee80211_ptr, you won't 227 * a regular netdev with assigned ieee80211_ptr, you won't
@@ -209,10 +233,13 @@ struct wiphy {
209 struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS]; 233 struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS];
210 234
211 /* Lets us get back the wiphy on the callback */ 235 /* Lets us get back the wiphy on the callback */
212 int (*reg_notifier)(struct wiphy *wiphy, enum reg_set_by setby); 236 int (*reg_notifier)(struct wiphy *wiphy,
237 struct regulatory_request *request);
213 238
214 /* fields below are read-only, assigned by cfg80211 */ 239 /* fields below are read-only, assigned by cfg80211 */
215 240
241 const struct ieee80211_regdomain *regd;
242
216 /* the item in /sys/class/ieee80211/ points to this, 243 /* the item in /sys/class/ieee80211/ points to this,
217 * you need use set_wiphy_dev() (see below) */ 244 * you need use set_wiphy_dev() (see below) */
218 struct device dev; 245 struct device dev;
@@ -361,7 +388,7 @@ ieee80211_get_channel(struct wiphy *wiphy, int freq)
361 */ 388 */
362struct ieee80211_rate * 389struct ieee80211_rate *
363ieee80211_get_response_rate(struct ieee80211_supported_band *sband, 390ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
364 u64 basic_rates, int bitrate); 391 u32 basic_rates, int bitrate);
365 392
366/** 393/**
367 * regulatory_hint - driver hint to the wireless core a regulatory domain 394 * regulatory_hint - driver hint to the wireless core a regulatory domain
@@ -378,8 +405,15 @@ ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
378 * domain should be in or by providing a completely build regulatory domain. 405 * domain should be in or by providing a completely build regulatory domain.
379 * If the driver provides an ISO/IEC 3166 alpha2 userspace will be queried 406 * If the driver provides an ISO/IEC 3166 alpha2 userspace will be queried
380 * for a regulatory domain structure for the respective country. 407 * for a regulatory domain structure for the respective country.
408 *
409 * The wiphy must have been registered to cfg80211 prior to this call.
410 * For cfg80211 drivers this means you must first use wiphy_register(),
411 * for mac80211 drivers you must first use ieee80211_register_hw().
412 *
413 * Drivers should check the return value, its possible you can get
414 * an -ENOMEM.
381 */ 415 */
382extern void regulatory_hint(struct wiphy *wiphy, const char *alpha2); 416extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
383 417
384/** 418/**
385 * regulatory_hint_11d - hints a country IE as a regulatory domain 419 * regulatory_hint_11d - hints a country IE as a regulatory domain
@@ -395,4 +429,44 @@ extern void regulatory_hint(struct wiphy *wiphy, const char *alpha2);
395extern void regulatory_hint_11d(struct wiphy *wiphy, 429extern void regulatory_hint_11d(struct wiphy *wiphy,
396 u8 *country_ie, 430 u8 *country_ie,
397 u8 country_ie_len); 431 u8 country_ie_len);
432/**
433 * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain
434 * @wiphy: the wireless device we want to process the regulatory domain on
435 * @regd: the custom regulatory domain to use for this wiphy
436 *
437 * Drivers can sometimes have custom regulatory domains which do not apply
438 * to a specific country. Drivers can use this to apply such custom regulatory
439 * domains. This routine must be called prior to wiphy registration. The
440 * custom regulatory domain will be trusted completely and as such previous
441 * default channel settings will be disregarded. If no rule is found for a
442 * channel on the regulatory domain the channel will be disabled.
443 */
444extern void wiphy_apply_custom_regulatory(
445 struct wiphy *wiphy,
446 const struct ieee80211_regdomain *regd);
447
448/**
449 * freq_reg_info - get regulatory information for the given frequency
450 * @wiphy: the wiphy for which we want to process this rule for
451 * @center_freq: Frequency in KHz for which we want regulatory information for
452 * @bandwidth: the bandwidth requirement you have in KHz, if you do not have one
453 * you can set this to 0. If this frequency is allowed we then set
454 * this value to the maximum allowed bandwidth.
455 * @reg_rule: the regulatory rule which we have for this frequency
456 *
457 * Use this function to get the regulatory rule for a specific frequency on
458 * a given wireless device. If the device has a specific regulatory domain
459 * it wants to follow we respect that unless a country IE has been received
460 * and processed already.
461 *
462 * Returns 0 if it was able to find a valid regulatory rule which does
463 * apply to the given center_freq otherwise it returns non-zero. It will
464 * also return -ERANGE if we determine the given center_freq does not even have
465 * a regulatory rule for a frequency range in the center_freq's band. See
466 * freq_in_rule_band() for our current definition of a band -- this is purely
467 * subjective and right now its 802.11 specific.
468 */
469extern int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth,
470 const struct ieee80211_reg_rule **reg_rule);
471
398#endif /* __NET_WIRELESS_H */ 472#endif /* __NET_WIRELESS_H */