diff options
author | Felix Fietkau <nbd@openwrt.org> | 2009-01-30 02:52:21 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2009-01-30 02:52:21 +0000 |
commit | f16fea56d6b65f9445b6d224e1bb8ed71de97dcb (patch) | |
tree | 921f77ceafd7b0913d545a14d983711ec19b61a6 /package/mac80211/patches/320-rx_dma_unmap.patch | |
parent | 13efa28c8ccc4e3910c81629bbe72ee39564f8ca (diff) | |
download | upstream-f16fea56d6b65f9445b6d224e1bb8ed71de97dcb.tar.gz upstream-f16fea56d6b65f9445b6d224e1bb8ed71de97dcb.tar.bz2 upstream-f16fea56d6b65f9445b6d224e1bb8ed71de97dcb.zip |
add some work-in-progress patches for ath5k stability and performance
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@14277 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/mac80211/patches/320-rx_dma_unmap.patch')
-rw-r--r-- | package/mac80211/patches/320-rx_dma_unmap.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/package/mac80211/patches/320-rx_dma_unmap.patch b/package/mac80211/patches/320-rx_dma_unmap.patch new file mode 100644 index 0000000000..f7cd62a7ce --- /dev/null +++ b/package/mac80211/patches/320-rx_dma_unmap.patch @@ -0,0 +1,37 @@ +When freeing rx dma descriptors, use the right buffer size. +Fixes kernel oopses on module unload on ixp4xx and most likely +other platforms as well. + +Signed-off-by: Felix Fietkau <nbd@openwrt.org> + +--- a/drivers/net/wireless/ath5k/base.c ++++ b/drivers/net/wireless/ath5k/base.c +@@ -308,6 +308,19 @@ static inline void ath5k_txbuf_free(stru + bf->skb = NULL; + } + ++static inline void ath5k_rxbuf_free(struct ath5k_softc *sc, ++ struct ath5k_buf *bf) ++{ ++ BUG_ON(!bf); ++ if (!bf->skb) ++ return; ++ pci_unmap_single(sc->pdev, bf->skbaddr, sc->rxbufsize, ++ PCI_DMA_FROMDEVICE); ++ dev_kfree_skb_any(bf->skb); ++ bf->skb = NULL; ++} ++ ++ + /* Queues setup */ + static struct ath5k_txq *ath5k_txq_setup(struct ath5k_softc *sc, + int qtype, int subtype); +@@ -1341,7 +1354,7 @@ ath5k_desc_free(struct ath5k_softc *sc, + list_for_each_entry(bf, &sc->txbuf, list) + ath5k_txbuf_free(sc, bf); + list_for_each_entry(bf, &sc->rxbuf, list) +- ath5k_txbuf_free(sc, bf); ++ ath5k_rxbuf_free(sc, bf); + + /* Free memory associated with all descriptors */ + pci_free_consistent(pdev, sc->desc_len, sc->desc, sc->desc_daddr); |