wireless: unify QoS control field definitions
authorJohannes Berg <johannes.berg@intel.com>
Wed, 22 Jun 2011 08:06:59 +0000 (10:06 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 27 Jun 2011 19:09:39 +0000 (15:09 -0400)
Move all that mac80211 has into the generic
ieee80211.h header file and use them. At the
same time move them from mask+shift to just
bits and rename them for consistent names.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/carl9170/rx.c
drivers/net/wireless/libertas_tf/main.c
include/linux/ieee80211.h
net/mac80211/rx.c
net/mac80211/wme.c
net/mac80211/wme.h

index ec21ea9fd8d5c9a9cd4ad644d33f5c1e40b74517..dc99030ea8b67f07c1d28b7e1b8d3c6b8f564a14 100644 (file)
@@ -472,7 +472,7 @@ static struct sk_buff *carl9170_rx_copy_data(u8 *buf, int len)
                u8 *qc = ieee80211_get_qos_ctl(hdr);
                reserved += NET_IP_ALIGN;
 
-               if (*qc & IEEE80211_QOS_CONTROL_A_MSDU_PRESENT)
+               if (*qc & IEEE80211_QOS_CTL_A_MSDU_PRESENT)
                        reserved += NET_IP_ALIGN;
        }
 
index d4005081f1dfde09bd2845f4cf85a9d712dd25e1..2aa4de7cad24c6cffa0595f41cb80b0f4ca743ba 100644 (file)
@@ -585,7 +585,7 @@ int lbtf_rx(struct lbtf_private *priv, struct sk_buff *skb)
        need_padding ^= ieee80211_has_a4(hdr->frame_control);
        need_padding ^= ieee80211_is_data_qos(hdr->frame_control) &&
                        (*ieee80211_get_qos_ctl(hdr) &
-                        IEEE80211_QOS_CONTROL_A_MSDU_PRESENT);
+                        IEEE80211_QOS_CTL_A_MSDU_PRESENT);
 
        if (need_padding) {
                memmove(skb->data + 2, skb->data, skb->len);
index bf56b6f78270e6a60a63e4870295006a07ca23d8..a26108e4d924dbcc34405c8cf49bc11a9b3871fb 100644 (file)
 #define IEEE80211_MAX_MESH_ID_LEN      32
 
 #define IEEE80211_QOS_CTL_LEN          2
-#define IEEE80211_QOS_CTL_TID_MASK     0x000F
-#define IEEE80211_QOS_CTL_TAG1D_MASK   0x0007
+/* 1d tag mask */
+#define IEEE80211_QOS_CTL_TAG1D_MASK           0x0007
+/* TID mask */
+#define IEEE80211_QOS_CTL_TID_MASK             0x000f
+/* EOSP */
+#define IEEE80211_QOS_CTL_EOSP                 0x0010
+/* ACK policy */
+#define IEEE80211_QOS_CTL_ACK_POLICY_NORMAL    0x0000
+#define IEEE80211_QOS_CTL_ACK_POLICY_NOACK     0x0020
+#define IEEE80211_QOS_CTL_ACK_POLICY_NO_EXPL   0x0040
+#define IEEE80211_QOS_CTL_ACK_POLICY_BLOCKACK  0x0060
+/* A-MSDU 802.11n */
+#define IEEE80211_QOS_CTL_A_MSDU_PRESENT       0x0080
 
 /* U-APSD queue for WMM IEs sent by AP */
 #define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD      (1<<7)
@@ -1423,9 +1434,6 @@ enum ieee80211_sa_query_action {
 };
 
 
-/* A-MSDU 802.11n */
-#define IEEE80211_QOS_CONTROL_A_MSDU_PRESENT 0x0080
-
 /* cipher suite selectors */
 #define WLAN_CIPHER_SUITE_USE_GROUP    0x000FAC00
 #define WLAN_CIPHER_SUITE_WEP40                0x000FAC01
index 7fa8c6be7bf02564cd5714033fbdb8761b30b03d..b5493ecd1e930036faaff8cbd0b36f52c41a42ef 100644 (file)
@@ -338,7 +338,7 @@ static void ieee80211_parse_qos(struct ieee80211_rx_data *rx)
                u8 *qc = ieee80211_get_qos_ctl(hdr);
                /* frame has qos control */
                tid = *qc & IEEE80211_QOS_CTL_TID_MASK;
-               if (*qc & IEEE80211_QOS_CONTROL_A_MSDU_PRESENT)
+               if (*qc & IEEE80211_QOS_CTL_A_MSDU_PRESENT)
                        status->rx_flags |= IEEE80211_RX_AMSDU;
        } else {
                /*
index 28bc084dbfb95ecc5a91fbc81800e200b63550bd..7a49532f14cbff932fbfdbfaddc53abc0c974c17 100644 (file)
@@ -151,8 +151,7 @@ void ieee80211_set_qos_hdr(struct ieee80211_local *local, struct sk_buff *skb)
                tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
 
                if (unlikely(local->wifi_wme_noack_test))
-                       ack_policy |= QOS_CONTROL_ACK_POLICY_NOACK <<
-                                       QOS_CONTROL_ACK_POLICY_SHIFT;
+                       ack_policy |= IEEE80211_QOS_CTL_ACK_POLICY_NOACK;
                /* qos header is 2 bytes, second reserved */
                *p++ = ack_policy | tid;
                *p = 0;
index 6053b1c9feee161da93c056f611a9046028da85c..faead6d0202659877f8b86c427805b5becb54999 100644 (file)
 #include <linux/netdevice.h>
 #include "ieee80211_i.h"
 
-#define QOS_CONTROL_ACK_POLICY_NORMAL 0
-#define QOS_CONTROL_ACK_POLICY_NOACK 1
-
-#define QOS_CONTROL_ACK_POLICY_SHIFT 5
-
 extern const int ieee802_1d_to_ac[8];
 
 u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,