aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43legacy/radio.c
diff options
context:
space:
mode:
authorStefano Brivio <stefano.brivio@polimi.it>2008-01-23 08:48:50 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-31 22:26:37 -0500
commite78c9d285709f535caae405f1da5b2936f51f0b5 (patch)
tree13840f98a004920dd8e93e8fe2c16d8b51b59e8f /drivers/net/wireless/b43legacy/radio.c
parent8712f2769dd66d8e7ff179d525b93e0a15a5b963 (diff)
b43legacy: fix MAC control and microcode init
This zeros out all microcode related memory before loading the microcode. This also fixes initialization of the MAC control register. The _only_ place where we overwrite the contents of the MAC control register is at the beginning of b43_chip_init(). All other places must do read() -> mask/set -> write() to not overwrite existing bits. This also adds a longer delay for waiting for the microcode to initialize itself. It seems that the current timeout is sufficient on all available devices, but there's no real reason why we shouldn't wait for up to one second. Slow embedded devices might exist. Better safe than sorry. While at it, fix naming of MACCTL values. This patch by Michael Buesch has been ported to b43legacy. Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it> Acked-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/b43legacy/radio.c')
-rw-r--r--drivers/net/wireless/b43legacy/radio.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/wireless/b43legacy/radio.c b/drivers/net/wireless/b43legacy/radio.c
index 318a270cf9b4..955832e8654f 100644
--- a/drivers/net/wireless/b43legacy/radio.c
+++ b/drivers/net/wireless/b43legacy/radio.c
@@ -91,10 +91,10 @@ void b43legacy_radio_lock(struct b43legacy_wldev *dev)
91{ 91{
92 u32 status; 92 u32 status;
93 93
94 status = b43legacy_read32(dev, B43legacy_MMIO_STATUS_BITFIELD); 94 status = b43legacy_read32(dev, B43legacy_MMIO_MACCTL);
95 B43legacy_WARN_ON(status & B43legacy_SBF_RADIOREG_LOCK); 95 B43legacy_WARN_ON(status & B43legacy_MACCTL_RADIOLOCK);
96 status |= B43legacy_SBF_RADIOREG_LOCK; 96 status |= B43legacy_MACCTL_RADIOLOCK;
97 b43legacy_write32(dev, B43legacy_MMIO_STATUS_BITFIELD, status); 97 b43legacy_write32(dev, B43legacy_MMIO_MACCTL, status);
98 mmiowb(); 98 mmiowb();
99 udelay(10); 99 udelay(10);
100} 100}
@@ -104,10 +104,10 @@ void b43legacy_radio_unlock(struct b43legacy_wldev *dev)
104 u32 status; 104 u32 status;
105 105
106 b43legacy_read16(dev, B43legacy_MMIO_PHY_VER); /* dummy read */ 106 b43legacy_read16(dev, B43legacy_MMIO_PHY_VER); /* dummy read */
107 status = b43legacy_read32(dev, B43legacy_MMIO_STATUS_BITFIELD); 107 status = b43legacy_read32(dev, B43legacy_MMIO_MACCTL);
108 B43legacy_WARN_ON(!(status & B43legacy_SBF_RADIOREG_LOCK)); 108 B43legacy_WARN_ON(!(status & B43legacy_MACCTL_RADIOLOCK));
109 status &= ~B43legacy_SBF_RADIOREG_LOCK; 109 status &= ~B43legacy_MACCTL_RADIOLOCK;
110 b43legacy_write32(dev, B43legacy_MMIO_STATUS_BITFIELD, status); 110 b43legacy_write32(dev, B43legacy_MMIO_MACCTL, status);
111 mmiowb(); 111 mmiowb();
112} 112}
113 113