Skip to content

Commit

Permalink
ath9k: add duration field to ath_tx_status
Browse files Browse the repository at this point in the history
Add duration field to ath_tx_status in order to report frame duration for each
entry in multi-retry chain. These fields will be used in ACK timeout estimation
algorithm (dynack)

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Lorenzo Bianconi authored and John W. Linville committed Sep 16, 2014
1 parent 8e15e09 commit 36678b2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/net/wireless/ath/ath9k/ar9002_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,13 @@ static int ar9002_hw_proc_txdesc(struct ath_hw *ah, void *ds,
ts->evm1 = ads->AR_TxEVM1;
ts->evm2 = ads->AR_TxEVM2;

status = ACCESS_ONCE(ads->ds_ctl4);
ts->duration[0] = MS(status, AR_PacketDur0);
ts->duration[1] = MS(status, AR_PacketDur1);
status = ACCESS_ONCE(ads->ds_ctl5);
ts->duration[2] = MS(status, AR_PacketDur2);
ts->duration[3] = MS(status, AR_PacketDur3);

return 0;
}

Expand Down
9 changes: 9 additions & 0 deletions drivers/net/wireless/ath/ath9k/ar9003_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,11 @@ static int ar9003_hw_proc_txdesc(struct ath_hw *ah, void *ds,
struct ath_tx_status *ts)
{
struct ar9003_txs *ads;
struct ar9003_txc *adc;
u32 status;

ads = &ah->ts_ring[ah->ts_tail];
adc = (struct ar9003_txc *)ads;

status = ACCESS_ONCE(ads->status8);
if ((status & AR_TxDone) == 0)
Expand Down Expand Up @@ -426,6 +428,13 @@ static int ar9003_hw_proc_txdesc(struct ath_hw *ah, void *ds,
ts->ts_rssi_ext1 = MS(status, AR_TxRSSIAnt11);
ts->ts_rssi_ext2 = MS(status, AR_TxRSSIAnt12);

status = ACCESS_ONCE(adc->ctl15);
ts->duration[0] = MS(status, AR_PacketDur0);
ts->duration[1] = MS(status, AR_PacketDur1);
status = ACCESS_ONCE(adc->ctl16);
ts->duration[2] = MS(status, AR_PacketDur2);
ts->duration[3] = MS(status, AR_PacketDur3);

memset(ads, 0, sizeof(*ads));

return 0;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath9k/mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ struct ath_tx_status {
u32 evm0;
u32 evm1;
u32 evm2;
u32 duration[4];
};

struct ath_rx_status {
Expand Down

0 comments on commit 36678b2

Please sign in to comment.