Commit 8e118f0e authored by Stefano Brivio's avatar Stefano Brivio Committed by John W. Linville

b43legacy: fix DMA for 30/32-bit DMA engines

This checks if the DMA address is bigger than what the controller can manage.
It will reallocate the buffers in the GFP_DMA zone in that case.

The patch by Michael Buesch has been ported to b43legacy.
Thanks to Matti Viljanen for reporting this.

Cc: Matti Viljanen <viljanen.matti@gmail.com>
Signed-off-by: default avatarStefano Brivio <stefano.brivio@polimi.it>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d68ab680
This diff is collapsed.
...@@ -218,6 +218,12 @@ struct b43legacy_dma_ops { ...@@ -218,6 +218,12 @@ struct b43legacy_dma_ops {
void (*set_current_rxslot)(struct b43legacy_dmaring *ring, int slot); void (*set_current_rxslot)(struct b43legacy_dmaring *ring, int slot);
}; };
enum b43legacy_dmatype {
B43legacy_DMA_30BIT = 30,
B43legacy_DMA_32BIT = 32,
B43legacy_DMA_64BIT = 64,
};
struct b43legacy_dmaring { struct b43legacy_dmaring {
/* Lowlevel DMA ops. */ /* Lowlevel DMA ops. */
const struct b43legacy_dma_ops *ops; const struct b43legacy_dma_ops *ops;
...@@ -250,8 +256,8 @@ struct b43legacy_dmaring { ...@@ -250,8 +256,8 @@ struct b43legacy_dmaring {
int index; int index;
/* Boolean. Is this a TX ring? */ /* Boolean. Is this a TX ring? */
bool tx; bool tx;
/* Boolean. 64bit DMA if true, 32bit DMA otherwise. */ /* The type of DMA engine used. */
bool dma64; enum b43legacy_dmatype type;
/* Boolean. Is this ring stopped at ieee80211 level? */ /* Boolean. Is this ring stopped at ieee80211 level? */
bool stopped; bool stopped;
/* Lock, only used for TX. */ /* Lock, only used for TX. */
...@@ -284,15 +290,6 @@ void b43legacy_dma_write(struct b43legacy_dmaring *ring, ...@@ -284,15 +290,6 @@ void b43legacy_dma_write(struct b43legacy_dmaring *ring,
int b43legacy_dma_init(struct b43legacy_wldev *dev); int b43legacy_dma_init(struct b43legacy_wldev *dev);
void b43legacy_dma_free(struct b43legacy_wldev *dev); void b43legacy_dma_free(struct b43legacy_wldev *dev);
int b43legacy_dmacontroller_rx_reset(struct b43legacy_wldev *dev,
u16 dmacontroller_mmio_base,
int dma64);
int b43legacy_dmacontroller_tx_reset(struct b43legacy_wldev *dev,
u16 dmacontroller_mmio_base,
int dma64);
u16 b43legacy_dmacontroller_base(int dma64bit, int dmacontroller_idx);
void b43legacy_dma_tx_suspend(struct b43legacy_wldev *dev); void b43legacy_dma_tx_suspend(struct b43legacy_wldev *dev);
void b43legacy_dma_tx_resume(struct b43legacy_wldev *dev); void b43legacy_dma_tx_resume(struct b43legacy_wldev *dev);
...@@ -320,20 +317,6 @@ void b43legacy_dma_free(struct b43legacy_wldev *dev) ...@@ -320,20 +317,6 @@ void b43legacy_dma_free(struct b43legacy_wldev *dev)
{ {
} }
static inline static inline
int b43legacy_dmacontroller_rx_reset(struct b43legacy_wldev *dev,
u16 dmacontroller_mmio_base,
int dma64)
{
return 0;
}
static inline
int b43legacy_dmacontroller_tx_reset(struct b43legacy_wldev *dev,
u16 dmacontroller_mmio_base,
int dma64)
{
return 0;
}
static inline
void b43legacy_dma_get_tx_stats(struct b43legacy_wldev *dev, void b43legacy_dma_get_tx_stats(struct b43legacy_wldev *dev,
struct ieee80211_tx_queue_stats *stats) struct ieee80211_tx_queue_stats *stats)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment