blob: eb1dd5bc9b270d4e47a94fa1f8b599ab8f2986b4 [file] [log] [blame]
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -07001#ifndef __NET_WIRELESS_REG_H
2#define __NET_WIRELESS_REG_H
3
Johannes Berga3d2eaf2008-09-15 11:10:52 +02004bool is_world_regdom(const char *alpha2);
5bool reg_is_valid_request(const char *alpha2);
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -07006
Luis R. Rodriguez3f2355c2008-11-12 14:22:02 -08007void reg_device_remove(struct wiphy *wiphy);
8
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -07009int regulatory_init(void);
10void regulatory_exit(void);
11
Johannes Berga3d2eaf2008-09-15 11:10:52 +020012int set_regdom(const struct ieee80211_regdomain *rd);
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -070013
Johannes Bergcf032682008-10-21 09:42:38 +020014/**
15 * __regulatory_hint - hint to the wireless core a regulatory domain
Johannes Bergbe3d4812008-10-24 20:32:21 +020016 * @wiphy: if the hint comes from country information from an AP, this
17 * is required to be set to the wiphy that received the information
Johannes Bergcf032682008-10-21 09:42:38 +020018 * @alpha2: the ISO/IEC 3166 alpha2 being claimed the regulatory domain
Johannes Bergbe3d4812008-10-24 20:32:21 +020019 * should be in.
Luis R. Rodriguez3f2355c2008-11-12 14:22:02 -080020 * @country_ie_checksum: checksum of processed country IE, set this to 0
21 * if the hint did not come from a country IE
22 * @country_ie_env: the environment the IE told us we are in, %ENVIRON_*
Johannes Bergcf032682008-10-21 09:42:38 +020023 *
24 * The Wireless subsystem can use this function to hint to the wireless core
Luis R. Rodriguez3f2355c2008-11-12 14:22:02 -080025 * what it believes should be the current regulatory domain by giving it an
26 * ISO/IEC 3166 alpha2 country code it knows its regulatory domain should be
27 * in.
Johannes Bergcf032682008-10-21 09:42:38 +020028 *
Johannes Bergbe3d4812008-10-24 20:32:21 +020029 * Returns zero if all went fine, %-EALREADY if a regulatory domain had
30 * already been set or other standard error codes.
Johannes Bergcf032682008-10-21 09:42:38 +020031 *
32 */
33extern int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by,
Luis R. Rodriguez3f2355c2008-11-12 14:22:02 -080034 const char *alpha2, u32 country_ie_checksum,
35 enum environment_cap country_ie_env);
Johannes Bergcf032682008-10-21 09:42:38 +020036
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -070037#endif /* __NET_WIRELESS_REG_H */