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>
This commit is contained in:
committed by
John W. Linville
parent
e24549485f
commit
e039fa4a41
@ -149,8 +149,7 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd)
|
||||
struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr);
|
||||
struct ieee80211_hw *hw = &local->hw;
|
||||
struct ieee80211_sched_data *q = qdisc_priv(qd);
|
||||
struct ieee80211_tx_packet_data *pkt_data =
|
||||
(struct ieee80211_tx_packet_data *) skb->cb;
|
||||
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
||||
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
|
||||
unsigned short fc = le16_to_cpu(hdr->frame_control);
|
||||
struct Qdisc *qdisc;
|
||||
@ -158,8 +157,8 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd)
|
||||
int err, queue;
|
||||
u8 tid;
|
||||
|
||||
if (pkt_data->flags & IEEE80211_TXPD_REQUEUE) {
|
||||
queue = pkt_data->queue;
|
||||
if (info->flags & IEEE80211_TX_CTL_REQUEUE) {
|
||||
queue = info->queue;
|
||||
rcu_read_lock();
|
||||
sta = sta_info_get(local, hdr->addr1);
|
||||
tid = skb->priority & QOS_CONTROL_TAG1D_MASK;
|
||||
@ -168,9 +167,9 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd)
|
||||
if ((ampdu_queue < QD_NUM(hw)) &&
|
||||
test_bit(ampdu_queue, q->qdisc_pool)) {
|
||||
queue = ampdu_queue;
|
||||
pkt_data->flags |= IEEE80211_TXPD_AMPDU;
|
||||
info->flags |= IEEE80211_TX_CTL_AMPDU;
|
||||
} else {
|
||||
pkt_data->flags &= ~IEEE80211_TXPD_AMPDU;
|
||||
info->flags &= ~IEEE80211_TX_CTL_AMPDU;
|
||||
}
|
||||
}
|
||||
rcu_read_unlock();
|
||||
@ -206,9 +205,9 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd)
|
||||
if ((ampdu_queue < QD_NUM(hw)) &&
|
||||
test_bit(ampdu_queue, q->qdisc_pool)) {
|
||||
queue = ampdu_queue;
|
||||
pkt_data->flags |= IEEE80211_TXPD_AMPDU;
|
||||
info->flags |= IEEE80211_TX_CTL_AMPDU;
|
||||
} else {
|
||||
pkt_data->flags &= ~IEEE80211_TXPD_AMPDU;
|
||||
info->flags &= ~IEEE80211_TX_CTL_AMPDU;
|
||||
}
|
||||
}
|
||||
|
||||
@ -220,7 +219,7 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd)
|
||||
err = NET_XMIT_DROP;
|
||||
} else {
|
||||
tid = skb->priority & QOS_CONTROL_TAG1D_MASK;
|
||||
pkt_data->queue = (unsigned int) queue;
|
||||
info->queue = (unsigned int) queue;
|
||||
qdisc = q->queues[queue];
|
||||
err = qdisc->enqueue(skb, qdisc);
|
||||
if (err == NET_XMIT_SUCCESS) {
|
||||
@ -241,13 +240,12 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd)
|
||||
static int wme_qdiscop_requeue(struct sk_buff *skb, struct Qdisc* qd)
|
||||
{
|
||||
struct ieee80211_sched_data *q = qdisc_priv(qd);
|
||||
struct ieee80211_tx_packet_data *pkt_data =
|
||||
(struct ieee80211_tx_packet_data *) skb->cb;
|
||||
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
||||
struct Qdisc *qdisc;
|
||||
int err;
|
||||
|
||||
/* we recorded which queue to use earlier! */
|
||||
qdisc = q->queues[pkt_data->queue];
|
||||
qdisc = q->queues[info->queue];
|
||||
|
||||
if ((err = qdisc->ops->requeue(skb, qdisc)) == 0) {
|
||||
qd->q.qlen++;
|
||||
|
Reference in New Issue
Block a user