blob: a4845b140a8436fb86ea4718705c2468d6092ac7 [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 Berg734366d2008-09-15 10:56:48 +02004extern struct mutex cfg80211_reg_mutex;
Johannes Berga3d2eaf2008-09-15 11:10:52 +02005bool is_world_regdom(const char *alpha2);
6bool reg_is_valid_request(const char *alpha2);
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -07007
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -07008int regulatory_init(void);
9void regulatory_exit(void);
10
Johannes Berga3d2eaf2008-09-15 11:10:52 +020011int set_regdom(const struct ieee80211_regdomain *rd);
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -070012
Johannes Bergcf032682008-10-21 09:42:38 +020013/**
14 * __regulatory_hint - hint to the wireless core a regulatory domain
15 * @wiphy: if a driver is providing the hint this is the driver's very
16 * own &struct wiphy
17 * @alpha2: the ISO/IEC 3166 alpha2 being claimed the regulatory domain
18 * should be in. If @rd is set this should be NULL
19 * @rd: a complete regulatory domain, if passed the caller need not worry
20 * about freeing it
21 *
22 * The Wireless subsystem can use this function to hint to the wireless core
23 * what it believes should be the current regulatory domain by
24 * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory
25 * domain should be in or by providing a completely build regulatory domain.
26 *
27 * Returns -EALREADY if *a regulatory domain* has already been set. Note that
28 * this could be by another driver. It is safe for drivers to continue if
29 * -EALREADY is returned, if drivers are not capable of world roaming they
30 * should not register more channels than they support. Right now we only
31 * support listening to the first driver hint. If the driver is capable
32 * of world roaming but wants to respect its own EEPROM mappings for
33 * specific regulatory domains it should register the @reg_notifier callback
34 * on the &struct wiphy. Returns 0 if the hint went through fine or through an
35 * intersection operation. Otherwise a standard error code is returned.
36 *
37 */
38extern int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by,
39 const char *alpha2, struct ieee80211_regdomain *rd);
40
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -070041#endif /* __NET_WIRELESS_REG_H */