Hi,

I forgot to mention that the function " compute_ack_duration(ah, rate);" is 
simply equivalent to "ath5k_hw_get_frame_duration(ah, 10, rate);"

Best Regards

Daniel




________________________________
De: Dani Camps <danicamp...@yahoo.com>
Para: "ath5k-devel@lists.ath5k.org" <ath5k-devel@lists.ath5k.org>
Enviado: viernes 9 de septiembre de 2011 15:35
Asunto: Computing packet transmission time in ath5k




Dear all,

I am trying to compute the duration of a transmitted packet in ath5k, my goal 
is to be able to measure network utilization as the sum of transmitted and 
received frames over the air.

Regarding transmission time I have added the following code 
to ath5k_txbuf_setup:

-----------------------------------------
static int
ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
  struct ath5k_txq *txq, int padsize)
{
struct ath5k_hw *ah = sc->ah;
struct ath5k_desc *ds = bf->desc;

....

rc_flags = info->control.rates[0].flags;
hw_rate = (rc_flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) ?
rate->hw_value_short : rate->hw_value;

pktlen = skb->len;

//==========> My code: Start
frame_len = (int) pktlen - padsize + FCS_LEN;
ack_tx_time = compute_ack_duration(ah, rate);
bf->frame_tx_duration = ath5k_hw_get_frame_duration(sc->ah, frame_len, rate) + 
(unsigned long long) ack_tx_time;
//==========> My code: End


-----------------------------------------


Where frame_tx_duration is a new int field that I have defined in ath5k_buf.

The problem that I am having is that the previous code seems to overestimate 
the transmission time, but I do not know why. The only thing that occurs to me 
is whether the "rate" variable in "ath5k_txbuf_setup" is actually smaller than 
the rate that the HW actually uses. Could this be possible ? Or maybe my 
"frame_len" computation is not correct ?

It would be really helpful if anyone can give me some advice, on why the 
previous code overestimates transmission time, and if possible on what would be 
a better way to compute the transmission time of the packet.

I am currently testing this with kernel 2.6.38 and with an Atheros AR5413 
chipset.

Best Regards

Daniel
_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel

Reply via email to