Luis R. Rodriguez | b2e1b30 | 2008-09-09 23:19:48 -0700 | [diff] [blame] | 1 | #ifndef __NET_WIRELESS_REG_H |
| 2 | #define __NET_WIRELESS_REG_H |
| 3 | |
Johannes Berg | 734366d | 2008-09-15 10:56:48 +0200 | [diff] [blame] | 4 | extern struct mutex cfg80211_reg_mutex; |
Johannes Berg | a3d2eaf | 2008-09-15 11:10:52 +0200 | [diff] [blame] | 5 | bool is_world_regdom(const char *alpha2); |
| 6 | bool reg_is_valid_request(const char *alpha2); |
Luis R. Rodriguez | b2e1b30 | 2008-09-09 23:19:48 -0700 | [diff] [blame] | 7 | |
Luis R. Rodriguez | b2e1b30 | 2008-09-09 23:19:48 -0700 | [diff] [blame] | 8 | int regulatory_init(void); |
| 9 | void regulatory_exit(void); |
| 10 | |
Johannes Berg | a3d2eaf | 2008-09-15 11:10:52 +0200 | [diff] [blame] | 11 | int set_regdom(const struct ieee80211_regdomain *rd); |
Luis R. Rodriguez | b2e1b30 | 2008-09-09 23:19:48 -0700 | [diff] [blame] | 12 | |
Johannes Berg | cf03268 | 2008-10-21 09:42:38 +0200 | [diff] [blame^] | 13 | /** |
| 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 | */ |
| 38 | extern int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by, |
| 39 | const char *alpha2, struct ieee80211_regdomain *rd); |
| 40 | |
Luis R. Rodriguez | b2e1b30 | 2008-09-09 23:19:48 -0700 | [diff] [blame] | 41 | #endif /* __NET_WIRELESS_REG_H */ |