Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 77db31ea authored by Michael Buesch's avatar Michael Buesch Committed by John W. Linville
Browse files

[PATCH] bcm43xx: Partially fix PIO code. Add Kconfig option for PIO or DMA mode (or both).

parent 5c57807a
Loading
Loading
Loading
Loading
+1 −17
Original line number Original line Diff line number Diff line
@@ -500,23 +500,7 @@ config PRISM54
	  will be called prism54.ko.
	  will be called prism54.ko.


source "drivers/net/wireless/hostap/Kconfig"
source "drivers/net/wireless/hostap/Kconfig"

source "drivers/net/wireless/bcm43xx/Kconfig"
config BCM43XX
	tristate "Broadcom BCM43xx wireless support"
	depends on PCI && IEEE80211 && NET_RADIO && IEEE80211_SOFTMAC && EXPERIMENTAL
	select FW_LOADER
	---help---
	  This is an experimental driver for the Broadcom 43xx wireless chip,
	  found in the Apple Airport Extreme and various other devices.

config BCM43XX_DEBUG
	bool "Broadcom BCM43xx debugging (RECOMMENDED)"
	depends on BCM43XX
	default y
	---help---
	  Broadcom 43xx debugging messages.
	  Say Y, because the driver is still very experimental and
	  this will help you get it running.


# yes, this works even when no drivers are selected
# yes, this works even when no drivers are selected
config NET_WIRELESS
config NET_WIRELESS
+57 −0
Original line number Original line Diff line number Diff line
config BCM43XX
	tristate "Broadcom BCM43xx wireless support"
	depends on PCI && IEEE80211 && IEEE80211_SOFTMAC && NET_RADIO && EXPERIMENTAL
	select FW_LOADER
	---help---
	  This is an experimental driver for the Broadcom 43xx wireless chip,
	  found in the Apple Airport Extreme and various other devices.

config BCM43XX_DEBUG
	bool "Broadcom BCM43xx debugging (RECOMMENDED)"
	depends on BCM43XX
	default y
	---help---
	  Broadcom 43xx debugging messages.
	  Say Y, because the driver is still very experimental and
	  this will help you get it running.

config BCM43XX_DMA
	bool
config BCM43XX_PIO
	bool

choice
	prompt "BCM43xx data transfer mode"
	depends on BCM43XX
	default BCM43XX_DMA_AND_PIO

config BCM43XX_DMA_AND_PIO_MODE
	bool "DMA + PIO"
	select BCM43XX_DMA
	select BCM43XX_PIO
	---help---
	  Include both, Direct Memory Access (DMA) and Programmed I/O (PIO)
	  data transfer modes.
	  The actually used mode is selectable through the module
	  parameter "pio". If the module parameter is pio=0, DMA is used.
	  Otherwise PIO is used. DMA is default.

	  If unsure, choose this option.

config BCM43XX_DMA_MODE
	bool "DMA (Direct Memory Access) only"
	select BCM43XX_DMA
	---help---
	  Only include Direct Memory Access (DMA).
	  This reduces the size of the driver module, by omitting the PIO code.

config BCM43XX_PIO_MODE
	bool "PIO (Programmed I/O) only"
	select BCM43XX_PIO
	---help---
	  Only include Programmed I/O (PIO).
	  This reduces the size of the driver module, by omitting the DMA code.
	  Please note that PIO transfers are slow (compared to DMA).
	  Only use PIO, if DMA does not work for you.

endchoice
+4 −2
Original line number Original line Diff line number Diff line
obj-$(CONFIG_BCM43XX) += bcm43xx.o
obj-$(CONFIG_BCM43XX) += bcm43xx.o
bcm43xx-obj-$(CONFIG_BCM43XX_DEBUG) += bcm43xx_debugfs.o
bcm43xx-obj-$(CONFIG_BCM43XX_DEBUG) += bcm43xx_debugfs.o


bcm43xx-objs := bcm43xx_main.o bcm43xx_dma.o \
bcm43xx-obj-$(CONFIG_BCM43XX_DMA) += bcm43xx_dma.o
bcm43xx-obj-$(CONFIG_BCM43XX_PIO) += bcm43xx_pio.o

bcm43xx-objs := bcm43xx_main.o bcm43xx_ilt.o \
		bcm43xx_radio.o bcm43xx_phy.o \
		bcm43xx_radio.o bcm43xx_phy.o \
		bcm43xx_power.o bcm43xx_wx.o \
		bcm43xx_power.o bcm43xx_wx.o \
		bcm43xx_pio.o bcm43xx_ilt.o \
		bcm43xx_leds.o bcm43xx_ethtool.o \
		bcm43xx_leds.o bcm43xx_ethtool.o \
		$(bcm43xx-obj-y)
		$(bcm43xx-obj-y)
+28 −1
Original line number Original line Diff line number Diff line
@@ -639,7 +639,7 @@ struct bcm43xx_private {
	u32 initialized:1,		/* init_board() succeed */
	u32 initialized:1,		/* init_board() succeed */
	    was_initialized:1,		/* for PCI suspend/resume. */
	    was_initialized:1,		/* for PCI suspend/resume. */
	    shutting_down:1,		/* free_board() in progress */
	    shutting_down:1,		/* free_board() in progress */
	    pio_mode:1,			/* PIO (if true), or DMA (if false) used. */
	    __using_pio:1,		/* Internal, use bcm43xx_using_pio(). */
	    bad_frames_preempt:1,	/* Use "Bad Frames Preemption" (default off) */
	    bad_frames_preempt:1,	/* Use "Bad Frames Preemption" (default off) */
	    reg124_set_0x4:1,		/* Some variable to keep track of IRQ stuff. */
	    reg124_set_0x4:1,		/* Some variable to keep track of IRQ stuff. */
	    powersaving:1,		/* TRUE if we are in PowerSaving mode. FALSE otherwise. */
	    powersaving:1,		/* TRUE if we are in PowerSaving mode. FALSE otherwise. */
@@ -749,6 +749,33 @@ struct bcm43xx_private * bcm43xx_priv(struct net_device *dev)
	return ieee80211softmac_priv(dev);
	return ieee80211softmac_priv(dev);
}
}



/* Helper function, which returns a boolean.
 * TRUE, if PIO is used; FALSE, if DMA is used.
 */
#if defined(CONFIG_BCM43XX_DMA) && defined(CONFIG_BCM43XX_PIO)
static inline
int bcm43xx_using_pio(struct bcm43xx_private *bcm)
{
	return bcm->__using_pio;
}
#elif defined(CONFIG_BCM43XX_DMA)
static inline
int bcm43xx_using_pio(struct bcm43xx_private *bcm)
{
	return 0;
}
#elif defined(CONFIG_BCM43XX_PIO)
static inline
int bcm43xx_using_pio(struct bcm43xx_private *bcm)
{
	return 1;
}
#else
# error "Using neither DMA nor PIO? Confused..."
#endif


static inline
static inline
int bcm43xx_num_80211_cores(struct bcm43xx_private *bcm)
int bcm43xx_num_80211_cores(struct bcm43xx_private *bcm)
{
{
+46 −0
Original line number Original line Diff line number Diff line
@@ -94,6 +94,10 @@
#define BCM43xx_TXRESUME_PERCENT	50
#define BCM43xx_TXRESUME_PERCENT	50





#ifdef CONFIG_BCM43XX_DMA


struct sk_buff;
struct sk_buff;
struct bcm43xx_private;
struct bcm43xx_private;
struct bcm43xx_xmitstatus;
struct bcm43xx_xmitstatus;
@@ -172,4 +176,46 @@ int bcm43xx_dma_tx(struct bcm43xx_private *bcm,
		   struct ieee80211_txb *txb);
		   struct ieee80211_txb *txb);
void bcm43xx_dma_rx(struct bcm43xx_dmaring *ring);
void bcm43xx_dma_rx(struct bcm43xx_dmaring *ring);



#else /* CONFIG_BCM43XX_DMA */


static inline
int bcm43xx_dma_init(struct bcm43xx_private *bcm)
{
	return 0;
}
static inline
void bcm43xx_dma_free(struct bcm43xx_private *bcm)
{
}
static inline
int bcm43xx_dmacontroller_rx_reset(struct bcm43xx_private *bcm,
				   u16 dmacontroller_mmio_base)
{
	return 0;
}
static inline
int bcm43xx_dmacontroller_tx_reset(struct bcm43xx_private *bcm,
				   u16 dmacontroller_mmio_base)
{
	return 0;
}
static inline
int bcm43xx_dma_tx(struct bcm43xx_private *bcm,
		   struct ieee80211_txb *txb)
{
	return 0;
}
static inline
void bcm43xx_dma_handle_xmitstatus(struct bcm43xx_private *bcm,
				   struct bcm43xx_xmitstatus *status)
{
}
static inline
void bcm43xx_dma_rx(struct bcm43xx_dmaring *ring)
{
}

#endif /* CONFIG_BCM43XX_DMA */
#endif /* BCM43xx_DMA_H_ */
#endif /* BCM43xx_DMA_H_ */
Loading