mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
ath9k: Do not update frame's duration field
When AR_DurUpdateEna is set, the frame's duration field is updated by the MAC based on the current rate. Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
822ceaefaa
commit
14cc709f33
2 changed files with 11 additions and 46 deletions
|
@ -516,7 +516,6 @@ struct ath_tx_control {
|
||||||
u32 keyix;
|
u32 keyix;
|
||||||
int min_rate;
|
int min_rate;
|
||||||
int mcast_rate;
|
int mcast_rate;
|
||||||
u16 nextfraglen;
|
|
||||||
struct ath_softc *dev;
|
struct ath_softc *dev;
|
||||||
dma_addr_t dmacontext;
|
dma_addr_t dmacontext;
|
||||||
};
|
};
|
||||||
|
|
|
@ -227,7 +227,6 @@ static int ath_tx_prepare(struct ath_softc *sc,
|
||||||
}
|
}
|
||||||
|
|
||||||
txctl->if_id = 0;
|
txctl->if_id = 0;
|
||||||
txctl->nextfraglen = 0;
|
|
||||||
txctl->frmlen = skb->len + FCS_LEN - (hdrlen & 3);
|
txctl->frmlen = skb->len + FCS_LEN - (hdrlen & 3);
|
||||||
txctl->txpower = MAX_RATE_POWER; /* FIXME */
|
txctl->txpower = MAX_RATE_POWER; /* FIXME */
|
||||||
|
|
||||||
|
@ -344,51 +343,18 @@ static int ath_tx_prepare(struct ath_softc *sc,
|
||||||
}
|
}
|
||||||
rix = rcs[0].rix;
|
rix = rcs[0].rix;
|
||||||
|
|
||||||
/*
|
if (ieee80211_has_morefrags(fc) ||
|
||||||
* Calculate duration. This logically belongs in the 802.11
|
(le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG)) {
|
||||||
* layer but it lacks sufficient information to calculate it.
|
|
||||||
*/
|
|
||||||
if ((txctl->flags & ATH9K_TXDESC_NOACK) == 0 && !ieee80211_is_ctl(fc)) {
|
|
||||||
u16 dur;
|
|
||||||
/*
|
/*
|
||||||
* XXX not right with fragmentation.
|
** Force hardware to use computed duration for next
|
||||||
*/
|
** fragment by disabling multi-rate retry, which
|
||||||
if (sc->sc_flags & SC_OP_PREAMBLE_SHORT)
|
** updates duration based on the multi-rate
|
||||||
dur = rt->info[rix].spAckDuration;
|
** duration table.
|
||||||
else
|
*/
|
||||||
dur = rt->info[rix].lpAckDuration;
|
rcs[1].tries = rcs[2].tries = rcs[3].tries = 0;
|
||||||
|
rcs[1].rix = rcs[2].rix = rcs[3].rix = 0;
|
||||||
if (le16_to_cpu(hdr->frame_control) &
|
/* reset tries but keep rate index */
|
||||||
IEEE80211_FCTL_MOREFRAGS) {
|
rcs[0].tries = ATH_TXMAXTRY;
|
||||||
dur += dur; /* Add additional 'SIFS + ACK' */
|
|
||||||
|
|
||||||
/*
|
|
||||||
** Compute size of next fragment in order to compute
|
|
||||||
** durations needed to update NAV.
|
|
||||||
** The last fragment uses the ACK duration only.
|
|
||||||
** Add time for next fragment.
|
|
||||||
*/
|
|
||||||
dur += ath9k_hw_computetxtime(sc->sc_ah, rt,
|
|
||||||
txctl->nextfraglen,
|
|
||||||
rix,
|
|
||||||
(sc->sc_flags & SC_OP_PREAMBLE_SHORT));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ieee80211_has_morefrags(fc) ||
|
|
||||||
(le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG)) {
|
|
||||||
/*
|
|
||||||
** Force hardware to use computed duration for next
|
|
||||||
** fragment by disabling multi-rate retry, which
|
|
||||||
** updates duration based on the multi-rate
|
|
||||||
** duration table.
|
|
||||||
*/
|
|
||||||
rcs[1].tries = rcs[2].tries = rcs[3].tries = 0;
|
|
||||||
rcs[1].rix = rcs[2].rix = rcs[3].rix = 0;
|
|
||||||
/* reset tries but keep rate index */
|
|
||||||
rcs[0].tries = ATH_TXMAXTRY;
|
|
||||||
}
|
|
||||||
|
|
||||||
hdr->duration_id = cpu_to_le16(dur);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue