aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-07-02 14:05:34 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-07-08 14:15:59 -0400
commit238f74a227fd7de8ea1bc66dcbbd36cf9920d1cb (patch)
tree2174b8920ae81c82e7e382d1fc66e1609df11828 /net/mac80211/rx.c
parent994d31f7430c3639b73c6ee038bd437c926b1227 (diff)
mac80211: move QOS control helpers into ieee80211.h
Also remove the WLAN_IS_QOS_DATA inline after removing the last two users. This starts moving away from using rx->fc to using the header frame_control directly. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r--net/mac80211/rx.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 6a88e8f9bff0..a3a26e557274 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -321,20 +321,20 @@ ieee80211_rx_monitor(struct ieee80211_local *local, struct sk_buff *origskb,
321 321
322static void ieee80211_parse_qos(struct ieee80211_rx_data *rx) 322static void ieee80211_parse_qos(struct ieee80211_rx_data *rx)
323{ 323{
324 u8 *data = rx->skb->data; 324 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;
325 int tid; 325 int tid;
326 326
327 /* does the frame have a qos control field? */ 327 /* does the frame have a qos control field? */
328 if (WLAN_FC_IS_QOS_DATA(rx->fc)) { 328 if (ieee80211_is_data_qos(hdr->frame_control)) {
329 u8 *qc = data + ieee80211_get_hdrlen(rx->fc) - QOS_CONTROL_LEN; 329 u8 *qc = ieee80211_get_qos_ctl(hdr);
330 /* frame has qos control */ 330 /* frame has qos control */
331 tid = qc[0] & QOS_CONTROL_TID_MASK; 331 tid = *qc & IEEE80211_QOS_CTL_TID_MASK;
332 if (qc[0] & IEEE80211_QOS_CONTROL_A_MSDU_PRESENT) 332 if (*qc & IEEE80211_QOS_CONTROL_A_MSDU_PRESENT)
333 rx->flags |= IEEE80211_RX_AMSDU; 333 rx->flags |= IEEE80211_RX_AMSDU;
334 else 334 else
335 rx->flags &= ~IEEE80211_RX_AMSDU; 335 rx->flags &= ~IEEE80211_RX_AMSDU;
336 } else { 336 } else {
337 if (unlikely((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT)) { 337 if (unlikely(ieee80211_is_mgmt(hdr->frame_control))) {
338 /* Separate TID for management frames */ 338 /* Separate TID for management frames */
339 tid = NUM_RX_DATA_QUEUES - 1; 339 tid = NUM_RX_DATA_QUEUES - 1;
340 } else { 340 } else {
@@ -1037,19 +1037,19 @@ ieee80211_rx_h_ps_poll(struct ieee80211_rx_data *rx)
1037static ieee80211_rx_result debug_noinline 1037static ieee80211_rx_result debug_noinline
1038ieee80211_rx_h_remove_qos_control(struct ieee80211_rx_data *rx) 1038ieee80211_rx_h_remove_qos_control(struct ieee80211_rx_data *rx)
1039{ 1039{
1040 u16 fc = rx->fc;
1041 u8 *data = rx->skb->data; 1040 u8 *data = rx->skb->data;
1042 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) data; 1041 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)data;
1043 1042
1044 if (!WLAN_FC_IS_QOS_DATA(fc)) 1043 if (!ieee80211_is_data_qos(hdr->frame_control))
1045 return RX_CONTINUE; 1044 return RX_CONTINUE;
1046 1045
1047 /* remove the qos control field, update frame type and meta-data */ 1046 /* remove the qos control field, update frame type and meta-data */
1048 memmove(data + 2, data, ieee80211_get_hdrlen(fc) - 2); 1047 memmove(data + IEEE80211_QOS_CTL_LEN, data,
1049 hdr = (struct ieee80211_hdr *) skb_pull(rx->skb, 2); 1048 ieee80211_hdrlen(hdr->frame_control) - IEEE80211_QOS_CTL_LEN);
1049 hdr = (struct ieee80211_hdr *)skb_pull(rx->skb, IEEE80211_QOS_CTL_LEN);
1050 /* change frame type to non QOS */ 1050 /* change frame type to non QOS */
1051 rx->fc = fc &= ~IEEE80211_STYPE_QOS_DATA; 1051 rx->fc &= ~IEEE80211_STYPE_QOS_DATA;
1052 hdr->frame_control = cpu_to_le16(fc); 1052 hdr->frame_control &= ~cpu_to_le16(IEEE80211_STYPE_QOS_DATA);
1053 1053
1054 return RX_CONTINUE; 1054 return RX_CONTINUE;
1055} 1055}
@@ -2044,7 +2044,7 @@ static u8 ieee80211_rx_reorder_ampdu(struct ieee80211_local *local,
2044 if (!ieee80211_is_data_qos(hdr->frame_control)) 2044 if (!ieee80211_is_data_qos(hdr->frame_control))
2045 goto end_reorder; 2045 goto end_reorder;
2046 2046
2047 tid = *ieee80211_get_qos_ctl(hdr) & QOS_CONTROL_TID_MASK; 2047 tid = *ieee80211_get_qos_ctl(hdr) & IEEE80211_QOS_CTL_TID_MASK;
2048 2048
2049 if (sta->ampdu_mlme.tid_state_rx[tid] != HT_AGG_STATE_OPERATIONAL) 2049 if (sta->ampdu_mlme.tid_state_rx[tid] != HT_AGG_STATE_OPERATIONAL)
2050 goto end_reorder; 2050 goto end_reorder;