aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/xmit.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath9k/xmit.c')
-rw-r--r--drivers/net/wireless/ath9k/xmit.c56
1 files changed, 11 insertions, 45 deletions
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c
index a18cea69904..87aebf17573 100644
--- a/drivers/net/wireless/ath9k/xmit.c
+++ b/drivers/net/wireless/ath9k/xmit.c
@@ -227,7 +227,6 @@ static int ath_tx_prepare(struct ath_softc *sc,
227 } 227 }
228 228
229 txctl->if_id = 0; 229 txctl->if_id = 0;
230 txctl->nextfraglen = 0;
231 txctl->frmlen = skb->len + FCS_LEN - (hdrlen & 3); 230 txctl->frmlen = skb->len + FCS_LEN - (hdrlen & 3);
232 txctl->txpower = MAX_RATE_POWER; /* FIXME */ 231 txctl->txpower = MAX_RATE_POWER; /* FIXME */
233 232
@@ -344,51 +343,18 @@ static int ath_tx_prepare(struct ath_softc *sc,
344 } 343 }
345 rix = rcs[0].rix; 344 rix = rcs[0].rix;
346 345
347 /* 346 if (ieee80211_has_morefrags(fc) ||
348 * Calculate duration. This logically belongs in the 802.11 347 (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG)) {
349 * layer but it lacks sufficient information to calculate it.
350 */
351 if ((txctl->flags & ATH9K_TXDESC_NOACK) == 0 && !ieee80211_is_ctl(fc)) {
352 u16 dur;
353 /* 348 /*
354 * XXX not right with fragmentation. 349 ** Force hardware to use computed duration for next
355 */ 350 ** fragment by disabling multi-rate retry, which
356 if (sc->sc_flags & SC_OP_PREAMBLE_SHORT) 351 ** updates duration based on the multi-rate
357 dur = rt->info[rix].spAckDuration; 352 ** duration table.
358 else 353 */
359 dur = rt->info[rix].lpAckDuration; 354 rcs[1].tries = rcs[2].tries = rcs[3].tries = 0;
360 355 rcs[1].rix = rcs[2].rix = rcs[3].rix = 0;
361 if (le16_to_cpu(hdr->frame_control) & 356 /* reset tries but keep rate index */
362 IEEE80211_FCTL_MOREFRAGS) { 357 rcs[0].tries = ATH_TXMAXTRY;
363 dur += dur; /* Add additional 'SIFS + ACK' */
364
365 /*
366 ** Compute size of next fragment in order to compute
367 ** durations needed to update NAV.
368 ** The last fragment uses the ACK duration only.
369 ** Add time for next fragment.
370 */
371 dur += ath9k_hw_computetxtime(sc->sc_ah, rt,
372 txctl->nextfraglen,
373 rix,
374 (sc->sc_flags & SC_OP_PREAMBLE_SHORT));
375 }
376
377 if (ieee80211_has_morefrags(fc) ||
378 (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG)) {
379 /*
380 ** Force hardware to use computed duration for next
381 ** fragment by disabling multi-rate retry, which
382 ** updates duration based on the multi-rate
383 ** duration table.
384 */
385 rcs[1].tries = rcs[2].tries = rcs[3].tries = 0;
386 rcs[1].rix = rcs[2].rix = rcs[3].rix = 0;
387 /* reset tries but keep rate index */
388 rcs[0].tries = ATH_TXMAXTRY;
389 }
390
391 hdr->duration_id = cpu_to_le16(dur);
392 } 358 }
393 359
394 /* 360 /*