cfg80211 is the new Linux wireless configuration API. cfg80211 will replace Wireless-Extensions. You use nl80211 to configure a device. Note that we are not going to add any new features to Wireless Extensions, we'll only fix bugs for it. If you don't like what you see with Wireless-Extensions then help us advance cfg80211.
cfg80211 has regulatory compliance built into it, each registered device obeys cfg80211's regulatory interpretations and provides an API for drivers and for mac80211 to provide hints to it as to what rules should be enforced. A device registers with cfg80211 a list of supported bands and each band has a list of supported channels. During registration cfg80211 will ensure only the allowed channels for the currently set regulatory domain will be left enabled.
cfg80211 provides APIs for both drivers and mac80211 to supply regulatory hints to further enhance regulatory compliance.
After registration with cfg80211 a driver can provide a regulatory_hint() with an alpha2. This alpha2 can come from a map read from the device's EEPROM.
cfg80211 supports enhancing regulatory compliance by allowing drivers and mac80211 to inform it of when a country information element has been received and should be obeyed. The Country Information Element (cf. 802.11-2007 18.104.22.168) contains the information required to allow a station to identify the regulatory domain in which the AP is located and to configure its PHY for operation in that regulatory domain. The Country IE contains, amongst other things, the list of permissions (channels and transmit power on those channels) and an ISO/IEC 3166-1 country code. regulatory_hint_11d() can be used to pass to cfg80211 an IEEE 802.11 country information element. cfg80211 will parse the information element, build a regulatory domain from it and intersect with what CRDA tells us should apply for the given alpha2. This prevents rogue/busted APs from providing incorrect information.