aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00dev.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-05-15 06:55:29 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-21 21:48:11 -0400
commite039fa4a4195ac4ee895e6f3d1334beed63256fe (patch)
treecfd0762d73df96b73052378be7b157c4ac6e7035 /drivers/net/wireless/rt2x00/rt2x00dev.c
parente24549485f859be6518929bb1c9c0257d79f033d (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 'drivers/net/wireless/rt2x00/rt2x00dev.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c49
1 files changed, 23 insertions, 26 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index d341764e1b24..69e233610c94 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -415,7 +415,6 @@ static void rt2x00lib_intf_scheduled_iter(void *data, u8 *mac,
415 struct rt2x00_dev *rt2x00dev = data; 415 struct rt2x00_dev *rt2x00dev = data;
416 struct rt2x00_intf *intf = vif_to_intf(vif); 416 struct rt2x00_intf *intf = vif_to_intf(vif);
417 struct sk_buff *skb; 417 struct sk_buff *skb;
418 struct ieee80211_tx_control control;
419 struct ieee80211_bss_conf conf; 418 struct ieee80211_bss_conf conf;
420 int delayed_flags; 419 int delayed_flags;
421 420
@@ -433,9 +432,9 @@ static void rt2x00lib_intf_scheduled_iter(void *data, u8 *mac,
433 spin_unlock(&intf->lock); 432 spin_unlock(&intf->lock);
434 433
435 if (delayed_flags & DELAYED_UPDATE_BEACON) { 434 if (delayed_flags & DELAYED_UPDATE_BEACON) {
436 skb = ieee80211_beacon_get(rt2x00dev->hw, vif, &control); 435 skb = ieee80211_beacon_get(rt2x00dev->hw, vif);
437 if (skb && rt2x00dev->ops->hw->beacon_update(rt2x00dev->hw, 436 if (skb &&
438 skb, &control)) 437 rt2x00dev->ops->hw->beacon_update(rt2x00dev->hw, skb))
439 dev_kfree_skb(skb); 438 dev_kfree_skb(skb);
440 } 439 }
441 440
@@ -494,8 +493,13 @@ void rt2x00lib_txdone(struct queue_entry *entry,
494 struct txdone_entry_desc *txdesc) 493 struct txdone_entry_desc *txdesc)
495{ 494{
496 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; 495 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
497 struct skb_frame_desc *skbdesc; 496 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb);
498 struct ieee80211_tx_status tx_status; 497
498 /*
499 * Send frame to debugfs immediately, after this call is completed
500 * we are going to overwrite the skb->cb array.
501 */
502 rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_TXDONE, entry->skb);
499 503
500 /* 504 /*
501 * Update TX statistics. 505 * Update TX statistics.
@@ -508,21 +512,20 @@ void rt2x00lib_txdone(struct queue_entry *entry,
508 /* 512 /*
509 * Initialize TX status 513 * Initialize TX status
510 */ 514 */
511 tx_status.flags = 0; 515 memset(&tx_info->status, 0, sizeof(tx_info->status));
512 tx_status.ack_signal = 0; 516 tx_info->status.ack_signal = 0;
513 tx_status.excessive_retries = 517 tx_info->status.excessive_retries =
514 test_bit(TXDONE_EXCESSIVE_RETRY, &txdesc->flags); 518 test_bit(TXDONE_EXCESSIVE_RETRY, &txdesc->flags);
515 tx_status.retry_count = txdesc->retry; 519 tx_info->status.retry_count = txdesc->retry;
516 memcpy(&tx_status.control, txdesc->control, sizeof(*txdesc->control));
517 520
518 if (!(tx_status.control.flags & IEEE80211_TXCTL_NO_ACK)) { 521 if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) {
519 if (test_bit(TXDONE_SUCCESS, &txdesc->flags)) 522 if (test_bit(TXDONE_SUCCESS, &txdesc->flags))
520 tx_status.flags |= IEEE80211_TX_STATUS_ACK; 523 tx_info->flags |= IEEE80211_TX_STAT_ACK;
521 else if (test_bit(TXDONE_FAILURE, &txdesc->flags)) 524 else if (test_bit(TXDONE_FAILURE, &txdesc->flags))
522 rt2x00dev->low_level_stats.dot11ACKFailureCount++; 525 rt2x00dev->low_level_stats.dot11ACKFailureCount++;
523 } 526 }
524 527
525 if (tx_status.control.flags & IEEE80211_TXCTL_USE_RTS_CTS) { 528 if (tx_info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) {
526 if (test_bit(TXDONE_SUCCESS, &txdesc->flags)) 529 if (test_bit(TXDONE_SUCCESS, &txdesc->flags))
527 rt2x00dev->low_level_stats.dot11RTSSuccessCount++; 530 rt2x00dev->low_level_stats.dot11RTSSuccessCount++;
528 else if (test_bit(TXDONE_FAILURE, &txdesc->flags)) 531 else if (test_bit(TXDONE_FAILURE, &txdesc->flags))
@@ -530,19 +533,13 @@ void rt2x00lib_txdone(struct queue_entry *entry,
530 } 533 }
531 534
532 /* 535 /*
533 * Send the tx_status to debugfs. Only send the status report 536 * Only send the status report to mac80211 when TX status was
534 * to mac80211 when the frame originated from there. If this was 537 * requested by it. If this was a extra frame coming through
535 * a extra frame coming through a mac80211 library call (RTS/CTS) 538 * a mac80211 library call (RTS/CTS) then we should not send the
536 * then we should not send the status report back. 539 * status report back.
537 * If send to mac80211, mac80211 will clean up the skb structure,
538 * otherwise we have to do it ourself.
539 */ 540 */
540 rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_TXDONE, entry->skb); 541 if (tx_info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS)
541 542 ieee80211_tx_status_irqsafe(rt2x00dev->hw, entry->skb);
542 skbdesc = get_skb_frame_desc(entry->skb);
543 if (!(skbdesc->flags & FRAME_DESC_DRIVER_GENERATED))
544 ieee80211_tx_status_irqsafe(rt2x00dev->hw,
545 entry->skb, &tx_status);
546 else 543 else
547 dev_kfree_skb_irq(entry->skb); 544 dev_kfree_skb_irq(entry->skb);
548 entry->skb = NULL; 545 entry->skb = NULL;