reg.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef __NET_WIRELESS_REG_H
  2. #define __NET_WIRELESS_REG_H
  3. extern struct mutex cfg80211_reg_mutex;
  4. bool is_world_regdom(const char *alpha2);
  5. bool reg_is_valid_request(const char *alpha2);
  6. int regulatory_init(void);
  7. void regulatory_exit(void);
  8. int set_regdom(const struct ieee80211_regdomain *rd);
  9. /**
  10. * __regulatory_hint - hint to the wireless core a regulatory domain
  11. * @wiphy: if a driver is providing the hint this is the driver's very
  12. * own &struct wiphy
  13. * @alpha2: the ISO/IEC 3166 alpha2 being claimed the regulatory domain
  14. * should be in. If @rd is set this should be NULL
  15. * @rd: a complete regulatory domain, if passed the caller need not worry
  16. * about freeing it
  17. *
  18. * The Wireless subsystem can use this function to hint to the wireless core
  19. * what it believes should be the current regulatory domain by
  20. * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory
  21. * domain should be in or by providing a completely build regulatory domain.
  22. *
  23. * Returns -EALREADY if *a regulatory domain* has already been set. Note that
  24. * this could be by another driver. It is safe for drivers to continue if
  25. * -EALREADY is returned, if drivers are not capable of world roaming they
  26. * should not register more channels than they support. Right now we only
  27. * support listening to the first driver hint. If the driver is capable
  28. * of world roaming but wants to respect its own EEPROM mappings for
  29. * specific regulatory domains it should register the @reg_notifier callback
  30. * on the &struct wiphy. Returns 0 if the hint went through fine or through an
  31. * intersection operation. Otherwise a standard error code is returned.
  32. *
  33. */
  34. extern int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by,
  35. const char *alpha2, struct ieee80211_regdomain *rd);
  36. #endif /* __NET_WIRELESS_REG_H */