Deleted Added
full compact
if_ath_tx_ht.c (246536) if_ath_tx_ht.c (247085)
1/*-
2 * Copyright (c) 2011 Adrian Chadd, Xenion Pty Ltd.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27 * THE POSSIBILITY OF SUCH DAMAGES.
28 */
29
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2011 Adrian Chadd, Xenion Pty Ltd.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27 * THE POSSIBILITY OF SUCH DAMAGES.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath_tx_ht.c 246536 2013-02-08 09:07:03Z adrian $");
31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath_tx_ht.c 247085 2013-02-21 06:18:40Z adrian $");
32
33#include "opt_inet.h"
34#include "opt_ath.h"
35#include "opt_wlan.h"
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/sysctl.h>

--- 301 unchanged lines hidden (view full) ---

341 /* Select standard number of delimiters based on frame length */
342 ndelim = ATH_AGGR_GET_NDELIM(pktlen);
343
344 /*
345 * If encryption is enabled, add extra delimiters to let the
346 * crypto hardware catch up. This could be tuned per-MAC and
347 * per-rate, but for now we'll simply assume encryption is
348 * always enabled.
32
33#include "opt_inet.h"
34#include "opt_ath.h"
35#include "opt_wlan.h"
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/sysctl.h>

--- 301 unchanged lines hidden (view full) ---

341 /* Select standard number of delimiters based on frame length */
342 ndelim = ATH_AGGR_GET_NDELIM(pktlen);
343
344 /*
345 * If encryption is enabled, add extra delimiters to let the
346 * crypto hardware catch up. This could be tuned per-MAC and
347 * per-rate, but for now we'll simply assume encryption is
348 * always enabled.
349 *
350 * Also note that the Atheros reference driver inserts two
351 * delimiters by default for pre-AR9380 peers. This will
352 * include "that" required delimiter.
349 */
350 ndelim += ATH_AGGR_ENCRYPTDELIM;
351
352 /*
353 * For AR9380, there's a minimum number of delimeters
354 * required when doing RTS.
353 */
354 ndelim += ATH_AGGR_ENCRYPTDELIM;
355
356 /*
357 * For AR9380, there's a minimum number of delimeters
358 * required when doing RTS.
359 *
360 * XXX TODO: this is only needed if (a) RTS/CTS is enabled, and
361 * XXX (b) this is the first sub-frame in the aggregate.
355 */
356 if (sc->sc_use_ent && (sc->sc_ent_cfg & AH_ENT_RTSCTS_DELIM_WAR)
357 && ndelim < AH_FIRST_DESC_NDELIMS)
358 ndelim = AH_FIRST_DESC_NDELIMS;
359
360 DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR,
361 "%s: pktlen=%d, ndelim=%d, mpdudensity=%d\n",
362 __func__, pktlen, ndelim, mpdudensity);

--- 52 unchanged lines hidden (view full) ---

415/*
416 * Fetch the aggregation limit.
417 *
418 * It's the lowest of the four rate series 4ms frame length.
419 */
420static int
421ath_get_aggr_limit(struct ath_softc *sc, struct ath_buf *bf)
422{
362 */
363 if (sc->sc_use_ent && (sc->sc_ent_cfg & AH_ENT_RTSCTS_DELIM_WAR)
364 && ndelim < AH_FIRST_DESC_NDELIMS)
365 ndelim = AH_FIRST_DESC_NDELIMS;
366
367 DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR,
368 "%s: pktlen=%d, ndelim=%d, mpdudensity=%d\n",
369 __func__, pktlen, ndelim, mpdudensity);

--- 52 unchanged lines hidden (view full) ---

422/*
423 * Fetch the aggregation limit.
424 *
425 * It's the lowest of the four rate series 4ms frame length.
426 */
427static int
428ath_get_aggr_limit(struct ath_softc *sc, struct ath_buf *bf)
429{
423 int amin = 65530;
430 int amin = ATH_AGGR_MAXSIZE;
424 int i;
425
431 int i;
432
433 if (sc->sc_aggr_limit > 0 && sc->sc_aggr_limit < ATH_AGGR_MAXSIZE)
434 amin = sc->sc_aggr_limit;
435
426 for (i = 0; i < ATH_RC_NUM; i++) {
427 if (bf->bf_state.bfs_rc[i].tries == 0)
428 continue;
429 amin = MIN(amin, bf->bf_state.bfs_rc[i].max4msframelen);
430 }
431
432 DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: max frame len= %d\n",
433 __func__, amin);

--- 49 unchanged lines hidden (view full) ---

483
484 /*
485 * XXX this isn't strictly correct - sc_txchainmask
486 * XXX isn't the currently active chainmask;
487 * XXX it's the interface chainmask at startup.
488 * XXX It's overridden in the HAL rate scenario function
489 * XXX for now.
490 */
436 for (i = 0; i < ATH_RC_NUM; i++) {
437 if (bf->bf_state.bfs_rc[i].tries == 0)
438 continue;
439 amin = MIN(amin, bf->bf_state.bfs_rc[i].max4msframelen);
440 }
441
442 DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: max frame len= %d\n",
443 __func__, amin);

--- 49 unchanged lines hidden (view full) ---

493
494 /*
495 * XXX this isn't strictly correct - sc_txchainmask
496 * XXX isn't the currently active chainmask;
497 * XXX it's the interface chainmask at startup.
498 * XXX It's overridden in the HAL rate scenario function
499 * XXX for now.
500 */
501 /*
502 * XXX TODO: When the NIC is capable of three stream TX,
503 * transmit 1/2 stream rates on two streams.
504 *
505 * This reduces the power consumption of the NIC and
506 * keeps it within the PCIe slot power limits.
507 */
491 series[i].ChSel = sc->sc_txchainmask;
492
493 if (flags & (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA))
494 series[i].RateFlags |= HAL_RATESERIES_RTS_CTS;
495
496 /*
497 * Transmit 40MHz frames only if the node has negotiated
498 * it rather than whether the node is capable of it or not.

--- 351 unchanged lines hidden ---
508 series[i].ChSel = sc->sc_txchainmask;
509
510 if (flags & (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA))
511 series[i].RateFlags |= HAL_RATESERIES_RTS_CTS;
512
513 /*
514 * Transmit 40MHz frames only if the node has negotiated
515 * it rather than whether the node is capable of it or not.

--- 351 unchanged lines hidden ---