summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath9k/ar9002_mac.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-09-30 11:24:23 +0200
committerJohn W. Linville <linville@tuxdriver.com>2014-09-30 13:17:48 -0400
commit315dd1149b6048cec805667f511726bbe8e5c975 (patch)
tree6bc8a44734b05bda1b501d820af8d3a675a9912b /drivers/net/wireless/ath/ath9k/ar9002_mac.c
parent4d9f634b02e4240f86719f30e4c9e62f6a4c4d36 (diff)
ath9k: fix getting tx duration for dynack
On AR9003, tx control and tx status are in separate descriptor rings. Tx duration is extracted from the tx control descriptor data, which ar9003_hw_proc_txdesc cannot access. Fix getting the duration by adding a separate callback for it. Acked-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ar9002_mac.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9002_mac.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_mac.c b/drivers/net/wireless/ath/ath9k/ar9002_mac.c
index 669cb3747208..2a93519f4bdf 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_mac.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_mac.c
@@ -381,16 +381,27 @@ 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;
}
+static int ar9002_hw_get_duration(struct ath_hw *ah, const void *ds, int index)
+{
+ struct ar5416_desc *ads = AR5416DESC(ds);
+
+ switch (index) {
+ case 0:
+ return MS(ACCESS_ONCE(ads->ds_ctl4), AR_PacketDur0);
+ case 1:
+ return MS(ACCESS_ONCE(ads->ds_ctl4), AR_PacketDur1);
+ case 2:
+ return MS(ACCESS_ONCE(ads->ds_ctl5), AR_PacketDur2);
+ case 3:
+ return MS(ACCESS_ONCE(ads->ds_ctl5), AR_PacketDur3);
+ default:
+ return -1;
+ }
+}
+
void ath9k_hw_setuprxdesc(struct ath_hw *ah, struct ath_desc *ds,
u32 size, u32 flags)
{
@@ -413,4 +424,5 @@ void ar9002_hw_attach_mac_ops(struct ath_hw *ah)
ops->get_isr = ar9002_hw_get_isr;
ops->set_txdesc = ar9002_set_txdesc;
ops->proc_txdesc = ar9002_hw_proc_txdesc;
+ ops->get_duration = ar9002_hw_get_duration;
}