diff options
author | Jouni Malinen <jkmaline@cc.hut.fi> | 2005-07-30 23:43:19 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-07-31 00:28:02 -0400 |
commit | ebed67d2847a9d299b47eeb5d82744671ab2b198 (patch) | |
tree | 9565c6fdaa7745669ec11087e259544cc6b31d2f /drivers | |
parent | f3b10e1636dec053f4874d593e3de5d46da48a5f (diff) |
[PATCH] hostap: Start using net/ieee80211.h
Preparations for starting to use net/ieee80211 instead of private
IEEE 802.11 implementation. Include net/ieee80211.h and
net/ieee80211_crypt.h into files that will be needed these in the
future. Remove duplicate definitions from hostap_common.h and
rename WLAN_FC_GET_{TYPE,STYPE} macros for now sinc net/ieee80211.h
is using incompatible definitions. This will be resolved in the
future by updating Host AP to use the versions that do not shift
type/stype.
Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/hostap/hostap.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_80211_rx.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_80211_tx.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_ap.c | 24 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_common.h | 73 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_crypt_ccmp.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_hw.c | 13 |
7 files changed, 46 insertions, 102 deletions
diff --git a/drivers/net/wireless/hostap/hostap.c b/drivers/net/wireless/hostap/hostap.c index 182891f1dd02..75c75103f678 100644 --- a/drivers/net/wireless/hostap/hostap.c +++ b/drivers/net/wireless/hostap/hostap.c | |||
@@ -26,6 +26,8 @@ | |||
26 | #include <linux/rtnetlink.h> | 26 | #include <linux/rtnetlink.h> |
27 | #include <linux/wireless.h> | 27 | #include <linux/wireless.h> |
28 | #include <net/iw_handler.h> | 28 | #include <net/iw_handler.h> |
29 | #include <net/ieee80211.h> | ||
30 | #include <net/ieee80211_crypt.h> | ||
29 | #include <asm/uaccess.h> | 31 | #include <asm/uaccess.h> |
30 | 32 | ||
31 | #include "hostap_wlan.h" | 33 | #include "hostap_wlan.h" |
@@ -596,7 +598,7 @@ void hostap_dump_rx_header(const char *name, const struct hfa384x_rx_frame *rx) | |||
596 | fc = __le16_to_cpu(rx->frame_control); | 598 | fc = __le16_to_cpu(rx->frame_control); |
597 | printk(KERN_DEBUG " FC=0x%04x (type=%d:%d) dur=0x%04x seq=0x%04x " | 599 | printk(KERN_DEBUG " FC=0x%04x (type=%d:%d) dur=0x%04x seq=0x%04x " |
598 | "data_len=%d%s%s\n", | 600 | "data_len=%d%s%s\n", |
599 | fc, WLAN_FC_GET_TYPE(fc), WLAN_FC_GET_STYPE(fc), | 601 | fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc), |
600 | __le16_to_cpu(rx->duration_id), __le16_to_cpu(rx->seq_ctrl), | 602 | __le16_to_cpu(rx->duration_id), __le16_to_cpu(rx->seq_ctrl), |
601 | __le16_to_cpu(rx->data_len), | 603 | __le16_to_cpu(rx->data_len), |
602 | fc & WLAN_FC_TODS ? " [ToDS]" : "", | 604 | fc & WLAN_FC_TODS ? " [ToDS]" : "", |
@@ -625,7 +627,7 @@ void hostap_dump_tx_header(const char *name, const struct hfa384x_tx_frame *tx) | |||
625 | fc = __le16_to_cpu(tx->frame_control); | 627 | fc = __le16_to_cpu(tx->frame_control); |
626 | printk(KERN_DEBUG " FC=0x%04x (type=%d:%d) dur=0x%04x seq=0x%04x " | 628 | printk(KERN_DEBUG " FC=0x%04x (type=%d:%d) dur=0x%04x seq=0x%04x " |
627 | "data_len=%d%s%s\n", | 629 | "data_len=%d%s%s\n", |
628 | fc, WLAN_FC_GET_TYPE(fc), WLAN_FC_GET_STYPE(fc), | 630 | fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc), |
629 | __le16_to_cpu(tx->duration_id), __le16_to_cpu(tx->seq_ctrl), | 631 | __le16_to_cpu(tx->duration_id), __le16_to_cpu(tx->seq_ctrl), |
630 | __le16_to_cpu(tx->data_len), | 632 | __le16_to_cpu(tx->data_len), |
631 | fc & WLAN_FC_TODS ? " [ToDS]" : "", | 633 | fc & WLAN_FC_TODS ? " [ToDS]" : "", |
@@ -668,13 +670,13 @@ int hostap_80211_get_hdrlen(u16 fc) | |||
668 | { | 670 | { |
669 | int hdrlen = 24; | 671 | int hdrlen = 24; |
670 | 672 | ||
671 | switch (WLAN_FC_GET_TYPE(fc)) { | 673 | switch (HOSTAP_FC_GET_TYPE(fc)) { |
672 | case WLAN_FC_TYPE_DATA: | 674 | case WLAN_FC_TYPE_DATA: |
673 | if ((fc & WLAN_FC_FROMDS) && (fc & WLAN_FC_TODS)) | 675 | if ((fc & WLAN_FC_FROMDS) && (fc & WLAN_FC_TODS)) |
674 | hdrlen = 30; /* Addr4 */ | 676 | hdrlen = 30; /* Addr4 */ |
675 | break; | 677 | break; |
676 | case WLAN_FC_TYPE_CTRL: | 678 | case WLAN_FC_TYPE_CTRL: |
677 | switch (WLAN_FC_GET_STYPE(fc)) { | 679 | switch (HOSTAP_FC_GET_STYPE(fc)) { |
678 | case WLAN_FC_STYPE_CTS: | 680 | case WLAN_FC_STYPE_CTS: |
679 | case WLAN_FC_STYPE_ACK: | 681 | case WLAN_FC_STYPE_ACK: |
680 | hdrlen = 10; | 682 | hdrlen = 10; |
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c index 026d47d9c521..a0da9b9c890c 100644 --- a/drivers/net/wireless/hostap/hostap_80211_rx.c +++ b/drivers/net/wireless/hostap/hostap_80211_rx.c | |||
@@ -21,7 +21,7 @@ void hostap_dump_rx_80211(const char *name, struct sk_buff *skb, | |||
21 | 21 | ||
22 | fc = le16_to_cpu(hdr->frame_control); | 22 | fc = le16_to_cpu(hdr->frame_control); |
23 | printk(KERN_DEBUG " FC=0x%04x (type=%d:%d)%s%s", | 23 | printk(KERN_DEBUG " FC=0x%04x (type=%d:%d)%s%s", |
24 | fc, WLAN_FC_GET_TYPE(fc), WLAN_FC_GET_STYPE(fc), | 24 | fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc), |
25 | fc & WLAN_FC_TODS ? " [ToDS]" : "", | 25 | fc & WLAN_FC_TODS ? " [ToDS]" : "", |
26 | fc & WLAN_FC_FROMDS ? " [FromDS]" : ""); | 26 | fc & WLAN_FC_FROMDS ? " [FromDS]" : ""); |
27 | 27 | ||
@@ -224,7 +224,7 @@ prism2_frag_cache_get(local_info_t *local, struct hostap_ieee80211_hdr *hdr) | |||
224 | 224 | ||
225 | sc = le16_to_cpu(hdr->seq_ctrl); | 225 | sc = le16_to_cpu(hdr->seq_ctrl); |
226 | frag = WLAN_GET_SEQ_FRAG(sc); | 226 | frag = WLAN_GET_SEQ_FRAG(sc); |
227 | seq = WLAN_GET_SEQ_SEQ(sc); | 227 | seq = WLAN_GET_SEQ_SEQ(sc) >> 4; |
228 | 228 | ||
229 | if (frag == 0) { | 229 | if (frag == 0) { |
230 | /* Reserve enough space to fit maximum frame length */ | 230 | /* Reserve enough space to fit maximum frame length */ |
@@ -274,7 +274,7 @@ static int prism2_frag_cache_invalidate(local_info_t *local, | |||
274 | struct prism2_frag_entry *entry; | 274 | struct prism2_frag_entry *entry; |
275 | 275 | ||
276 | sc = le16_to_cpu(hdr->seq_ctrl); | 276 | sc = le16_to_cpu(hdr->seq_ctrl); |
277 | seq = WLAN_GET_SEQ_SEQ(sc); | 277 | seq = WLAN_GET_SEQ_SEQ(sc) >> 4; |
278 | 278 | ||
279 | entry = prism2_frag_cache_find(local, seq, -1, hdr->addr2, hdr->addr1); | 279 | entry = prism2_frag_cache_find(local, seq, -1, hdr->addr2, hdr->addr1); |
280 | 280 | ||
@@ -719,8 +719,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, | |||
719 | goto rx_dropped; | 719 | goto rx_dropped; |
720 | 720 | ||
721 | fc = le16_to_cpu(hdr->frame_control); | 721 | fc = le16_to_cpu(hdr->frame_control); |
722 | type = WLAN_FC_GET_TYPE(fc); | 722 | type = HOSTAP_FC_GET_TYPE(fc); |
723 | stype = WLAN_FC_GET_STYPE(fc); | 723 | stype = HOSTAP_FC_GET_STYPE(fc); |
724 | sc = le16_to_cpu(hdr->seq_ctrl); | 724 | sc = le16_to_cpu(hdr->seq_ctrl); |
725 | frag = WLAN_GET_SEQ_FRAG(sc); | 725 | frag = WLAN_GET_SEQ_FRAG(sc); |
726 | hdrlen = hostap_80211_get_hdrlen(fc); | 726 | hdrlen = hostap_80211_get_hdrlen(fc); |
@@ -896,7 +896,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, | |||
896 | printk(KERN_DEBUG "%s: Rx cannot get skb from " | 896 | printk(KERN_DEBUG "%s: Rx cannot get skb from " |
897 | "fragment cache (morefrag=%d seq=%u frag=%u)\n", | 897 | "fragment cache (morefrag=%d seq=%u frag=%u)\n", |
898 | dev->name, (fc & WLAN_FC_MOREFRAG) != 0, | 898 | dev->name, (fc & WLAN_FC_MOREFRAG) != 0, |
899 | WLAN_GET_SEQ_SEQ(sc), frag); | 899 | WLAN_GET_SEQ_SEQ(sc) >> 4, frag); |
900 | goto rx_dropped; | 900 | goto rx_dropped; |
901 | } | 901 | } |
902 | 902 | ||
diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c index 8a94a80ec55f..52e81cd406fb 100644 --- a/drivers/net/wireless/hostap/hostap_80211_tx.c +++ b/drivers/net/wireless/hostap/hostap_80211_tx.c | |||
@@ -13,7 +13,7 @@ void hostap_dump_tx_80211(const char *name, struct sk_buff *skb) | |||
13 | 13 | ||
14 | fc = le16_to_cpu(hdr->frame_control); | 14 | fc = le16_to_cpu(hdr->frame_control); |
15 | printk(KERN_DEBUG " FC=0x%04x (type=%d:%d)%s%s", | 15 | printk(KERN_DEBUG " FC=0x%04x (type=%d:%d)%s%s", |
16 | fc, WLAN_FC_GET_TYPE(fc), WLAN_FC_GET_STYPE(fc), | 16 | fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc), |
17 | fc & WLAN_FC_TODS ? " [ToDS]" : "", | 17 | fc & WLAN_FC_TODS ? " [ToDS]" : "", |
18 | fc & WLAN_FC_FROMDS ? " [FromDS]" : ""); | 18 | fc & WLAN_FC_FROMDS ? " [FromDS]" : ""); |
19 | 19 | ||
@@ -267,8 +267,8 @@ int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
267 | if (skb->len >= IEEE80211_DATA_HDR3_LEN + sizeof(rfc1042_header) + 2) { | 267 | if (skb->len >= IEEE80211_DATA_HDR3_LEN + sizeof(rfc1042_header) + 2) { |
268 | hdr = (struct hostap_ieee80211_hdr *) skb->data; | 268 | hdr = (struct hostap_ieee80211_hdr *) skb->data; |
269 | fc = le16_to_cpu(hdr->frame_control); | 269 | fc = le16_to_cpu(hdr->frame_control); |
270 | if (WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA && | 270 | if (HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA && |
271 | WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_DATA) { | 271 | HOSTAP_FC_GET_STYPE(fc) == WLAN_FC_STYPE_DATA) { |
272 | u8 *pos = &skb->data[IEEE80211_DATA_HDR3_LEN + | 272 | u8 *pos = &skb->data[IEEE80211_DATA_HDR3_LEN + |
273 | sizeof(rfc1042_header)]; | 273 | sizeof(rfc1042_header)]; |
274 | meta->ethertype = (pos[0] << 8) | pos[1]; | 274 | meta->ethertype = (pos[0] << 8) | pos[1]; |
@@ -409,7 +409,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
409 | break; | 409 | break; |
410 | case AP_TX_CONTINUE_NOT_AUTHORIZED: | 410 | case AP_TX_CONTINUE_NOT_AUTHORIZED: |
411 | if (local->ieee_802_1x && | 411 | if (local->ieee_802_1x && |
412 | WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA && | 412 | HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA && |
413 | meta->ethertype != ETH_P_PAE && !meta->wds) { | 413 | meta->ethertype != ETH_P_PAE && !meta->wds) { |
414 | printk(KERN_DEBUG "%s: dropped frame to unauthorized " | 414 | printk(KERN_DEBUG "%s: dropped frame to unauthorized " |
415 | "port (IEEE 802.1X): ethertype=0x%04x\n", | 415 | "port (IEEE 802.1X): ethertype=0x%04x\n", |
@@ -446,7 +446,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
446 | hdr->frame_control = cpu_to_le16(fc); | 446 | hdr->frame_control = cpu_to_le16(fc); |
447 | } | 447 | } |
448 | 448 | ||
449 | if (WLAN_FC_GET_TYPE(fc) != WLAN_FC_TYPE_DATA) { | 449 | if (HOSTAP_FC_GET_TYPE(fc) != WLAN_FC_TYPE_DATA) { |
450 | no_encrypt = 1; | 450 | no_encrypt = 1; |
451 | tx.crypt = NULL; | 451 | tx.crypt = NULL; |
452 | } | 452 | } |
@@ -467,7 +467,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
467 | fc |= WLAN_FC_ISWEP; | 467 | fc |= WLAN_FC_ISWEP; |
468 | hdr->frame_control = cpu_to_le16(fc); | 468 | hdr->frame_control = cpu_to_le16(fc); |
469 | } else if (local->drop_unencrypted && | 469 | } else if (local->drop_unencrypted && |
470 | WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA && | 470 | HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA && |
471 | meta->ethertype != ETH_P_PAE) { | 471 | meta->ethertype != ETH_P_PAE) { |
472 | if (net_ratelimit()) { | 472 | if (net_ratelimit()) { |
473 | printk(KERN_DEBUG "%s: dropped unencrypted TX data " | 473 | printk(KERN_DEBUG "%s: dropped unencrypted TX data " |
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c index b9684e3a568b..f59912a0fb4c 100644 --- a/drivers/net/wireless/hostap/hostap_ap.c +++ b/drivers/net/wireless/hostap/hostap_ap.c | |||
@@ -634,8 +634,8 @@ static void hostap_ap_tx_cb_auth(struct sk_buff *skb, int ok, void *data) | |||
634 | 634 | ||
635 | hdr = (struct hostap_ieee80211_hdr *) skb->data; | 635 | hdr = (struct hostap_ieee80211_hdr *) skb->data; |
636 | fc = le16_to_cpu(hdr->frame_control); | 636 | fc = le16_to_cpu(hdr->frame_control); |
637 | if (WLAN_FC_GET_TYPE(fc) != WLAN_FC_TYPE_MGMT || | 637 | if (HOSTAP_FC_GET_TYPE(fc) != WLAN_FC_TYPE_MGMT || |
638 | WLAN_FC_GET_STYPE(fc) != WLAN_FC_STYPE_AUTH || | 638 | HOSTAP_FC_GET_STYPE(fc) != WLAN_FC_STYPE_AUTH || |
639 | skb->len < IEEE80211_MGMT_HDR_LEN + 6) { | 639 | skb->len < IEEE80211_MGMT_HDR_LEN + 6) { |
640 | printk(KERN_DEBUG "%s: hostap_ap_tx_cb_auth received invalid " | 640 | printk(KERN_DEBUG "%s: hostap_ap_tx_cb_auth received invalid " |
641 | "frame\n", dev->name); | 641 | "frame\n", dev->name); |
@@ -703,9 +703,9 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data) | |||
703 | 703 | ||
704 | hdr = (struct hostap_ieee80211_hdr *) skb->data; | 704 | hdr = (struct hostap_ieee80211_hdr *) skb->data; |
705 | fc = le16_to_cpu(hdr->frame_control); | 705 | fc = le16_to_cpu(hdr->frame_control); |
706 | if (WLAN_FC_GET_TYPE(fc) != WLAN_FC_TYPE_MGMT || | 706 | if (HOSTAP_FC_GET_TYPE(fc) != WLAN_FC_TYPE_MGMT || |
707 | (WLAN_FC_GET_STYPE(fc) != WLAN_FC_STYPE_ASSOC_RESP && | 707 | (HOSTAP_FC_GET_STYPE(fc) != WLAN_FC_STYPE_ASSOC_RESP && |
708 | WLAN_FC_GET_STYPE(fc) != WLAN_FC_STYPE_REASSOC_RESP) || | 708 | HOSTAP_FC_GET_STYPE(fc) != WLAN_FC_STYPE_REASSOC_RESP) || |
709 | skb->len < IEEE80211_MGMT_HDR_LEN + 4) { | 709 | skb->len < IEEE80211_MGMT_HDR_LEN + 4) { |
710 | printk(KERN_DEBUG "%s: hostap_ap_tx_cb_assoc received invalid " | 710 | printk(KERN_DEBUG "%s: hostap_ap_tx_cb_assoc received invalid " |
711 | "frame\n", dev->name); | 711 | "frame\n", dev->name); |
@@ -2145,8 +2145,8 @@ static void handle_ap_item(local_info_t *local, struct sk_buff *skb, | |||
2145 | * buffer is long enough */ | 2145 | * buffer is long enough */ |
2146 | hdr = (struct hostap_ieee80211_hdr *) skb->data; | 2146 | hdr = (struct hostap_ieee80211_hdr *) skb->data; |
2147 | fc = le16_to_cpu(hdr->frame_control); | 2147 | fc = le16_to_cpu(hdr->frame_control); |
2148 | type = WLAN_FC_GET_TYPE(fc); | 2148 | type = HOSTAP_FC_GET_TYPE(fc); |
2149 | stype = WLAN_FC_GET_STYPE(fc); | 2149 | stype = HOSTAP_FC_GET_STYPE(fc); |
2150 | 2150 | ||
2151 | #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT | 2151 | #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT |
2152 | if (!local->hostapd && type == WLAN_FC_TYPE_DATA) { | 2152 | if (!local->hostapd && type == WLAN_FC_TYPE_DATA) { |
@@ -2271,8 +2271,8 @@ void hostap_rx(struct net_device *dev, struct sk_buff *skb, | |||
2271 | fc = le16_to_cpu(hdr->frame_control); | 2271 | fc = le16_to_cpu(hdr->frame_control); |
2272 | 2272 | ||
2273 | if (local->ap->ap_policy == AP_OTHER_AP_SKIP_ALL && | 2273 | if (local->ap->ap_policy == AP_OTHER_AP_SKIP_ALL && |
2274 | WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_MGMT && | 2274 | HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_MGMT && |
2275 | WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_BEACON) | 2275 | HOSTAP_FC_GET_STYPE(fc) == WLAN_FC_STYPE_BEACON) |
2276 | goto drop; | 2276 | goto drop; |
2277 | 2277 | ||
2278 | skb->protocol = __constant_htons(ETH_P_HOSTAP); | 2278 | skb->protocol = __constant_htons(ETH_P_HOSTAP); |
@@ -2907,7 +2907,7 @@ int hostap_update_sta_ps(local_info_t *local, struct hostap_ieee80211_hdr *hdr) | |||
2907 | 2907 | ||
2908 | fc = le16_to_cpu(hdr->frame_control); | 2908 | fc = le16_to_cpu(hdr->frame_control); |
2909 | hostap_update_sta_ps2(local, sta, fc & WLAN_FC_PWRMGT, | 2909 | hostap_update_sta_ps2(local, sta, fc & WLAN_FC_PWRMGT, |
2910 | WLAN_FC_GET_TYPE(fc), WLAN_FC_GET_STYPE(fc)); | 2910 | HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc)); |
2911 | 2911 | ||
2912 | atomic_dec(&sta->users); | 2912 | atomic_dec(&sta->users); |
2913 | return 0; | 2913 | return 0; |
@@ -2932,8 +2932,8 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev, | |||
2932 | hdr = (struct hostap_ieee80211_hdr *) skb->data; | 2932 | hdr = (struct hostap_ieee80211_hdr *) skb->data; |
2933 | 2933 | ||
2934 | fc = le16_to_cpu(hdr->frame_control); | 2934 | fc = le16_to_cpu(hdr->frame_control); |
2935 | type = WLAN_FC_GET_TYPE(fc); | 2935 | type = HOSTAP_FC_GET_TYPE(fc); |
2936 | stype = WLAN_FC_GET_STYPE(fc); | 2936 | stype = HOSTAP_FC_GET_STYPE(fc); |
2937 | 2937 | ||
2938 | spin_lock(&local->ap->sta_table_lock); | 2938 | spin_lock(&local->ap->sta_table_lock); |
2939 | sta = ap_get_sta(local->ap, hdr->addr2); | 2939 | sta = ap_get_sta(local->ap, hdr->addr2); |
diff --git a/drivers/net/wireless/hostap/hostap_common.h b/drivers/net/wireless/hostap/hostap_common.h index feec70e68d4e..3b79d9e95e6f 100644 --- a/drivers/net/wireless/hostap/hostap_common.h +++ b/drivers/net/wireless/hostap/hostap_common.h | |||
@@ -27,14 +27,14 @@ | |||
27 | #define WLAN_FC_ISWEP BIT(14) | 27 | #define WLAN_FC_ISWEP BIT(14) |
28 | #define WLAN_FC_ORDER BIT(15) | 28 | #define WLAN_FC_ORDER BIT(15) |
29 | 29 | ||
30 | #define WLAN_FC_GET_TYPE(fc) (((fc) & (BIT(3) | BIT(2))) >> 2) | 30 | /* |
31 | #define WLAN_FC_GET_STYPE(fc) \ | 31 | * To be replaced with ieee80211.h WLAN_FC_GET_* once HostAP code is updated to |
32 | * use the versions without right shift. | ||
33 | */ | ||
34 | #define HOSTAP_FC_GET_TYPE(fc) (((fc) & (BIT(3) | BIT(2))) >> 2) | ||
35 | #define HOSTAP_FC_GET_STYPE(fc) \ | ||
32 | (((fc) & (BIT(7) | BIT(6) | BIT(5) | BIT(4))) >> 4) | 36 | (((fc) & (BIT(7) | BIT(6) | BIT(5) | BIT(4))) >> 4) |
33 | 37 | ||
34 | #define WLAN_GET_SEQ_FRAG(seq) ((seq) & (BIT(3) | BIT(2) | BIT(1) | BIT(0))) | ||
35 | #define WLAN_GET_SEQ_SEQ(seq) \ | ||
36 | (((seq) & (~(BIT(3) | BIT(2) | BIT(1) | BIT(0)))) >> 4) | ||
37 | |||
38 | #define WLAN_FC_TYPE_MGMT 0 | 38 | #define WLAN_FC_TYPE_MGMT 0 |
39 | #define WLAN_FC_TYPE_CTRL 1 | 39 | #define WLAN_FC_TYPE_CTRL 1 |
40 | #define WLAN_FC_TYPE_DATA 2 | 40 | #define WLAN_FC_TYPE_DATA 2 |
@@ -70,66 +70,7 @@ | |||
70 | #define WLAN_FC_STYPE_CFPOLL 6 | 70 | #define WLAN_FC_STYPE_CFPOLL 6 |
71 | #define WLAN_FC_STYPE_CFACKPOLL 7 | 71 | #define WLAN_FC_STYPE_CFACKPOLL 7 |
72 | 72 | ||
73 | /* Authentication algorithms */ | 73 | #define WLAN_CAPABILITY_ESS WLAN_CAPABILITY_BSS |
74 | #define WLAN_AUTH_OPEN 0 | ||
75 | #define WLAN_AUTH_SHARED_KEY 1 | ||
76 | |||
77 | #define WLAN_AUTH_CHALLENGE_LEN 128 | ||
78 | |||
79 | #define WLAN_CAPABILITY_ESS BIT(0) | ||
80 | #define WLAN_CAPABILITY_IBSS BIT(1) | ||
81 | #define WLAN_CAPABILITY_CF_POLLABLE BIT(2) | ||
82 | #define WLAN_CAPABILITY_CF_POLL_REQUEST BIT(3) | ||
83 | #define WLAN_CAPABILITY_PRIVACY BIT(4) | ||
84 | |||
85 | /* Status codes */ | ||
86 | #define WLAN_STATUS_SUCCESS 0 | ||
87 | #define WLAN_STATUS_UNSPECIFIED_FAILURE 1 | ||
88 | #define WLAN_STATUS_CAPS_UNSUPPORTED 10 | ||
89 | #define WLAN_STATUS_REASSOC_NO_ASSOC 11 | ||
90 | #define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12 | ||
91 | #define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13 | ||
92 | #define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14 | ||
93 | #define WLAN_STATUS_CHALLENGE_FAIL 15 | ||
94 | #define WLAN_STATUS_AUTH_TIMEOUT 16 | ||
95 | #define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17 | ||
96 | #define WLAN_STATUS_ASSOC_DENIED_RATES 18 | ||
97 | /* 802.11b */ | ||
98 | #define WLAN_STATUS_ASSOC_DENIED_NOSHORT 19 | ||
99 | #define WLAN_STATUS_ASSOC_DENIED_NOPBCC 20 | ||
100 | #define WLAN_STATUS_ASSOC_DENIED_NOAGILITY 21 | ||
101 | /* IEEE 802.11i */ | ||
102 | #define WLAN_STATUS_INVALID_IE 40 | ||
103 | #define WLAN_STATUS_GROUP_CIPHER_NOT_VALID 41 | ||
104 | #define WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID 42 | ||
105 | #define WLAN_STATUS_AKMP_NOT_VALID 43 | ||
106 | #define WLAN_STATUS_UNSUPPORTED_RSN_IE_VERSION 44 | ||
107 | #define WLAN_STATUS_INVALID_RSN_IE_CAPAB 45 | ||
108 | #define WLAN_STATUS_CIPHER_REJECTED_PER_POLICY 46 | ||
109 | |||
110 | /* Reason codes */ | ||
111 | #define WLAN_REASON_UNSPECIFIED 1 | ||
112 | #define WLAN_REASON_PREV_AUTH_NOT_VALID 2 | ||
113 | #define WLAN_REASON_DEAUTH_LEAVING 3 | ||
114 | #define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4 | ||
115 | #define WLAN_REASON_DISASSOC_AP_BUSY 5 | ||
116 | #define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6 | ||
117 | #define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7 | ||
118 | #define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8 | ||
119 | #define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9 | ||
120 | /* IEEE 802.11i */ | ||
121 | #define WLAN_REASON_INVALID_IE 13 | ||
122 | #define WLAN_REASON_MICHAEL_MIC_FAILURE 14 | ||
123 | #define WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT 15 | ||
124 | #define WLAN_REASON_GROUP_KEY_UPDATE_TIMEOUT 16 | ||
125 | #define WLAN_REASON_IE_IN_4WAY_DIFFERS 17 | ||
126 | #define WLAN_REASON_GROUP_CIPHER_NOT_VALID 18 | ||
127 | #define WLAN_REASON_PAIRWISE_CIPHER_NOT_VALID 19 | ||
128 | #define WLAN_REASON_AKMP_NOT_VALID 20 | ||
129 | #define WLAN_REASON_UNSUPPORTED_RSN_IE_VERSION 21 | ||
130 | #define WLAN_REASON_INVALID_RSN_IE_CAPAB 22 | ||
131 | #define WLAN_REASON_IEEE_802_1X_AUTH_FAILED 23 | ||
132 | #define WLAN_REASON_CIPHER_SUITE_REJECTED 24 | ||
133 | 74 | ||
134 | 75 | ||
135 | /* Information Element IDs */ | 76 | /* Information Element IDs */ |
diff --git a/drivers/net/wireless/hostap/hostap_crypt_ccmp.c b/drivers/net/wireless/hostap/hostap_crypt_ccmp.c index ad26aac2d5fe..9e18340f7a38 100644 --- a/drivers/net/wireless/hostap/hostap_crypt_ccmp.c +++ b/drivers/net/wireless/hostap/hostap_crypt_ccmp.c | |||
@@ -151,8 +151,8 @@ static void ccmp_init_blocks(struct crypto_tfm *tfm, | |||
151 | fc = le16_to_cpu(hdr->frame_control); | 151 | fc = le16_to_cpu(hdr->frame_control); |
152 | a4_included = ((fc & (WLAN_FC_TODS | WLAN_FC_FROMDS)) == | 152 | a4_included = ((fc & (WLAN_FC_TODS | WLAN_FC_FROMDS)) == |
153 | (WLAN_FC_TODS | WLAN_FC_FROMDS)); | 153 | (WLAN_FC_TODS | WLAN_FC_FROMDS)); |
154 | qc_included = ((WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA) && | 154 | qc_included = ((HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA) && |
155 | (WLAN_FC_GET_STYPE(fc) & 0x08)); | 155 | (HOSTAP_FC_GET_STYPE(fc) & 0x08)); |
156 | aad_len = 22; | 156 | aad_len = 22; |
157 | if (a4_included) | 157 | if (a4_included) |
158 | aad_len += 6; | 158 | aad_len += 6; |
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index 80d0cd30c9d3..72a8a19ad8c0 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c | |||
@@ -48,9 +48,10 @@ | |||
48 | #include <linux/rtnetlink.h> | 48 | #include <linux/rtnetlink.h> |
49 | #include <linux/wireless.h> | 49 | #include <linux/wireless.h> |
50 | #include <net/iw_handler.h> | 50 | #include <net/iw_handler.h> |
51 | #include <net/ieee80211.h> | ||
52 | #include <net/ieee80211_crypt.h> | ||
51 | #include <asm/irq.h> | 53 | #include <asm/irq.h> |
52 | 54 | ||
53 | |||
54 | #include "hostap_80211.h" | 55 | #include "hostap_80211.h" |
55 | #include "hostap.h" | 56 | #include "hostap.h" |
56 | #include "hostap_ap.h" | 57 | #include "hostap_ap.h" |
@@ -1890,7 +1891,7 @@ static int prism2_tx_80211(struct sk_buff *skb, struct net_device *dev) | |||
1890 | hdr_len = 24; | 1891 | hdr_len = 24; |
1891 | memcpy(&txdesc.frame_control, skb->data, hdr_len); | 1892 | memcpy(&txdesc.frame_control, skb->data, hdr_len); |
1892 | fc = le16_to_cpu(txdesc.frame_control); | 1893 | fc = le16_to_cpu(txdesc.frame_control); |
1893 | if (WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA && | 1894 | if (HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA && |
1894 | (fc & WLAN_FC_FROMDS) && (fc & WLAN_FC_TODS) && skb->len >= 30) { | 1895 | (fc & WLAN_FC_FROMDS) && (fc & WLAN_FC_TODS) && skb->len >= 30) { |
1895 | /* Addr4 */ | 1896 | /* Addr4 */ |
1896 | memcpy(txdesc.addr4, skb->data + hdr_len, ETH_ALEN); | 1897 | memcpy(txdesc.addr4, skb->data + hdr_len, ETH_ALEN); |
@@ -2521,10 +2522,10 @@ static void prism2_txexc(local_info_t *local) | |||
2521 | PDEBUG(DEBUG_EXTRA, " retry_count=%d tx_rate=%d fc=0x%04x " | 2522 | PDEBUG(DEBUG_EXTRA, " retry_count=%d tx_rate=%d fc=0x%04x " |
2522 | "(%s%s%s::%d%s%s)\n", | 2523 | "(%s%s%s::%d%s%s)\n", |
2523 | txdesc.retry_count, txdesc.tx_rate, fc, | 2524 | txdesc.retry_count, txdesc.tx_rate, fc, |
2524 | WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_MGMT ? "Mgmt" : "", | 2525 | HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_MGMT ? "Mgmt" : "", |
2525 | WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_CTRL ? "Ctrl" : "", | 2526 | HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_CTRL ? "Ctrl" : "", |
2526 | WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA ? "Data" : "", | 2527 | HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA ? "Data" : "", |
2527 | WLAN_FC_GET_STYPE(fc), | 2528 | HOSTAP_FC_GET_STYPE(fc), |
2528 | fc & WLAN_FC_TODS ? " ToDS" : "", | 2529 | fc & WLAN_FC_TODS ? " ToDS" : "", |
2529 | fc & WLAN_FC_FROMDS ? " FromDS" : ""); | 2530 | fc & WLAN_FC_FROMDS ? " FromDS" : ""); |
2530 | PDEBUG(DEBUG_EXTRA, " A1=" MACSTR " A2=" MACSTR " A3=" | 2531 | PDEBUG(DEBUG_EXTRA, " A1=" MACSTR " A2=" MACSTR " A3=" |