Commit 5e3d4718 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Kalle Valo

ath9k: dynack: move debug log after buffer increments

Move debug log in ath_dynack_sample_tx_ts and ath_dynack_sample_ack_ts
after timestamp buffer head/tail increments in order to make debugging
more user friendly
Tested-by: default avatarKoen Vandeputte <koen.vandeputte@ncentric.com>
Signed-off-by: default avatarLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 3831a2a0
...@@ -171,11 +171,12 @@ static void ath_dynack_compute_to(struct ath_hw *ah) ...@@ -171,11 +171,12 @@ static void ath_dynack_compute_to(struct ath_hw *ah)
void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb, void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb,
struct ath_tx_status *ts) struct ath_tx_status *ts)
{ {
u8 ridx;
struct ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
struct ath_dynack *da = &ah->dynack; struct ath_dynack *da = &ah->dynack;
struct ath_common *common = ath9k_hw_common(ah); struct ath_common *common = ath9k_hw_common(ah);
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
u32 dur = ts->duration;
u8 ridx;
if ((info->flags & IEEE80211_TX_CTL_NO_ACK) || !da->enabled) if ((info->flags & IEEE80211_TX_CTL_NO_ACK) || !da->enabled)
return; return;
...@@ -203,14 +204,13 @@ void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb, ...@@ -203,14 +204,13 @@ void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb,
ridx = ts->ts_rateindex; ridx = ts->ts_rateindex;
da->st_rbf.ts[da->st_rbf.t_rb].tstamp = ts->ts_tstamp; da->st_rbf.ts[da->st_rbf.t_rb].tstamp = ts->ts_tstamp;
da->st_rbf.ts[da->st_rbf.t_rb].dur = ts->duration;
ether_addr_copy(da->st_rbf.addr[da->st_rbf.t_rb].h_dest, hdr->addr1); ether_addr_copy(da->st_rbf.addr[da->st_rbf.t_rb].h_dest, hdr->addr1);
ether_addr_copy(da->st_rbf.addr[da->st_rbf.t_rb].h_src, hdr->addr2); ether_addr_copy(da->st_rbf.addr[da->st_rbf.t_rb].h_src, hdr->addr2);
if (!(info->status.rates[ridx].flags & IEEE80211_TX_RC_MCS)) { if (!(info->status.rates[ridx].flags & IEEE80211_TX_RC_MCS)) {
u32 phy, sifs;
const struct ieee80211_rate *rate; const struct ieee80211_rate *rate;
struct ieee80211_tx_rate *rates = info->status.rates; struct ieee80211_tx_rate *rates = info->status.rates;
u32 phy;
rate = &common->sbands[info->band].bitrates[rates[ridx].idx]; rate = &common->sbands[info->band].bitrates[rates[ridx].idx];
if (info->band == NL80211_BAND_2GHZ && if (info->band == NL80211_BAND_2GHZ &&
...@@ -219,19 +219,18 @@ void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb, ...@@ -219,19 +219,18 @@ void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb,
else else
phy = WLAN_RC_PHY_OFDM; phy = WLAN_RC_PHY_OFDM;
sifs = ath_dynack_get_sifs(ah, phy); dur -= ath_dynack_get_sifs(ah, phy);
da->st_rbf.ts[da->st_rbf.t_rb].dur -= sifs;
} }
da->st_rbf.ts[da->st_rbf.t_rb].dur = dur;
ath_dbg(common, DYNACK, "{%pM} tx sample %u [dur %u][h %u-t %u]\n",
hdr->addr1, da->st_rbf.ts[da->st_rbf.t_rb].tstamp,
da->st_rbf.ts[da->st_rbf.t_rb].dur, da->st_rbf.h_rb,
(da->st_rbf.t_rb + 1) % ATH_DYN_BUF);
INCR(da->st_rbf.t_rb, ATH_DYN_BUF); INCR(da->st_rbf.t_rb, ATH_DYN_BUF);
if (da->st_rbf.t_rb == da->st_rbf.h_rb) if (da->st_rbf.t_rb == da->st_rbf.h_rb)
INCR(da->st_rbf.h_rb, ATH_DYN_BUF); INCR(da->st_rbf.h_rb, ATH_DYN_BUF);
ath_dbg(common, DYNACK, "{%pM} tx sample %u [dur %u][h %u-t %u]\n",
hdr->addr1, ts->ts_tstamp, dur, da->st_rbf.h_rb,
da->st_rbf.t_rb);
ath_dynack_compute_to(ah); ath_dynack_compute_to(ah);
spin_unlock_bh(&da->qlock); spin_unlock_bh(&da->qlock);
...@@ -258,14 +257,13 @@ void ath_dynack_sample_ack_ts(struct ath_hw *ah, struct sk_buff *skb, ...@@ -258,14 +257,13 @@ void ath_dynack_sample_ack_ts(struct ath_hw *ah, struct sk_buff *skb,
spin_lock_bh(&da->qlock); spin_lock_bh(&da->qlock);
da->ack_rbf.tstamp[da->ack_rbf.t_rb] = ts; da->ack_rbf.tstamp[da->ack_rbf.t_rb] = ts;
ath_dbg(common, DYNACK, "rx sample %u [h %u-t %u]\n",
da->ack_rbf.tstamp[da->ack_rbf.t_rb],
da->ack_rbf.h_rb, (da->ack_rbf.t_rb + 1) % ATH_DYN_BUF);
INCR(da->ack_rbf.t_rb, ATH_DYN_BUF); INCR(da->ack_rbf.t_rb, ATH_DYN_BUF);
if (da->ack_rbf.t_rb == da->ack_rbf.h_rb) if (da->ack_rbf.t_rb == da->ack_rbf.h_rb)
INCR(da->ack_rbf.h_rb, ATH_DYN_BUF); INCR(da->ack_rbf.h_rb, ATH_DYN_BUF);
ath_dbg(common, DYNACK, "rx sample %u [h %u-t %u]\n",
ts, da->ack_rbf.h_rb, da->ack_rbf.t_rb);
ath_dynack_compute_to(ah); ath_dynack_compute_to(ah);
spin_unlock_bh(&da->qlock); spin_unlock_bh(&da->qlock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment