aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/ieee80211.h62
-rw-r--r--include/linux/nl80211.h5
-rw-r--r--include/linux/rfkill.h1
-rw-r--r--include/net/wireless.h22
4 files changed, 90 insertions, 0 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 56b0eb25d927..a6ec928186ad 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1042,6 +1042,68 @@ enum ieee80211_spectrum_mgmt_actioncode {
1042 WLAN_ACTION_SPCT_CHL_SWITCH = 4, 1042 WLAN_ACTION_SPCT_CHL_SWITCH = 4,
1043}; 1043};
1044 1044
1045/*
1046 * IEEE 802.11-2007 7.3.2.9 Country information element
1047 *
1048 * Minimum length is 8 octets, ie len must be evenly
1049 * divisible by 2
1050 */
1051
1052/* Although the spec says 8 I'm seeing 6 in practice */
1053#define IEEE80211_COUNTRY_IE_MIN_LEN 6
1054
1055/*
1056 * For regulatory extension stuff see IEEE 802.11-2007
1057 * Annex I (page 1141) and Annex J (page 1147). Also
1058 * review 7.3.2.9.
1059 *
1060 * When dot11RegulatoryClassesRequired is true and the
1061 * first_channel/reg_extension_id is >= 201 then the IE
1062 * compromises of the 'ext' struct represented below:
1063 *
1064 * - Regulatory extension ID - when generating IE this just needs
1065 * to be monotonically increasing for each triplet passed in
1066 * the IE
1067 * - Regulatory class - index into set of rules
1068 * - Coverage class - index into air propagation time (Table 7-27),
1069 * in microseconds, you can compute the air propagation time from
1070 * the index by multiplying by 3, so index 10 yields a propagation
1071 * of 10 us. Valid values are 0-31, values 32-255 are not defined
1072 * yet. A value of 0 inicates air propagation of <= 1 us.
1073 *
1074 * See also Table I.2 for Emission limit sets and table
1075 * I.3 for Behavior limit sets. Table J.1 indicates how to map
1076 * a reg_class to an emission limit set and behavior limit set.
1077 */
1078#define IEEE80211_COUNTRY_EXTENSION_ID 201
1079
1080/*
1081 * Channels numbers in the IE must be monotonically increasing
1082 * if dot11RegulatoryClassesRequired is not true.
1083 *
1084 * If dot11RegulatoryClassesRequired is true consecutive
1085 * subband triplets following a regulatory triplet shall
1086 * have monotonically increasing first_channel number fields.
1087 *
1088 * Channel numbers shall not overlap.
1089 *
1090 * Note that max_power is signed.
1091 */
1092struct ieee80211_country_ie_triplet {
1093 union {
1094 struct {
1095 u8 first_channel;
1096 u8 num_channels;
1097 s8 max_power;
1098 } __attribute__ ((packed)) chans;
1099 struct {
1100 u8 reg_extension_id;
1101 u8 reg_class;
1102 u8 coverage_class;
1103 } __attribute__ ((packed)) ext;
1104 };
1105} __attribute__ ((packed));
1106
1045/* BACK action code */ 1107/* BACK action code */
1046enum ieee80211_back_actioncode { 1108enum ieee80211_back_actioncode {
1047 WLAN_ACTION_ADDBA_REQ = 0, 1109 WLAN_ACTION_ADDBA_REQ = 0,
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 79827345351d..e08c8bcfb78d 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -508,6 +508,8 @@ enum nl80211_band_attr {
508 * on this channel in current regulatory domain. 508 * on this channel in current regulatory domain.
509 * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory 509 * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
510 * on this channel in current regulatory domain. 510 * on this channel in current regulatory domain.
511 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
512 * (100 * dBm).
511 */ 513 */
512enum nl80211_frequency_attr { 514enum nl80211_frequency_attr {
513 __NL80211_FREQUENCY_ATTR_INVALID, 515 __NL80211_FREQUENCY_ATTR_INVALID,
@@ -516,12 +518,15 @@ enum nl80211_frequency_attr {
516 NL80211_FREQUENCY_ATTR_PASSIVE_SCAN, 518 NL80211_FREQUENCY_ATTR_PASSIVE_SCAN,
517 NL80211_FREQUENCY_ATTR_NO_IBSS, 519 NL80211_FREQUENCY_ATTR_NO_IBSS,
518 NL80211_FREQUENCY_ATTR_RADAR, 520 NL80211_FREQUENCY_ATTR_RADAR,
521 NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
519 522
520 /* keep last */ 523 /* keep last */
521 __NL80211_FREQUENCY_ATTR_AFTER_LAST, 524 __NL80211_FREQUENCY_ATTR_AFTER_LAST,
522 NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1 525 NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1
523}; 526};
524 527
528#define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER
529
525/** 530/**
526 * enum nl80211_bitrate_attr - bitrate attributes 531 * enum nl80211_bitrate_attr - bitrate attributes
527 * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps 532 * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index 4cd64b0d9825..f376a93927f7 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -108,6 +108,7 @@ struct rfkill {
108 108
109 struct device dev; 109 struct device dev;
110 struct list_head node; 110 struct list_head node;
111 enum rfkill_state state_for_resume;
111}; 112};
112#define to_rfkill(d) container_of(d, struct rfkill, dev) 113#define to_rfkill(d) container_of(d, struct rfkill, dev)
113 114
diff --git a/include/net/wireless.h b/include/net/wireless.h
index 412351560b76..21c5d966142d 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -181,6 +181,11 @@ struct ieee80211_supported_band {
181 * struct wiphy - wireless hardware description 181 * struct wiphy - wireless hardware description
182 * @idx: the wiphy index assigned to this item 182 * @idx: the wiphy index assigned to this item
183 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> 183 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name>
184 * @fw_handles_regulatory: tells us the firmware for this device
185 * has its own regulatory solution and cannot identify the
186 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
187 * we will disregard the first regulatory hint (when the
188 * initiator is %REGDOM_SET_BY_CORE).
184 * @reg_notifier: the driver's regulatory notification callback 189 * @reg_notifier: the driver's regulatory notification callback
185 */ 190 */
186struct wiphy { 191struct wiphy {
@@ -192,6 +197,8 @@ struct wiphy {
192 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ 197 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
193 u16 interface_modes; 198 u16 interface_modes;
194 199
200 bool fw_handles_regulatory;
201
195 /* If multiple wiphys are registered and you're handed e.g. 202 /* If multiple wiphys are registered and you're handed e.g.
196 * a regular netdev with assigned ieee80211_ptr, you won't 203 * a regular netdev with assigned ieee80211_ptr, you won't
197 * know whether it points to a wiphy your driver has registered 204 * know whether it points to a wiphy your driver has registered
@@ -373,4 +380,19 @@ ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
373 * for a regulatory domain structure for the respective country. 380 * for a regulatory domain structure for the respective country.
374 */ 381 */
375extern void regulatory_hint(struct wiphy *wiphy, const char *alpha2); 382extern void regulatory_hint(struct wiphy *wiphy, const char *alpha2);
383
384/**
385 * regulatory_hint_11d - hints a country IE as a regulatory domain
386 * @wiphy: the wireless device giving the hint (used only for reporting
387 * conflicts)
388 * @country_ie: pointer to the country IE
389 * @country_ie_len: length of the country IE
390 *
391 * We will intersect the rd with the what CRDA tells us should apply
392 * for the alpha2 this country IE belongs to, this prevents APs from
393 * sending us incorrect or outdated information against a country.
394 */
395extern void regulatory_hint_11d(struct wiphy *wiphy,
396 u8 *country_ie,
397 u8 country_ie_len);
376#endif /* __NET_WIRELESS_H */ 398#endif /* __NET_WIRELESS_H */