blob: a76ea3ff7cd6af1a9da0044a7b8eca2afabea85a [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
Luis R. Rodriguez3f2355c2008-11-12 14:22:02 -080014enum environment_cap {
15 ENVIRON_ANY,
16 ENVIRON_INDOOR,
17 ENVIRON_OUTDOOR,
18};
19
20
Johannes Bergcf032682008-10-21 09:42:38 +020021/**
22 * __regulatory_hint - hint to the wireless core a regulatory domain
Johannes Bergbe3d4812008-10-24 20:32:21 +020023 * @wiphy: if the hint comes from country information from an AP, this
24 * is required to be set to the wiphy that received the information
Johannes Bergcf032682008-10-21 09:42:38 +020025 * @alpha2: the ISO/IEC 3166 alpha2 being claimed the regulatory domain
Johannes Bergbe3d4812008-10-24 20:32:21 +020026 * should be in.
Luis R. Rodriguez3f2355c2008-11-12 14:22:02 -080027 * @country_ie_checksum: checksum of processed country IE, set this to 0
28 * if the hint did not come from a country IE
29 * @country_ie_env: the environment the IE told us we are in, %ENVIRON_*
Johannes Bergcf032682008-10-21 09:42:38 +020030 *
31 * The Wireless subsystem can use this function to hint to the wireless core
Luis R. Rodriguez3f2355c2008-11-12 14:22:02 -080032 * what it believes should be the current regulatory domain by giving it an
33 * ISO/IEC 3166 alpha2 country code it knows its regulatory domain should be
34 * in.
Johannes Bergcf032682008-10-21 09:42:38 +020035 *
Johannes Bergbe3d4812008-10-24 20:32:21 +020036 * Returns zero if all went fine, %-EALREADY if a regulatory domain had
37 * already been set or other standard error codes.
Johannes Bergcf032682008-10-21 09:42:38 +020038 *
39 */
40extern int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by,
Luis R. Rodriguez3f2355c2008-11-12 14:22:02 -080041 const char *alpha2, u32 country_ie_checksum,
42 enum environment_cap country_ie_env);
Johannes Bergcf032682008-10-21 09:42:38 +020043
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -070044#endif /* __NET_WIRELESS_REG_H */