diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2008-11-12 17:22:02 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-25 16:41:26 -0500 |
commit | 3f2355cb9111ac04e7ae06a4d7044da2ae813863 (patch) | |
tree | 11f5594b7d48281a12a2116ad7af1d20d5947455 /include/linux/ieee80211.h | |
parent | 88dc1c3f7f9058cd5ceae1e4b53453484c7b0364 (diff) |
cfg80211/mac80211: Add 802.11d support
This adds country IE parsing to mac80211 and enables its usage
within the new regulatory infrastructure in cfg80211. We parse
the country IEs only on management beacons for the BSSID you are
associated to and disregard the IEs when the country and environment
(indoor, outdoor, any) matches the already processed country IE.
To avoid following misinformed or outdated APs we build and use
a regulatory domain out of the intersection between what the AP
provides us on the country IE and what CRDA is aware is allowed
on the same country.
A secondary device is allowed to follow only the same country IE
as it make no sense for two devices on a system to be in two
different countries.
In the case the AP is using country IEs for an incorrect country
the user may help compliance further by setting the regulatory
domain before or after the IE is parsed and in that case another
intersection will be performed.
CONFIG_WIRELESS_OLD_REGULATORY is supported but requires CRDA
present.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/linux/ieee80211.h')
-rw-r--r-- | include/linux/ieee80211.h | 62 |
1 files changed, 62 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 | */ | ||
1092 | struct 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 */ |
1046 | enum ieee80211_back_actioncode { | 1108 | enum ieee80211_back_actioncode { |
1047 | WLAN_ACTION_ADDBA_REQ = 0, | 1109 | WLAN_ACTION_ADDBA_REQ = 0, |