diff options
author | Michael Buesch <mb@bu3sch.de> | 2009-02-20 13:28:14 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-27 14:52:53 -0500 |
commit | 4cf507696ae41950cd430e7534180fddd624b3cd (patch) | |
tree | 6cb514d5ad42f016c4739066b709a93852a66621 | |
parent | 76e190cd4b3b9e79096df153edb04092433a797b (diff) |
b43: Convert usage of b43_radio_set()
This patch converts code to use the new b43_radio_set() API.
The semantic patch that makes this change is as follows:
// <smpl>
@@
expression dev, addr, set;
@@
-b43_radio_write16(dev, addr, b43_radio_read16(dev, addr) | set);
+b43_radio_set(dev, addr, set);
// </smpl>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/b43/phy_a.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_g.c | 38 | ||||
-rw-r--r-- | drivers/net/wireless/b43/wa.c | 3 |
3 files changed, 16 insertions, 31 deletions
diff --git a/drivers/net/wireless/b43/phy_a.c b/drivers/net/wireless/b43/phy_a.c index 6845d120bc2e..b07df38d5c21 100644 --- a/drivers/net/wireless/b43/phy_a.c +++ b/drivers/net/wireless/b43/phy_a.c | |||
@@ -227,16 +227,14 @@ static void b43_phy_ww(struct b43_wldev *dev) | |||
227 | b43_phy_mask(dev, B43_PHY_CRS0, ~B43_PHY_CRS0_EN); | 227 | b43_phy_mask(dev, B43_PHY_CRS0, ~B43_PHY_CRS0_EN); |
228 | b43_phy_set(dev, B43_PHY_OFDM(0x1B), 0x1000); | 228 | b43_phy_set(dev, B43_PHY_OFDM(0x1B), 0x1000); |
229 | b43_phy_maskset(dev, B43_PHY_OFDM(0x82), 0xF0FF, 0x0300); | 229 | b43_phy_maskset(dev, B43_PHY_OFDM(0x82), 0xF0FF, 0x0300); |
230 | b43_radio_write16(dev, 0x0009, | 230 | b43_radio_set(dev, 0x0009, 0x0080); |
231 | b43_radio_read16(dev, 0x0009) | 0x0080); | ||
232 | b43_radio_write16(dev, 0x0012, | 231 | b43_radio_write16(dev, 0x0012, |
233 | (b43_radio_read16(dev, 0x0012) & 0xFFFC) | 0x0002); | 232 | (b43_radio_read16(dev, 0x0012) & 0xFFFC) | 0x0002); |
234 | b43_wa_initgains(dev); | 233 | b43_wa_initgains(dev); |
235 | b43_phy_write(dev, B43_PHY_OFDM(0xBA), 0x3ED5); | 234 | b43_phy_write(dev, B43_PHY_OFDM(0xBA), 0x3ED5); |
236 | b = b43_phy_read(dev, B43_PHY_PWRDOWN); | 235 | b = b43_phy_read(dev, B43_PHY_PWRDOWN); |
237 | b43_phy_write(dev, B43_PHY_PWRDOWN, (b & 0xFFF8) | 0x0005); | 236 | b43_phy_write(dev, B43_PHY_PWRDOWN, (b & 0xFFF8) | 0x0005); |
238 | b43_radio_write16(dev, 0x0004, | 237 | b43_radio_set(dev, 0x0004, 0x0004); |
239 | b43_radio_read16(dev, 0x0004) | 0x0004); | ||
240 | for (i = 0x10; i <= 0x20; i++) { | 238 | for (i = 0x10; i <= 0x20; i++) { |
241 | b43_radio_write16(dev, 0x0013, i); | 239 | b43_radio_write16(dev, 0x0013, i); |
242 | curr_s = b43_phy_read(dev, B43_PHY_OTABLEQ) & 0x00FF; | 240 | curr_s = b43_phy_read(dev, B43_PHY_OTABLEQ) & 0x00FF; |
diff --git a/drivers/net/wireless/b43/phy_g.c b/drivers/net/wireless/b43/phy_g.c index 9068eda11ba3..c8e4342cbd0f 100644 --- a/drivers/net/wireless/b43/phy_g.c +++ b/drivers/net/wireless/b43/phy_g.c | |||
@@ -468,8 +468,8 @@ static void b43_calc_nrssi_offset(struct b43_wldev *dev) | |||
468 | b43_phy_set(dev, 0x0060, 0x0040); | 468 | b43_phy_set(dev, 0x0060, 0x0040); |
469 | b43_phy_set(dev, 0x0014, 0x0200); | 469 | b43_phy_set(dev, 0x0014, 0x0200); |
470 | } | 470 | } |
471 | b43_radio_write16(dev, 0x007A, b43_radio_read16(dev, 0x007A) | 0x0070); | 471 | b43_radio_set(dev, 0x007A, 0x0070); |
472 | b43_radio_write16(dev, 0x007A, b43_radio_read16(dev, 0x007A) | 0x0080); | 472 | b43_radio_set(dev, 0x007A, 0x0080); |
473 | udelay(30); | 473 | udelay(30); |
474 | 474 | ||
475 | v47F = (s16) ((b43_phy_read(dev, 0x047F) >> 8) & 0x003F); | 475 | v47F = (s16) ((b43_phy_read(dev, 0x047F) >> 8) & 0x003F); |
@@ -512,8 +512,7 @@ static void b43_calc_nrssi_offset(struct b43_wldev *dev) | |||
512 | b43_phy_mask(dev, 0x0815, 0xFFFB); | 512 | b43_phy_mask(dev, 0x0815, 0xFFFB); |
513 | } | 513 | } |
514 | b43_phy_maskset(dev, 0x0003, 0xFF9F, 0x0040); | 514 | b43_phy_maskset(dev, 0x0003, 0xFF9F, 0x0040); |
515 | b43_radio_write16(dev, 0x007A, | 515 | b43_radio_set(dev, 0x007A, 0x000F); |
516 | b43_radio_read16(dev, 0x007A) | 0x000F); | ||
517 | b43_set_all_gains(dev, 3, 0, 1); | 516 | b43_set_all_gains(dev, 3, 0, 1); |
518 | b43_radio_write16(dev, 0x0043, (b43_radio_read16(dev, 0x0043) | 517 | b43_radio_write16(dev, 0x0043, (b43_radio_read16(dev, 0x0043) |
519 | & 0x00F0) | 0x000F); | 518 | & 0x00F0) | 0x000F); |
@@ -625,8 +624,7 @@ static void b43_calc_nrssi_slope(struct b43_wldev *dev) | |||
625 | b43_phy_set(dev, 0x0060, 0x0040); | 624 | b43_phy_set(dev, 0x0060, 0x0040); |
626 | b43_phy_set(dev, 0x0014, 0x0200); | 625 | b43_phy_set(dev, 0x0014, 0x0200); |
627 | } | 626 | } |
628 | b43_radio_write16(dev, 0x007A, | 627 | b43_radio_set(dev, 0x007A, 0x0070); |
629 | b43_radio_read16(dev, 0x007A) | 0x0070); | ||
630 | b43_set_all_gains(dev, 0, 8, 0); | 628 | b43_set_all_gains(dev, 0, 8, 0); |
631 | b43_radio_write16(dev, 0x007A, | 629 | b43_radio_write16(dev, 0x007A, |
632 | b43_radio_read16(dev, 0x007A) & 0x00F7); | 630 | b43_radio_read16(dev, 0x007A) & 0x00F7); |
@@ -634,8 +632,7 @@ static void b43_calc_nrssi_slope(struct b43_wldev *dev) | |||
634 | b43_phy_maskset(dev, 0x0811, 0xFFCF, 0x0030); | 632 | b43_phy_maskset(dev, 0x0811, 0xFFCF, 0x0030); |
635 | b43_phy_maskset(dev, 0x0812, 0xFFCF, 0x0010); | 633 | b43_phy_maskset(dev, 0x0812, 0xFFCF, 0x0010); |
636 | } | 634 | } |
637 | b43_radio_write16(dev, 0x007A, | 635 | b43_radio_set(dev, 0x007A, 0x0080); |
638 | b43_radio_read16(dev, 0x007A) | 0x0080); | ||
639 | udelay(20); | 636 | udelay(20); |
640 | 637 | ||
641 | nrssi0 = (s16) ((b43_phy_read(dev, 0x047F) >> 8) & 0x003F); | 638 | nrssi0 = (s16) ((b43_phy_read(dev, 0x047F) >> 8) & 0x003F); |
@@ -651,8 +648,7 @@ static void b43_calc_nrssi_slope(struct b43_wldev *dev) | |||
651 | b43_write16(dev, B43_MMIO_CHANNEL_EXT, | 648 | b43_write16(dev, B43_MMIO_CHANNEL_EXT, |
652 | b43_read16(dev, B43_MMIO_CHANNEL_EXT) | 649 | b43_read16(dev, B43_MMIO_CHANNEL_EXT) |
653 | | 0x2000); | 650 | | 0x2000); |
654 | b43_radio_write16(dev, 0x007A, | 651 | b43_radio_set(dev, 0x007A, 0x000F); |
655 | b43_radio_read16(dev, 0x007A) | 0x000F); | ||
656 | b43_phy_write(dev, 0x0015, 0xF330); | 652 | b43_phy_write(dev, 0x0015, 0xF330); |
657 | if (phy->rev >= 2) { | 653 | if (phy->rev >= 2) { |
658 | b43_phy_maskset(dev, 0x0812, 0xFFCF, 0x0020); | 654 | b43_phy_maskset(dev, 0x0812, 0xFFCF, 0x0020); |
@@ -1355,8 +1351,7 @@ static u16 b43_radio_init2050(struct b43_wldev *dev) | |||
1355 | LPD(0, 0, 1))); | 1351 | LPD(0, 0, 1))); |
1356 | } | 1352 | } |
1357 | b43_phy_write(dev, B43_PHY_PGACTL, 0xBFA0); | 1353 | b43_phy_write(dev, B43_PHY_PGACTL, 0xBFA0); |
1358 | b43_radio_write16(dev, 0x51, b43_radio_read16(dev, 0x51) | 1354 | b43_radio_set(dev, 0x51, 0x0004); |
1359 | | 0x0004); | ||
1360 | if (phy->radio_rev == 8) { | 1355 | if (phy->radio_rev == 8) { |
1361 | b43_radio_write16(dev, 0x43, 0x1F); | 1356 | b43_radio_write16(dev, 0x43, 0x1F); |
1362 | } else { | 1357 | } else { |
@@ -1511,8 +1506,7 @@ static void b43_phy_initb5(struct b43_wldev *dev) | |||
1511 | u8 old_channel; | 1506 | u8 old_channel; |
1512 | 1507 | ||
1513 | if (phy->analog == 1) { | 1508 | if (phy->analog == 1) { |
1514 | b43_radio_write16(dev, 0x007A, b43_radio_read16(dev, 0x007A) | 1509 | b43_radio_set(dev, 0x007A, 0x0050); |
1515 | | 0x0050); | ||
1516 | } | 1510 | } |
1517 | if ((bus->boardinfo.vendor != SSB_BOARDVENDOR_BCM) && | 1511 | if ((bus->boardinfo.vendor != SSB_BOARDVENDOR_BCM) && |
1518 | (bus->boardinfo.type != SSB_BOARD_BU4306)) { | 1512 | (bus->boardinfo.type != SSB_BOARD_BU4306)) { |
@@ -1528,12 +1522,8 @@ static void b43_phy_initb5(struct b43_wldev *dev) | |||
1528 | 1522 | ||
1529 | if (phy->gmode || phy->rev >= 2) { | 1523 | if (phy->gmode || phy->rev >= 2) { |
1530 | if (phy->radio_ver == 0x2050) { | 1524 | if (phy->radio_ver == 0x2050) { |
1531 | b43_radio_write16(dev, 0x007A, | 1525 | b43_radio_set(dev, 0x007A, 0x0020); |
1532 | b43_radio_read16(dev, 0x007A) | 1526 | b43_radio_set(dev, 0x0051, 0x0004); |
1533 | | 0x0020); | ||
1534 | b43_radio_write16(dev, 0x0051, | ||
1535 | b43_radio_read16(dev, 0x0051) | ||
1536 | | 0x0004); | ||
1537 | } | 1527 | } |
1538 | b43_write16(dev, B43_MMIO_PHY_RADIO, 0x0000); | 1528 | b43_write16(dev, B43_MMIO_PHY_RADIO, 0x0000); |
1539 | 1529 | ||
@@ -1590,7 +1580,7 @@ static void b43_phy_initb5(struct b43_wldev *dev) | |||
1590 | b43_radio_write16(dev, 0x005B, 0x007B); | 1580 | b43_radio_write16(dev, 0x005B, 0x007B); |
1591 | b43_radio_write16(dev, 0x005C, 0x00B0); | 1581 | b43_radio_write16(dev, 0x005C, 0x00B0); |
1592 | 1582 | ||
1593 | b43_radio_write16(dev, 0x007A, b43_radio_read16(dev, 0x007A) | 0x0007); | 1583 | b43_radio_set(dev, 0x007A, 0x0007); |
1594 | 1584 | ||
1595 | b43_gphy_channel_switch(dev, old_channel, 0); | 1585 | b43_gphy_channel_switch(dev, old_channel, 0); |
1596 | 1586 | ||
@@ -1666,10 +1656,8 @@ static void b43_phy_initb6(struct b43_wldev *dev) | |||
1666 | val += 0x0202; | 1656 | val += 0x0202; |
1667 | } | 1657 | } |
1668 | if (phy->type == B43_PHYTYPE_G) { | 1658 | if (phy->type == B43_PHYTYPE_G) { |
1669 | b43_radio_write16(dev, 0x007A, | 1659 | b43_radio_set(dev, 0x007A, 0x0020); |
1670 | b43_radio_read16(dev, 0x007A) | 0x0020); | 1660 | b43_radio_set(dev, 0x0051, 0x0004); |
1671 | b43_radio_write16(dev, 0x0051, | ||
1672 | b43_radio_read16(dev, 0x0051) | 0x0004); | ||
1673 | b43_phy_set(dev, 0x0802, 0x0100); | 1661 | b43_phy_set(dev, 0x0802, 0x0100); |
1674 | b43_phy_set(dev, 0x042B, 0x2000); | 1662 | b43_phy_set(dev, 0x042B, 0x2000); |
1675 | b43_phy_write(dev, 0x5B, 0); | 1663 | b43_phy_write(dev, 0x5B, 0); |
diff --git a/drivers/net/wireless/b43/wa.c b/drivers/net/wireless/b43/wa.c index fecb86bd72ef..b0767cf22e2e 100644 --- a/drivers/net/wireless/b43/wa.c +++ b/drivers/net/wireless/b43/wa.c | |||
@@ -386,8 +386,7 @@ static void b43_wa_altagc(struct b43_wldev *dev) | |||
386 | b43_phy_maskset(dev, B43_PHY_OFDM(0x1A), ~0x007F, 0x000F); | 386 | b43_phy_maskset(dev, B43_PHY_OFDM(0x1A), ~0x007F, 0x000F); |
387 | b43_phy_maskset(dev, B43_PHY_OFDM(0x1A), ~0x3F80, 0x2B80); | 387 | b43_phy_maskset(dev, B43_PHY_OFDM(0x1A), ~0x3F80, 0x2B80); |
388 | b43_phy_maskset(dev, B43_PHY_ANTWRSETT, 0xF0FF, 0x0300); | 388 | b43_phy_maskset(dev, B43_PHY_ANTWRSETT, 0xF0FF, 0x0300); |
389 | b43_radio_write16(dev, 0x7A, | 389 | b43_radio_set(dev, 0x7A, 0x0008); |
390 | b43_radio_read16(dev, 0x7A) | 0x0008); | ||
391 | b43_phy_maskset(dev, B43_PHY_N1P1GAIN, ~0x000F, 0x0008); | 390 | b43_phy_maskset(dev, B43_PHY_N1P1GAIN, ~0x000F, 0x0008); |
392 | b43_phy_maskset(dev, B43_PHY_P1P2GAIN, ~0x0F00, 0x0600); | 391 | b43_phy_maskset(dev, B43_PHY_P1P2GAIN, ~0x0F00, 0x0600); |
393 | b43_phy_maskset(dev, B43_PHY_N1N2GAIN, ~0x0F00, 0x0700); | 392 | b43_phy_maskset(dev, B43_PHY_N1N2GAIN, ~0x0F00, 0x0700); |