Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wireless: unify QoS control field definitions

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>

authored by

Johannes Berg and committed by
John W. Linville
04b7dcf9 e913d468

+17 -15
+1 -1
drivers/net/wireless/ath/carl9170/rx.c
··· 472 472 u8 *qc = ieee80211_get_qos_ctl(hdr); 473 473 reserved += NET_IP_ALIGN; 474 474 475 - if (*qc & IEEE80211_QOS_CONTROL_A_MSDU_PRESENT) 475 + if (*qc & IEEE80211_QOS_CTL_A_MSDU_PRESENT) 476 476 reserved += NET_IP_ALIGN; 477 477 } 478 478
+1 -1
drivers/net/wireless/libertas_tf/main.c
··· 585 585 need_padding ^= ieee80211_has_a4(hdr->frame_control); 586 586 need_padding ^= ieee80211_is_data_qos(hdr->frame_control) && 587 587 (*ieee80211_get_qos_ctl(hdr) & 588 - IEEE80211_QOS_CONTROL_A_MSDU_PRESENT); 588 + IEEE80211_QOS_CTL_A_MSDU_PRESENT); 589 589 590 590 if (need_padding) { 591 591 memmove(skb->data + 2, skb->data, skb->len);
+13 -5
include/linux/ieee80211.h
··· 117 117 #define IEEE80211_MAX_MESH_ID_LEN 32 118 118 119 119 #define IEEE80211_QOS_CTL_LEN 2 120 - #define IEEE80211_QOS_CTL_TID_MASK 0x000F 121 - #define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 120 + /* 1d tag mask */ 121 + #define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 122 + /* TID mask */ 123 + #define IEEE80211_QOS_CTL_TID_MASK 0x000f 124 + /* EOSP */ 125 + #define IEEE80211_QOS_CTL_EOSP 0x0010 126 + /* ACK policy */ 127 + #define IEEE80211_QOS_CTL_ACK_POLICY_NORMAL 0x0000 128 + #define IEEE80211_QOS_CTL_ACK_POLICY_NOACK 0x0020 129 + #define IEEE80211_QOS_CTL_ACK_POLICY_NO_EXPL 0x0040 130 + #define IEEE80211_QOS_CTL_ACK_POLICY_BLOCKACK 0x0060 131 + /* A-MSDU 802.11n */ 132 + #define IEEE80211_QOS_CTL_A_MSDU_PRESENT 0x0080 122 133 123 134 /* U-APSD queue for WMM IEs sent by AP */ 124 135 #define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7) ··· 1433 1422 WLAN_ACTION_SA_QUERY_RESPONSE = 1, 1434 1423 }; 1435 1424 1436 - 1437 - /* A-MSDU 802.11n */ 1438 - #define IEEE80211_QOS_CONTROL_A_MSDU_PRESENT 0x0080 1439 1425 1440 1426 /* cipher suite selectors */ 1441 1427 #define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00
+1 -1
net/mac80211/rx.c
··· 338 338 u8 *qc = ieee80211_get_qos_ctl(hdr); 339 339 /* frame has qos control */ 340 340 tid = *qc & IEEE80211_QOS_CTL_TID_MASK; 341 - if (*qc & IEEE80211_QOS_CONTROL_A_MSDU_PRESENT) 341 + if (*qc & IEEE80211_QOS_CTL_A_MSDU_PRESENT) 342 342 status->rx_flags |= IEEE80211_RX_AMSDU; 343 343 } else { 344 344 /*
+1 -2
net/mac80211/wme.c
··· 151 151 tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; 152 152 153 153 if (unlikely(local->wifi_wme_noack_test)) 154 - ack_policy |= QOS_CONTROL_ACK_POLICY_NOACK << 155 - QOS_CONTROL_ACK_POLICY_SHIFT; 154 + ack_policy |= IEEE80211_QOS_CTL_ACK_POLICY_NOACK; 156 155 /* qos header is 2 bytes, second reserved */ 157 156 *p++ = ack_policy | tid; 158 157 *p = 0;
-5
net/mac80211/wme.h
··· 13 13 #include <linux/netdevice.h> 14 14 #include "ieee80211_i.h" 15 15 16 - #define QOS_CONTROL_ACK_POLICY_NORMAL 0 17 - #define QOS_CONTROL_ACK_POLICY_NOACK 1 18 - 19 - #define QOS_CONTROL_ACK_POLICY_SHIFT 5 20 - 21 16 extern const int ieee802_1d_to_ac[8]; 22 17 23 18 u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,