aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/bcm43xx/bcm43xx_radio.c
diff options
context:
space:
mode:
authorMichael Buesch <mbuesch@freenet.de>2006-03-12 13:44:29 -0500
committerJohn W. Linville <linville@tuxdriver.com>2006-03-27 11:19:36 -0500
commit73733847beead47dc31b1f8e1532e5eea9f8ddd3 (patch)
tree6c1c9f05d1ca6a7053151e2104f7d825b26e4ffc /drivers/net/wireless/bcm43xx/bcm43xx_radio.c
parent7ce942d0ff5df145831631f4df391c7207e676bb (diff)
[PATCH] bcm43xx: fix some stuff, add a few missing mmiowb(), remove dead code.
This may workaround the XMIT ERRORs some people are getting. Signed-off-by: Michael Buesch <mbuesch@freenet.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/bcm43xx/bcm43xx_radio.c')
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_radio.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_radio.c b/drivers/net/wireless/bcm43xx/bcm43xx_radio.c
index 3901aa994666..4d3b0e85876c 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_radio.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_radio.c
@@ -97,6 +97,7 @@ void bcm43xx_radio_lock(struct bcm43xx_private *bcm)
97 status = bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD); 97 status = bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD);
98 status |= BCM43xx_SBF_RADIOREG_LOCK; 98 status |= BCM43xx_SBF_RADIOREG_LOCK;
99 bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD, status); 99 bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD, status);
100 mmiowb();
100 udelay(10); 101 udelay(10);
101} 102}
102 103
@@ -108,6 +109,7 @@ void bcm43xx_radio_unlock(struct bcm43xx_private *bcm)
108 status = bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD); 109 status = bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD);
109 status &= ~BCM43xx_SBF_RADIOREG_LOCK; 110 status &= ~BCM43xx_SBF_RADIOREG_LOCK;
110 bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD, status); 111 bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD, status);
112 mmiowb();
111} 113}
112 114
113u16 bcm43xx_radio_read16(struct bcm43xx_private *bcm, u16 offset) 115u16 bcm43xx_radio_read16(struct bcm43xx_private *bcm, u16 offset)
@@ -142,6 +144,7 @@ u16 bcm43xx_radio_read16(struct bcm43xx_private *bcm, u16 offset)
142void bcm43xx_radio_write16(struct bcm43xx_private *bcm, u16 offset, u16 val) 144void bcm43xx_radio_write16(struct bcm43xx_private *bcm, u16 offset, u16 val)
143{ 145{
144 bcm43xx_write16(bcm, BCM43xx_MMIO_RADIO_CONTROL, offset); 146 bcm43xx_write16(bcm, BCM43xx_MMIO_RADIO_CONTROL, offset);
147 mmiowb();
145 bcm43xx_write16(bcm, BCM43xx_MMIO_RADIO_DATA_LOW, val); 148 bcm43xx_write16(bcm, BCM43xx_MMIO_RADIO_DATA_LOW, val);
146} 149}
147 150
@@ -161,10 +164,10 @@ static void bcm43xx_set_all_gains(struct bcm43xx_private *bcm,
161 } 164 }
162 165
163 for (i = 0; i < 4; i++) 166 for (i = 0; i < 4; i++)
164 bcm43xx_ilt_write16(bcm, offset + i, first); 167 bcm43xx_ilt_write(bcm, offset + i, first);
165 168
166 for (i = start; i < end; i++) 169 for (i = start; i < end; i++)
167 bcm43xx_ilt_write16(bcm, offset + i, second); 170 bcm43xx_ilt_write(bcm, offset + i, second);
168 171
169 if (third != -1) { 172 if (third != -1) {
170 tmp = ((u16)third << 14) | ((u16)third << 6); 173 tmp = ((u16)third << 14) | ((u16)third << 6);
@@ -196,11 +199,11 @@ static void bcm43xx_set_original_gains(struct bcm43xx_private *bcm)
196 tmp |= (i & 0x0001) << 1; 199 tmp |= (i & 0x0001) << 1;
197 tmp |= (i & 0x0002) >> 1; 200 tmp |= (i & 0x0002) >> 1;
198 201
199 bcm43xx_ilt_write16(bcm, offset + i, tmp); 202 bcm43xx_ilt_write(bcm, offset + i, tmp);
200 } 203 }
201 204
202 for (i = start; i < end; i++) 205 for (i = start; i < end; i++)
203 bcm43xx_ilt_write16(bcm, offset + i, i - start); 206 bcm43xx_ilt_write(bcm, offset + i, i - start);
204 207
205 bcm43xx_phy_write(bcm, 0x04A0, 208 bcm43xx_phy_write(bcm, 0x04A0,
206 (bcm43xx_phy_read(bcm, 0x04A0) & 0xBFBF) | 0x4040); 209 (bcm43xx_phy_read(bcm, 0x04A0) & 0xBFBF) | 0x4040);
@@ -316,6 +319,7 @@ u8 bcm43xx_radio_aci_scan(struct bcm43xx_private *bcm)
316void bcm43xx_nrssi_hw_write(struct bcm43xx_private *bcm, u16 offset, s16 val) 319void bcm43xx_nrssi_hw_write(struct bcm43xx_private *bcm, u16 offset, s16 val)
317{ 320{
318 bcm43xx_phy_write(bcm, BCM43xx_PHY_NRSSILT_CTRL, offset); 321 bcm43xx_phy_write(bcm, BCM43xx_PHY_NRSSILT_CTRL, offset);
322 mmiowb();
319 bcm43xx_phy_write(bcm, BCM43xx_PHY_NRSSILT_DATA, (u16)val); 323 bcm43xx_phy_write(bcm, BCM43xx_PHY_NRSSILT_DATA, (u16)val);
320} 324}
321 325
@@ -612,10 +616,6 @@ void bcm43xx_calc_nrssi_slope(struct bcm43xx_private *bcm)
612 } 616 }
613 break; 617 break;
614 case BCM43xx_PHYTYPE_G: 618 case BCM43xx_PHYTYPE_G:
615//FIXME: Something is broken here. This is called when enabling WLAN interfmode.
616// If this is done at runtime, I get an XMIT ERROR and transmission is
617// broken. I guess some important register is overwritten by accident.
618// The XMIT ERROR comes from the dummy_transmissions in set_gains.
619 if (radio->revision >= 9) 619 if (radio->revision >= 9)
620 return; 620 return;
621 if (radio->revision == 8) 621 if (radio->revision == 8)
@@ -1641,14 +1641,14 @@ void bcm43xx_radio_set_txpower_a(struct bcm43xx_private *bcm, u16 txpower)
1641 base &= 0x000F; 1641 base &= 0x000F;
1642 bcm43xx_phy_write(bcm, 0x0017, base | 0x0020); 1642 bcm43xx_phy_write(bcm, 0x0017, base | 0x0020);
1643 1643
1644 ilt = bcm43xx_ilt_read16(bcm, 0x3001); 1644 ilt = bcm43xx_ilt_read(bcm, 0x3001);
1645 ilt &= 0x0007; 1645 ilt &= 0x0007;
1646 1646
1647 dac = bcm43xx_get_txgain_dac(txpower); 1647 dac = bcm43xx_get_txgain_dac(txpower);
1648 dac <<= 3; 1648 dac <<= 3;
1649 dac |= ilt; 1649 dac |= ilt;
1650 1650
1651 bcm43xx_ilt_write16(bcm, 0x3001, dac); 1651 bcm43xx_ilt_write(bcm, 0x3001, dac);
1652 1652
1653 bcm->current_core->radio->txpower[0] = txpower; 1653 bcm->current_core->radio->txpower[0] = txpower;
1654 1654