From c0cd6137944f43ddf5c4a1ec36bc5a0c4c80857c Mon Sep 17 00:00:00 2001 From: Luis R. Rodriguez Date: Tue, 18 Nov 2008 19:20:12 -0800 Subject: [PATCH] ath9k: ensure we only allocate 4KB for DMA buffers To: johannes@sipsolutions.net, linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org We were actually using 8KB for buffers, that's not what we want as our hardware only supports 4KB buffers. If we need more we link them together for A-MPDUs. Signed-off-by: Maciej Zenczykowski Signed-off-by: Luis R. Rodriguez --- drivers/net/wireless/ath9k/recv.c | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c index 7b94539..d361c44 100644 --- a/drivers/net/wireless/ath9k/recv.c +++ b/drivers/net/wireless/ath9k/recv.c @@ -499,6 +499,7 @@ static void ath_opmode_init(struct ath_softc *sc) int ath_rx_init(struct ath_softc *sc, int nbufs) { +#define FUDGE 1140 struct sk_buff *skb; struct ath_buf *bf; int error = 0; @@ -508,13 +509,8 @@ int ath_rx_init(struct ath_softc *sc, int nbufs) sc->sc_rxflush = 0; spin_lock_init(&sc->sc_rxbuflock); - /* - * Cisco's VPN software requires that drivers be able to - * receive encapsulated frames that are larger than the MTU. - * Since we can't be sure how large a frame we'll get, setup - * to handle the larges on possible. - */ - sc->sc_rxbufsize = roundup(IEEE80211_MAX_MPDU_LEN, + /* We only need to ensure we get 4KB from the kernel */ + sc->sc_rxbufsize = roundup(IEEE80211_MAX_FRAME_LEN + FUDGE, min(sc->sc_cachelsz, (u16)64)); @@ -555,6 +551,7 @@ int ath_rx_init(struct ath_softc *sc, int nbufs) ath_rx_cleanup(sc); return error; +#undef FUDGE } /* Reclaim all rx queue resources */ -- 1.5.6.3