blob: 4730def5a69d07d79e069a75261b727cdc26eeee [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. Rodriguezfe33eb32009-02-21 00:04:30 -05009int regulatory_hint_user(const char *alpha2);
10
Luis R. Rodriguez3f2355c2008-11-12 14:22:02 -080011void reg_device_remove(struct wiphy *wiphy);
12
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -070013int regulatory_init(void);
14void regulatory_exit(void);
15
Johannes Berga3d2eaf2008-09-15 11:10:52 +020016int set_regdom(const struct ieee80211_regdomain *rd);
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -070017
Johannes Bergcf032682008-10-21 09:42:38 +020018/**
19 * __regulatory_hint - hint to the wireless core a regulatory domain
Johannes Bergbe3d4812008-10-24 20:32:21 +020020 * @wiphy: if the hint comes from country information from an AP, this
21 * is required to be set to the wiphy that received the information
Johannes Bergcf032682008-10-21 09:42:38 +020022 * @alpha2: the ISO/IEC 3166 alpha2 being claimed the regulatory domain
Johannes Bergbe3d4812008-10-24 20:32:21 +020023 * should be in.
Luis R. Rodriguez3f2355c2008-11-12 14:22:02 -080024 * @country_ie_checksum: checksum of processed country IE, set this to 0
25 * if the hint did not come from a country IE
26 * @country_ie_env: the environment the IE told us we are in, %ENVIRON_*
Johannes Bergcf032682008-10-21 09:42:38 +020027 *
28 * The Wireless subsystem can use this function to hint to the wireless core
Luis R. Rodriguez3f2355c2008-11-12 14:22:02 -080029 * what it believes should be the current regulatory domain by giving it an
30 * ISO/IEC 3166 alpha2 country code it knows its regulatory domain should be
31 * in.
Johannes Bergcf032682008-10-21 09:42:38 +020032 *
Johannes Bergbe3d4812008-10-24 20:32:21 +020033 * Returns zero if all went fine, %-EALREADY if a regulatory domain had
34 * already been set or other standard error codes.
Johannes Bergcf032682008-10-21 09:42:38 +020035 *
36 */
37extern int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by,
Luis R. Rodriguez3f2355c2008-11-12 14:22:02 -080038 const char *alpha2, u32 country_ie_checksum,
39 enum environment_cap country_ie_env);
Johannes Bergcf032682008-10-21 09:42:38 +020040
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -070041#endif /* __NET_WIRELESS_REG_H */