aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/wme.c
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-06-11 17:21:59 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-14 12:18:13 -0400
commit002aaf4ea6be3247c246d274979359c3bc93c82a (patch)
tree5697b85a40fda48b062fd0fd3a87239fd4447d57 /net/mac80211/wme.c
parenta494bb1cae40dd0a98682826d91ddf533cbc864e (diff)
mac80211: wme.c use new helpers
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/wme.c')
-rw-r--r--net/mac80211/wme.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index 14a9ff10a1e9..d8c2f9688b25 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -105,11 +105,8 @@ static int classify80211(struct sk_buff *skb, struct Qdisc *qd)
105{ 105{
106 struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); 106 struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr);
107 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 107 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
108 unsigned short fc = le16_to_cpu(hdr->frame_control);
109 int qos;
110 108
111 /* see if frame is data or non data frame */ 109 if (!ieee80211_is_data(hdr->frame_control)) {
112 if (unlikely((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA)) {
113 /* management frames go on AC_VO queue, but are sent 110 /* management frames go on AC_VO queue, but are sent
114 * without QoS control fields */ 111 * without QoS control fields */
115 return 0; 112 return 0;
@@ -119,10 +116,7 @@ static int classify80211(struct sk_buff *skb, struct Qdisc *qd)
119 /* use AC from radiotap */ 116 /* use AC from radiotap */
120 } 117 }
121 118
122 /* is this a QoS frame? */ 119 if (!ieee80211_is_data_qos(hdr->frame_control)) {
123 qos = fc & IEEE80211_STYPE_QOS_DATA;
124
125 if (!qos) {
126 skb->priority = 0; /* required for correct WPA/11i MIC */ 120 skb->priority = 0; /* required for correct WPA/11i MIC */
127 return ieee802_1d_to_ac[skb->priority]; 121 return ieee802_1d_to_ac[skb->priority];
128 } 122 }
@@ -151,7 +145,6 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd)
151 struct ieee80211_sched_data *q = qdisc_priv(qd); 145 struct ieee80211_sched_data *q = qdisc_priv(qd);
152 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 146 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
153 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 147 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
154 unsigned short fc = le16_to_cpu(hdr->frame_control);
155 struct Qdisc *qdisc; 148 struct Qdisc *qdisc;
156 struct sta_info *sta; 149 struct sta_info *sta;
157 int err, queue; 150 int err, queue;
@@ -185,16 +178,15 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd)
185 178
186 /* now we know the 1d priority, fill in the QoS header if there is one 179 /* now we know the 1d priority, fill in the QoS header if there is one
187 */ 180 */
188 if (WLAN_FC_IS_QOS_DATA(fc)) { 181 if (ieee80211_is_data_qos(hdr->frame_control)) {
189 u8 *p = skb->data + ieee80211_get_hdrlen(fc) - 2; 182 u8 *p = ieee80211_get_qos_ctl(hdr);
190 u8 ack_policy = 0; 183 u8 ack_policy = 0;
191 tid = skb->priority & QOS_CONTROL_TAG1D_MASK; 184 tid = skb->priority & QOS_CONTROL_TAG1D_MASK;
192 if (local->wifi_wme_noack_test) 185 if (local->wifi_wme_noack_test)
193 ack_policy |= QOS_CONTROL_ACK_POLICY_NOACK << 186 ack_policy |= QOS_CONTROL_ACK_POLICY_NOACK <<
194 QOS_CONTROL_ACK_POLICY_SHIFT; 187 QOS_CONTROL_ACK_POLICY_SHIFT;
195 /* qos header is 2 bytes, second reserved */ 188 /* qos header is 2 bytes, second reserved */
196 *p = ack_policy | tid; 189 *p++ = ack_policy | tid;
197 p++;
198 *p = 0; 190 *p = 0;
199 191
200 rcu_read_lock(); 192 rcu_read_lock();