aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-02-20 13:30:10 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-27 14:52:53 -0500
commit3718582a663e035af5d2634cd537a012e20cdb3f (patch)
treea0f8656edeecd293cfc454c03454e8a1ed46b678 /drivers
parent4cf507696ae41950cd430e7534180fddd624b3cd (diff)
b43: Convert usage of b43_radio_mask()
This patch converts code to use the new b43_radio_mask() API. The semantic patch that makes this change is as follows: // <smpl> @@ expression dev, addr, mask; @@ -b43_radio_write16(dev, addr, b43_radio_read16(dev, addr) & mask); +b43_radio_mask(dev, addr, mask); // </smpl> Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/b43/lo.c6
-rw-r--r--drivers/net/wireless/b43/phy_a.c23
-rw-r--r--drivers/net/wireless/b43/phy_g.c16
3 files changed, 17 insertions, 28 deletions
diff --git a/drivers/net/wireless/b43/lo.c b/drivers/net/wireless/b43/lo.c
index c5e07fc2d069..70c39bbbcf1f 100644
--- a/drivers/net/wireless/b43/lo.c
+++ b/drivers/net/wireless/b43/lo.c
@@ -231,8 +231,7 @@ static void lo_measure_txctl_values(struct b43_wldev *dev)
231 231
232 reg = lo_txctl_register_table(dev, &mask, NULL); 232 reg = lo_txctl_register_table(dev, &mask, NULL);
233 mask = ~mask; 233 mask = ~mask;
234 b43_radio_write16(dev, reg, b43_radio_read16(dev, reg) 234 b43_radio_mask(dev, reg, mask);
235 & mask);
236 235
237 if (has_tx_magnification(phy)) { 236 if (has_tx_magnification(phy)) {
238 int i, j; 237 int i, j;
@@ -269,8 +268,7 @@ static void lo_measure_txctl_values(struct b43_wldev *dev)
269 } else { 268 } else {
270 lo->tx_magn = 0; 269 lo->tx_magn = 0;
271 lo->tx_bias = 0; 270 lo->tx_bias = 0;
272 b43_radio_write16(dev, 0x52, b43_radio_read16(dev, 0x52) 271 b43_radio_mask(dev, 0x52, 0xFFF0); /* TX bias == 0 */
273 & 0xFFF0); /* TX bias == 0 */
274 } 272 }
275 lo->txctl_measured_time = jiffies; 273 lo->txctl_measured_time = jiffies;
276} 274}
diff --git a/drivers/net/wireless/b43/phy_a.c b/drivers/net/wireless/b43/phy_a.c
index b07df38d5c21..4f052ebf06da 100644
--- a/drivers/net/wireless/b43/phy_a.c
+++ b/drivers/net/wireless/b43/phy_a.c
@@ -134,12 +134,10 @@ static void aphy_channel_switch(struct b43_wldev *dev, unsigned int channel)
134 b43_radio_write16(dev, 0x003A, (b43_radio_read16(dev, 0x003A) 134 b43_radio_write16(dev, 0x003A, (b43_radio_read16(dev, 0x003A)
135 & 0xFF20) | 135 & 0xFF20) |
136 freq_r3A_value(freq)); 136 freq_r3A_value(freq));
137 b43_radio_write16(dev, 0x003D, 137 b43_radio_mask(dev, 0x003D, 0x00FF);
138 b43_radio_read16(dev, 0x003D) & 0x00FF);
139 b43_radio_write16(dev, 0x0081, (b43_radio_read16(dev, 0x0081) 138 b43_radio_write16(dev, 0x0081, (b43_radio_read16(dev, 0x0081)
140 & 0xFF7F) | 0x0080); 139 & 0xFF7F) | 0x0080);
141 b43_radio_write16(dev, 0x0035, 140 b43_radio_mask(dev, 0x0035, 0xFFEF);
142 b43_radio_read16(dev, 0x0035) & 0xFFEF);
143 b43_radio_write16(dev, 0x0035, (b43_radio_read16(dev, 0x0035) 141 b43_radio_write16(dev, 0x0035, (b43_radio_read16(dev, 0x0035)
144 & 0xFFEF) | 0x0010); 142 & 0xFFEF) | 0x0010);
145 b43_radio_set_tx_iq(dev); 143 b43_radio_set_tx_iq(dev);
@@ -160,10 +158,10 @@ static void b43_radio_init2060(struct b43_wldev *dev)
160 b43_radio_write16(dev, 0x0082, 0x0080); 158 b43_radio_write16(dev, 0x0082, 0x0080);
161 b43_radio_write16(dev, 0x0080, 0x0000); 159 b43_radio_write16(dev, 0x0080, 0x0000);
162 b43_radio_write16(dev, 0x003F, 0x00DA); 160 b43_radio_write16(dev, 0x003F, 0x00DA);
163 b43_radio_write16(dev, 0x0005, b43_radio_read16(dev, 0x0005) & ~0x0008); 161 b43_radio_mask(dev, 0x0005, ~0x0008);
164 b43_radio_write16(dev, 0x0081, b43_radio_read16(dev, 0x0081) & ~0x0010); 162 b43_radio_mask(dev, 0x0081, ~0x0010);
165 b43_radio_write16(dev, 0x0081, b43_radio_read16(dev, 0x0081) & ~0x0020); 163 b43_radio_mask(dev, 0x0081, ~0x0020);
166 b43_radio_write16(dev, 0x0081, b43_radio_read16(dev, 0x0081) & ~0x0020); 164 b43_radio_mask(dev, 0x0081, ~0x0020);
167 msleep(1); /* delay 400usec */ 165 msleep(1); /* delay 400usec */
168 166
169 b43_radio_write16(dev, 0x0081, 167 b43_radio_write16(dev, 0x0081,
@@ -172,9 +170,9 @@ static void b43_radio_init2060(struct b43_wldev *dev)
172 170
173 b43_radio_write16(dev, 0x0005, 171 b43_radio_write16(dev, 0x0005,
174 (b43_radio_read16(dev, 0x0005) & ~0x0008) | 0x0008); 172 (b43_radio_read16(dev, 0x0005) & ~0x0008) | 0x0008);
175 b43_radio_write16(dev, 0x0085, b43_radio_read16(dev, 0x0085) & ~0x0010); 173 b43_radio_mask(dev, 0x0085, ~0x0010);
176 b43_radio_write16(dev, 0x0005, b43_radio_read16(dev, 0x0005) & ~0x0008); 174 b43_radio_mask(dev, 0x0005, ~0x0008);
177 b43_radio_write16(dev, 0x0081, b43_radio_read16(dev, 0x0081) & ~0x0040); 175 b43_radio_mask(dev, 0x0081, ~0x0040);
178 b43_radio_write16(dev, 0x0081, 176 b43_radio_write16(dev, 0x0081,
179 (b43_radio_read16(dev, 0x0081) & ~0x0040) | 0x0040); 177 (b43_radio_read16(dev, 0x0081) & ~0x0040) | 0x0040);
180 b43_radio_write16(dev, 0x0005, 178 b43_radio_write16(dev, 0x0005,
@@ -247,8 +245,7 @@ static void b43_phy_ww(struct b43_wldev *dev)
247 best_s = curr_s; 245 best_s = curr_s;
248 } 246 }
249 b43_phy_write(dev, B43_PHY_PWRDOWN, b); 247 b43_phy_write(dev, B43_PHY_PWRDOWN, b);
250 b43_radio_write16(dev, 0x0004, 248 b43_radio_mask(dev, 0x0004, 0xFFFB);
251 b43_radio_read16(dev, 0x0004) & 0xFFFB);
252 b43_radio_write16(dev, 0x0013, best_s); 249 b43_radio_write16(dev, 0x0013, best_s);
253 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC1_R1, 0, 0xFFEC); 250 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC1_R1, 0, 0xFFEC);
254 b43_phy_write(dev, B43_PHY_OFDM(0xB7), 0x1E80); 251 b43_phy_write(dev, B43_PHY_OFDM(0xB7), 0x1E80);
diff --git a/drivers/net/wireless/b43/phy_g.c b/drivers/net/wireless/b43/phy_g.c
index c8e4342cbd0f..8bad858c2d7a 100644
--- a/drivers/net/wireless/b43/phy_g.c
+++ b/drivers/net/wireless/b43/phy_g.c
@@ -489,8 +489,7 @@ static void b43_calc_nrssi_offset(struct b43_wldev *dev)
489 if (saved == 0xFFFF) 489 if (saved == 0xFFFF)
490 saved = 4; 490 saved = 4;
491 } else { 491 } else {
492 b43_radio_write16(dev, 0x007A, 492 b43_radio_mask(dev, 0x007A, 0x007F);
493 b43_radio_read16(dev, 0x007A) & 0x007F);
494 if (phy->rev != 1) { /* Not in specs, but needed to prevent PPC machine check */ 493 if (phy->rev != 1) { /* Not in specs, but needed to prevent PPC machine check */
495 b43_phy_set(dev, 0x0814, 0x0001); 494 b43_phy_set(dev, 0x0814, 0x0001);
496 b43_phy_mask(dev, 0x0815, 0xFFFE); 495 b43_phy_mask(dev, 0x0815, 0xFFFE);
@@ -626,8 +625,7 @@ static void b43_calc_nrssi_slope(struct b43_wldev *dev)
626 } 625 }
627 b43_radio_set(dev, 0x007A, 0x0070); 626 b43_radio_set(dev, 0x007A, 0x0070);
628 b43_set_all_gains(dev, 0, 8, 0); 627 b43_set_all_gains(dev, 0, 8, 0);
629 b43_radio_write16(dev, 0x007A, 628 b43_radio_mask(dev, 0x007A, 0x00F7);
630 b43_radio_read16(dev, 0x007A) & 0x00F7);
631 if (phy->rev >= 2) { 629 if (phy->rev >= 2) {
632 b43_phy_maskset(dev, 0x0811, 0xFFCF, 0x0030); 630 b43_phy_maskset(dev, 0x0811, 0xFFCF, 0x0030);
633 b43_phy_maskset(dev, 0x0812, 0xFFCF, 0x0010); 631 b43_phy_maskset(dev, 0x0812, 0xFFCF, 0x0010);
@@ -639,8 +637,7 @@ static void b43_calc_nrssi_slope(struct b43_wldev *dev)
639 if (nrssi0 >= 0x0020) 637 if (nrssi0 >= 0x0020)
640 nrssi0 -= 0x0040; 638 nrssi0 -= 0x0040;
641 639
642 b43_radio_write16(dev, 0x007A, 640 b43_radio_mask(dev, 0x007A, 0x007F);
643 b43_radio_read16(dev, 0x007A) & 0x007F);
644 if (phy->rev >= 2) { 641 if (phy->rev >= 2) {
645 b43_phy_maskset(dev, 0x0003, 0xFF9F, 0x0040); 642 b43_phy_maskset(dev, 0x0003, 0xFF9F, 0x0040);
646 } 643 }
@@ -1803,8 +1800,7 @@ static void b43_calc_loopback_gain(struct b43_wldev *dev)
1803 b43_phy_set(dev, B43_PHY_RFOVERVAL, 0x8000); 1800 b43_phy_set(dev, B43_PHY_RFOVERVAL, 0x8000);
1804 } 1801 }
1805 } 1802 }
1806 b43_radio_write16(dev, 0x7A, b43_radio_read16(dev, 0x7A) 1803 b43_radio_mask(dev, 0x7A, 0x00F7);
1807 & 0x00F7);
1808 1804
1809 j = 0; 1805 j = 0;
1810 loop_i_max = (phy->radio_rev == 8) ? 15 : 9; 1806 loop_i_max = (phy->radio_rev == 8) ? 15 : 9;
@@ -1992,9 +1988,7 @@ static void b43_phy_init_pctl(struct b43_wldev *dev)
1992 } 1988 }
1993 } 1989 }
1994 if (phy->radio_ver == 0x2050 && phy->analog == 0) { 1990 if (phy->radio_ver == 0x2050 && phy->analog == 0) {
1995 b43_radio_write16(dev, 0x0076, 1991 b43_radio_mask(dev, 0x0076, 0xFF7B);
1996 b43_radio_read16(dev, 0x0076)
1997 & 0xFF7B);
1998 } else { 1992 } else {
1999 b43_set_txpower_g(dev, &old_bbatt, 1993 b43_set_txpower_g(dev, &old_bbatt,
2000 &old_rfatt, old_tx_control); 1994 &old_rfatt, old_tx_control);