aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorGábor Stefanik <netrolller.3d@gmail.com>2009-08-13 10:51:51 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-20 11:33:08 -0400
commit2f19c287fecb958eb68b1c2199b4dd6e00ba4276 (patch)
treefc1a733586330c42a444ec3562340988ad6df1ae /drivers/net
parent1758c0947605211ef953cc91d6bbdf847a21b822 (diff)
b43: Update dummy transmission to match V4 specs
The V4 dummy transmission has two extra bools in its prototype, so update all callers with the 2 bools. Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/b43/lo.c2
-rw-r--r--drivers/net/wireless/b43/main.c42
-rw-r--r--drivers/net/wireless/b43/main.h2
-rw-r--r--drivers/net/wireless/b43/phy_g.c6
-rw-r--r--drivers/net/wireless/b43/wa.c2
5 files changed, 31 insertions, 23 deletions
diff --git a/drivers/net/wireless/b43/lo.c b/drivers/net/wireless/b43/lo.c
index 22d0fbd83a62..976104f634a1 100644
--- a/drivers/net/wireless/b43/lo.c
+++ b/drivers/net/wireless/b43/lo.c
@@ -477,7 +477,7 @@ static void lo_measure_setup(struct b43_wldev *dev,
477 } else 477 } else
478 b43_phy_write(dev, B43_PHY_CCK(0x2B), 0x0802); 478 b43_phy_write(dev, B43_PHY_CCK(0x2B), 0x0802);
479 if (phy->rev >= 2) 479 if (phy->rev >= 2)
480 b43_dummy_transmission(dev); 480 b43_dummy_transmission(dev, false, true);
481 b43_gphy_channel_switch(dev, 6, 0); 481 b43_gphy_channel_switch(dev, 6, 0);
482 b43_radio_read16(dev, 0x51); /* dummy read */ 482 b43_radio_read16(dev, 0x51); /* dummy read */
483 if (phy->type == B43_PHYTYPE_G) 483 if (phy->type == B43_PHYTYPE_G)
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 950beefbeaeb..f6d039e303f4 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -691,9 +691,9 @@ static void b43_synchronize_irq(struct b43_wldev *dev)
691} 691}
692 692
693/* DummyTransmission function, as documented on 693/* DummyTransmission function, as documented on
694 * http://bcm-specs.sipsolutions.net/DummyTransmission 694 * http://bcm-v4.sipsolutions.net/802.11/DummyTransmission
695 */ 695 */
696void b43_dummy_transmission(struct b43_wldev *dev) 696void b43_dummy_transmission(struct b43_wldev *dev, bool ofdm, bool pa_on)
697{ 697{
698 struct b43_wl *wl = dev->wl; 698 struct b43_wl *wl = dev->wl;
699 struct b43_phy *phy = &dev->phy; 699 struct b43_phy *phy = &dev->phy;
@@ -707,19 +707,12 @@ void b43_dummy_transmission(struct b43_wldev *dev)
707 0x00000000, 707 0x00000000,
708 }; 708 };
709 709
710 switch (phy->type) { 710 if (ofdm) {
711 case B43_PHYTYPE_A:
712 max_loop = 0x1E; 711 max_loop = 0x1E;
713 buffer[0] = 0x000201CC; 712 buffer[0] = 0x000201CC;
714 break; 713 } else {
715 case B43_PHYTYPE_B:
716 case B43_PHYTYPE_G:
717 max_loop = 0xFA; 714 max_loop = 0xFA;
718 buffer[0] = 0x000B846E; 715 buffer[0] = 0x000B846E;
719 break;
720 default:
721 B43_WARN_ON(1);
722 return;
723 } 716 }
724 717
725 spin_lock_irq(&wl->irq_lock); 718 spin_lock_irq(&wl->irq_lock);
@@ -728,20 +721,35 @@ void b43_dummy_transmission(struct b43_wldev *dev)
728 for (i = 0; i < 5; i++) 721 for (i = 0; i < 5; i++)
729 b43_ram_write(dev, i * 4, buffer[i]); 722 b43_ram_write(dev, i * 4, buffer[i]);
730 723
731 /* Commit writes */
732 b43_read32(dev, B43_MMIO_MACCTL);
733
734 b43_write16(dev, 0x0568, 0x0000); 724 b43_write16(dev, 0x0568, 0x0000);
735 b43_write16(dev, 0x07C0, 0x0000); 725 if (dev->dev->id.revision < 11)
736 value = ((phy->type == B43_PHYTYPE_A) ? 1 : 0); 726 b43_write16(dev, 0x07C0, 0x0000);
727 else
728 b43_write16(dev, 0x07C0, 0x0100);
729 value = (ofdm ? 0x41 : 0x40);
737 b43_write16(dev, 0x050C, value); 730 b43_write16(dev, 0x050C, value);
731 if ((phy->type == B43_PHYTYPE_N) || (phy->type == B43_PHYTYPE_LP))
732 b43_write16(dev, 0x0514, 0x1A02);
738 b43_write16(dev, 0x0508, 0x0000); 733 b43_write16(dev, 0x0508, 0x0000);
739 b43_write16(dev, 0x050A, 0x0000); 734 b43_write16(dev, 0x050A, 0x0000);
740 b43_write16(dev, 0x054C, 0x0000); 735 b43_write16(dev, 0x054C, 0x0000);
741 b43_write16(dev, 0x056A, 0x0014); 736 b43_write16(dev, 0x056A, 0x0014);
742 b43_write16(dev, 0x0568, 0x0826); 737 b43_write16(dev, 0x0568, 0x0826);
743 b43_write16(dev, 0x0500, 0x0000); 738 b43_write16(dev, 0x0500, 0x0000);
744 b43_write16(dev, 0x0502, 0x0030); 739 if (!pa_on && (phy->type == B43_PHYTYPE_N)) {
740 //SPEC TODO
741 }
742
743 switch (phy->type) {
744 case B43_PHYTYPE_N:
745 b43_write16(dev, 0x0502, 0x00D0);
746 break;
747 case B43_PHYTYPE_LP:
748 b43_write16(dev, 0x0502, 0x0050);
749 break;
750 default:
751 b43_write16(dev, 0x0502, 0x0030);
752 }
745 753
746 if (phy->radio_ver == 0x2050 && phy->radio_rev <= 0x5) 754 if (phy->radio_ver == 0x2050 && phy->radio_rev <= 0x5)
747 b43_radio_write16(dev, 0x0051, 0x0017); 755 b43_radio_write16(dev, 0x0051, 0x0017);
diff --git a/drivers/net/wireless/b43/main.h b/drivers/net/wireless/b43/main.h
index 950fb1b0546d..0406e06781d4 100644
--- a/drivers/net/wireless/b43/main.h
+++ b/drivers/net/wireless/b43/main.h
@@ -123,7 +123,7 @@ void __b43_shm_write16(struct b43_wldev *dev, u16 routing, u16 offset, u16 value
123u64 b43_hf_read(struct b43_wldev *dev); 123u64 b43_hf_read(struct b43_wldev *dev);
124void b43_hf_write(struct b43_wldev *dev, u64 value); 124void b43_hf_write(struct b43_wldev *dev, u64 value);
125 125
126void b43_dummy_transmission(struct b43_wldev *dev); 126void b43_dummy_transmission(struct b43_wldev *dev, bool ofdm, bool pa_on);
127 127
128void b43_wireless_core_reset(struct b43_wldev *dev, u32 flags); 128void b43_wireless_core_reset(struct b43_wldev *dev, u32 flags);
129 129
diff --git a/drivers/net/wireless/b43/phy_g.c b/drivers/net/wireless/b43/phy_g.c
index 5300232449f6..e47131216a67 100644
--- a/drivers/net/wireless/b43/phy_g.c
+++ b/drivers/net/wireless/b43/phy_g.c
@@ -333,7 +333,7 @@ static void b43_set_all_gains(struct b43_wldev *dev,
333 b43_phy_maskset(dev, 0x04A1, 0xBFBF, tmp); 333 b43_phy_maskset(dev, 0x04A1, 0xBFBF, tmp);
334 b43_phy_maskset(dev, 0x04A2, 0xBFBF, tmp); 334 b43_phy_maskset(dev, 0x04A2, 0xBFBF, tmp);
335 } 335 }
336 b43_dummy_transmission(dev); 336 b43_dummy_transmission(dev, false, true);
337} 337}
338 338
339static void b43_set_original_gains(struct b43_wldev *dev) 339static void b43_set_original_gains(struct b43_wldev *dev)
@@ -365,7 +365,7 @@ static void b43_set_original_gains(struct b43_wldev *dev)
365 b43_phy_maskset(dev, 0x04A0, 0xBFBF, 0x4040); 365 b43_phy_maskset(dev, 0x04A0, 0xBFBF, 0x4040);
366 b43_phy_maskset(dev, 0x04A1, 0xBFBF, 0x4040); 366 b43_phy_maskset(dev, 0x04A1, 0xBFBF, 0x4040);
367 b43_phy_maskset(dev, 0x04A2, 0xBFBF, 0x4000); 367 b43_phy_maskset(dev, 0x04A2, 0xBFBF, 0x4000);
368 b43_dummy_transmission(dev); 368 b43_dummy_transmission(dev, false, true);
369} 369}
370 370
371/* http://bcm-specs.sipsolutions.net/NRSSILookupTable */ 371/* http://bcm-specs.sipsolutions.net/NRSSILookupTable */
@@ -1964,7 +1964,7 @@ static void b43_phy_init_pctl(struct b43_wldev *dev)
1964 } 1964 }
1965 b43_set_txpower_g(dev, &bbatt, &rfatt, 0); 1965 b43_set_txpower_g(dev, &bbatt, &rfatt, 0);
1966 } 1966 }
1967 b43_dummy_transmission(dev); 1967 b43_dummy_transmission(dev, false, true);
1968 gphy->cur_idle_tssi = b43_phy_read(dev, B43_PHY_ITSSI); 1968 gphy->cur_idle_tssi = b43_phy_read(dev, B43_PHY_ITSSI);
1969 if (B43_DEBUG) { 1969 if (B43_DEBUG) {
1970 /* Current-Idle-TSSI sanity check. */ 1970 /* Current-Idle-TSSI sanity check. */
diff --git a/drivers/net/wireless/b43/wa.c b/drivers/net/wireless/b43/wa.c
index e1e20f69f6d7..73e97fa4ddf7 100644
--- a/drivers/net/wireless/b43/wa.c
+++ b/drivers/net/wireless/b43/wa.c
@@ -37,7 +37,7 @@ static void b43_wa_papd(struct b43_wldev *dev)
37 backup = b43_ofdmtab_read16(dev, B43_OFDMTAB_PWRDYN2, 0); 37 backup = b43_ofdmtab_read16(dev, B43_OFDMTAB_PWRDYN2, 0);
38 b43_ofdmtab_write16(dev, B43_OFDMTAB_PWRDYN2, 0, 7); 38 b43_ofdmtab_write16(dev, B43_OFDMTAB_PWRDYN2, 0, 7);
39 b43_ofdmtab_write16(dev, B43_OFDMTAB_UNKNOWN_APHY, 0, 0); 39 b43_ofdmtab_write16(dev, B43_OFDMTAB_UNKNOWN_APHY, 0, 0);
40 b43_dummy_transmission(dev); 40 b43_dummy_transmission(dev, true, true);
41 b43_ofdmtab_write16(dev, B43_OFDMTAB_PWRDYN2, 0, backup); 41 b43_ofdmtab_write16(dev, B43_OFDMTAB_PWRDYN2, 0, backup);
42} 42}
43 43