Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193757
b: refs/heads/master
c: bf18723
h: refs/heads/master
i:
  193755: 4cd5773
v: v3
  • Loading branch information
Alban Browaeys authored and John W. Linville committed Mar 16, 2010
1 parent a4150be commit 5dc8282
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 632dd959d13d7b96b8eeb2af77b4511053c04633
refs/heads/master: bf18723d50206a0b485e438f14c22faf91a3908f
40 changes: 25 additions & 15 deletions trunk/drivers/net/wireless/rt2x00/rt2800pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -974,26 +974,36 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev)
* Obtain the status about this packet.
*/
txdesc.flags = 0;
if (rt2x00_get_field32(reg, TX_STA_FIFO_TX_SUCCESS))
__set_bit(TXDONE_SUCCESS, &txdesc.flags);
else
__set_bit(TXDONE_FAILURE, &txdesc.flags);
rt2x00_desc_read(txwi, 0, &word);
mcs = rt2x00_get_field32(word, TXWI_W0_MCS);
real_mcs = rt2x00_get_field32(reg, TX_STA_FIFO_MCS);

/*
* Ralink has a retry mechanism using a global fallback
* table. We setup this fallback table to try immediate
* lower rate for all rates. In the TX_STA_FIFO,
* the MCS field contains the MCS used for the successfull
* transmission. If the first transmission succeed,
* we have mcs == tx_mcs. On the second transmission,
* we have mcs = tx_mcs - 1. So the number of
* retry is (tx_mcs - mcs).
* table. We setup this fallback table to try the immediate
* lower rate for all rates. In the TX_STA_FIFO, the MCS field
* always contains the MCS used for the last transmission, be
* it successful or not.
*/
rt2x00_desc_read(txwi, 0, &word);
mcs = rt2x00_get_field32(word, TXWI_W0_MCS);
real_mcs = rt2x00_get_field32(reg, TX_STA_FIFO_MCS);
if (rt2x00_get_field32(reg, TX_STA_FIFO_TX_SUCCESS)) {
/*
* Transmission succeeded. The number of retries is
* mcs - real_mcs
*/
__set_bit(TXDONE_SUCCESS, &txdesc.flags);
txdesc.retry = ((mcs > real_mcs) ? mcs - real_mcs : 0);
} else {
/*
* Transmission failed. The number of retries is
* always 7 in this case (for a total number of 8
* frames sent).
*/
__set_bit(TXDONE_FAILURE, &txdesc.flags);
txdesc.retry = 7;
}

__set_bit(TXDONE_FALLBACK, &txdesc.flags);
txdesc.retry = mcs - min(mcs, real_mcs);


rt2x00lib_txdone(entry, &txdesc);
}
Expand Down

0 comments on commit 5dc8282

Please sign in to comment.