aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43/main.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-02-26 13:34:27 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-02-26 17:26:16 -0500
commit9e3bd9190800e8209b4a3e1d724c35f0738dcad2 (patch)
tree6899d414c070d8a5ad6074dd146419a559ae8c14 /drivers/net/wireless/b43/main.c
parent0e0a228398cc967c922759be36c69d32e4f62701 (diff)
b43: fall back gracefully to PIO mode after fatal DMA errors
This makes the b43 driver just automatically fall back to PIO mode when DMA doesn't work. The driver already told the user to do it, so rather than have the user reload the module with a new flag, just make the driver do it automatically. We keep the message as an indication that something is wrong, but now just automatically fall back to the hopefully working PIO case. (Some post-2.6.33 merge fixups by Larry Finger <Larry.Finger@lwfinger.net> and yours truly... -- JWL) Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/main.c')
-rw-r--r--drivers/net/wireless/b43/main.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 8f7a8c0ec27d..16580d0d3a02 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -107,9 +107,9 @@ int b43_modparam_verbose = B43_VERBOSITY_DEFAULT;
107module_param_named(verbose, b43_modparam_verbose, int, 0644); 107module_param_named(verbose, b43_modparam_verbose, int, 0644);
108MODULE_PARM_DESC(verbose, "Log message verbosity: 0=error, 1=warn, 2=info(default), 3=debug"); 108MODULE_PARM_DESC(verbose, "Log message verbosity: 0=error, 1=warn, 2=info(default), 3=debug");
109 109
110static int modparam_pio; 110int b43_modparam_pio = B43_PIO_DEFAULT;
111module_param_named(pio, modparam_pio, int, 0444); 111module_param_named(pio, b43_modparam_pio, int, 0644);
112MODULE_PARM_DESC(pio, "enable(1) / disable(0) PIO mode"); 112MODULE_PARM_DESC(pio, "Use PIO accesses by default: 0=DMA, 1=PIO");
113 113
114static const struct ssb_device_id b43_ssb_tbl[] = { 114static const struct ssb_device_id b43_ssb_tbl[] = {
115 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 5), 115 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 5),
@@ -1804,8 +1804,9 @@ static void b43_do_interrupt_thread(struct b43_wldev *dev)
1804 dma_reason[4], dma_reason[5]); 1804 dma_reason[4], dma_reason[5]);
1805 b43err(dev->wl, "This device does not support DMA " 1805 b43err(dev->wl, "This device does not support DMA "
1806 "on your system. Please use PIO instead.\n"); 1806 "on your system. Please use PIO instead.\n");
1807 b43err(dev->wl, "Unload the b43 module and reload " 1807 /* Fall back to PIO transfers if we get fatal DMA errors! */
1808 "with 'pio=1'\n"); 1808 dev->use_pio = 1;
1809 b43_controller_restart(dev, "DMA error");
1809 return; 1810 return;
1810 } 1811 }
1811 if (merged_dma_reason & B43_DMAIRQ_NONFATALMASK) { 1812 if (merged_dma_reason & B43_DMAIRQ_NONFATALMASK) {
@@ -4357,7 +4358,7 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
4357 4358
4358 if ((dev->dev->bus->bustype == SSB_BUSTYPE_PCMCIA) || 4359 if ((dev->dev->bus->bustype == SSB_BUSTYPE_PCMCIA) ||
4359 (dev->dev->bus->bustype == SSB_BUSTYPE_SDIO) || 4360 (dev->dev->bus->bustype == SSB_BUSTYPE_SDIO) ||
4360 modparam_pio) { 4361 dev->use_pio) {
4361 dev->__using_pio_transfers = 1; 4362 dev->__using_pio_transfers = 1;
4362 err = b43_pio_init(dev); 4363 err = b43_pio_init(dev);
4363 } else { 4364 } else {
@@ -4824,6 +4825,7 @@ static int b43_one_core_attach(struct ssb_device *dev, struct b43_wl *wl)
4824 if (!wldev) 4825 if (!wldev)
4825 goto out; 4826 goto out;
4826 4827
4828 wldev->use_pio = b43_modparam_pio;
4827 wldev->dev = dev; 4829 wldev->dev = dev;
4828 wldev->wl = wl; 4830 wldev->wl = wl;
4829 b43_set_status(wldev, B43_STAT_UNINIT); 4831 b43_set_status(wldev, B43_STAT_UNINIT);