aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-02-03 15:41:58 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-03 15:41:58 -0500
commit1725d409caba16ea5fc694bd50e95e79e8ced11a (patch)
tree688fe26dd4ceda5364692f0ce307aadb6f04f331 /include
parentb3ff29d2ccfe3af065a9b393699a8fbf2abd1b15 (diff)
parentb8abde45d7d6ab9e8ceced9b5990eeb1149d0b97 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'include')
-rw-r--r--include/linux/ath9k_platform.h28
-rw-r--r--include/linux/ieee80211.h181
-rw-r--r--include/linux/nl80211.h36
-rw-r--r--include/linux/pci_ids.h4
-rw-r--r--include/linux/spi/libertas_spi.h25
-rw-r--r--include/linux/ssb/ssb_regs.h36
-rw-r--r--include/linux/wireless.h12
-rw-r--r--include/net/cfg80211.h84
-rw-r--r--include/net/mac80211.h212
-rw-r--r--include/net/wireless.h68
10 files changed, 633 insertions, 53 deletions
diff --git a/include/linux/ath9k_platform.h b/include/linux/ath9k_platform.h
new file mode 100644
index 000000000000..b847fc7b93f9
--- /dev/null
+++ b/include/linux/ath9k_platform.h
@@ -0,0 +1,28 @@
1/*
2 * Copyright (c) 2008 Atheros Communications Inc.
3 * Copyright (c) 2009 Gabor Juhos <juhosg@openwrt.org>
4 * Copyright (c) 2009 Imre Kaloz <kaloz@openwrt.org>
5 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19#ifndef _LINUX_ATH9K_PLATFORM_H
20#define _LINUX_ATH9K_PLATFORM_H
21
22#define ATH9K_PLAT_EEP_MAX_WORDS 2048
23
24struct ath9k_platform_data {
25 u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
26};
27
28#endif /* _LINUX_ATH9K_PLATFORM_H */
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index c4e6ca1a6306..b1bb817d1427 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -527,6 +527,8 @@ struct ieee80211_tim_ie {
527 u8 virtual_map[0]; 527 u8 virtual_map[0];
528} __attribute__ ((packed)); 528} __attribute__ ((packed));
529 529
530#define WLAN_SA_QUERY_TR_ID_LEN 16
531
530struct ieee80211_mgmt { 532struct ieee80211_mgmt {
531 __le16 frame_control; 533 __le16 frame_control;
532 __le16 duration; 534 __le16 duration;
@@ -646,6 +648,10 @@ struct ieee80211_mgmt {
646 u8 action_code; 648 u8 action_code;
647 u8 variable[0]; 649 u8 variable[0];
648 } __attribute__((packed)) mesh_action; 650 } __attribute__((packed)) mesh_action;
651 struct {
652 u8 action;
653 u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
654 } __attribute__ ((packed)) sa_query;
649 } u; 655 } u;
650 } __attribute__ ((packed)) action; 656 } __attribute__ ((packed)) action;
651 } u; 657 } u;
@@ -655,6 +661,15 @@ struct ieee80211_mgmt {
655#define IEEE80211_MIN_ACTION_SIZE offsetof(struct ieee80211_mgmt, u.action.u) 661#define IEEE80211_MIN_ACTION_SIZE offsetof(struct ieee80211_mgmt, u.action.u)
656 662
657 663
664/* Management MIC information element (IEEE 802.11w) */
665struct ieee80211_mmie {
666 u8 element_id;
667 u8 length;
668 __le16 key_id;
669 u8 sequence_number[6];
670 u8 mic[8];
671} __attribute__ ((packed));
672
658/* Control frames */ 673/* Control frames */
659struct ieee80211_rts { 674struct ieee80211_rts {
660 __le16 frame_control; 675 __le16 frame_control;
@@ -899,6 +914,9 @@ enum ieee80211_statuscode {
899 /* 802.11g */ 914 /* 802.11g */
900 WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25, 915 WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25,
901 WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26, 916 WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26,
917 /* 802.11w */
918 WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY = 30,
919 WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION = 31,
902 /* 802.11i */ 920 /* 802.11i */
903 WLAN_STATUS_INVALID_IE = 40, 921 WLAN_STATUS_INVALID_IE = 40,
904 WLAN_STATUS_INVALID_GROUP_CIPHER = 41, 922 WLAN_STATUS_INVALID_GROUP_CIPHER = 41,
@@ -1018,6 +1036,8 @@ enum ieee80211_eid {
1018 WLAN_EID_HT_INFORMATION = 61, 1036 WLAN_EID_HT_INFORMATION = 61,
1019 /* 802.11i */ 1037 /* 802.11i */
1020 WLAN_EID_RSN = 48, 1038 WLAN_EID_RSN = 48,
1039 WLAN_EID_TIMEOUT_INTERVAL = 56,
1040 WLAN_EID_MMIE = 76 /* 802.11w */,
1021 WLAN_EID_WPA = 221, 1041 WLAN_EID_WPA = 221,
1022 WLAN_EID_GENERIC = 221, 1042 WLAN_EID_GENERIC = 221,
1023 WLAN_EID_VENDOR_SPECIFIC = 221, 1043 WLAN_EID_VENDOR_SPECIFIC = 221,
@@ -1030,6 +1050,8 @@ enum ieee80211_category {
1030 WLAN_CATEGORY_QOS = 1, 1050 WLAN_CATEGORY_QOS = 1,
1031 WLAN_CATEGORY_DLS = 2, 1051 WLAN_CATEGORY_DLS = 2,
1032 WLAN_CATEGORY_BACK = 3, 1052 WLAN_CATEGORY_BACK = 3,
1053 WLAN_CATEGORY_PUBLIC = 4,
1054 WLAN_CATEGORY_SA_QUERY = 8,
1033 WLAN_CATEGORY_WMM = 17, 1055 WLAN_CATEGORY_WMM = 17,
1034}; 1056};
1035 1057
@@ -1104,6 +1126,12 @@ struct ieee80211_country_ie_triplet {
1104 }; 1126 };
1105} __attribute__ ((packed)); 1127} __attribute__ ((packed));
1106 1128
1129enum ieee80211_timeout_interval_type {
1130 WLAN_TIMEOUT_REASSOC_DEADLINE = 1 /* 802.11r */,
1131 WLAN_TIMEOUT_KEY_LIFETIME = 2 /* 802.11r */,
1132 WLAN_TIMEOUT_ASSOC_COMEBACK = 3 /* 802.11w */,
1133};
1134
1107/* BACK action code */ 1135/* BACK action code */
1108enum ieee80211_back_actioncode { 1136enum ieee80211_back_actioncode {
1109 WLAN_ACTION_ADDBA_REQ = 0, 1137 WLAN_ACTION_ADDBA_REQ = 0,
@@ -1118,6 +1146,13 @@ enum ieee80211_back_parties {
1118 WLAN_BACK_TIMER = 2, 1146 WLAN_BACK_TIMER = 2,
1119}; 1147};
1120 1148
1149/* SA Query action */
1150enum ieee80211_sa_query_action {
1151 WLAN_ACTION_SA_QUERY_REQUEST = 0,
1152 WLAN_ACTION_SA_QUERY_RESPONSE = 1,
1153};
1154
1155
1121/* A-MSDU 802.11n */ 1156/* A-MSDU 802.11n */
1122#define IEEE80211_QOS_CONTROL_A_MSDU_PRESENT 0x0080 1157#define IEEE80211_QOS_CONTROL_A_MSDU_PRESENT 0x0080
1123 1158
@@ -1128,6 +1163,7 @@ enum ieee80211_back_parties {
1128/* reserved: 0x000FAC03 */ 1163/* reserved: 0x000FAC03 */
1129#define WLAN_CIPHER_SUITE_CCMP 0x000FAC04 1164#define WLAN_CIPHER_SUITE_CCMP 0x000FAC04
1130#define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 1165#define WLAN_CIPHER_SUITE_WEP104 0x000FAC05
1166#define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06
1131 1167
1132#define WLAN_MAX_KEY_LEN 32 1168#define WLAN_MAX_KEY_LEN 32
1133 1169
@@ -1185,4 +1221,149 @@ static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr)
1185 return hdr->addr1; 1221 return hdr->addr1;
1186} 1222}
1187 1223
1224/**
1225 * ieee80211_is_robust_mgmt_frame - check if frame is a robust management frame
1226 * @hdr: the frame (buffer must include at least the first octet of payload)
1227 */
1228static inline bool ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr)
1229{
1230 if (ieee80211_is_disassoc(hdr->frame_control) ||
1231 ieee80211_is_deauth(hdr->frame_control))
1232 return true;
1233
1234 if (ieee80211_is_action(hdr->frame_control)) {
1235 u8 *category;
1236
1237 /*
1238 * Action frames, excluding Public Action frames, are Robust
1239 * Management Frames. However, if we are looking at a Protected
1240 * frame, skip the check since the data may be encrypted and
1241 * the frame has already been found to be a Robust Management
1242 * Frame (by the other end).
1243 */
1244 if (ieee80211_has_protected(hdr->frame_control))
1245 return true;
1246 category = ((u8 *) hdr) + 24;
1247 return *category != WLAN_CATEGORY_PUBLIC;
1248 }
1249
1250 return false;
1251}
1252
1253/**
1254 * ieee80211_fhss_chan_to_freq - get channel frequency
1255 * @channel: the FHSS channel
1256 *
1257 * Convert IEEE802.11 FHSS channel to frequency (MHz)
1258 * Ref IEEE 802.11-2007 section 14.6
1259 */
1260static inline int ieee80211_fhss_chan_to_freq(int channel)
1261{
1262 if ((channel > 1) && (channel < 96))
1263 return channel + 2400;
1264 else
1265 return -1;
1266}
1267
1268/**
1269 * ieee80211_freq_to_fhss_chan - get channel
1270 * @freq: the channels frequency
1271 *
1272 * Convert frequency (MHz) to IEEE802.11 FHSS channel
1273 * Ref IEEE 802.11-2007 section 14.6
1274 */
1275static inline int ieee80211_freq_to_fhss_chan(int freq)
1276{
1277 if ((freq > 2401) && (freq < 2496))
1278 return freq - 2400;
1279 else
1280 return -1;
1281}
1282
1283/**
1284 * ieee80211_dsss_chan_to_freq - get channel center frequency
1285 * @channel: the DSSS channel
1286 *
1287 * Convert IEEE802.11 DSSS channel to the center frequency (MHz).
1288 * Ref IEEE 802.11-2007 section 15.6
1289 */
1290static inline int ieee80211_dsss_chan_to_freq(int channel)
1291{
1292 if ((channel > 0) && (channel < 14))
1293 return 2407 + (channel * 5);
1294 else if (channel == 14)
1295 return 2484;
1296 else
1297 return -1;
1298}
1299
1300/**
1301 * ieee80211_freq_to_dsss_chan - get channel
1302 * @freq: the frequency
1303 *
1304 * Convert frequency (MHz) to IEEE802.11 DSSS channel
1305 * Ref IEEE 802.11-2007 section 15.6
1306 *
1307 * This routine selects the channel with the closest center frequency.
1308 */
1309static inline int ieee80211_freq_to_dsss_chan(int freq)
1310{
1311 if ((freq >= 2410) && (freq < 2475))
1312 return (freq - 2405) / 5;
1313 else if ((freq >= 2482) && (freq < 2487))
1314 return 14;
1315 else
1316 return -1;
1317}
1318
1319/* Convert IEEE802.11 HR DSSS channel to frequency (MHz) and back
1320 * Ref IEEE 802.11-2007 section 18.4.6.2
1321 *
1322 * The channels and frequencies are the same as those defined for DSSS
1323 */
1324#define ieee80211_hr_chan_to_freq(chan) ieee80211_dsss_chan_to_freq(chan)
1325#define ieee80211_freq_to_hr_chan(freq) ieee80211_freq_to_dsss_chan(freq)
1326
1327/* Convert IEEE802.11 ERP channel to frequency (MHz) and back
1328 * Ref IEEE 802.11-2007 section 19.4.2
1329 */
1330#define ieee80211_erp_chan_to_freq(chan) ieee80211_hr_chan_to_freq(chan)
1331#define ieee80211_freq_to_erp_chan(freq) ieee80211_freq_to_hr_chan(freq)
1332
1333/**
1334 * ieee80211_ofdm_chan_to_freq - get channel center frequency
1335 * @s_freq: starting frequency == (dotChannelStartingFactor/2) MHz
1336 * @channel: the OFDM channel
1337 *
1338 * Convert IEEE802.11 OFDM channel to center frequency (MHz)
1339 * Ref IEEE 802.11-2007 section 17.3.8.3.2
1340 */
1341static inline int ieee80211_ofdm_chan_to_freq(int s_freq, int channel)
1342{
1343 if ((channel > 0) && (channel <= 200) &&
1344 (s_freq >= 4000))
1345 return s_freq + (channel * 5);
1346 else
1347 return -1;
1348}
1349
1350/**
1351 * ieee80211_freq_to_ofdm_channel - get channel
1352 * @s_freq: starting frequency == (dotChannelStartingFactor/2) MHz
1353 * @freq: the frequency
1354 *
1355 * Convert frequency (MHz) to IEEE802.11 OFDM channel
1356 * Ref IEEE 802.11-2007 section 17.3.8.3.2
1357 *
1358 * This routine selects the channel with the closest center frequency.
1359 */
1360static inline int ieee80211_freq_to_ofdm_chan(int s_freq, int freq)
1361{
1362 if ((freq > (s_freq + 2)) && (freq <= (s_freq + 1202)) &&
1363 (s_freq >= 4000))
1364 return (freq + 2 - s_freq) / 5;
1365 else
1366 return -1;
1367}
1368
1188#endif /* LINUX_IEEE80211_H */ 1369#endif /* LINUX_IEEE80211_H */
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index e86ed59f9ad5..76aae3d8e97e 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -47,7 +47,7 @@
47 * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or 47 * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or
48 * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME, 48 * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME,
49 * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ, and/or 49 * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ, and/or
50 * %NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET. 50 * %NL80211_ATTR_WIPHY_CHANNEL_TYPE.
51 * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request 51 * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
52 * or rename notification. Has attributes %NL80211_ATTR_WIPHY and 52 * or rename notification. Has attributes %NL80211_ATTR_WIPHY and
53 * %NL80211_ATTR_WIPHY_NAME. 53 * %NL80211_ATTR_WIPHY_NAME.
@@ -72,8 +72,8 @@
72 * 72 *
73 * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified 73 * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified
74 * by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC. 74 * by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC.
75 * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT or 75 * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT,
76 * %NL80211_ATTR_KEY_THRESHOLD. 76 * %NL80211_ATTR_KEY_DEFAULT_MGMT, or %NL80211_ATTR_KEY_THRESHOLD.
77 * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA, 77 * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA,
78 * %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC and %NL80211_ATTR_KEY_CIPHER 78 * %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC and %NL80211_ATTR_KEY_CIPHER
79 * attributes. 79 * attributes.
@@ -84,7 +84,7 @@
84 * %NL80222_CMD_NEW_BEACON message) 84 * %NL80222_CMD_NEW_BEACON message)
85 * @NL80211_CMD_SET_BEACON: set the beacon on an access point interface 85 * @NL80211_CMD_SET_BEACON: set the beacon on an access point interface
86 * using the %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD, 86 * using the %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD,
87 * %NL80211_BEACON_HEAD and %NL80211_BEACON_TAIL attributes. 87 * %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL attributes.
88 * @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface, 88 * @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface,
89 * parameters are like for %NL80211_CMD_SET_BEACON. 89 * parameters are like for %NL80211_CMD_SET_BEACON.
90 * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it 90 * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it
@@ -133,6 +133,14 @@
133 * @NL80211_CMD_SET_MESH_PARAMS: Set mesh networking properties for the 133 * @NL80211_CMD_SET_MESH_PARAMS: Set mesh networking properties for the
134 * interface identified by %NL80211_ATTR_IFINDEX 134 * interface identified by %NL80211_ATTR_IFINDEX
135 * 135 *
136 * @NL80211_CMD_SET_MGMT_EXTRA_IE: Set extra IEs for management frames. The
137 * interface is identified with %NL80211_ATTR_IFINDEX and the management
138 * frame subtype with %NL80211_ATTR_MGMT_SUBTYPE. The extra IE data to be
139 * added to the end of the specified management frame is specified with
140 * %NL80211_ATTR_IE. If the command succeeds, the requested data will be
141 * added to all specified management frames generated by
142 * kernel/firmware/driver.
143 *
136 * @NL80211_CMD_MAX: highest used command number 144 * @NL80211_CMD_MAX: highest used command number
137 * @__NL80211_CMD_AFTER_LAST: internal use 145 * @__NL80211_CMD_AFTER_LAST: internal use
138 */ 146 */
@@ -178,6 +186,8 @@ enum nl80211_commands {
178 NL80211_CMD_GET_MESH_PARAMS, 186 NL80211_CMD_GET_MESH_PARAMS,
179 NL80211_CMD_SET_MESH_PARAMS, 187 NL80211_CMD_SET_MESH_PARAMS,
180 188
189 NL80211_CMD_SET_MGMT_EXTRA_IE,
190
181 /* add new commands above here */ 191 /* add new commands above here */
182 192
183 /* used to define NL80211_CMD_MAX below */ 193 /* used to define NL80211_CMD_MAX below */
@@ -190,6 +200,7 @@ enum nl80211_commands {
190 * here 200 * here
191 */ 201 */
192#define NL80211_CMD_SET_BSS NL80211_CMD_SET_BSS 202#define NL80211_CMD_SET_BSS NL80211_CMD_SET_BSS
203#define NL80211_CMD_SET_MGMT_EXTRA_IE NL80211_CMD_SET_MGMT_EXTRA_IE
193 204
194/** 205/**
195 * enum nl80211_attrs - nl80211 netlink attributes 206 * enum nl80211_attrs - nl80211 netlink attributes
@@ -284,6 +295,12 @@ enum nl80211_commands {
284 * supported interface types, each a flag attribute with the number 295 * supported interface types, each a flag attribute with the number
285 * of the interface mode. 296 * of the interface mode.
286 * 297 *
298 * @NL80211_ATTR_MGMT_SUBTYPE: Management frame subtype for
299 * %NL80211_CMD_SET_MGMT_EXTRA_IE.
300 *
301 * @NL80211_ATTR_IE: Information element(s) data (used, e.g., with
302 * %NL80211_CMD_SET_MGMT_EXTRA_IE).
303 *
287 * @NL80211_ATTR_MAX: highest attribute number currently defined 304 * @NL80211_ATTR_MAX: highest attribute number currently defined
288 * @__NL80211_ATTR_AFTER_LAST: internal use 305 * @__NL80211_ATTR_AFTER_LAST: internal use
289 */ 306 */
@@ -346,6 +363,11 @@ enum nl80211_attrs {
346 NL80211_ATTR_WIPHY_FREQ, 363 NL80211_ATTR_WIPHY_FREQ,
347 NL80211_ATTR_WIPHY_CHANNEL_TYPE, 364 NL80211_ATTR_WIPHY_CHANNEL_TYPE,
348 365
366 NL80211_ATTR_KEY_DEFAULT_MGMT,
367
368 NL80211_ATTR_MGMT_SUBTYPE,
369 NL80211_ATTR_IE,
370
349 /* add attributes here, update the policy in nl80211.c */ 371 /* add attributes here, update the policy in nl80211.c */
350 372
351 __NL80211_ATTR_AFTER_LAST, 373 __NL80211_ATTR_AFTER_LAST,
@@ -360,7 +382,9 @@ enum nl80211_attrs {
360#define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES 382#define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES
361#define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS 383#define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS
362#define NL80211_ATTR_WIPHY_FREQ NL80211_ATTR_WIPHY_FREQ 384#define NL80211_ATTR_WIPHY_FREQ NL80211_ATTR_WIPHY_FREQ
363#define NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET 385#define NL80211_ATTR_WIPHY_CHANNEL_TYPE NL80211_ATTR_WIPHY_CHANNEL_TYPE
386#define NL80211_ATTR_MGMT_SUBTYPE NL80211_ATTR_MGMT_SUBTYPE
387#define NL80211_ATTR_IE NL80211_ATTR_IE
364 388
365#define NL80211_MAX_SUPP_RATES 32 389#define NL80211_MAX_SUPP_RATES 32
366#define NL80211_MAX_SUPP_REG_RULES 32 390#define NL80211_MAX_SUPP_REG_RULES 32
@@ -412,12 +436,14 @@ enum nl80211_iftype {
412 * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames 436 * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
413 * with short barker preamble 437 * with short barker preamble
414 * @NL80211_STA_FLAG_WME: station is WME/QoS capable 438 * @NL80211_STA_FLAG_WME: station is WME/QoS capable
439 * @NL80211_STA_FLAG_MFP: station uses management frame protection
415 */ 440 */
416enum nl80211_sta_flags { 441enum nl80211_sta_flags {
417 __NL80211_STA_FLAG_INVALID, 442 __NL80211_STA_FLAG_INVALID,
418 NL80211_STA_FLAG_AUTHORIZED, 443 NL80211_STA_FLAG_AUTHORIZED,
419 NL80211_STA_FLAG_SHORT_PREAMBLE, 444 NL80211_STA_FLAG_SHORT_PREAMBLE,
420 NL80211_STA_FLAG_WME, 445 NL80211_STA_FLAG_WME,
446 NL80211_STA_FLAG_MFP,
421 447
422 /* keep last */ 448 /* keep last */
423 __NL80211_STA_FLAG_AFTER_LAST, 449 __NL80211_STA_FLAG_AFTER_LAST,
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 2370184e3654..966e02332990 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -834,6 +834,8 @@
834#define PCI_DEVICE_ID_PROMISE_20276 0x5275 834#define PCI_DEVICE_ID_PROMISE_20276 0x5275
835#define PCI_DEVICE_ID_PROMISE_20277 0x7275 835#define PCI_DEVICE_ID_PROMISE_20277 0x7275
836 836
837#define PCI_VENDOR_ID_FOXCONN 0x105b
838
837#define PCI_VENDOR_ID_UMC 0x1060 839#define PCI_VENDOR_ID_UMC 0x1060
838#define PCI_DEVICE_ID_UMC_UM8673F 0x0101 840#define PCI_DEVICE_ID_UMC_UM8673F 0x0101
839#define PCI_DEVICE_ID_UMC_UM8886BF 0x673a 841#define PCI_DEVICE_ID_UMC_UM8886BF 0x673a
@@ -1969,6 +1971,8 @@
1969 1971
1970#define PCI_VENDOR_ID_SAMSUNG 0x144d 1972#define PCI_VENDOR_ID_SAMSUNG 0x144d
1971 1973
1974#define PCI_VENDOR_ID_AMBIT 0x1468
1975
1972#define PCI_VENDOR_ID_MYRICOM 0x14c1 1976#define PCI_VENDOR_ID_MYRICOM 0x14c1
1973 1977
1974#define PCI_VENDOR_ID_TITAN 0x14D2 1978#define PCI_VENDOR_ID_TITAN 0x14D2
diff --git a/include/linux/spi/libertas_spi.h b/include/linux/spi/libertas_spi.h
new file mode 100644
index 000000000000..ada71b4f3788
--- /dev/null
+++ b/include/linux/spi/libertas_spi.h
@@ -0,0 +1,25 @@
1/*
2 * board-specific data for the libertas_spi driver.
3 *
4 * Copyright 2008 Analog Devices Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or (at
9 * your option) any later version.
10 */
11#ifndef _LIBERTAS_SPI_H_
12#define _LIBERTAS_SPI_H_
13struct libertas_spi_platform_data {
14 /* There are two ways to read data from the WLAN module's SPI
15 * interface. Setting 0 or 1 here controls which one is used.
16 *
17 * Usually you want to set use_dummy_writes = 1.
18 * However, if that doesn't work or if you are using a slow SPI clock
19 * speed, you may want to use 0 here. */
20 u16 use_dummy_writes;
21
22 /* GPIO number to use as chip select */
23 u16 gpio_cs;
24};
25#endif
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index 99a0f991e850..a01b982b5783 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -326,6 +326,42 @@
326#define SSB_SPROM5_GPIOB_P3 0xFF00 /* Pin 3 */ 326#define SSB_SPROM5_GPIOB_P3 0xFF00 /* Pin 3 */
327#define SSB_SPROM5_GPIOB_P3_SHIFT 8 327#define SSB_SPROM5_GPIOB_P3_SHIFT 8
328 328
329/* SPROM Revision 8 */
330#define SSB_SPROM8_BFLLO 0x1084 /* Boardflags (low 16 bits) */
331#define SSB_SPROM8_BFLHI 0x1086 /* Boardflags Hi */
332#define SSB_SPROM8_IL0MAC 0x108C /* 6 byte MAC address */
333#define SSB_SPROM8_CCODE 0x1092 /* 2 byte country code */
334#define SSB_SPROM8_ANTAVAIL 0x109C /* Antenna available bitfields*/
335#define SSB_SPROM8_ANTAVAIL_A 0xFF00 /* A-PHY bitfield */
336#define SSB_SPROM8_ANTAVAIL_A_SHIFT 8
337#define SSB_SPROM8_ANTAVAIL_BG 0x00FF /* B-PHY and G-PHY bitfield */
338#define SSB_SPROM8_ANTAVAIL_BG_SHIFT 0
339#define SSB_SPROM8_AGAIN01 0x109E /* Antenna Gain (in dBm Q5.2) */
340#define SSB_SPROM8_AGAIN0 0x00FF /* Antenna 0 */
341#define SSB_SPROM8_AGAIN0_SHIFT 0
342#define SSB_SPROM8_AGAIN1 0xFF00 /* Antenna 1 */
343#define SSB_SPROM8_AGAIN1_SHIFT 8
344#define SSB_SPROM8_AGAIN23 0x10A0
345#define SSB_SPROM8_AGAIN2 0x00FF /* Antenna 2 */
346#define SSB_SPROM8_AGAIN2_SHIFT 0
347#define SSB_SPROM8_AGAIN3 0xFF00 /* Antenna 3 */
348#define SSB_SPROM8_AGAIN3_SHIFT 8
349#define SSB_SPROM8_GPIOA 0x1096 /*Gen. Purpose IO # 0 and 1 */
350#define SSB_SPROM8_GPIOA_P0 0x00FF /* Pin 0 */
351#define SSB_SPROM8_GPIOA_P1 0xFF00 /* Pin 1 */
352#define SSB_SPROM8_GPIOA_P1_SHIFT 8
353#define SSB_SPROM8_GPIOB 0x1098 /* Gen. Purpose IO # 2 and 3 */
354#define SSB_SPROM8_GPIOB_P2 0x00FF /* Pin 2 */
355#define SSB_SPROM8_GPIOB_P3 0xFF00 /* Pin 3 */
356#define SSB_SPROM8_GPIOB_P3_SHIFT 8
357#define SSB_SPROM8_MAXP_BG 0x10C0 /* Max Power BG in path 1 */
358#define SSB_SPROM8_MAXP_BG_MASK 0x00FF /* Mask for Max Power BG */
359#define SSB_SPROM8_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */
360#define SSB_SPROM8_ITSSI_BG_SHIFT 8
361#define SSB_SPROM8_MAXP_A 0x10C8 /* Max Power A in path 1 */
362#define SSB_SPROM8_MAXP_A_MASK 0x00FF /* Mask for Max Power A */
363#define SSB_SPROM8_ITSSI_A 0xFF00 /* Mask for path 1 itssi_a */
364#define SSB_SPROM8_ITSSI_A_SHIFT 8
329 365
330/* Values for SSB_SPROM1_BINF_CCODE */ 366/* Values for SSB_SPROM1_BINF_CCODE */
331enum { 367enum {
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index d7958f9b52cb..cb24204851f7 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -577,18 +577,22 @@
577#define IW_AUTH_RX_UNENCRYPTED_EAPOL 8 577#define IW_AUTH_RX_UNENCRYPTED_EAPOL 8
578#define IW_AUTH_ROAMING_CONTROL 9 578#define IW_AUTH_ROAMING_CONTROL 9
579#define IW_AUTH_PRIVACY_INVOKED 10 579#define IW_AUTH_PRIVACY_INVOKED 10
580#define IW_AUTH_CIPHER_GROUP_MGMT 11
581#define IW_AUTH_MFP 12
580 582
581/* IW_AUTH_WPA_VERSION values (bit field) */ 583/* IW_AUTH_WPA_VERSION values (bit field) */
582#define IW_AUTH_WPA_VERSION_DISABLED 0x00000001 584#define IW_AUTH_WPA_VERSION_DISABLED 0x00000001
583#define IW_AUTH_WPA_VERSION_WPA 0x00000002 585#define IW_AUTH_WPA_VERSION_WPA 0x00000002
584#define IW_AUTH_WPA_VERSION_WPA2 0x00000004 586#define IW_AUTH_WPA_VERSION_WPA2 0x00000004
585 587
586/* IW_AUTH_PAIRWISE_CIPHER and IW_AUTH_GROUP_CIPHER values (bit field) */ 588/* IW_AUTH_PAIRWISE_CIPHER, IW_AUTH_GROUP_CIPHER, and IW_AUTH_CIPHER_GROUP_MGMT
589 * values (bit field) */
587#define IW_AUTH_CIPHER_NONE 0x00000001 590#define IW_AUTH_CIPHER_NONE 0x00000001
588#define IW_AUTH_CIPHER_WEP40 0x00000002 591#define IW_AUTH_CIPHER_WEP40 0x00000002
589#define IW_AUTH_CIPHER_TKIP 0x00000004 592#define IW_AUTH_CIPHER_TKIP 0x00000004
590#define IW_AUTH_CIPHER_CCMP 0x00000008 593#define IW_AUTH_CIPHER_CCMP 0x00000008
591#define IW_AUTH_CIPHER_WEP104 0x00000010 594#define IW_AUTH_CIPHER_WEP104 0x00000010
595#define IW_AUTH_CIPHER_AES_CMAC 0x00000020
592 596
593/* IW_AUTH_KEY_MGMT values (bit field) */ 597/* IW_AUTH_KEY_MGMT values (bit field) */
594#define IW_AUTH_KEY_MGMT_802_1X 1 598#define IW_AUTH_KEY_MGMT_802_1X 1
@@ -604,6 +608,11 @@
604#define IW_AUTH_ROAMING_DISABLE 1 /* user space program used for roaming 608#define IW_AUTH_ROAMING_DISABLE 1 /* user space program used for roaming
605 * control */ 609 * control */
606 610
611/* IW_AUTH_MFP (management frame protection) values */
612#define IW_AUTH_MFP_DISABLED 0 /* MFP disabled */
613#define IW_AUTH_MFP_OPTIONAL 1 /* MFP optional */
614#define IW_AUTH_MFP_REQUIRED 2 /* MFP required */
615
607/* SIOCSIWENCODEEXT definitions */ 616/* SIOCSIWENCODEEXT definitions */
608#define IW_ENCODE_SEQ_MAX_SIZE 8 617#define IW_ENCODE_SEQ_MAX_SIZE 8
609/* struct iw_encode_ext ->alg */ 618/* struct iw_encode_ext ->alg */
@@ -612,6 +621,7 @@
612#define IW_ENCODE_ALG_TKIP 2 621#define IW_ENCODE_ALG_TKIP 2
613#define IW_ENCODE_ALG_CCMP 3 622#define IW_ENCODE_ALG_CCMP 3
614#define IW_ENCODE_ALG_PMK 4 623#define IW_ENCODE_ALG_PMK 4
624#define IW_ENCODE_ALG_AES_CMAC 5
615/* struct iw_encode_ext ->ext_flags */ 625/* struct iw_encode_ext ->ext_flags */
616#define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001 626#define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001
617#define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002 627#define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 23c0ab74ded6..dd1fd51638fc 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -112,12 +112,14 @@ struct beacon_parameters {
112 * @STATION_FLAG_SHORT_PREAMBLE: station is capable of receiving frames 112 * @STATION_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
113 * with short preambles 113 * with short preambles
114 * @STATION_FLAG_WME: station is WME/QoS capable 114 * @STATION_FLAG_WME: station is WME/QoS capable
115 * @STATION_FLAG_MFP: station uses management frame protection
115 */ 116 */
116enum station_flags { 117enum station_flags {
117 STATION_FLAG_CHANGED = 1<<0, 118 STATION_FLAG_CHANGED = 1<<0,
118 STATION_FLAG_AUTHORIZED = 1<<NL80211_STA_FLAG_AUTHORIZED, 119 STATION_FLAG_AUTHORIZED = 1<<NL80211_STA_FLAG_AUTHORIZED,
119 STATION_FLAG_SHORT_PREAMBLE = 1<<NL80211_STA_FLAG_SHORT_PREAMBLE, 120 STATION_FLAG_SHORT_PREAMBLE = 1<<NL80211_STA_FLAG_SHORT_PREAMBLE,
120 STATION_FLAG_WME = 1<<NL80211_STA_FLAG_WME, 121 STATION_FLAG_WME = 1<<NL80211_STA_FLAG_WME,
122 STATION_FLAG_MFP = 1<<NL80211_STA_FLAG_MFP,
121}; 123};
122 124
123/** 125/**
@@ -355,6 +357,51 @@ enum reg_set_by {
355 REGDOM_SET_BY_COUNTRY_IE, 357 REGDOM_SET_BY_COUNTRY_IE,
356}; 358};
357 359
360/**
361 * enum environment_cap - Environment parsed from country IE
362 * @ENVIRON_ANY: indicates country IE applies to both indoor and
363 * outdoor operation.
364 * @ENVIRON_INDOOR: indicates country IE applies only to indoor operation
365 * @ENVIRON_OUTDOOR: indicates country IE applies only to outdoor operation
366 */
367enum environment_cap {
368 ENVIRON_ANY,
369 ENVIRON_INDOOR,
370 ENVIRON_OUTDOOR,
371};
372
373/**
374 * struct regulatory_request - receipt of last regulatory request
375 *
376 * @wiphy: this is set if this request's initiator is
377 * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This
378 * can be used by the wireless core to deal with conflicts
379 * and potentially inform users of which devices specifically
380 * cased the conflicts.
381 * @initiator: indicates who sent this request, could be any of
382 * of those set in reg_set_by, %REGDOM_SET_BY_*
383 * @alpha2: the ISO / IEC 3166 alpha2 country code of the requested
384 * regulatory domain. We have a few special codes:
385 * 00 - World regulatory domain
386 * 99 - built by driver but a specific alpha2 cannot be determined
387 * 98 - result of an intersection between two regulatory domains
388 * @intersect: indicates whether the wireless core should intersect
389 * the requested regulatory domain with the presently set regulatory
390 * domain.
391 * @country_ie_checksum: checksum of the last processed and accepted
392 * country IE
393 * @country_ie_env: lets us know if the AP is telling us we are outdoor,
394 * indoor, or if it doesn't matter
395 */
396struct regulatory_request {
397 struct wiphy *wiphy;
398 enum reg_set_by initiator;
399 char alpha2[2];
400 bool intersect;
401 u32 country_ie_checksum;
402 enum environment_cap country_ie_env;
403};
404
358struct ieee80211_freq_range { 405struct ieee80211_freq_range {
359 u32 start_freq_khz; 406 u32 start_freq_khz;
360 u32 end_freq_khz; 407 u32 end_freq_khz;
@@ -431,6 +478,26 @@ struct ieee80211_txq_params {
431 u8 aifs; 478 u8 aifs;
432}; 479};
433 480
481/**
482 * struct mgmt_extra_ie_params - Extra management frame IE parameters
483 *
484 * Used to add extra IE(s) into management frames. If the driver cannot add the
485 * requested data into all management frames of the specified subtype that are
486 * generated in kernel or firmware/hardware, it must reject the configuration
487 * call. The IE data buffer is added to the end of the specified management
488 * frame body after all other IEs. This addition is not applied to frames that
489 * are injected through a monitor interface.
490 *
491 * @subtype: Management frame subtype
492 * @ies: IE data buffer or %NULL to remove previous data
493 * @ies_len: Length of @ies in octets
494 */
495struct mgmt_extra_ie_params {
496 u8 subtype;
497 u8 *ies;
498 int ies_len;
499};
500
434/* from net/wireless.h */ 501/* from net/wireless.h */
435struct wiphy; 502struct wiphy;
436 503
@@ -450,6 +517,9 @@ struct ieee80211_channel;
450 * wireless extensions but this is subject to reevaluation as soon as this 517 * wireless extensions but this is subject to reevaluation as soon as this
451 * code is used more widely and we have a first user without wext. 518 * code is used more widely and we have a first user without wext.
452 * 519 *
520 * @suspend: wiphy device needs to be suspended
521 * @resume: wiphy device needs to be resumed
522 *
453 * @add_virtual_intf: create a new virtual interface with the given name, 523 * @add_virtual_intf: create a new virtual interface with the given name,
454 * must set the struct wireless_dev's iftype. 524 * must set the struct wireless_dev's iftype.
455 * 525 *
@@ -471,6 +541,8 @@ struct ieee80211_channel;
471 * 541 *
472 * @set_default_key: set the default key on an interface 542 * @set_default_key: set the default key on an interface
473 * 543 *
544 * @set_default_mgmt_key: set the default management frame key on an interface
545 *
474 * @add_beacon: Add a beacon with given parameters, @head, @interval 546 * @add_beacon: Add a beacon with given parameters, @head, @interval
475 * and @dtim_period will be valid, @tail is optional. 547 * and @dtim_period will be valid, @tail is optional.
476 * @set_beacon: Change the beacon parameters for an access point mode 548 * @set_beacon: Change the beacon parameters for an access point mode
@@ -497,8 +569,13 @@ struct ieee80211_channel;
497 * @set_txq_params: Set TX queue parameters 569 * @set_txq_params: Set TX queue parameters
498 * 570 *
499 * @set_channel: Set channel 571 * @set_channel: Set channel
572 *
573 * @set_mgmt_extra_ie: Set extra IE data for management frames
500 */ 574 */
501struct cfg80211_ops { 575struct cfg80211_ops {
576 int (*suspend)(struct wiphy *wiphy);
577 int (*resume)(struct wiphy *wiphy);
578
502 int (*add_virtual_intf)(struct wiphy *wiphy, char *name, 579 int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
503 enum nl80211_iftype type, u32 *flags, 580 enum nl80211_iftype type, u32 *flags,
504 struct vif_params *params); 581 struct vif_params *params);
@@ -518,6 +595,9 @@ struct cfg80211_ops {
518 int (*set_default_key)(struct wiphy *wiphy, 595 int (*set_default_key)(struct wiphy *wiphy,
519 struct net_device *netdev, 596 struct net_device *netdev,
520 u8 key_index); 597 u8 key_index);
598 int (*set_default_mgmt_key)(struct wiphy *wiphy,
599 struct net_device *netdev,
600 u8 key_index);
521 601
522 int (*add_beacon)(struct wiphy *wiphy, struct net_device *dev, 602 int (*add_beacon)(struct wiphy *wiphy, struct net_device *dev,
523 struct beacon_parameters *info); 603 struct beacon_parameters *info);
@@ -564,6 +644,10 @@ struct cfg80211_ops {
564 int (*set_channel)(struct wiphy *wiphy, 644 int (*set_channel)(struct wiphy *wiphy,
565 struct ieee80211_channel *chan, 645 struct ieee80211_channel *chan,
566 enum nl80211_channel_type channel_type); 646 enum nl80211_channel_type channel_type);
647
648 int (*set_mgmt_extra_ie)(struct wiphy *wiphy,
649 struct net_device *dev,
650 struct mgmt_extra_ie_params *params);
567}; 651};
568 652
569/* temporary wext handlers */ 653/* temporary wext handlers */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 559422fc0943..e2144f0e8728 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -207,7 +207,7 @@ struct ieee80211_bss_conf {
207 u16 beacon_int; 207 u16 beacon_int;
208 u16 assoc_capability; 208 u16 assoc_capability;
209 u64 timestamp; 209 u64 timestamp;
210 u64 basic_rates; 210 u32 basic_rates;
211 struct ieee80211_bss_ht_conf ht; 211 struct ieee80211_bss_ht_conf ht;
212}; 212};
213 213
@@ -262,6 +262,26 @@ enum mac80211_tx_control_flags {
262 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12), 262 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12),
263}; 263};
264 264
265/**
266 * enum mac80211_rate_control_flags - per-rate flags set by the
267 * Rate Control algorithm.
268 *
269 * These flags are set by the Rate control algorithm for each rate during tx,
270 * in the @flags member of struct ieee80211_tx_rate.
271 *
272 * @IEEE80211_TX_RC_USE_RTS_CTS: Use RTS/CTS exchange for this rate.
273 * @IEEE80211_TX_RC_USE_CTS_PROTECT: CTS-to-self protection is required.
274 * This is set if the current BSS requires ERP protection.
275 * @IEEE80211_TX_RC_USE_SHORT_PREAMBLE: Use short preamble.
276 * @IEEE80211_TX_RC_MCS: HT rate.
277 * @IEEE80211_TX_RC_GREEN_FIELD: Indicates whether this rate should be used in
278 * Greenfield mode.
279 * @IEEE80211_TX_RC_40_MHZ_WIDTH: Indicates if the Channel Width should be 40 MHz.
280 * @IEEE80211_TX_RC_DUP_DATA: The frame should be transmitted on both of the
281 * adjacent 20 MHz channels, if the current channel type is
282 * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS.
283 * @IEEE80211_TX_RC_SHORT_GI: Short Guard interval should be used for this rate.
284 */
265enum mac80211_rate_control_flags { 285enum mac80211_rate_control_flags {
266 IEEE80211_TX_RC_USE_RTS_CTS = BIT(0), 286 IEEE80211_TX_RC_USE_RTS_CTS = BIT(0),
267 IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1), 287 IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1),
@@ -507,11 +527,6 @@ static inline int __deprecated __IEEE80211_CONF_SHORT_SLOT_TIME(void)
507} 527}
508#define IEEE80211_CONF_SHORT_SLOT_TIME (__IEEE80211_CONF_SHORT_SLOT_TIME()) 528#define IEEE80211_CONF_SHORT_SLOT_TIME (__IEEE80211_CONF_SHORT_SLOT_TIME())
509 529
510struct ieee80211_ht_conf {
511 bool enabled;
512 enum nl80211_channel_type channel_type;
513};
514
515/** 530/**
516 * enum ieee80211_conf_changed - denotes which configuration changed 531 * enum ieee80211_conf_changed - denotes which configuration changed
517 * 532 *
@@ -520,10 +535,10 @@ struct ieee80211_ht_conf {
520 * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed 535 * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed
521 * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed 536 * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed
522 * @IEEE80211_CONF_CHANGE_PS: the PS flag changed 537 * @IEEE80211_CONF_CHANGE_PS: the PS flag changed
538 * @IEEE80211_CONF_CHANGE_DYNPS_TIMEOUT: the dynamic PS timeout changed
523 * @IEEE80211_CONF_CHANGE_POWER: the TX power changed 539 * @IEEE80211_CONF_CHANGE_POWER: the TX power changed
524 * @IEEE80211_CONF_CHANGE_CHANNEL: the channel changed 540 * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed
525 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed 541 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed
526 * @IEEE80211_CONF_CHANGE_HT: HT configuration changed
527 */ 542 */
528enum ieee80211_conf_changed { 543enum ieee80211_conf_changed {
529 IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0), 544 IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0),
@@ -531,10 +546,10 @@ enum ieee80211_conf_changed {
531 IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2), 546 IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2),
532 IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3), 547 IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3),
533 IEEE80211_CONF_CHANGE_PS = BIT(4), 548 IEEE80211_CONF_CHANGE_PS = BIT(4),
534 IEEE80211_CONF_CHANGE_POWER = BIT(5), 549 IEEE80211_CONF_CHANGE_DYNPS_TIMEOUT = BIT(5),
535 IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), 550 IEEE80211_CONF_CHANGE_POWER = BIT(6),
536 IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7), 551 IEEE80211_CONF_CHANGE_CHANNEL = BIT(7),
537 IEEE80211_CONF_CHANGE_HT = BIT(8), 552 IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(8),
538}; 553};
539 554
540/** 555/**
@@ -547,8 +562,9 @@ enum ieee80211_conf_changed {
547 * @listen_interval: listen interval in units of beacon interval 562 * @listen_interval: listen interval in units of beacon interval
548 * @flags: configuration flags defined above 563 * @flags: configuration flags defined above
549 * @power_level: requested transmit power (in dBm) 564 * @power_level: requested transmit power (in dBm)
565 * @dynamic_ps_timeout: dynamic powersave timeout (in ms)
550 * @channel: the channel to tune to 566 * @channel: the channel to tune to
551 * @ht: the HT configuration for the device 567 * @channel_type: the channel (HT) type
552 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame 568 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame
553 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11, 569 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11,
554 * but actually means the number of transmissions not the number of retries 570 * but actually means the number of transmissions not the number of retries
@@ -559,7 +575,7 @@ enum ieee80211_conf_changed {
559struct ieee80211_conf { 575struct ieee80211_conf {
560 int beacon_int; 576 int beacon_int;
561 u32 flags; 577 u32 flags;
562 int power_level; 578 int power_level, dynamic_ps_timeout;
563 579
564 u16 listen_interval; 580 u16 listen_interval;
565 bool radio_enabled; 581 bool radio_enabled;
@@ -567,7 +583,7 @@ struct ieee80211_conf {
567 u8 long_frame_max_tx_count, short_frame_max_tx_count; 583 u8 long_frame_max_tx_count, short_frame_max_tx_count;
568 584
569 struct ieee80211_channel *channel; 585 struct ieee80211_channel *channel;
570 struct ieee80211_ht_conf ht; 586 enum nl80211_channel_type channel_type;
571}; 587};
572 588
573/** 589/**
@@ -630,10 +646,12 @@ struct ieee80211_if_init_conf {
630 * @IEEE80211_IFCC_BSSID: The BSSID changed. 646 * @IEEE80211_IFCC_BSSID: The BSSID changed.
631 * @IEEE80211_IFCC_BEACON: The beacon for this interface changed 647 * @IEEE80211_IFCC_BEACON: The beacon for this interface changed
632 * (currently AP and MESH only), use ieee80211_beacon_get(). 648 * (currently AP and MESH only), use ieee80211_beacon_get().
649 * @IEEE80211_IFCC_BEACON_ENABLED: The enable_beacon value changed.
633 */ 650 */
634enum ieee80211_if_conf_change { 651enum ieee80211_if_conf_change {
635 IEEE80211_IFCC_BSSID = BIT(0), 652 IEEE80211_IFCC_BSSID = BIT(0),
636 IEEE80211_IFCC_BEACON = BIT(1), 653 IEEE80211_IFCC_BEACON = BIT(1),
654 IEEE80211_IFCC_BEACON_ENABLED = BIT(2),
637}; 655};
638 656
639/** 657/**
@@ -641,13 +659,16 @@ enum ieee80211_if_conf_change {
641 * 659 *
642 * @changed: parameters that have changed, see &enum ieee80211_if_conf_change. 660 * @changed: parameters that have changed, see &enum ieee80211_if_conf_change.
643 * @bssid: BSSID of the network we are associated to/creating. 661 * @bssid: BSSID of the network we are associated to/creating.
662 * @enable_beacon: Indicates whether beacons can be sent.
663 * This is valid only for AP/IBSS/MESH modes.
644 * 664 *
645 * This structure is passed to the config_interface() callback of 665 * This structure is passed to the config_interface() callback of
646 * &struct ieee80211_hw. 666 * &struct ieee80211_hw.
647 */ 667 */
648struct ieee80211_if_conf { 668struct ieee80211_if_conf {
649 u32 changed; 669 u32 changed;
650 u8 *bssid; 670 const u8 *bssid;
671 bool enable_beacon;
651}; 672};
652 673
653/** 674/**
@@ -655,11 +676,13 @@ struct ieee80211_if_conf {
655 * @ALG_WEP: WEP40 or WEP104 676 * @ALG_WEP: WEP40 or WEP104
656 * @ALG_TKIP: TKIP 677 * @ALG_TKIP: TKIP
657 * @ALG_CCMP: CCMP (AES) 678 * @ALG_CCMP: CCMP (AES)
679 * @ALG_AES_CMAC: AES-128-CMAC
658 */ 680 */
659enum ieee80211_key_alg { 681enum ieee80211_key_alg {
660 ALG_WEP, 682 ALG_WEP,
661 ALG_TKIP, 683 ALG_TKIP,
662 ALG_CCMP, 684 ALG_CCMP,
685 ALG_AES_CMAC,
663}; 686};
664 687
665/** 688/**
@@ -688,12 +711,16 @@ enum ieee80211_key_len {
688 * generation in software. 711 * generation in software.
689 * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates 712 * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates
690 * that the key is pairwise rather then a shared key. 713 * that the key is pairwise rather then a shared key.
714 * @IEEE80211_KEY_FLAG_SW_MGMT: This flag should be set by the driver for a
715 * CCMP key if it requires CCMP encryption of management frames (MFP) to
716 * be done in software.
691 */ 717 */
692enum ieee80211_key_flags { 718enum ieee80211_key_flags {
693 IEEE80211_KEY_FLAG_WMM_STA = 1<<0, 719 IEEE80211_KEY_FLAG_WMM_STA = 1<<0,
694 IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1, 720 IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1,
695 IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2, 721 IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2,
696 IEEE80211_KEY_FLAG_PAIRWISE = 1<<3, 722 IEEE80211_KEY_FLAG_PAIRWISE = 1<<3,
723 IEEE80211_KEY_FLAG_SW_MGMT = 1<<4,
697}; 724};
698 725
699/** 726/**
@@ -714,8 +741,8 @@ enum ieee80211_key_flags {
714 * - Temporal Encryption Key (128 bits) 741 * - Temporal Encryption Key (128 bits)
715 * - Temporal Authenticator Tx MIC Key (64 bits) 742 * - Temporal Authenticator Tx MIC Key (64 bits)
716 * - Temporal Authenticator Rx MIC Key (64 bits) 743 * - Temporal Authenticator Rx MIC Key (64 bits)
717 * @icv_len: FIXME 744 * @icv_len: The ICV length for this key type
718 * @iv_len: FIXME 745 * @iv_len: The IV length for this key type
719 */ 746 */
720struct ieee80211_key_conf { 747struct ieee80211_key_conf {
721 enum ieee80211_key_alg alg; 748 enum ieee80211_key_alg alg;
@@ -759,7 +786,7 @@ enum set_key_cmd {
759 * sizeof(void *), size is determined in hw information. 786 * sizeof(void *), size is determined in hw information.
760 */ 787 */
761struct ieee80211_sta { 788struct ieee80211_sta {
762 u64 supp_rates[IEEE80211_NUM_BANDS]; 789 u32 supp_rates[IEEE80211_NUM_BANDS];
763 u8 addr[ETH_ALEN]; 790 u8 addr[ETH_ALEN];
764 u16 aid; 791 u16 aid;
765 struct ieee80211_sta_ht_cap ht_cap; 792 struct ieee80211_sta_ht_cap ht_cap;
@@ -854,10 +881,18 @@ enum ieee80211_tkip_key_type {
854 * @IEEE80211_HW_AMPDU_AGGREGATION: 881 * @IEEE80211_HW_AMPDU_AGGREGATION:
855 * Hardware supports 11n A-MPDU aggregation. 882 * Hardware supports 11n A-MPDU aggregation.
856 * 883 *
857 * @IEEE80211_HW_NO_STACK_DYNAMIC_PS: 884 * @IEEE80211_HW_SUPPORTS_PS:
858 * Hardware which has dynamic power save support, meaning 885 * Hardware has power save support (i.e. can go to sleep).
859 * that power save is enabled in idle periods, and don't need support 886 *
860 * from stack. 887 * @IEEE80211_HW_PS_NULLFUNC_STACK:
888 * Hardware requires nullfunc frame handling in stack, implies
889 * stack support for dynamic PS.
890 *
891 * @IEEE80211_HW_SUPPORTS_DYNAMIC_PS:
892 * Hardware has support for dynamic PS.
893 *
894 * @IEEE80211_HW_MFP_CAPABLE:
895 * Hardware supports management frame protection (MFP, IEEE 802.11w).
861 */ 896 */
862enum ieee80211_hw_flags { 897enum ieee80211_hw_flags {
863 IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, 898 IEEE80211_HW_RX_INCLUDES_FCS = 1<<1,
@@ -870,7 +905,10 @@ enum ieee80211_hw_flags {
870 IEEE80211_HW_NOISE_DBM = 1<<8, 905 IEEE80211_HW_NOISE_DBM = 1<<8,
871 IEEE80211_HW_SPECTRUM_MGMT = 1<<9, 906 IEEE80211_HW_SPECTRUM_MGMT = 1<<9,
872 IEEE80211_HW_AMPDU_AGGREGATION = 1<<10, 907 IEEE80211_HW_AMPDU_AGGREGATION = 1<<10,
873 IEEE80211_HW_NO_STACK_DYNAMIC_PS = 1<<11, 908 IEEE80211_HW_SUPPORTS_PS = 1<<11,
909 IEEE80211_HW_PS_NULLFUNC_STACK = 1<<12,
910 IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<13,
911 IEEE80211_HW_MFP_CAPABLE = 1<<14,
874}; 912};
875 913
876/** 914/**
@@ -890,9 +928,8 @@ enum ieee80211_hw_flags {
890 * @workqueue: single threaded workqueue available for driver use, 928 * @workqueue: single threaded workqueue available for driver use,
891 * allocated by mac80211 on registration and flushed when an 929 * allocated by mac80211 on registration and flushed when an
892 * interface is removed. 930 * interface is removed.
893 * NOTICE: All work performed on this workqueue should NEVER 931 * NOTICE: All work performed on this workqueue must not
894 * acquire the RTNL lock (i.e. Don't use the function 932 * acquire the RTNL lock.
895 * ieee80211_iterate_active_interfaces())
896 * 933 *
897 * @priv: pointer to private area that was allocated for driver use 934 * @priv: pointer to private area that was allocated for driver use
898 * along with this structure. 935 * along with this structure.
@@ -952,6 +989,19 @@ struct ieee80211_hw {
952}; 989};
953 990
954/** 991/**
992 * wiphy_to_ieee80211_hw - return a mac80211 driver hw struct from a wiphy
993 *
994 * @wiphy: the &struct wiphy which we want to query
995 *
996 * mac80211 drivers can use this to get to their respective
997 * &struct ieee80211_hw. Drivers wishing to get to their own private
998 * structure can then access it via hw->priv. Note that mac802111 drivers should
999 * not use wiphy_priv() to try to get their private driver structure as this
1000 * is already used internally by mac80211.
1001 */
1002struct ieee80211_hw *wiphy_to_ieee80211_hw(struct wiphy *wiphy);
1003
1004/**
955 * SET_IEEE80211_DEV - set device for 802.11 hardware 1005 * SET_IEEE80211_DEV - set device for 802.11 hardware
956 * 1006 *
957 * @hw: the &struct ieee80211_hw to set the device for 1007 * @hw: the &struct ieee80211_hw to set the device for
@@ -1018,16 +1068,12 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
1018 * 1068 *
1019 * The set_key() callback in the &struct ieee80211_ops for a given 1069 * The set_key() callback in the &struct ieee80211_ops for a given
1020 * device is called to enable hardware acceleration of encryption and 1070 * device is called to enable hardware acceleration of encryption and
1021 * decryption. The callback takes an @address parameter that will be 1071 * decryption. The callback takes a @sta parameter that will be NULL
1022 * the broadcast address for default keys, the other station's hardware 1072 * for default keys or keys used for transmission only, or point to
1023 * address for individual keys or the zero address for keys that will 1073 * the station information for the peer for individual keys.
1024 * be used only for transmission.
1025 * Multiple transmission keys with the same key index may be used when 1074 * Multiple transmission keys with the same key index may be used when
1026 * VLANs are configured for an access point. 1075 * VLANs are configured for an access point.
1027 * 1076 *
1028 * The @local_address parameter will always be set to our own address,
1029 * this is only relevant if you support multiple local addresses.
1030 *
1031 * When transmitting, the TX control data will use the @hw_key_idx 1077 * When transmitting, the TX control data will use the @hw_key_idx
1032 * selected by the driver by modifying the &struct ieee80211_key_conf 1078 * selected by the driver by modifying the &struct ieee80211_key_conf
1033 * pointed to by the @key parameter to the set_key() function. 1079 * pointed to by the @key parameter to the set_key() function.
@@ -1061,6 +1107,42 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
1061 */ 1107 */
1062 1108
1063/** 1109/**
1110 * DOC: Powersave support
1111 *
1112 * mac80211 has support for various powersave implementations.
1113 *
1114 * First, it can support hardware that handles all powersaving by
1115 * itself, such hardware should simply set the %IEEE80211_HW_SUPPORTS_PS
1116 * hardware flag. In that case, it will be told about the desired
1117 * powersave mode depending on the association status, and the driver
1118 * must take care of sending nullfunc frames when necessary, i.e. when
1119 * entering and leaving powersave mode. The driver is required to look at
1120 * the AID in beacons and signal to the AP that it woke up when it finds
1121 * traffic directed to it. This mode supports dynamic PS by simply
1122 * enabling/disabling PS.
1123 *
1124 * Additionally, such hardware may set the %IEEE80211_HW_SUPPORTS_DYNAMIC_PS
1125 * flag to indicate that it can support dynamic PS mode itself (see below).
1126 *
1127 * Other hardware designs cannot send nullfunc frames by themselves and also
1128 * need software support for parsing the TIM bitmap. This is also supported
1129 * by mac80211 by combining the %IEEE80211_HW_SUPPORTS_PS and
1130 * %IEEE80211_HW_PS_NULLFUNC_STACK flags. The hardware is of course still
1131 * required to pass up beacons. Additionally, in this case, mac80211 will
1132 * wake up the hardware when multicast traffic is announced in the beacon.
1133 *
1134 * FIXME: I don't think we can be fast enough in software when we want to
1135 * receive multicast traffic?
1136 *
1137 * Dynamic powersave mode is an extension to normal powersave mode in which
1138 * the hardware stays awake for a user-specified period of time after sending
1139 * a frame so that reply frames need not be buffered and therefore delayed
1140 * to the next wakeup. This can either be supported by hardware, in which case
1141 * the driver needs to look at the @dynamic_ps_timeout hardware configuration
1142 * value, or by the stack if all nullfunc handling is in the stack.
1143 */
1144
1145/**
1064 * DOC: Frame filtering 1146 * DOC: Frame filtering
1065 * 1147 *
1066 * mac80211 requires to see many management frames for proper 1148 * mac80211 requires to see many management frames for proper
@@ -1172,6 +1254,8 @@ enum ieee80211_ampdu_mlme_action {
1172 * configuration in the TX control data. This handler should, 1254 * configuration in the TX control data. This handler should,
1173 * preferably, never fail and stop queues appropriately, more 1255 * preferably, never fail and stop queues appropriately, more
1174 * importantly, however, it must never fail for A-MPDU-queues. 1256 * importantly, however, it must never fail for A-MPDU-queues.
1257 * This function should return NETDEV_TX_OK except in very
1258 * limited cases.
1175 * Must be implemented and atomic. 1259 * Must be implemented and atomic.
1176 * 1260 *
1177 * @start: Called before the first netdevice attached to the hardware 1261 * @start: Called before the first netdevice attached to the hardware
@@ -1212,9 +1296,12 @@ enum ieee80211_ampdu_mlme_action {
1212 * 1296 *
1213 * @config: Handler for configuration requests. IEEE 802.11 code calls this 1297 * @config: Handler for configuration requests. IEEE 802.11 code calls this
1214 * function to change hardware configuration, e.g., channel. 1298 * function to change hardware configuration, e.g., channel.
1299 * This function should never fail but returns a negative error code
1300 * if it does.
1215 * 1301 *
1216 * @config_interface: Handler for configuration requests related to interfaces 1302 * @config_interface: Handler for configuration requests related to interfaces
1217 * (e.g. BSSID changes.) 1303 * (e.g. BSSID changes.)
1304 * Returns a negative error code which will be seen in userspace.
1218 * 1305 *
1219 * @bss_info_changed: Handler for configuration requests related to BSS 1306 * @bss_info_changed: Handler for configuration requests related to BSS
1220 * parameters that may vary during BSS's lifespan, and may affect low 1307 * parameters that may vary during BSS's lifespan, and may affect low
@@ -1232,8 +1319,9 @@ enum ieee80211_ampdu_mlme_action {
1232 * 1319 *
1233 * @set_key: See the section "Hardware crypto acceleration" 1320 * @set_key: See the section "Hardware crypto acceleration"
1234 * This callback can sleep, and is only called between add_interface 1321 * This callback can sleep, and is only called between add_interface
1235 * and remove_interface calls, i.e. while the interface with the 1322 * and remove_interface calls, i.e. while the given virtual interface
1236 * given local_address is enabled. 1323 * is enabled.
1324 * Returns a negative error code if the key can't be added.
1237 * 1325 *
1238 * @update_tkip_key: See the section "Hardware crypto acceleration" 1326 * @update_tkip_key: See the section "Hardware crypto acceleration"
1239 * This callback will be called in the context of Rx. Called for drivers 1327 * This callback will be called in the context of Rx. Called for drivers
@@ -1245,8 +1333,10 @@ enum ieee80211_ampdu_mlme_action {
1245 * bands. When the scan finishes, ieee80211_scan_completed() must be 1333 * bands. When the scan finishes, ieee80211_scan_completed() must be
1246 * called; note that it also must be called when the scan cannot finish 1334 * called; note that it also must be called when the scan cannot finish
1247 * because the hardware is turned off! Anything else is a bug! 1335 * because the hardware is turned off! Anything else is a bug!
1336 * Returns a negative error code which will be seen in userspace.
1248 * 1337 *
1249 * @get_stats: return low-level statistics 1338 * @get_stats: Return low-level statistics.
1339 * Returns zero if statistics are available.
1250 * 1340 *
1251 * @get_tkip_seq: If your device implements TKIP encryption in hardware this 1341 * @get_tkip_seq: If your device implements TKIP encryption in hardware this
1252 * callback should be provided to read the TKIP transmit IVs (both IV32 1342 * callback should be provided to read the TKIP transmit IVs (both IV32
@@ -1260,6 +1350,7 @@ enum ieee80211_ampdu_mlme_action {
1260 * 1350 *
1261 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), 1351 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
1262 * bursting) for a hardware TX queue. 1352 * bursting) for a hardware TX queue.
1353 * Returns a negative error code on failure.
1263 * 1354 *
1264 * @get_tx_stats: Get statistics of the current TX queue status. This is used 1355 * @get_tx_stats: Get statistics of the current TX queue status. This is used
1265 * to get number of currently queued packets (queue length), maximum queue 1356 * to get number of currently queued packets (queue length), maximum queue
@@ -1268,7 +1359,11 @@ enum ieee80211_ampdu_mlme_action {
1268 * hw->ampdu_queues items. 1359 * hw->ampdu_queues items.
1269 * 1360 *
1270 * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently, 1361 * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently,
1271 * this is only used for IBSS mode debugging and, as such, is not a 1362 * this is only used for IBSS mode BSSID merging and debugging. Is not a
1363 * required function. Must be atomic.
1364 *
1365 * @set_tsf: Set the TSF timer to the specified value in the firmware/hardware.
1366 * Currently, this is only used for IBSS mode debugging. Is not a
1272 * required function. Must be atomic. 1367 * required function. Must be atomic.
1273 * 1368 *
1274 * @reset_tsf: Reset the TSF timer and allow firmware/hardware to synchronize 1369 * @reset_tsf: Reset the TSF timer and allow firmware/hardware to synchronize
@@ -1279,13 +1374,15 @@ enum ieee80211_ampdu_mlme_action {
1279 * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us. 1374 * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us.
1280 * This is needed only for IBSS mode and the result of this function is 1375 * This is needed only for IBSS mode and the result of this function is
1281 * used to determine whether to reply to Probe Requests. 1376 * used to determine whether to reply to Probe Requests.
1377 * Returns non-zero if this device sent the last beacon.
1282 * 1378 *
1283 * @ampdu_action: Perform a certain A-MPDU action 1379 * @ampdu_action: Perform a certain A-MPDU action
1284 * The RA/TID combination determines the destination and TID we want 1380 * The RA/TID combination determines the destination and TID we want
1285 * the ampdu action to be performed for. The action is defined through 1381 * the ampdu action to be performed for. The action is defined through
1286 * ieee80211_ampdu_mlme_action. Starting sequence number (@ssn) 1382 * ieee80211_ampdu_mlme_action. Starting sequence number (@ssn)
1287 * is the first frame we expect to perform the action on. notice 1383 * is the first frame we expect to perform the action on. Notice
1288 * that TX/RX_STOP can pass NULL for this parameter. 1384 * that TX/RX_STOP can pass NULL for this parameter.
1385 * Returns a negative error code on failure.
1289 */ 1386 */
1290struct ieee80211_ops { 1387struct ieee80211_ops {
1291 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 1388 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
@@ -1310,7 +1407,7 @@ struct ieee80211_ops {
1310 int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta, 1407 int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
1311 bool set); 1408 bool set);
1312 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, 1409 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd,
1313 const u8 *local_address, const u8 *address, 1410 struct ieee80211_vif *vif, struct ieee80211_sta *sta,
1314 struct ieee80211_key_conf *key); 1411 struct ieee80211_key_conf *key);
1315 void (*update_tkip_key)(struct ieee80211_hw *hw, 1412 void (*update_tkip_key)(struct ieee80211_hw *hw,
1316 struct ieee80211_key_conf *conf, const u8 *address, 1413 struct ieee80211_key_conf *conf, const u8 *address,
@@ -1328,6 +1425,7 @@ struct ieee80211_ops {
1328 int (*get_tx_stats)(struct ieee80211_hw *hw, 1425 int (*get_tx_stats)(struct ieee80211_hw *hw,
1329 struct ieee80211_tx_queue_stats *stats); 1426 struct ieee80211_tx_queue_stats *stats);
1330 u64 (*get_tsf)(struct ieee80211_hw *hw); 1427 u64 (*get_tsf)(struct ieee80211_hw *hw);
1428 void (*set_tsf)(struct ieee80211_hw *hw, u64 tsf);
1331 void (*reset_tsf)(struct ieee80211_hw *hw); 1429 void (*reset_tsf)(struct ieee80211_hw *hw);
1332 int (*tx_last_beacon)(struct ieee80211_hw *hw); 1430 int (*tx_last_beacon)(struct ieee80211_hw *hw);
1333 int (*ampdu_action)(struct ieee80211_hw *hw, 1431 int (*ampdu_action)(struct ieee80211_hw *hw,
@@ -1962,4 +2060,34 @@ rate_lowest_index(struct ieee80211_supported_band *sband,
1962int ieee80211_rate_control_register(struct rate_control_ops *ops); 2060int ieee80211_rate_control_register(struct rate_control_ops *ops);
1963void ieee80211_rate_control_unregister(struct rate_control_ops *ops); 2061void ieee80211_rate_control_unregister(struct rate_control_ops *ops);
1964 2062
2063static inline bool
2064conf_is_ht20(struct ieee80211_conf *conf)
2065{
2066 return conf->channel_type == NL80211_CHAN_HT20;
2067}
2068
2069static inline bool
2070conf_is_ht40_minus(struct ieee80211_conf *conf)
2071{
2072 return conf->channel_type == NL80211_CHAN_HT40MINUS;
2073}
2074
2075static inline bool
2076conf_is_ht40_plus(struct ieee80211_conf *conf)
2077{
2078 return conf->channel_type == NL80211_CHAN_HT40PLUS;
2079}
2080
2081static inline bool
2082conf_is_ht40(struct ieee80211_conf *conf)
2083{
2084 return conf_is_ht40_minus(conf) || conf_is_ht40_plus(conf);
2085}
2086
2087static inline bool
2088conf_is_ht(struct ieee80211_conf *conf)
2089{
2090 return conf->channel_type != NL80211_CHAN_NO_HT;
2091}
2092
1965#endif /* MAC80211_H */ 2093#endif /* MAC80211_H */
diff --git a/include/net/wireless.h b/include/net/wireless.h
index 21c5d966142d..a42c1562d52b 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -181,12 +181,25 @@ 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 184 * @custom_regulatory: tells us the driver for this device
185 * has its own regulatory solution and cannot identify the 185 * has its own custom regulatory domain and cannot identify the
186 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled 186 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
187 * we will disregard the first regulatory hint (when the 187 * we will disregard the first regulatory hint (when the
188 * initiator is %REGDOM_SET_BY_CORE). 188 * initiator is %REGDOM_SET_BY_CORE).
189 * @strict_regulatory: tells us the driver for this device will ignore
190 * regulatory domain settings until it gets its own regulatory domain
191 * via its regulatory_hint(). After its gets its own regulatory domain
192 * it will only allow further regulatory domain settings to further
193 * enhance compliance. For example if channel 13 and 14 are disabled
194 * by this regulatory domain no user regulatory domain can enable these
195 * channels at a later time. This can be used for devices which do not
196 * have calibration information gauranteed for frequencies or settings
197 * outside of its regulatory domain.
189 * @reg_notifier: the driver's regulatory notification callback 198 * @reg_notifier: the driver's regulatory notification callback
199 * @regd: the driver's regulatory domain, if one was requested via
200 * the regulatory_hint() API. This can be used by the driver
201 * on the reg_notifier() if it chooses to ignore future
202 * regulatory domain changes caused by other drivers.
190 */ 203 */
191struct wiphy { 204struct wiphy {
192 /* assign these fields before you register the wiphy */ 205 /* assign these fields before you register the wiphy */
@@ -197,7 +210,8 @@ struct wiphy {
197 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ 210 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
198 u16 interface_modes; 211 u16 interface_modes;
199 212
200 bool fw_handles_regulatory; 213 bool custom_regulatory;
214 bool strict_regulatory;
201 215
202 /* If multiple wiphys are registered and you're handed e.g. 216 /* If multiple wiphys are registered and you're handed e.g.
203 * a regular netdev with assigned ieee80211_ptr, you won't 217 * a regular netdev with assigned ieee80211_ptr, you won't
@@ -209,10 +223,13 @@ struct wiphy {
209 struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS]; 223 struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS];
210 224
211 /* Lets us get back the wiphy on the callback */ 225 /* Lets us get back the wiphy on the callback */
212 int (*reg_notifier)(struct wiphy *wiphy, enum reg_set_by setby); 226 int (*reg_notifier)(struct wiphy *wiphy,
227 struct regulatory_request *request);
213 228
214 /* fields below are read-only, assigned by cfg80211 */ 229 /* fields below are read-only, assigned by cfg80211 */
215 230
231 const struct ieee80211_regdomain *regd;
232
216 /* the item in /sys/class/ieee80211/ points to this, 233 /* the item in /sys/class/ieee80211/ points to this,
217 * you need use set_wiphy_dev() (see below) */ 234 * you need use set_wiphy_dev() (see below) */
218 struct device dev; 235 struct device dev;
@@ -361,7 +378,7 @@ ieee80211_get_channel(struct wiphy *wiphy, int freq)
361 */ 378 */
362struct ieee80211_rate * 379struct ieee80211_rate *
363ieee80211_get_response_rate(struct ieee80211_supported_band *sband, 380ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
364 u64 basic_rates, int bitrate); 381 u32 basic_rates, int bitrate);
365 382
366/** 383/**
367 * regulatory_hint - driver hint to the wireless core a regulatory domain 384 * regulatory_hint - driver hint to the wireless core a regulatory domain
@@ -395,4 +412,45 @@ extern void regulatory_hint(struct wiphy *wiphy, const char *alpha2);
395extern void regulatory_hint_11d(struct wiphy *wiphy, 412extern void regulatory_hint_11d(struct wiphy *wiphy,
396 u8 *country_ie, 413 u8 *country_ie,
397 u8 country_ie_len); 414 u8 country_ie_len);
415
416/**
417 * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain
418 * @wiphy: the wireless device we want to process the regulatory domain on
419 * @regd: the custom regulatory domain to use for this wiphy
420 *
421 * Drivers can sometimes have custom regulatory domains which do not apply
422 * to a specific country. Drivers can use this to apply such custom regulatory
423 * domains. This routine must be called prior to wiphy registration. The
424 * custom regulatory domain will be trusted completely and as such previous
425 * default channel settings will be disregarded. If no rule is found for a
426 * channel on the regulatory domain the channel will be disabled.
427 */
428extern void wiphy_apply_custom_regulatory(
429 struct wiphy *wiphy,
430 const struct ieee80211_regdomain *regd);
431
432/**
433 * freq_reg_info - get regulatory information for the given frequency
434 * @wiphy: the wiphy for which we want to process this rule for
435 * @center_freq: Frequency in KHz for which we want regulatory information for
436 * @bandwidth: the bandwidth requirement you have in KHz, if you do not have one
437 * you can set this to 0. If this frequency is allowed we then set
438 * this value to the maximum allowed bandwidth.
439 * @reg_rule: the regulatory rule which we have for this frequency
440 *
441 * Use this function to get the regulatory rule for a specific frequency on
442 * a given wireless device. If the device has a specific regulatory domain
443 * it wants to follow we respect that unless a country IE has been received
444 * and processed already.
445 *
446 * Returns 0 if it was able to find a valid regulatory rule which does
447 * apply to the given center_freq otherwise it returns non-zero. It will
448 * also return -ERANGE if we determine the given center_freq does not even have
449 * a regulatory rule for a frequency range in the center_freq's band. See
450 * freq_in_rule_band() for our current definition of a band -- this is purely
451 * subjective and right now its 802.11 specific.
452 */
453extern int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth,
454 const struct ieee80211_reg_rule **reg_rule);
455
398#endif /* __NET_WIRELESS_H */ 456#endif /* __NET_WIRELESS_H */