blob: fe8c83f34fb7e8465c9dc8d0804bb04aa58ef928 [file] [log] [blame]
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -07001#ifndef __NET_WIRELESS_REG_H
2#define __NET_WIRELESS_REG_H
3
Luis R. Rodriguezf1303472009-01-30 09:26:42 -08004extern const struct ieee80211_regdomain *cfg80211_regdomain;
5
Johannes Berga3d2eaf2008-09-15 11:10:52 +02006bool is_world_regdom(const char *alpha2);
7bool reg_is_valid_request(const char *alpha2);
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -07008
Luis R. Rodriguez3f2355c2008-11-12 14:22:02 -08009void reg_device_remove(struct wiphy *wiphy);
10
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -070011int regulatory_init(void);
12void regulatory_exit(void);
13
Johannes Berga3d2eaf2008-09-15 11:10:52 +020014int set_regdom(const struct ieee80211_regdomain *rd);
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -070015
Johannes Bergcf032682008-10-21 09:42:38 +020016/**
17 * __regulatory_hint - hint to the wireless core a regulatory domain
Johannes Bergbe3d4812008-10-24 20:32:21 +020018 * @wiphy: if the hint comes from country information from an AP, this
19 * is required to be set to the wiphy that received the information
Johannes Bergcf032682008-10-21 09:42:38 +020020 * @alpha2: the ISO/IEC 3166 alpha2 being claimed the regulatory domain
Johannes Bergbe3d4812008-10-24 20:32:21 +020021 * should be in.
Luis R. Rodriguez3f2355c2008-11-12 14:22:02 -080022 * @country_ie_checksum: checksum of processed country IE, set this to 0
23 * if the hint did not come from a country IE
24 * @country_ie_env: the environment the IE told us we are in, %ENVIRON_*
Johannes Bergcf032682008-10-21 09:42:38 +020025 *
26 * The Wireless subsystem can use this function to hint to the wireless core
Luis R. Rodriguez3f2355c2008-11-12 14:22:02 -080027 * what it believes should be the current regulatory domain by giving it an
28 * ISO/IEC 3166 alpha2 country code it knows its regulatory domain should be
29 * in.
Johannes Bergcf032682008-10-21 09:42:38 +020030 *
Johannes Bergbe3d4812008-10-24 20:32:21 +020031 * Returns zero if all went fine, %-EALREADY if a regulatory domain had
32 * already been set or other standard error codes.
Johannes Bergcf032682008-10-21 09:42:38 +020033 *
34 */
35extern int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by,
Luis R. Rodriguez3f2355c2008-11-12 14:22:02 -080036 const char *alpha2, u32 country_ie_checksum,
37 enum environment_cap country_ie_env);
Johannes Bergcf032682008-10-21 09:42:38 +020038
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -070039#endif /* __NET_WIRELESS_REG_H */