aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2009-12-10 18:35:01 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-12-28 16:31:28 -0500
commitb02914af4d7020828ce921a572589dd793517c09 (patch)
tree38ffc3e54ada2aa664c2d9ab0dd7b71fab985db9 /drivers
parent7dc6a7a7635365b140af969e972900866d0bf34b (diff)
b43: Allow PIO mode to be selected at module load
If userencounter the "Fatal DMA Problem" with a BCM43XX device, and still wish to use b43 as the driver, their only option is to rebuild the kernel with CONFIG_B43_FORCE_PIO. This patch removes this option and allows PIO mode to be selected with a load-time parameter for the module. Note that the configuration variable CONFIG_B43_PIO is also removed. Once the DMA problem with the BCM4312 devices is solved, this patch will likely be reverted. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Tested-by: John Daiker <daikerjohn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/b43/Kconfig17
-rw-r--r--drivers/net/wireless/b43/Makefile2
-rw-r--r--drivers/net/wireless/b43/b43.h13
-rw-r--r--drivers/net/wireless/b43/dma.c2
-rw-r--r--drivers/net/wireless/b43/main.c9
-rw-r--r--drivers/net/wireless/b43/pio.h40
6 files changed, 8 insertions, 75 deletions
diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig
index 64c12e1bced..073be566d05 100644
--- a/drivers/net/wireless/b43/Kconfig
+++ b/drivers/net/wireless/b43/Kconfig
@@ -3,6 +3,7 @@ config B43
3 depends on SSB_POSSIBLE && MAC80211 && HAS_DMA 3 depends on SSB_POSSIBLE && MAC80211 && HAS_DMA
4 select SSB 4 select SSB
5 select FW_LOADER 5 select FW_LOADER
6 select SSB_BLOCKIO
6 ---help--- 7 ---help---
7 b43 is a driver for the Broadcom 43xx series wireless devices. 8 b43 is a driver for the Broadcom 43xx series wireless devices.
8 9
@@ -78,14 +79,6 @@ config B43_SDIO
78 79
79 If unsure, say N. 80 If unsure, say N.
80 81
81# Data transfers to the device via PIO
82# This is only needed on PCMCIA and SDIO devices. All others can do DMA properly.
83config B43_PIO
84 bool
85 depends on B43 && (B43_SDIO || B43_PCMCIA || B43_FORCE_PIO)
86 select SSB_BLOCKIO
87 default y
88
89config B43_NPHY 82config B43_NPHY
90 bool "Pre IEEE 802.11n support (BROKEN)" 83 bool "Pre IEEE 802.11n support (BROKEN)"
91 depends on B43 && EXPERIMENTAL && BROKEN 84 depends on B43 && EXPERIMENTAL && BROKEN
@@ -137,12 +130,4 @@ config B43_DEBUG
137 for production use. 130 for production use.
138 Only say Y, if you are debugging a problem in the b43 driver sourcecode. 131 Only say Y, if you are debugging a problem in the b43 driver sourcecode.
139 132
140config B43_FORCE_PIO
141 bool "Force usage of PIO instead of DMA"
142 depends on B43 && B43_DEBUG
143 ---help---
144 This will disable DMA and always enable PIO instead.
145 133
146 Say N!
147 This is only for debugging the PIO engine code. You do
148 _NOT_ want to enable this.
diff --git a/drivers/net/wireless/b43/Makefile b/drivers/net/wireless/b43/Makefile
index 84772a2542d..5e83b6f0a3a 100644
--- a/drivers/net/wireless/b43/Makefile
+++ b/drivers/net/wireless/b43/Makefile
@@ -12,7 +12,7 @@ b43-y += xmit.o
12b43-y += lo.o 12b43-y += lo.o
13b43-y += wa.o 13b43-y += wa.o
14b43-y += dma.o 14b43-y += dma.o
15b43-$(CONFIG_B43_PIO) += pio.o 15b43-y += pio.o
16b43-y += rfkill.o 16b43-y += rfkill.o
17b43-$(CONFIG_B43_LEDS) += leds.o 17b43-$(CONFIG_B43_LEDS) += leds.o
18b43-$(CONFIG_B43_PCMCIA) += pcmcia.o 18b43-$(CONFIG_B43_PCMCIA) += pcmcia.o
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index fe3bf949199..2f12a750bc9 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -821,11 +821,9 @@ struct b43_wl {
821 /* The device LEDs. */ 821 /* The device LEDs. */
822 struct b43_leds leds; 822 struct b43_leds leds;
823 823
824#ifdef CONFIG_B43_PIO
825 /* Kmalloc'ed scratch space for PIO TX/RX. Protected by wl->mutex. */ 824 /* Kmalloc'ed scratch space for PIO TX/RX. Protected by wl->mutex. */
826 u8 pio_scratchspace[110] __attribute__((__aligned__(8))); 825 u8 pio_scratchspace[110] __attribute__((__aligned__(8)));
827 u8 pio_tailspace[4] __attribute__((__aligned__(8))); 826 u8 pio_tailspace[4] __attribute__((__aligned__(8)));
828#endif /* CONFIG_B43_PIO */
829}; 827};
830 828
831static inline struct b43_wl *hw_to_b43_wl(struct ieee80211_hw *hw) 829static inline struct b43_wl *hw_to_b43_wl(struct ieee80211_hw *hw)
@@ -876,20 +874,9 @@ static inline void b43_write32(struct b43_wldev *dev, u16 offset, u32 value)
876 874
877static inline bool b43_using_pio_transfers(struct b43_wldev *dev) 875static inline bool b43_using_pio_transfers(struct b43_wldev *dev)
878{ 876{
879#ifdef CONFIG_B43_PIO
880 return dev->__using_pio_transfers; 877 return dev->__using_pio_transfers;
881#else
882 return 0;
883#endif
884} 878}
885 879
886#ifdef CONFIG_B43_FORCE_PIO
887# define B43_FORCE_PIO 1
888#else
889# define B43_FORCE_PIO 0
890#endif
891
892
893/* Message printing */ 880/* Message printing */
894void b43info(struct b43_wl *wl, const char *fmt, ...) 881void b43info(struct b43_wl *wl, const char *fmt, ...)
895 __attribute__ ((format(printf, 2, 3))); 882 __attribute__ ((format(printf, 2, 3)));
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
index 027be275e03..5dd8a210ac2 100644
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -1760,7 +1760,6 @@ void b43_dma_tx_resume(struct b43_wldev *dev)
1760 b43_power_saving_ctl_bits(dev, 0); 1760 b43_power_saving_ctl_bits(dev, 0);
1761} 1761}
1762 1762
1763#ifdef CONFIG_B43_PIO
1764static void direct_fifo_rx(struct b43_wldev *dev, enum b43_dmatype type, 1763static void direct_fifo_rx(struct b43_wldev *dev, enum b43_dmatype type,
1765 u16 mmio_base, bool enable) 1764 u16 mmio_base, bool enable)
1766{ 1765{
@@ -1794,4 +1793,3 @@ void b43_dma_direct_fifo_rx(struct b43_wldev *dev,
1794 mmio_base = b43_dmacontroller_base(type, engine_index); 1793 mmio_base = b43_dmacontroller_base(type, engine_index);
1795 direct_fifo_rx(dev, type, mmio_base, enable); 1794 direct_fifo_rx(dev, type, mmio_base, enable);
1796} 1795}
1797#endif /* CONFIG_B43_PIO */
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 19b4eae47b5..b0b5ce95000 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -102,6 +102,9 @@ int b43_modparam_verbose = B43_VERBOSITY_DEFAULT;
102module_param_named(verbose, b43_modparam_verbose, int, 0644); 102module_param_named(verbose, b43_modparam_verbose, int, 0644);
103MODULE_PARM_DESC(verbose, "Log message verbosity: 0=error, 1=warn, 2=info(default), 3=debug"); 103MODULE_PARM_DESC(verbose, "Log message verbosity: 0=error, 1=warn, 2=info(default), 3=debug");
104 104
105static int modparam_pio;
106module_param_named(pio, modparam_pio, int, 0444);
107MODULE_PARM_DESC(pio, "enable(1) / disable(0) PIO mode");
105 108
106static const struct ssb_device_id b43_ssb_tbl[] = { 109static const struct ssb_device_id b43_ssb_tbl[] = {
107 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 5), 110 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 5),
@@ -1786,8 +1789,8 @@ static void b43_do_interrupt_thread(struct b43_wldev *dev)
1786 dma_reason[4], dma_reason[5]); 1789 dma_reason[4], dma_reason[5]);
1787 b43err(dev->wl, "This device does not support DMA " 1790 b43err(dev->wl, "This device does not support DMA "
1788 "on your system. Please use PIO instead.\n"); 1791 "on your system. Please use PIO instead.\n");
1789 b43err(dev->wl, "CONFIG_B43_FORCE_PIO must be set in " 1792 b43err(dev->wl, "Unload the b43 module and reload "
1790 "your kernel configuration.\n"); 1793 "with 'pio=1'\n");
1791 return; 1794 return;
1792 } 1795 }
1793 if (merged_dma_reason & B43_DMAIRQ_NONFATALMASK) { 1796 if (merged_dma_reason & B43_DMAIRQ_NONFATALMASK) {
@@ -4353,7 +4356,7 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
4353 4356
4354 if ((dev->dev->bus->bustype == SSB_BUSTYPE_PCMCIA) || 4357 if ((dev->dev->bus->bustype == SSB_BUSTYPE_PCMCIA) ||
4355 (dev->dev->bus->bustype == SSB_BUSTYPE_SDIO) || 4358 (dev->dev->bus->bustype == SSB_BUSTYPE_SDIO) ||
4356 B43_FORCE_PIO) { 4359 modparam_pio) {
4357 dev->__using_pio_transfers = 1; 4360 dev->__using_pio_transfers = 1;
4358 err = b43_pio_init(dev); 4361 err = b43_pio_init(dev);
4359 } else { 4362 } else {
diff --git a/drivers/net/wireless/b43/pio.h b/drivers/net/wireless/b43/pio.h
index 7dd649c9dda..7b3c42f93a1 100644
--- a/drivers/net/wireless/b43/pio.h
+++ b/drivers/net/wireless/b43/pio.h
@@ -55,8 +55,6 @@
55#define B43_PIO_MAX_NR_TXPACKETS 32 55#define B43_PIO_MAX_NR_TXPACKETS 32
56 56
57 57
58#ifdef CONFIG_B43_PIO
59
60struct b43_pio_txpacket { 58struct b43_pio_txpacket {
61 /* Pointer to the TX queue we belong to. */ 59 /* Pointer to the TX queue we belong to. */
62 struct b43_pio_txqueue *queue; 60 struct b43_pio_txqueue *queue;
@@ -169,42 +167,4 @@ void b43_pio_rx(struct b43_pio_rxqueue *q);
169void b43_pio_tx_suspend(struct b43_wldev *dev); 167void b43_pio_tx_suspend(struct b43_wldev *dev);
170void b43_pio_tx_resume(struct b43_wldev *dev); 168void b43_pio_tx_resume(struct b43_wldev *dev);
171 169
172
173#else /* CONFIG_B43_PIO */
174
175
176static inline int b43_pio_init(struct b43_wldev *dev)
177{
178 return 0;
179}
180static inline void b43_pio_free(struct b43_wldev *dev)
181{
182}
183static inline void b43_pio_stop(struct b43_wldev *dev)
184{
185}
186static inline int b43_pio_tx(struct b43_wldev *dev,
187 struct sk_buff *skb)
188{
189 return 0;
190}
191static inline void b43_pio_handle_txstatus(struct b43_wldev *dev,
192 const struct b43_txstatus *status)
193{
194}
195static inline void b43_pio_get_tx_stats(struct b43_wldev *dev,
196 struct ieee80211_tx_queue_stats *stats)
197{
198}
199static inline void b43_pio_rx(struct b43_pio_rxqueue *q)
200{
201}
202static inline void b43_pio_tx_suspend(struct b43_wldev *dev)
203{
204}
205static inline void b43_pio_tx_resume(struct b43_wldev *dev)
206{
207}
208
209#endif /* CONFIG_B43_PIO */
210#endif /* B43_PIO_H_ */ 170#endif /* B43_PIO_H_ */