aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2011-06-27 18:08:53 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-06-29 15:11:02 -0400
commit3e644ab47e0cbedc7dd694d3af9996dc514ebf4a (patch)
tree65bafe24a93e4134d033a9bc0ece182825534bf7
parente8dec1e99aee468c6fb19f07a2660f9205a70f2c (diff)
b43: HT-PHY: init radio when enabling it
Masks and sets were found in MMIO dumps by using MMIO hacks. Shortly: radio_write(0x0c51) <- 0x0070 radio_write(0x0c5a) <- 0x0003 radio_write(0x0146) <- 0x0003 radio_write(0x0546) <- 0x0003 radio_write(0x0946) <- 0x0003 radio_write(0x002e) <- 0x0078 radio_write(0x00c0) <- 0x0080 radio_write(0x002e) <- 0xff87 radio_write(0x00c0) <- 0xff7f radio_write(0x0011) <- 0xfff7 Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/b43/phy_ht.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/net/wireless/b43/phy_ht.c b/drivers/net/wireless/b43/phy_ht.c
index 8df92e12799a..28fb7464c318 100644
--- a/drivers/net/wireless/b43/phy_ht.c
+++ b/drivers/net/wireless/b43/phy_ht.c
@@ -28,6 +28,10 @@
28#include "radio_2059.h" 28#include "radio_2059.h"
29#include "main.h" 29#include "main.h"
30 30
31/**************************************************
32 * Radio 2059.
33 **************************************************/
34
31static void b43_radio_2059_channel_setup(struct b43_wldev *dev, 35static void b43_radio_2059_channel_setup(struct b43_wldev *dev,
32 const struct b43_phy_ht_channeltab_e_radio2059 *e) 36 const struct b43_phy_ht_channeltab_e_radio2059 *e)
33{ 37{
@@ -79,6 +83,30 @@ static void b43_radio_2059_channel_setup(struct b43_wldev *dev,
79 udelay(300); 83 udelay(300);
80} 84}
81 85
86static void b43_radio_2059_init(struct b43_wldev *dev)
87{
88 const u16 routing[] = { R2059_SYN, R2059_TXRX0, R2059_RXRX1 };
89 u8 i;
90
91 b43_radio_write(dev, R2059_ALL | 0x51, 0x0070);
92 b43_radio_write(dev, R2059_ALL | 0x5a, 0x0003);
93
94 for (i = 0; i < ARRAY_SIZE(routing); i++)
95 b43_radio_set(dev, routing[i] | 0x146, 0x3);
96
97 b43_radio_set(dev, 0x2e, 0x0078);
98 b43_radio_set(dev, 0xc0, 0x0080);
99 msleep(2);
100 b43_radio_mask(dev, 0x2e, ~0x0078);
101 b43_radio_mask(dev, 0xc0, ~0x0080);
102
103 b43_radio_mask(dev, 0x11, 0x0008);
104}
105
106/**************************************************
107 * Channel switching ops.
108 **************************************************/
109
82static void b43_phy_ht_channel_setup(struct b43_wldev *dev, 110static void b43_phy_ht_channel_setup(struct b43_wldev *dev,
83 const struct b43_phy_ht_channeltab_e_phy *e, 111 const struct b43_phy_ht_channeltab_e_phy *e,
84 struct ieee80211_channel *new_channel) 112 struct ieee80211_channel *new_channel)
@@ -200,6 +228,11 @@ static void b43_phy_ht_op_software_rfkill(struct b43_wldev *dev,
200 b43_phy_maskset(dev, B43_PHY_HT_RF_CTL1, ~0, 0x1); 228 b43_phy_maskset(dev, B43_PHY_HT_RF_CTL1, ~0, 0x1);
201 b43_phy_mask(dev, B43_PHY_HT_RF_CTL1, ~0); 229 b43_phy_mask(dev, B43_PHY_HT_RF_CTL1, ~0);
202 b43_phy_maskset(dev, B43_PHY_HT_RF_CTL1, ~0, 0x2); 230 b43_phy_maskset(dev, B43_PHY_HT_RF_CTL1, ~0, 0x2);
231
232 if (dev->phy.radio_ver == 0x2059)
233 b43_radio_2059_init(dev);
234 else
235 B43_WARN_ON(1);
203 } 236 }
204} 237}
205 238