aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2008-09-30 21:43:03 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-31 19:00:50 -0400
commit72118015271e6d3852cb9f647efe0987d131adaa (patch)
tree6cf548edeb3eb1d6c561fc78951096775de86b22
parent9387b7caf3049168fc97a8a9111af8fe2143af18 (diff)
wireless: avoid some net/ieee80211.h vs. linux/ieee80211.h conflicts
There is quite a lot of overlap in definitions between these headers... Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/hostap/hostap_common.h13
-rw-r--r--drivers/net/wireless/ipw2200.c24
-rw-r--r--include/linux/ieee80211.h3
-rw-r--r--include/net/ieee80211.h112
-rw-r--r--include/net/lib80211.h4
-rw-r--r--net/ieee80211/ieee80211_rx.c2
6 files changed, 19 insertions, 139 deletions
diff --git a/drivers/net/wireless/hostap/hostap_common.h b/drivers/net/wireless/hostap/hostap_common.h
index b470c743c2d1..90b64b092007 100644
--- a/drivers/net/wireless/hostap/hostap_common.h
+++ b/drivers/net/wireless/hostap/hostap_common.h
@@ -6,19 +6,6 @@
6 6
7/* IEEE 802.11 defines */ 7/* IEEE 802.11 defines */
8 8
9/* Information Element IDs */
10#define WLAN_EID_SSID 0
11#define WLAN_EID_SUPP_RATES 1
12#define WLAN_EID_FH_PARAMS 2
13#define WLAN_EID_DS_PARAMS 3
14#define WLAN_EID_CF_PARAMS 4
15#define WLAN_EID_TIM 5
16#define WLAN_EID_IBSS_PARAMS 6
17#define WLAN_EID_CHALLENGE 16
18#define WLAN_EID_RSN 48
19#define WLAN_EID_GENERIC 221
20
21
22/* HFA384X Configuration RIDs */ 9/* HFA384X Configuration RIDs */
23#define HFA384X_RID_CNFPORTTYPE 0xFC00 10#define HFA384X_RID_CNFPORTTYPE 0xFC00
24#define HFA384X_RID_CNFOWNMACADDR 0xFC01 11#define HFA384X_RID_CNFOWNMACADDR 0xFC01
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 2b9d96a5c10e..051ae92d8b65 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -4446,7 +4446,7 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4446 4446
4447#ifdef CONFIG_IPW2200_QOS 4447#ifdef CONFIG_IPW2200_QOS
4448#define IPW_GET_PACKET_STYPE(x) WLAN_FC_GET_STYPE( \ 4448#define IPW_GET_PACKET_STYPE(x) WLAN_FC_GET_STYPE( \
4449 le16_to_cpu(((struct ieee80211_hdr *)(x))->frame_ctl)) 4449 le16_to_cpu(((struct ieee80211_hdr *)(x))->frame_control))
4450 if ((priv->status & STATUS_AUTH) && 4450 if ((priv->status & STATUS_AUTH) &&
4451 (IPW_GET_PACKET_STYPE(&notif->u.raw) 4451 (IPW_GET_PACKET_STYPE(&notif->u.raw)
4452 == IEEE80211_STYPE_ASSOC_RESP)) { 4452 == IEEE80211_STYPE_ASSOC_RESP)) {
@@ -7665,12 +7665,12 @@ static void ipw_rebuild_decrypted_skb(struct ipw_priv *priv,
7665 u16 fc; 7665 u16 fc;
7666 7666
7667 hdr = (struct ieee80211_hdr *)skb->data; 7667 hdr = (struct ieee80211_hdr *)skb->data;
7668 fc = le16_to_cpu(hdr->frame_ctl); 7668 fc = le16_to_cpu(hdr->frame_control);
7669 if (!(fc & IEEE80211_FCTL_PROTECTED)) 7669 if (!(fc & IEEE80211_FCTL_PROTECTED))
7670 return; 7670 return;
7671 7671
7672 fc &= ~IEEE80211_FCTL_PROTECTED; 7672 fc &= ~IEEE80211_FCTL_PROTECTED;
7673 hdr->frame_ctl = cpu_to_le16(fc); 7673 hdr->frame_control = cpu_to_le16(fc);
7674 switch (priv->ieee->sec.level) { 7674 switch (priv->ieee->sec.level) {
7675 case SEC_LEVEL_3: 7675 case SEC_LEVEL_3:
7676 /* Remove CCMP HDR */ 7676 /* Remove CCMP HDR */
@@ -7982,17 +7982,17 @@ static void ipw_handle_promiscuous_rx(struct ipw_priv *priv,
7982 } 7982 }
7983 7983
7984 hdr = (void *)rxb->skb->data + IPW_RX_FRAME_SIZE; 7984 hdr = (void *)rxb->skb->data + IPW_RX_FRAME_SIZE;
7985 if (ieee80211_is_management(le16_to_cpu(hdr->frame_ctl))) { 7985 if (ieee80211_is_management(le16_to_cpu(hdr->frame_control))) {
7986 if (filter & IPW_PROM_NO_MGMT) 7986 if (filter & IPW_PROM_NO_MGMT)
7987 return; 7987 return;
7988 if (filter & IPW_PROM_MGMT_HEADER_ONLY) 7988 if (filter & IPW_PROM_MGMT_HEADER_ONLY)
7989 hdr_only = 1; 7989 hdr_only = 1;
7990 } else if (ieee80211_is_control(le16_to_cpu(hdr->frame_ctl))) { 7990 } else if (ieee80211_is_control(le16_to_cpu(hdr->frame_control))) {
7991 if (filter & IPW_PROM_NO_CTL) 7991 if (filter & IPW_PROM_NO_CTL)
7992 return; 7992 return;
7993 if (filter & IPW_PROM_CTL_HEADER_ONLY) 7993 if (filter & IPW_PROM_CTL_HEADER_ONLY)
7994 hdr_only = 1; 7994 hdr_only = 1;
7995 } else if (ieee80211_is_data(le16_to_cpu(hdr->frame_ctl))) { 7995 } else if (ieee80211_is_data(le16_to_cpu(hdr->frame_control))) {
7996 if (filter & IPW_PROM_NO_DATA) 7996 if (filter & IPW_PROM_NO_DATA)
7997 return; 7997 return;
7998 if (filter & IPW_PROM_DATA_HEADER_ONLY) 7998 if (filter & IPW_PROM_DATA_HEADER_ONLY)
@@ -8010,7 +8010,7 @@ static void ipw_handle_promiscuous_rx(struct ipw_priv *priv,
8010 ipw_rt = (void *)skb->data; 8010 ipw_rt = (void *)skb->data;
8011 8011
8012 if (hdr_only) 8012 if (hdr_only)
8013 len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); 8013 len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_control));
8014 8014
8015 memcpy(ipw_rt->payload, hdr, len); 8015 memcpy(ipw_rt->payload, hdr, len);
8016 8016
@@ -8230,7 +8230,7 @@ static int is_duplicate_packet(struct ipw_priv *priv,
8230 /* Comment this line now since we observed the card receives 8230 /* Comment this line now since we observed the card receives
8231 * duplicate packets but the FCTL_RETRY bit is not set in the 8231 * duplicate packets but the FCTL_RETRY bit is not set in the
8232 * IBSS mode with fragmentation enabled. 8232 * IBSS mode with fragmentation enabled.
8233 BUG_ON(!(le16_to_cpu(header->frame_ctl) & IEEE80211_FCTL_RETRY)); */ 8233 BUG_ON(!(le16_to_cpu(header->frame_control) & IEEE80211_FCTL_RETRY)); */
8234 return 1; 8234 return 1;
8235} 8235}
8236 8236
@@ -10381,17 +10381,17 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv *priv,
10381 10381
10382 /* Filtering of fragment chains is done agains the first fragment */ 10382 /* Filtering of fragment chains is done agains the first fragment */
10383 hdr = (void *)txb->fragments[0]->data; 10383 hdr = (void *)txb->fragments[0]->data;
10384 if (ieee80211_is_management(le16_to_cpu(hdr->frame_ctl))) { 10384 if (ieee80211_is_management(le16_to_cpu(hdr->frame_control))) {
10385 if (filter & IPW_PROM_NO_MGMT) 10385 if (filter & IPW_PROM_NO_MGMT)
10386 return; 10386 return;
10387 if (filter & IPW_PROM_MGMT_HEADER_ONLY) 10387 if (filter & IPW_PROM_MGMT_HEADER_ONLY)
10388 hdr_only = 1; 10388 hdr_only = 1;
10389 } else if (ieee80211_is_control(le16_to_cpu(hdr->frame_ctl))) { 10389 } else if (ieee80211_is_control(le16_to_cpu(hdr->frame_control))) {
10390 if (filter & IPW_PROM_NO_CTL) 10390 if (filter & IPW_PROM_NO_CTL)
10391 return; 10391 return;
10392 if (filter & IPW_PROM_CTL_HEADER_ONLY) 10392 if (filter & IPW_PROM_CTL_HEADER_ONLY)
10393 hdr_only = 1; 10393 hdr_only = 1;
10394 } else if (ieee80211_is_data(le16_to_cpu(hdr->frame_ctl))) { 10394 } else if (ieee80211_is_data(le16_to_cpu(hdr->frame_control))) {
10395 if (filter & IPW_PROM_NO_DATA) 10395 if (filter & IPW_PROM_NO_DATA)
10396 return; 10396 return;
10397 if (filter & IPW_PROM_DATA_HEADER_ONLY) 10397 if (filter & IPW_PROM_DATA_HEADER_ONLY)
@@ -10406,7 +10406,7 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv *priv,
10406 10406
10407 if (hdr_only) { 10407 if (hdr_only) {
10408 hdr = (void *)src->data; 10408 hdr = (void *)src->data;
10409 len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); 10409 len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_control));
10410 } else 10410 } else
10411 len = src->len; 10411 len = src->len;
10412 10412
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index b0726e2079b5..aad99195a4cc 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -826,8 +826,7 @@ struct ieee80211_ht_info {
826/* Authentication algorithms */ 826/* Authentication algorithms */
827#define WLAN_AUTH_OPEN 0 827#define WLAN_AUTH_OPEN 0
828#define WLAN_AUTH_SHARED_KEY 1 828#define WLAN_AUTH_SHARED_KEY 1
829#define WLAN_AUTH_FAST_BSS_TRANSITION 2 829#define WLAN_AUTH_LEAP 2
830#define WLAN_AUTH_LEAP 128
831 830
832#define WLAN_AUTH_CHALLENGE_LEN 128 831#define WLAN_AUTH_CHALLENGE_LEN 128
833 832
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index afa34d3be721..738734a4653b 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -28,6 +28,7 @@
28#include <linux/if_ether.h> /* ETH_ALEN */ 28#include <linux/if_ether.h> /* ETH_ALEN */
29#include <linux/kernel.h> /* ARRAY_SIZE */ 29#include <linux/kernel.h> /* ARRAY_SIZE */
30#include <linux/wireless.h> 30#include <linux/wireless.h>
31#include <linux/ieee80211.h>
31 32
32#define IEEE80211_VERSION "git-1.1.13" 33#define IEEE80211_VERSION "git-1.1.13"
33 34
@@ -214,94 +215,6 @@ struct ieee80211_snap_hdr {
214#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG) 215#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG)
215#define WLAN_GET_SEQ_SEQ(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4) 216#define WLAN_GET_SEQ_SEQ(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4)
216 217
217/* Authentication algorithms */
218#define WLAN_AUTH_OPEN 0
219#define WLAN_AUTH_SHARED_KEY 1
220#define WLAN_AUTH_LEAP 2
221
222#define WLAN_AUTH_CHALLENGE_LEN 128
223
224#define WLAN_CAPABILITY_ESS (1<<0)
225#define WLAN_CAPABILITY_IBSS (1<<1)
226#define WLAN_CAPABILITY_CF_POLLABLE (1<<2)
227#define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3)
228#define WLAN_CAPABILITY_PRIVACY (1<<4)
229#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
230#define WLAN_CAPABILITY_PBCC (1<<6)
231#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
232#define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8)
233#define WLAN_CAPABILITY_QOS (1<<9)
234#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10)
235#define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
236
237/* 802.11g ERP information element */
238#define WLAN_ERP_NON_ERP_PRESENT (1<<0)
239#define WLAN_ERP_USE_PROTECTION (1<<1)
240#define WLAN_ERP_BARKER_PREAMBLE (1<<2)
241
242/* Status codes */
243enum ieee80211_statuscode {
244 WLAN_STATUS_SUCCESS = 0,
245 WLAN_STATUS_UNSPECIFIED_FAILURE = 1,
246 WLAN_STATUS_CAPS_UNSUPPORTED = 10,
247 WLAN_STATUS_REASSOC_NO_ASSOC = 11,
248 WLAN_STATUS_ASSOC_DENIED_UNSPEC = 12,
249 WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG = 13,
250 WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION = 14,
251 WLAN_STATUS_CHALLENGE_FAIL = 15,
252 WLAN_STATUS_AUTH_TIMEOUT = 16,
253 WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17,
254 WLAN_STATUS_ASSOC_DENIED_RATES = 18,
255 /* 802.11b */
256 WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE = 19,
257 WLAN_STATUS_ASSOC_DENIED_NOPBCC = 20,
258 WLAN_STATUS_ASSOC_DENIED_NOAGILITY = 21,
259 /* 802.11h */
260 WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM = 22,
261 WLAN_STATUS_ASSOC_REJECTED_BAD_POWER = 23,
262 WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN = 24,
263 /* 802.11g */
264 WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25,
265 WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26,
266 /* 802.11i */
267 WLAN_STATUS_INVALID_IE = 40,
268 WLAN_STATUS_INVALID_GROUP_CIPHER = 41,
269 WLAN_STATUS_INVALID_PAIRWISE_CIPHER = 42,
270 WLAN_STATUS_INVALID_AKMP = 43,
271 WLAN_STATUS_UNSUPP_RSN_VERSION = 44,
272 WLAN_STATUS_INVALID_RSN_IE_CAP = 45,
273 WLAN_STATUS_CIPHER_SUITE_REJECTED = 46,
274};
275
276/* Reason codes */
277enum ieee80211_reasoncode {
278 WLAN_REASON_UNSPECIFIED = 1,
279 WLAN_REASON_PREV_AUTH_NOT_VALID = 2,
280 WLAN_REASON_DEAUTH_LEAVING = 3,
281 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4,
282 WLAN_REASON_DISASSOC_AP_BUSY = 5,
283 WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6,
284 WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7,
285 WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8,
286 WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9,
287 /* 802.11h */
288 WLAN_REASON_DISASSOC_BAD_POWER = 10,
289 WLAN_REASON_DISASSOC_BAD_SUPP_CHAN = 11,
290 /* 802.11i */
291 WLAN_REASON_INVALID_IE = 13,
292 WLAN_REASON_MIC_FAILURE = 14,
293 WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT = 15,
294 WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT = 16,
295 WLAN_REASON_IE_DIFFERENT = 17,
296 WLAN_REASON_INVALID_GROUP_CIPHER = 18,
297 WLAN_REASON_INVALID_PAIRWISE_CIPHER = 19,
298 WLAN_REASON_INVALID_AKMP = 20,
299 WLAN_REASON_UNSUPP_RSN_VERSION = 21,
300 WLAN_REASON_INVALID_RSN_IE_CAP = 22,
301 WLAN_REASON_IEEE8021X_FAILED = 23,
302 WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
303};
304
305/* Action categories - 802.11h */ 218/* Action categories - 802.11h */
306enum ieee80211_actioncategories { 219enum ieee80211_actioncategories {
307 WLAN_ACTION_SPECTRUM_MGMT = 0, 220 WLAN_ACTION_SPECTRUM_MGMT = 0,
@@ -530,15 +443,6 @@ enum ieee80211_mfie {
530 MFIE_TYPE_QOS_PARAMETER = 222, 443 MFIE_TYPE_QOS_PARAMETER = 222,
531}; 444};
532 445
533/* Minimal header; can be used for passing 802.11 frames with sufficient
534 * information to determine what type of underlying data type is actually
535 * stored in the data. */
536struct ieee80211_hdr {
537 __le16 frame_ctl;
538 __le16 duration_id;
539 u8 payload[0];
540} __attribute__ ((packed));
541
542struct ieee80211_hdr_1addr { 446struct ieee80211_hdr_1addr {
543 __le16 frame_ctl; 447 __le16 frame_ctl;
544 __le16 duration_id; 448 __le16 duration_id;
@@ -586,18 +490,6 @@ struct ieee80211_hdr_3addrqos {
586 __le16 qos_ctl; 490 __le16 qos_ctl;
587} __attribute__ ((packed)); 491} __attribute__ ((packed));
588 492
589struct ieee80211_hdr_4addrqos {
590 __le16 frame_ctl;
591 __le16 duration_id;
592 u8 addr1[ETH_ALEN];
593 u8 addr2[ETH_ALEN];
594 u8 addr3[ETH_ALEN];
595 __le16 seq_ctl;
596 u8 addr4[ETH_ALEN];
597 u8 payload[0];
598 __le16 qos_ctl;
599} __attribute__ ((packed));
600
601struct ieee80211_info_element { 493struct ieee80211_info_element {
602 u8 id; 494 u8 id;
603 u8 len; 495 u8 len;
@@ -1187,7 +1079,7 @@ static inline int ieee80211_get_hdrlen(u16 fc)
1187 1079
1188static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr) 1080static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr)
1189{ 1081{
1190 switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) { 1082 switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_control))) {
1191 case IEEE80211_1ADDR_LEN: 1083 case IEEE80211_1ADDR_LEN:
1192 return ((struct ieee80211_hdr_1addr *)hdr)->payload; 1084 return ((struct ieee80211_hdr_1addr *)hdr)->payload;
1193 case IEEE80211_2ADDR_LEN: 1085 case IEEE80211_2ADDR_LEN:
diff --git a/include/net/lib80211.h b/include/net/lib80211.h
index 906d96f1b264..e1558a187ac0 100644
--- a/include/net/lib80211.h
+++ b/include/net/lib80211.h
@@ -8,9 +8,11 @@
8#ifndef LIB80211_H 8#ifndef LIB80211_H
9#define LIB80211_H 9#define LIB80211_H
10 10
11#include <linux/ieee80211.h>
12
11/* print_ssid() is intended to be used in debug (and possibly error) 13/* print_ssid() is intended to be used in debug (and possibly error)
12 * messages. It should never be used for passing ssid to user space. */ 14 * messages. It should never be used for passing ssid to user space. */
13const char *print_ssid(char *buf, const char *ssid, u8 ssid_len); 15const char *print_ssid(char *buf, const char *ssid, u8 ssid_len);
14#define DECLARE_SSID_BUF(var) char var[32 * 4 + 1] __maybe_unused 16#define DECLARE_SSID_BUF(var) char var[IEEE80211_MAX_SSID_LEN * 4 + 1] __maybe_unused
15 17
16#endif /* LIB80211_H */ 18#endif /* LIB80211_H */
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
index d19c8de6ef25..a91ef8475467 100644
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -40,7 +40,7 @@ static void ieee80211_monitor_rx(struct ieee80211_device *ieee,
40 struct ieee80211_rx_stats *rx_stats) 40 struct ieee80211_rx_stats *rx_stats)
41{ 41{
42 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 42 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
43 u16 fc = le16_to_cpu(hdr->frame_ctl); 43 u16 fc = le16_to_cpu(hdr->frame_control);
44 44
45 skb->dev = ieee->dev; 45 skb->dev = ieee->dev;
46 skb_reset_mac_header(skb); 46 skb_reset_mac_header(skb);