aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/wme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-05-02 18:44:09 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-07 15:15:00 -0400
commit5c5e12898af0978a780991950be12d0d73c02f04 (patch)
treebb4c321ea741e4dae2bd87e3c75176110a8819ac /net/mac80211/wme.c
parent3df5ee60f1ee559b1417397461891f8b483e8089 (diff)
mac80211: fix wme code
In commit e100bb64bf7cdeae7f742a65ee1985649a7fd1b4 (mac80211: QoS related cleanups) I accidentally changed a variable from int to u16 causing a warning that a comparison for < 0 was always false. John thought this was a missing deletion of code and removed the warning by deleting the never executed branch of code in commit 3df5ee60f1ee559b1417397461891f8b483e8089 (wireless: fix warning introduced by "mac80211: QoS related cleanups") but the problem really was my mistake of using a u16 variable for the queue variable when that variable can also contain an error code. This patch restores the original code and variable type. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/wme.c')
-rw-r--r--net/mac80211/wme.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index b1e20ca03ffe..8ffff27fe000 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -155,8 +155,7 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd)
155 unsigned short fc = le16_to_cpu(hdr->frame_control); 155 unsigned short fc = le16_to_cpu(hdr->frame_control);
156 struct Qdisc *qdisc; 156 struct Qdisc *qdisc;
157 struct sta_info *sta; 157 struct sta_info *sta;
158 int err; 158 int err, queue;
159 u16 queue;
160 u8 tid; 159 u8 tid;
161 160
162 if (pkt_data->flags & IEEE80211_TXPD_REQUEUE) { 161 if (pkt_data->flags & IEEE80211_TXPD_REQUEUE) {
@@ -216,15 +215,20 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd)
216 rcu_read_unlock(); 215 rcu_read_unlock();
217 } 216 }
218 217
219 tid = skb->priority & QOS_CONTROL_TAG1D_MASK; 218 if (unlikely(queue < 0)) {
220 pkt_data->queue = (unsigned int) queue; 219 kfree_skb(skb);
221 qdisc = q->queues[queue]; 220 err = NET_XMIT_DROP;
222 err = qdisc->enqueue(skb, qdisc); 221 } else {
223 if (err == NET_XMIT_SUCCESS) { 222 tid = skb->priority & QOS_CONTROL_TAG1D_MASK;
224 qd->q.qlen++; 223 pkt_data->queue = (unsigned int) queue;
225 qd->bstats.bytes += skb->len; 224 qdisc = q->queues[queue];
226 qd->bstats.packets++; 225 err = qdisc->enqueue(skb, qdisc);
227 return NET_XMIT_SUCCESS; 226 if (err == NET_XMIT_SUCCESS) {
227 qd->q.qlen++;
228 qd->bstats.bytes += skb->len;
229 qd->bstats.packets++;
230 return NET_XMIT_SUCCESS;
231 }
228 } 232 }
229 qd->qstats.drops++; 233 qd->qstats.drops++;
230 return err; 234 return err;