]>
Commit | Line | Data |
---|---|---|
3ababc44 GKH |
1 | From b02914af4d7020828ce921a572589dd793517c09 Mon Sep 17 00:00:00 2001 |
2 | From: Larry Finger <Larry.Finger@lwfinger.net> | |
3 | Date: Thu, 10 Dec 2009 17:35:01 -0600 | |
4 | Subject: b43: Allow PIO mode to be selected at module load | |
5 | ||
6 | From: Larry Finger <Larry.Finger@lwfinger.net> | |
7 | ||
8 | commit b02914af4d7020828ce921a572589dd793517c09 upstream. | |
9 | ||
10 | If userencounter the "Fatal DMA Problem" with a BCM43XX device, and | |
11 | still wish to use b43 as the driver, their only option is to rebuild | |
12 | the kernel with CONFIG_B43_FORCE_PIO. This patch removes this option and | |
13 | allows PIO mode to be selected with a load-time parameter for the module. | |
14 | Note that the configuration variable CONFIG_B43_PIO is also removed. | |
15 | ||
16 | Once the DMA problem with the BCM4312 devices is solved, this patch will | |
17 | likely be reverted. | |
18 | ||
19 | Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> | |
20 | Tested-by: John Daiker <daikerjohn@gmail.com> | |
21 | Cc: maximilian attems <max@stro.at> | |
22 | Signed-off-by: John W. Linville <linville@tuxdriver.com> | |
23 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
24 | ||
25 | --- | |
26 | drivers/net/wireless/b43/Kconfig | 19 +----------------- | |
27 | drivers/net/wireless/b43/Makefile | 2 - | |
28 | drivers/net/wireless/b43/b43.h | 13 ------------ | |
29 | drivers/net/wireless/b43/dma.c | 2 - | |
30 | drivers/net/wireless/b43/main.c | 9 +++++--- | |
31 | drivers/net/wireless/b43/pio.h | 40 -------------------------------------- | |
32 | 6 files changed, 9 insertions(+), 76 deletions(-) | |
33 | ||
34 | --- a/drivers/net/wireless/b43/Kconfig | |
35 | +++ b/drivers/net/wireless/b43/Kconfig | |
36 | @@ -3,6 +3,7 @@ config B43 | |
37 | depends on SSB_POSSIBLE && MAC80211 && WLAN_80211 && HAS_DMA | |
38 | select SSB | |
39 | select FW_LOADER | |
40 | + select SSB_BLOCKIO | |
41 | ---help--- | |
42 | b43 is a driver for the Broadcom 43xx series wireless devices. | |
43 | ||
44 | @@ -78,14 +79,6 @@ config B43_SDIO | |
45 | ||
46 | If unsure, say N. | |
47 | ||
48 | -# Data transfers to the device via PIO | |
49 | -# This is only needed on PCMCIA and SDIO devices. All others can do DMA properly. | |
50 | -config B43_PIO | |
51 | - bool | |
52 | - depends on B43 && (B43_SDIO || B43_PCMCIA || B43_FORCE_PIO) | |
53 | - select SSB_BLOCKIO | |
54 | - default y | |
55 | - | |
56 | config B43_NPHY | |
57 | bool "Pre IEEE 802.11n support (BROKEN)" | |
58 | depends on B43 && EXPERIMENTAL && BROKEN | |
59 | @@ -137,12 +130,4 @@ config B43_DEBUG | |
60 | for production use. | |
61 | Only say Y, if you are debugging a problem in the b43 driver sourcecode. | |
62 | ||
63 | -config B43_FORCE_PIO | |
64 | - bool "Force usage of PIO instead of DMA" | |
65 | - depends on B43 && B43_DEBUG | |
66 | - ---help--- | |
67 | - This will disable DMA and always enable PIO instead. | |
68 | - | |
69 | - Say N! | |
70 | - This is only for debugging the PIO engine code. You do | |
71 | - _NOT_ want to enable this. | |
72 | + | |
73 | --- a/drivers/net/wireless/b43/Makefile | |
74 | +++ b/drivers/net/wireless/b43/Makefile | |
75 | @@ -12,7 +12,7 @@ b43-y += xmit.o | |
76 | b43-y += lo.o | |
77 | b43-y += wa.o | |
78 | b43-y += dma.o | |
79 | -b43-$(CONFIG_B43_PIO) += pio.o | |
80 | +b43-y += pio.o | |
81 | b43-y += rfkill.o | |
82 | b43-$(CONFIG_B43_LEDS) += leds.o | |
83 | b43-$(CONFIG_B43_PCMCIA) += pcmcia.o | |
84 | --- a/drivers/net/wireless/b43/b43.h | |
85 | +++ b/drivers/net/wireless/b43/b43.h | |
86 | @@ -830,7 +830,6 @@ struct b43_wl { | |
87 | /* The device LEDs. */ | |
88 | struct b43_leds leds; | |
89 | ||
90 | -#ifdef CONFIG_B43_PIO | |
91 | /* | |
92 | * RX/TX header/tail buffers used by the frame transmit functions. | |
93 | */ | |
94 | @@ -838,7 +837,6 @@ struct b43_wl { | |
95 | struct b43_txhdr txhdr; | |
96 | u8 rx_tail[4]; | |
97 | u8 tx_tail[4]; | |
98 | -#endif /* CONFIG_B43_PIO */ | |
99 | }; | |
100 | ||
101 | static inline struct b43_wl *hw_to_b43_wl(struct ieee80211_hw *hw) | |
102 | @@ -889,20 +887,9 @@ static inline void b43_write32(struct b4 | |
103 | ||
104 | static inline bool b43_using_pio_transfers(struct b43_wldev *dev) | |
105 | { | |
106 | -#ifdef CONFIG_B43_PIO | |
107 | return dev->__using_pio_transfers; | |
108 | -#else | |
109 | - return 0; | |
110 | -#endif | |
111 | } | |
112 | ||
113 | -#ifdef CONFIG_B43_FORCE_PIO | |
114 | -# define B43_FORCE_PIO 1 | |
115 | -#else | |
116 | -# define B43_FORCE_PIO 0 | |
117 | -#endif | |
118 | - | |
119 | - | |
120 | /* Message printing */ | |
121 | void b43info(struct b43_wl *wl, const char *fmt, ...) | |
122 | __attribute__ ((format(printf, 2, 3))); | |
123 | --- a/drivers/net/wireless/b43/dma.c | |
124 | +++ b/drivers/net/wireless/b43/dma.c | |
125 | @@ -1620,7 +1620,6 @@ void b43_dma_tx_resume(struct b43_wldev | |
126 | b43_power_saving_ctl_bits(dev, 0); | |
127 | } | |
128 | ||
129 | -#ifdef CONFIG_B43_PIO | |
130 | static void direct_fifo_rx(struct b43_wldev *dev, enum b43_dmatype type, | |
131 | u16 mmio_base, bool enable) | |
132 | { | |
133 | @@ -1654,4 +1653,3 @@ void b43_dma_direct_fifo_rx(struct b43_w | |
134 | mmio_base = b43_dmacontroller_base(type, engine_index); | |
135 | direct_fifo_rx(dev, type, mmio_base, enable); | |
136 | } | |
137 | -#endif /* CONFIG_B43_PIO */ | |
138 | --- a/drivers/net/wireless/b43/main.c | |
139 | +++ b/drivers/net/wireless/b43/main.c | |
140 | @@ -102,6 +102,9 @@ int b43_modparam_verbose = B43_VERBOSITY | |
141 | module_param_named(verbose, b43_modparam_verbose, int, 0644); | |
142 | MODULE_PARM_DESC(verbose, "Log message verbosity: 0=error, 1=warn, 2=info(default), 3=debug"); | |
143 | ||
144 | +static int modparam_pio; | |
145 | +module_param_named(pio, modparam_pio, int, 0444); | |
146 | +MODULE_PARM_DESC(pio, "enable(1) / disable(0) PIO mode"); | |
147 | ||
148 | static const struct ssb_device_id b43_ssb_tbl[] = { | |
149 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 5), | |
150 | @@ -1790,8 +1793,8 @@ static void b43_do_interrupt_thread(stru | |
151 | dma_reason[4], dma_reason[5]); | |
152 | b43err(dev->wl, "This device does not support DMA " | |
153 | "on your system. Please use PIO instead.\n"); | |
154 | - b43err(dev->wl, "CONFIG_B43_FORCE_PIO must be set in " | |
155 | - "your kernel configuration.\n"); | |
156 | + b43err(dev->wl, "Unload the b43 module and reload " | |
157 | + "with 'pio=1'\n"); | |
158 | return; | |
159 | } | |
160 | if (merged_dma_reason & B43_DMAIRQ_NONFATALMASK) { | |
161 | @@ -4358,7 +4361,7 @@ static int b43_wireless_core_init(struct | |
162 | ||
163 | if ((dev->dev->bus->bustype == SSB_BUSTYPE_PCMCIA) || | |
164 | (dev->dev->bus->bustype == SSB_BUSTYPE_SDIO) || | |
165 | - B43_FORCE_PIO) { | |
166 | + modparam_pio) { | |
167 | dev->__using_pio_transfers = 1; | |
168 | err = b43_pio_init(dev); | |
169 | } else { | |
170 | --- a/drivers/net/wireless/b43/pio.h | |
171 | +++ b/drivers/net/wireless/b43/pio.h | |
172 | @@ -55,8 +55,6 @@ | |
173 | #define B43_PIO_MAX_NR_TXPACKETS 32 | |
174 | ||
175 | ||
176 | -#ifdef CONFIG_B43_PIO | |
177 | - | |
178 | struct b43_pio_txpacket { | |
179 | /* Pointer to the TX queue we belong to. */ | |
180 | struct b43_pio_txqueue *queue; | |
181 | @@ -169,42 +167,4 @@ void b43_pio_rx(struct b43_pio_rxqueue * | |
182 | void b43_pio_tx_suspend(struct b43_wldev *dev); | |
183 | void b43_pio_tx_resume(struct b43_wldev *dev); | |
184 | ||
185 | - | |
186 | -#else /* CONFIG_B43_PIO */ | |
187 | - | |
188 | - | |
189 | -static inline int b43_pio_init(struct b43_wldev *dev) | |
190 | -{ | |
191 | - return 0; | |
192 | -} | |
193 | -static inline void b43_pio_free(struct b43_wldev *dev) | |
194 | -{ | |
195 | -} | |
196 | -static inline void b43_pio_stop(struct b43_wldev *dev) | |
197 | -{ | |
198 | -} | |
199 | -static inline int b43_pio_tx(struct b43_wldev *dev, | |
200 | - struct sk_buff *skb) | |
201 | -{ | |
202 | - return 0; | |
203 | -} | |
204 | -static inline void b43_pio_handle_txstatus(struct b43_wldev *dev, | |
205 | - const struct b43_txstatus *status) | |
206 | -{ | |
207 | -} | |
208 | -static inline void b43_pio_get_tx_stats(struct b43_wldev *dev, | |
209 | - struct ieee80211_tx_queue_stats *stats) | |
210 | -{ | |
211 | -} | |
212 | -static inline void b43_pio_rx(struct b43_pio_rxqueue *q) | |
213 | -{ | |
214 | -} | |
215 | -static inline void b43_pio_tx_suspend(struct b43_wldev *dev) | |
216 | -{ | |
217 | -} | |
218 | -static inline void b43_pio_tx_resume(struct b43_wldev *dev) | |
219 | -{ | |
220 | -} | |
221 | - | |
222 | -#endif /* CONFIG_B43_PIO */ | |
223 | #endif /* B43_PIO_H_ */ |