diff options
author | Jouni Malinen <jkmaline@cc.hut.fi> | 2005-08-14 22:08:44 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-08-14 23:07:30 -0400 |
commit | 4339d328631aa815fe2181b9164b3690ca2db4da (patch) | |
tree | 1848ffbf700ccd4e38c70e218f91dd2a7eadf018 /drivers/net/wireless/hostap/hostap_80211_rx.c | |
parent | c0f72ca8e4f1b459b5582c1c8dcaf7e53151f069 (diff) |
[PATCH] hostap: Use ieee80211 WLAN_FC_GET_{TYPE,STYPE}
Replace temporary HOSTAP_FC_GET_{TYPE,STYPE} macros with the ieee80211
version of WLAN_FC_GET_{TYPE,STYPE}.
Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/wireless/hostap/hostap_80211_rx.c')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_80211_rx.c | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c index 5363400a5da2..3752a677abb6 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_ctl); | 22 | fc = le16_to_cpu(hdr->frame_ctl); |
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, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc), | 24 | fc, WLAN_FC_GET_TYPE(fc) >> 2, WLAN_FC_GET_STYPE(fc) >> 4, |
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 | ||
@@ -445,8 +445,8 @@ hostap_rx_frame_mgmt(local_info_t *local, struct sk_buff *skb, | |||
445 | skb->data); | 445 | skb->data); |
446 | } | 446 | } |
447 | 447 | ||
448 | if (local->hostapd && type == WLAN_FC_TYPE_MGMT) { | 448 | if (local->hostapd && type == IEEE80211_FTYPE_MGMT) { |
449 | if (stype == WLAN_FC_STYPE_BEACON && | 449 | if (stype == IEEE80211_STYPE_BEACON && |
450 | local->iw_mode == IW_MODE_MASTER) { | 450 | local->iw_mode == IW_MODE_MASTER) { |
451 | struct sk_buff *skb2; | 451 | struct sk_buff *skb2; |
452 | /* Process beacon frames also in kernel driver to | 452 | /* Process beacon frames also in kernel driver to |
@@ -467,23 +467,24 @@ hostap_rx_frame_mgmt(local_info_t *local, struct sk_buff *skb, | |||
467 | } | 467 | } |
468 | 468 | ||
469 | if (local->iw_mode == IW_MODE_MASTER) { | 469 | if (local->iw_mode == IW_MODE_MASTER) { |
470 | if (type != WLAN_FC_TYPE_MGMT && type != WLAN_FC_TYPE_CTRL) { | 470 | if (type != IEEE80211_FTYPE_MGMT && |
471 | type != IEEE80211_FTYPE_CTL) { | ||
471 | printk(KERN_DEBUG "%s: unknown management frame " | 472 | printk(KERN_DEBUG "%s: unknown management frame " |
472 | "(type=0x%02x, stype=0x%02x) dropped\n", | 473 | "(type=0x%02x, stype=0x%02x) dropped\n", |
473 | skb->dev->name, type, stype); | 474 | skb->dev->name, type >> 2, stype >> 4); |
474 | return -1; | 475 | return -1; |
475 | } | 476 | } |
476 | 477 | ||
477 | hostap_rx(skb->dev, skb, rx_stats); | 478 | hostap_rx(skb->dev, skb, rx_stats); |
478 | return 0; | 479 | return 0; |
479 | } else if (type == WLAN_FC_TYPE_MGMT && | 480 | } else if (type == IEEE80211_FTYPE_MGMT && |
480 | (stype == WLAN_FC_STYPE_BEACON || | 481 | (stype == IEEE80211_STYPE_BEACON || |
481 | stype == WLAN_FC_STYPE_PROBE_RESP)) { | 482 | stype == IEEE80211_STYPE_PROBE_RESP)) { |
482 | hostap_rx_sta_beacon(local, skb, stype); | 483 | hostap_rx_sta_beacon(local, skb, stype); |
483 | return -1; | 484 | return -1; |
484 | } else if (type == WLAN_FC_TYPE_MGMT && | 485 | } else if (type == IEEE80211_FTYPE_MGMT && |
485 | (stype == WLAN_FC_STYPE_ASSOC_RESP || | 486 | (stype == IEEE80211_STYPE_ASSOC_RESP || |
486 | stype == WLAN_FC_STYPE_REASSOC_RESP)) { | 487 | stype == IEEE80211_STYPE_REASSOC_RESP)) { |
487 | /* Ignore (Re)AssocResp silently since these are not currently | 488 | /* Ignore (Re)AssocResp silently since these are not currently |
488 | * needed but are still received when WPA/RSN mode is enabled. | 489 | * needed but are still received when WPA/RSN mode is enabled. |
489 | */ | 490 | */ |
@@ -491,7 +492,7 @@ hostap_rx_frame_mgmt(local_info_t *local, struct sk_buff *skb, | |||
491 | } else { | 492 | } else { |
492 | printk(KERN_DEBUG "%s: hostap_rx_frame_mgmt: dropped unhandled" | 493 | printk(KERN_DEBUG "%s: hostap_rx_frame_mgmt: dropped unhandled" |
493 | " management frame in non-Host AP mode (type=%d:%d)\n", | 494 | " management frame in non-Host AP mode (type=%d:%d)\n", |
494 | skb->dev->name, type, stype); | 495 | skb->dev->name, type >> 2, stype >> 4); |
495 | return -1; | 496 | return -1; |
496 | } | 497 | } |
497 | } | 498 | } |
@@ -719,8 +720,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, | |||
719 | goto rx_dropped; | 720 | goto rx_dropped; |
720 | 721 | ||
721 | fc = le16_to_cpu(hdr->frame_ctl); | 722 | fc = le16_to_cpu(hdr->frame_ctl); |
722 | type = HOSTAP_FC_GET_TYPE(fc); | 723 | type = WLAN_FC_GET_TYPE(fc); |
723 | stype = HOSTAP_FC_GET_STYPE(fc); | 724 | stype = WLAN_FC_GET_STYPE(fc); |
724 | sc = le16_to_cpu(hdr->seq_ctl); | 725 | sc = le16_to_cpu(hdr->seq_ctl); |
725 | frag = WLAN_GET_SEQ_FRAG(sc); | 726 | frag = WLAN_GET_SEQ_FRAG(sc); |
726 | hdrlen = hostap_80211_get_hdrlen(fc); | 727 | hdrlen = hostap_80211_get_hdrlen(fc); |
@@ -784,8 +785,9 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, | |||
784 | } | 785 | } |
785 | } | 786 | } |
786 | 787 | ||
787 | if (type != WLAN_FC_TYPE_DATA) { | 788 | if (type != IEEE80211_FTYPE_DATA) { |
788 | if (type == WLAN_FC_TYPE_MGMT && stype == WLAN_FC_STYPE_AUTH && | 789 | if (type == IEEE80211_FTYPE_MGMT && |
790 | stype == IEEE80211_STYPE_AUTH && | ||
789 | fc & WLAN_FC_ISWEP && local->host_decrypt && | 791 | fc & WLAN_FC_ISWEP && local->host_decrypt && |
790 | (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0) | 792 | (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0) |
791 | { | 793 | { |
@@ -867,14 +869,14 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, | |||
867 | 869 | ||
868 | /* Nullfunc frames may have PS-bit set, so they must be passed to | 870 | /* Nullfunc frames may have PS-bit set, so they must be passed to |
869 | * hostap_handle_sta_rx() before being dropped here. */ | 871 | * hostap_handle_sta_rx() before being dropped here. */ |
870 | if (stype != WLAN_FC_STYPE_DATA && | 872 | if (stype != IEEE80211_STYPE_DATA && |
871 | stype != WLAN_FC_STYPE_DATA_CFACK && | 873 | stype != IEEE80211_STYPE_DATA_CFACK && |
872 | stype != WLAN_FC_STYPE_DATA_CFPOLL && | 874 | stype != IEEE80211_STYPE_DATA_CFPOLL && |
873 | stype != WLAN_FC_STYPE_DATA_CFACKPOLL) { | 875 | stype != IEEE80211_STYPE_DATA_CFACKPOLL) { |
874 | if (stype != WLAN_FC_STYPE_NULLFUNC) | 876 | if (stype != IEEE80211_STYPE_NULLFUNC) |
875 | printk(KERN_DEBUG "%s: RX: dropped data frame " | 877 | printk(KERN_DEBUG "%s: RX: dropped data frame " |
876 | "with no data (type=0x%02x, subtype=0x%02x)\n", | 878 | "with no data (type=0x%02x, subtype=0x%02x)\n", |
877 | dev->name, type, stype); | 879 | dev->name, type >> 2, stype >> 4); |
878 | goto rx_dropped; | 880 | goto rx_dropped; |
879 | } | 881 | } |
880 | 882 | ||