diff options
author | sam <sam@FreeBSD.org> | 2006-02-09 21:03:25 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2006-02-09 21:03:25 +0000 |
commit | a2c8f3b1ef9e8ca7cead0b18fd8053f81686448e (patch) | |
tree | d2791691b9db78a82eb1a94c416c22242ea7afb4 /sys/dev | |
parent | 63dd123deaa3064141ef7ef49e7896499e41e881 (diff) | |
download | FreeBSD-src-a2c8f3b1ef9e8ca7cead0b18fd8053f81686448e.zip FreeBSD-src-a2c8f3b1ef9e8ca7cead0b18fd8053f81686448e.tar.gz |
allow the size of tx+rx buffer pools to be tuned
MFC after: 2 weeks
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ath/if_ath.c | 17 | ||||
-rw-r--r-- | sys/dev/ath/if_athvar.h | 4 |
2 files changed, 19 insertions, 2 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 879f567..81e5f8a 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -200,6 +200,15 @@ static int ath_regdomain = 0; /* regulatory domain */ SYSCTL_INT(_hw_ath, OID_AUTO, regdomain, CTLFLAG_RD, &ath_regdomain, 0, "regulatory domain"); +static int ath_rxbuf = ATH_RXBUF; /* # rx buffers to allocate */ +SYSCTL_INT(_hw_ath, OID_AUTO, rxbuf, CTLFLAG_RD, &ath_rxbuf, + 0, "rx buffers allocated"); +TUNABLE_INT("hw.ath.rxbuf", &ath_rxbuf); +static int ath_txbuf = ATH_TXBUF; /* # tx buffers to allocate */ +SYSCTL_INT(_hw_ath, OID_AUTO, txbuf, CTLFLAG_RD, &ath_txbuf, + 0, "tx buffers allocated"); +TUNABLE_INT("hw.ath.txbuf", &ath_txbuf); + #ifdef AR_DEBUG static int ath_debug = 0; SYSCTL_INT(_hw_ath, OID_AUTO, debug, CTLFLAG_RW, &ath_debug, @@ -2378,12 +2387,12 @@ ath_desc_alloc(struct ath_softc *sc) int error; error = ath_descdma_setup(sc, &sc->sc_rxdma, &sc->sc_rxbuf, - "rx", ATH_RXBUF, 1); + "rx", ath_rxbuf, 1); if (error != 0) return error; error = ath_descdma_setup(sc, &sc->sc_txdma, &sc->sc_txbuf, - "tx", ATH_TXBUF, ATH_TXDESC); + "tx", ath_txbuf, ATH_TXDESC); if (error != 0) { ath_descdma_cleanup(sc, &sc->sc_rxdma, &sc->sc_rxbuf); return error; @@ -4981,5 +4990,9 @@ ath_announce(struct ath_softc *sc) sc->sc_cabq->axq_qnum); if_printf(ifp, "Use hw queue %u for beacons\n", sc->sc_bhalq); } + if (ath_rxbuf != ATH_RXBUF) + if_printf(ifp, "using %u rx buffers\n", ath_rxbuf); + if (ath_txbuf != ATH_TXBUF) + if_printf(ifp, "using %u tx buffers\n", ath_txbuf); #undef HAL_MODE_DUALBAND } diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index 7e49da1..aaa9695 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -51,8 +51,12 @@ #define ATH_TIMEOUT 1000 +#ifndef ATH_RXBUF #define ATH_RXBUF 40 /* number of RX buffers */ +#endif +#ifndef ATH_TXBUF #define ATH_TXBUF 100 /* number of TX buffers */ +#endif #define ATH_TXDESC 10 /* number of descriptors per buffer */ #define ATH_TXMAXTRY 11 /* max number of transmit attempts */ #define ATH_TXMGTTRY 4 /* xmit attempts for mgt/ctl frames */ |