Return-path: Received: from mail-wg0-f44.google.com ([74.125.82.44]:33389 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753239AbaGMKS3 (ORCPT ); Sun, 13 Jul 2014 06:18:29 -0400 Received: by mail-wg0-f44.google.com with SMTP id m15so2850294wgh.3 for ; Sun, 13 Jul 2014 03:18:28 -0700 (PDT) From: Lorenzo Bianconi To: ath9k-devel@lists.ath9k.org Cc: linux-wireless@vger.kernel.org, Philippe Duchein Subject: [RFCv2 02/10] ath9k: add duration field to ath_tx_status Date: Sun, 13 Jul 2014 12:18:16 +0200 Message-Id: <1405246704-7489-3-git-send-email-lorenzo.bianconi83@gmail.com> (sfid-20140713_121836_148960_DFA71A0A) In-Reply-To: <1405246704-7489-1-git-send-email-lorenzo.bianconi83@gmail.com> References: <1405246704-7489-1-git-send-email-lorenzo.bianconi83@gmail.com> Sender: linux-wireless-owner@vger.kernel.org List-ID: 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 dynamic ack timeout processing Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/ath/ath9k/ar9002_mac.c | 7 +++++++ drivers/net/wireless/ath/ath9k/ar9003_mac.c | 9 +++++++++ drivers/net/wireless/ath/ath9k/mac.h | 1 + 3 files changed, 17 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/ar9002_mac.c b/drivers/net/wireless/ath/ath9k/ar9002_mac.c index 741b38d..b1d8d0e 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_mac.c +++ b/drivers/net/wireless/ath/ath9k/ar9002_mac.c @@ -377,6 +377,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; } diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c index 729ffbf..d261c6e 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c @@ -351,9 +351,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) @@ -422,6 +424,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; diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h index da76867..06efbe8 100644 --- a/drivers/net/wireless/ath/ath9k/mac.h +++ b/drivers/net/wireless/ath/ath9k/mac.h @@ -121,6 +121,7 @@ struct ath_tx_status { u32 evm0; u32 evm1; u32 evm2; + u32 duration[4]; }; struct ath_rx_status { -- 1.9.1