diff options
author | Michael Buesch <mb@bu3sch.de> | 2009-02-20 13:25:05 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-27 14:52:52 -0500 |
commit | ac1ea3959f4c6694e92fe18a2ec72cfbed0c71fa (patch) | |
tree | 83467238eea281bcbacad41791e877167e6df8fc /drivers/net/wireless/b43/wa.c | |
parent | e59be0b5299ce327d67cfca737b839ef98e0da0e (diff) |
b43: Convert usage of b43_phy_mask()
This patch converts code to use the new b43_phy_mask() API.
The semantic patch that makes this change is as follows:
// <smpl>
@@
expression dev, addr, mask;
@@
-b43_phy_write(dev, addr, b43_phy_read(dev, addr) & mask);
+b43_phy_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/net/wireless/b43/wa.c')
-rw-r--r-- | drivers/net/wireless/b43/wa.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/net/wireless/b43/wa.c b/drivers/net/wireless/b43/wa.c index fe7a7de046fe..701dff84e997 100644 --- a/drivers/net/wireless/b43/wa.c +++ b/drivers/net/wireless/b43/wa.c | |||
@@ -62,8 +62,7 @@ void b43_wa_initgains(struct b43_wldev *dev) | |||
62 | struct b43_phy *phy = &dev->phy; | 62 | struct b43_phy *phy = &dev->phy; |
63 | 63 | ||
64 | b43_phy_write(dev, B43_PHY_LNAHPFCTL, 0x1FF9); | 64 | b43_phy_write(dev, B43_PHY_LNAHPFCTL, 0x1FF9); |
65 | b43_phy_write(dev, B43_PHY_LPFGAINCTL, | 65 | b43_phy_mask(dev, B43_PHY_LPFGAINCTL, 0xFF0F); |
66 | b43_phy_read(dev, B43_PHY_LPFGAINCTL) & 0xFF0F); | ||
67 | if (phy->rev <= 2) | 66 | if (phy->rev <= 2) |
68 | b43_ofdmtab_write16(dev, B43_OFDMTAB_LPFGAIN, 0, 0x1FBF); | 67 | b43_ofdmtab_write16(dev, B43_OFDMTAB_LPFGAIN, 0, 0x1FBF); |
69 | b43_radio_write16(dev, 0x0002, 0x1FBF); | 68 | b43_radio_write16(dev, 0x0002, 0x1FBF); |
@@ -86,7 +85,7 @@ void b43_wa_initgains(struct b43_wldev *dev) | |||
86 | 85 | ||
87 | static void b43_wa_divider(struct b43_wldev *dev) | 86 | static void b43_wa_divider(struct b43_wldev *dev) |
88 | { | 87 | { |
89 | b43_phy_write(dev, 0x002B, b43_phy_read(dev, 0x002B) & ~0x0100); | 88 | b43_phy_mask(dev, 0x002B, ~0x0100); |
90 | b43_phy_write(dev, 0x008E, 0x58C1); | 89 | b43_phy_write(dev, 0x008E, 0x58C1); |
91 | } | 90 | } |
92 | 91 | ||
@@ -433,8 +432,7 @@ static void b43_wa_altagc(struct b43_wldev *dev) | |||
433 | b43_phy_write(dev, B43_PHY_OFDM(0x1B), | 432 | b43_phy_write(dev, B43_PHY_OFDM(0x1B), |
434 | (b43_phy_read(dev, B43_PHY_OFDM(0x1B)) & ~0x001E) | 0x0002); | 433 | (b43_phy_read(dev, B43_PHY_OFDM(0x1B)) & ~0x001E) | 0x0002); |
435 | } else { | 434 | } else { |
436 | b43_phy_write(dev, B43_PHY_OFDM(0x1B), | 435 | b43_phy_mask(dev, B43_PHY_OFDM(0x1B), ~0x001E); |
437 | b43_phy_read(dev, B43_PHY_OFDM(0x1B)) & ~0x001E); | ||
438 | b43_phy_write(dev, B43_PHY_OFDM(0x1F), 0x287A); | 436 | b43_phy_write(dev, B43_PHY_OFDM(0x1F), 0x287A); |
439 | b43_phy_write(dev, B43_PHY_LPFGAINCTL, | 437 | b43_phy_write(dev, B43_PHY_LPFGAINCTL, |
440 | (b43_phy_read(dev, B43_PHY_LPFGAINCTL) & ~0x000F) | 0x0004); | 438 | (b43_phy_read(dev, B43_PHY_LPFGAINCTL) & ~0x000F) | 0x0004); |
@@ -465,10 +463,8 @@ static void b43_wa_altagc(struct b43_wldev *dev) | |||
465 | b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC3, 3, 28); | 463 | b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC3, 3, 28); |
466 | } | 464 | } |
467 | if (phy->rev >= 6) { | 465 | if (phy->rev >= 6) { |
468 | b43_phy_write(dev, B43_PHY_OFDM(0x26), | 466 | b43_phy_mask(dev, B43_PHY_OFDM(0x26), ~0x0003); |
469 | b43_phy_read(dev, B43_PHY_OFDM(0x26)) & ~0x0003); | 467 | b43_phy_mask(dev, B43_PHY_OFDM(0x26), ~0x1000); |
470 | b43_phy_write(dev, B43_PHY_OFDM(0x26), | ||
471 | b43_phy_read(dev, B43_PHY_OFDM(0x26)) & ~0x1000); | ||
472 | } | 468 | } |
473 | b43_phy_read(dev, B43_PHY_VERSION_OFDM); /* Dummy read */ | 469 | b43_phy_read(dev, B43_PHY_VERSION_OFDM); /* Dummy read */ |
474 | } | 470 | } |
@@ -534,8 +530,7 @@ static void b43_wa_boards_g(struct b43_wldev *dev) | |||
534 | b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 2, 0x0001); | 530 | b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 2, 0x0001); |
535 | if ((bus->sprom.boardflags_lo & B43_BFL_EXTLNA) && | 531 | if ((bus->sprom.boardflags_lo & B43_BFL_EXTLNA) && |
536 | (phy->rev >= 7)) { | 532 | (phy->rev >= 7)) { |
537 | b43_phy_write(dev, B43_PHY_EXTG(0x11), | 533 | b43_phy_mask(dev, B43_PHY_EXTG(0x11), 0xF7FF); |
538 | b43_phy_read(dev, B43_PHY_EXTG(0x11)) & 0xF7FF); | ||
539 | b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 0x0020, 0x0001); | 534 | b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 0x0020, 0x0001); |
540 | b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 0x0021, 0x0001); | 535 | b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 0x0021, 0x0001); |
541 | b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 0x0022, 0x0001); | 536 | b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 0x0022, 0x0001); |