diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-05-15 06:55:29 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-21 21:48:11 -0400 |
commit | e039fa4a4195ac4ee895e6f3d1334beed63256fe (patch) | |
tree | cfd0762d73df96b73052378be7b157c4ac6e7035 /net/mac80211/wme.c | |
parent | e24549485f859be6518929bb1c9c0257d79f033d (diff) |
mac80211: move TX info into skb->cb
This patch converts mac80211 and all drivers to have transmit
information and status in skb->cb rather than allocating extra
memory for it and copying all the data around. To make it fit,
a union is used where only data that is necessary for all steps
is kept outside of the union.
A number of fixes were done by Ivo, as well as the rt2x00 part
of this patch.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/wme.c')
-rw-r--r-- | net/mac80211/wme.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index c87baf4ce979..477690f4dca7 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c | |||
@@ -149,8 +149,7 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd) | |||
149 | struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); | 149 | struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); |
150 | struct ieee80211_hw *hw = &local->hw; | 150 | struct ieee80211_hw *hw = &local->hw; |
151 | struct ieee80211_sched_data *q = qdisc_priv(qd); | 151 | struct ieee80211_sched_data *q = qdisc_priv(qd); |
152 | struct ieee80211_tx_packet_data *pkt_data = | 152 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
153 | (struct ieee80211_tx_packet_data *) skb->cb; | ||
154 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | 153 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; |
155 | unsigned short fc = le16_to_cpu(hdr->frame_control); | 154 | unsigned short fc = le16_to_cpu(hdr->frame_control); |
156 | struct Qdisc *qdisc; | 155 | struct Qdisc *qdisc; |
@@ -158,8 +157,8 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd) | |||
158 | int err, queue; | 157 | int err, queue; |
159 | u8 tid; | 158 | u8 tid; |
160 | 159 | ||
161 | if (pkt_data->flags & IEEE80211_TXPD_REQUEUE) { | 160 | if (info->flags & IEEE80211_TX_CTL_REQUEUE) { |
162 | queue = pkt_data->queue; | 161 | queue = info->queue; |
163 | rcu_read_lock(); | 162 | rcu_read_lock(); |
164 | sta = sta_info_get(local, hdr->addr1); | 163 | sta = sta_info_get(local, hdr->addr1); |
165 | tid = skb->priority & QOS_CONTROL_TAG1D_MASK; | 164 | tid = skb->priority & QOS_CONTROL_TAG1D_MASK; |
@@ -168,9 +167,9 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd) | |||
168 | if ((ampdu_queue < QD_NUM(hw)) && | 167 | if ((ampdu_queue < QD_NUM(hw)) && |
169 | test_bit(ampdu_queue, q->qdisc_pool)) { | 168 | test_bit(ampdu_queue, q->qdisc_pool)) { |
170 | queue = ampdu_queue; | 169 | queue = ampdu_queue; |
171 | pkt_data->flags |= IEEE80211_TXPD_AMPDU; | 170 | info->flags |= IEEE80211_TX_CTL_AMPDU; |
172 | } else { | 171 | } else { |
173 | pkt_data->flags &= ~IEEE80211_TXPD_AMPDU; | 172 | info->flags &= ~IEEE80211_TX_CTL_AMPDU; |
174 | } | 173 | } |
175 | } | 174 | } |
176 | rcu_read_unlock(); | 175 | rcu_read_unlock(); |
@@ -206,9 +205,9 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd) | |||
206 | if ((ampdu_queue < QD_NUM(hw)) && | 205 | if ((ampdu_queue < QD_NUM(hw)) && |
207 | test_bit(ampdu_queue, q->qdisc_pool)) { | 206 | test_bit(ampdu_queue, q->qdisc_pool)) { |
208 | queue = ampdu_queue; | 207 | queue = ampdu_queue; |
209 | pkt_data->flags |= IEEE80211_TXPD_AMPDU; | 208 | info->flags |= IEEE80211_TX_CTL_AMPDU; |
210 | } else { | 209 | } else { |
211 | pkt_data->flags &= ~IEEE80211_TXPD_AMPDU; | 210 | info->flags &= ~IEEE80211_TX_CTL_AMPDU; |
212 | } | 211 | } |
213 | } | 212 | } |
214 | 213 | ||
@@ -220,7 +219,7 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd) | |||
220 | err = NET_XMIT_DROP; | 219 | err = NET_XMIT_DROP; |
221 | } else { | 220 | } else { |
222 | tid = skb->priority & QOS_CONTROL_TAG1D_MASK; | 221 | tid = skb->priority & QOS_CONTROL_TAG1D_MASK; |
223 | pkt_data->queue = (unsigned int) queue; | 222 | info->queue = (unsigned int) queue; |
224 | qdisc = q->queues[queue]; | 223 | qdisc = q->queues[queue]; |
225 | err = qdisc->enqueue(skb, qdisc); | 224 | err = qdisc->enqueue(skb, qdisc); |
226 | if (err == NET_XMIT_SUCCESS) { | 225 | if (err == NET_XMIT_SUCCESS) { |
@@ -241,13 +240,12 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd) | |||
241 | static int wme_qdiscop_requeue(struct sk_buff *skb, struct Qdisc* qd) | 240 | static int wme_qdiscop_requeue(struct sk_buff *skb, struct Qdisc* qd) |
242 | { | 241 | { |
243 | struct ieee80211_sched_data *q = qdisc_priv(qd); | 242 | struct ieee80211_sched_data *q = qdisc_priv(qd); |
244 | struct ieee80211_tx_packet_data *pkt_data = | 243 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
245 | (struct ieee80211_tx_packet_data *) skb->cb; | ||
246 | struct Qdisc *qdisc; | 244 | struct Qdisc *qdisc; |
247 | int err; | 245 | int err; |
248 | 246 | ||
249 | /* we recorded which queue to use earlier! */ | 247 | /* we recorded which queue to use earlier! */ |
250 | qdisc = q->queues[pkt_data->queue]; | 248 | qdisc = q->queues[info->queue]; |
251 | 249 | ||
252 | if ((err = qdisc->ops->requeue(skb, qdisc)) == 0) { | 250 | if ((err = qdisc->ops->requeue(skb, qdisc)) == 0) { |
253 | qd->q.qlen++; | 251 | qd->q.qlen++; |