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>
This commit is contained in:

committed by
John W. Linville

parent
cb121bad67
commit
e6a9854b05
@@ -498,7 +498,9 @@ void rt2x00lib_txdone(struct queue_entry *entry,
|
||||
{
|
||||
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
|
||||
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb);
|
||||
struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
|
||||
enum data_queue_qid qid = skb_get_queue_mapping(entry->skb);
|
||||
u8 rate_idx, rate_flags;
|
||||
|
||||
/*
|
||||
* Unmap the skb.
|
||||
@@ -528,14 +530,18 @@ void rt2x00lib_txdone(struct queue_entry *entry,
|
||||
rt2x00dev->link.qual.tx_failed +=
|
||||
test_bit(TXDONE_FAILURE, &txdesc->flags);
|
||||
|
||||
rate_idx = skbdesc->tx_rate_idx;
|
||||
rate_flags = skbdesc->tx_rate_flags;
|
||||
|
||||
/*
|
||||
* Initialize TX status
|
||||
*/
|
||||
memset(&tx_info->status, 0, sizeof(tx_info->status));
|
||||
tx_info->status.ack_signal = 0;
|
||||
tx_info->status.excessive_retries =
|
||||
test_bit(TXDONE_EXCESSIVE_RETRY, &txdesc->flags);
|
||||
tx_info->status.retry_count = txdesc->retry;
|
||||
tx_info->status.rates[0].idx = rate_idx;
|
||||
tx_info->status.rates[0].flags = rate_flags;
|
||||
tx_info->status.rates[0].count = txdesc->retry + 1;
|
||||
tx_info->status.rates[1].idx = -1; /* terminate */
|
||||
|
||||
if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) {
|
||||
if (test_bit(TXDONE_SUCCESS, &txdesc->flags))
|
||||
@@ -544,7 +550,7 @@ void rt2x00lib_txdone(struct queue_entry *entry,
|
||||
rt2x00dev->low_level_stats.dot11ACKFailureCount++;
|
||||
}
|
||||
|
||||
if (tx_info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) {
|
||||
if (rate_flags & IEEE80211_TX_RC_USE_RTS_CTS) {
|
||||
if (test_bit(TXDONE_SUCCESS, &txdesc->flags))
|
||||
rt2x00dev->low_level_stats.dot11RTSSuccessCount++;
|
||||
else if (test_bit(TXDONE_FAILURE, &txdesc->flags))
|
||||
|
Reference in New Issue
Block a user