diff options
| author | David Woodhouse <David.Woodhouse@intel.com> | 2008-07-11 14:36:25 +0100 | 
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2008-07-11 14:36:25 +0100 | 
| commit | a8931ef380c92d121ae74ecfb03b2d63f72eea6f (patch) | |
| tree | 980fb6b019e11e6cb1ece55b7faff184721a8053 /drivers/net/wireless/b43/dma.c | |
| parent | 90574d0a4d4b73308ae54a2a57a4f3f1fa98e984 (diff) | |
| parent | e5a5816f7875207cb0a0a7032e39a4686c5e10a4 (diff) | |
| download | olio-linux-3.10-a8931ef380c92d121ae74ecfb03b2d63f72eea6f.tar.xz olio-linux-3.10-a8931ef380c92d121ae74ecfb03b2d63f72eea6f.zip  | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/net/wireless/b43/dma.c')
| -rw-r--r-- | drivers/net/wireless/b43/dma.c | 65 | 
1 files changed, 32 insertions, 33 deletions
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c index 6dcbb3c87e7..e23f2f172bd 100644 --- a/drivers/net/wireless/b43/dma.c +++ b/drivers/net/wireless/b43/dma.c @@ -795,24 +795,49 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,  {  	struct b43_dmaring *ring;  	int err; -	int nr_slots;  	dma_addr_t dma_test;  	ring = kzalloc(sizeof(*ring), GFP_KERNEL);  	if (!ring)  		goto out; -	ring->type = type; -	nr_slots = B43_RXRING_SLOTS; +	ring->nr_slots = B43_RXRING_SLOTS;  	if (for_tx) -		nr_slots = B43_TXRING_SLOTS; +		ring->nr_slots = B43_TXRING_SLOTS; -	ring->meta = kcalloc(nr_slots, sizeof(struct b43_dmadesc_meta), +	ring->meta = kcalloc(ring->nr_slots, sizeof(struct b43_dmadesc_meta),  			     GFP_KERNEL);  	if (!ring->meta)  		goto err_kfree_ring; + +	ring->type = type; +	ring->dev = dev; +	ring->mmio_base = b43_dmacontroller_base(type, controller_index); +	ring->index = controller_index; +	if (type == B43_DMA_64BIT) +		ring->ops = &dma64_ops; +	else +		ring->ops = &dma32_ops;  	if (for_tx) { -		ring->txhdr_cache = kcalloc(nr_slots, +		ring->tx = 1; +		ring->current_slot = -1; +	} else { +		if (ring->index == 0) { +			ring->rx_buffersize = B43_DMA0_RX_BUFFERSIZE; +			ring->frameoffset = B43_DMA0_RX_FRAMEOFFSET; +		} else if (ring->index == 3) { +			ring->rx_buffersize = B43_DMA3_RX_BUFFERSIZE; +			ring->frameoffset = B43_DMA3_RX_FRAMEOFFSET; +		} else +			B43_WARN_ON(1); +	} +	spin_lock_init(&ring->lock); +#ifdef CONFIG_B43_DEBUG +	ring->last_injected_overflow = jiffies; +#endif + +	if (for_tx) { +		ring->txhdr_cache = kcalloc(ring->nr_slots,  					    b43_txhdr_size(dev),  					    GFP_KERNEL);  		if (!ring->txhdr_cache) @@ -828,7 +853,7 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,  					  b43_txhdr_size(dev), 1)) {  			/* ugh realloc */  			kfree(ring->txhdr_cache); -			ring->txhdr_cache = kcalloc(nr_slots, +			ring->txhdr_cache = kcalloc(ring->nr_slots,  						    b43_txhdr_size(dev),  						    GFP_KERNEL | GFP_DMA);  			if (!ring->txhdr_cache) @@ -853,32 +878,6 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,  				 DMA_TO_DEVICE);  	} -	ring->dev = dev; -	ring->nr_slots = nr_slots; -	ring->mmio_base = b43_dmacontroller_base(type, controller_index); -	ring->index = controller_index; -	if (type == B43_DMA_64BIT) -		ring->ops = &dma64_ops; -	else -		ring->ops = &dma32_ops; -	if (for_tx) { -		ring->tx = 1; -		ring->current_slot = -1; -	} else { -		if (ring->index == 0) { -			ring->rx_buffersize = B43_DMA0_RX_BUFFERSIZE; -			ring->frameoffset = B43_DMA0_RX_FRAMEOFFSET; -		} else if (ring->index == 3) { -			ring->rx_buffersize = B43_DMA3_RX_BUFFERSIZE; -			ring->frameoffset = B43_DMA3_RX_FRAMEOFFSET; -		} else -			B43_WARN_ON(1); -	} -	spin_lock_init(&ring->lock); -#ifdef CONFIG_B43_DEBUG -	ring->last_injected_overflow = jiffies; -#endif -  	err = alloc_ringmemory(ring);  	if (err)  		goto err_kfree_txhdr_cache;  |