diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-10-21 06:40:02 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-10-31 19:00:23 -0400 |
commit | e6a9854b05c1a6af1308fe2b8c68f35abf28a3ee (patch) | |
tree | 241f611f8194586ccabf61bacb060508773b9d05 /drivers/net/wireless/rt2x00/rt2x00dev.c | |
parent | cb121bad67a32cde37adc2729b7e18aa4fd3063e (diff) |
mac80211/drivers: rewrite the rate control API
So after the previous changes we were still unhappy with how
convoluted the API is and decided to make things simpler for
everybody. This completely changes the rate control API, now
taking into account 802.11n with MCS rates and more control,
most drivers don't support that though.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes@sipsolutions.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.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 697806cf94e2..e1feab8b6b02 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -498,7 +498,9 @@ void rt2x00lib_txdone(struct queue_entry *entry, | |||
498 | { | 498 | { |
499 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 499 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
500 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); | 500 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); |
501 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); | ||
501 | enum data_queue_qid qid = skb_get_queue_mapping(entry->skb); | 502 | enum data_queue_qid qid = skb_get_queue_mapping(entry->skb); |
503 | u8 rate_idx, rate_flags; | ||
502 | 504 | ||
503 | /* | 505 | /* |
504 | * Unmap the skb. | 506 | * Unmap the skb. |
@@ -528,14 +530,18 @@ void rt2x00lib_txdone(struct queue_entry *entry, | |||
528 | rt2x00dev->link.qual.tx_failed += | 530 | rt2x00dev->link.qual.tx_failed += |
529 | test_bit(TXDONE_FAILURE, &txdesc->flags); | 531 | test_bit(TXDONE_FAILURE, &txdesc->flags); |
530 | 532 | ||
533 | rate_idx = skbdesc->tx_rate_idx; | ||
534 | rate_flags = skbdesc->tx_rate_flags; | ||
535 | |||
531 | /* | 536 | /* |
532 | * Initialize TX status | 537 | * Initialize TX status |
533 | */ | 538 | */ |
534 | memset(&tx_info->status, 0, sizeof(tx_info->status)); | 539 | memset(&tx_info->status, 0, sizeof(tx_info->status)); |
535 | tx_info->status.ack_signal = 0; | 540 | tx_info->status.ack_signal = 0; |
536 | tx_info->status.excessive_retries = | 541 | tx_info->status.rates[0].idx = rate_idx; |
537 | test_bit(TXDONE_EXCESSIVE_RETRY, &txdesc->flags); | 542 | tx_info->status.rates[0].flags = rate_flags; |
538 | tx_info->status.retry_count = txdesc->retry; | 543 | tx_info->status.rates[0].count = txdesc->retry + 1; |
544 | tx_info->status.rates[1].idx = -1; /* terminate */ | ||
539 | 545 | ||
540 | if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) { | 546 | if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) { |
541 | if (test_bit(TXDONE_SUCCESS, &txdesc->flags)) | 547 | if (test_bit(TXDONE_SUCCESS, &txdesc->flags)) |
@@ -544,7 +550,7 @@ void rt2x00lib_txdone(struct queue_entry *entry, | |||
544 | rt2x00dev->low_level_stats.dot11ACKFailureCount++; | 550 | rt2x00dev->low_level_stats.dot11ACKFailureCount++; |
545 | } | 551 | } |
546 | 552 | ||
547 | if (tx_info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) { | 553 | if (rate_flags & IEEE80211_TX_RC_USE_RTS_CTS) { |
548 | if (test_bit(TXDONE_SUCCESS, &txdesc->flags)) | 554 | if (test_bit(TXDONE_SUCCESS, &txdesc->flags)) |
549 | rt2x00dev->low_level_stats.dot11RTSSuccessCount++; | 555 | rt2x00dev->low_level_stats.dot11RTSSuccessCount++; |
550 | else if (test_bit(TXDONE_FAILURE, &txdesc->flags)) | 556 | else if (test_bit(TXDONE_FAILURE, &txdesc->flags)) |