diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2011-08-14 17:27:29 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-24 14:41:41 -0400 |
commit | ba356b569f7c0ff5cdf6c1abb8a9b789e5eeed22 (patch) | |
tree | 1544c890691ffbc2bc6d5713b369980dfb408477 /drivers | |
parent | f928668f2d822ec51c0853fc92f4da2fef376958 (diff) |
b43: LCN-PHY: implement disabling radio
wl reads radio version, then disables it. That's how we found it in MMIO
dump:
radio_read(0x0000) -> 0x0031 <-- RADIO READ WITHOUT 0x200 SET!
radio_read(0x0001) -> 0x0064 <-- RADIO READ WITHOUT 0x200 SET!
radio_read(0x0002) -> 0x0020 <-- RADIO READ WITHOUT 0x200 SET!
read32 0xfaafc120 -> 0x04000400
phy_read(0x044d) -> 0x0000
phy_write(0x044d) <- 0x0000
phy_read(0x044c) -> 0x1fff
phy_write(0x044c) <- 0x1fff
phy_read(0x04b7) -> 0x0000
phy_write(0x04b7) <- 0x0000
phy_read(0x04b1) -> 0x0000
phy_write(0x04b1) <- 0x0000
phy_read(0x04b0) -> 0x7dff
phy_write(0x04b0) <- 0x7dff
phy_read(0x04fa) -> 0x0000
phy_write(0x04fa) <- 0x0000
phy_read(0x04f9) -> 0x007f
phy_write(0x04f9) <- 0x007f
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/b43/phy_lcn.c | 23 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_lcn.h | 9 |
2 files changed, 32 insertions, 0 deletions
diff --git a/drivers/net/wireless/b43/phy_lcn.c b/drivers/net/wireless/b43/phy_lcn.c index 03944ad13cfb..69a93b5586c8 100644 --- a/drivers/net/wireless/b43/phy_lcn.c +++ b/drivers/net/wireless/b43/phy_lcn.c | |||
@@ -60,6 +60,27 @@ static void b43_phy_lcn_op_prepare_structs(struct b43_wldev *dev) | |||
60 | memset(phy_lcn, 0, sizeof(*phy_lcn)); | 60 | memset(phy_lcn, 0, sizeof(*phy_lcn)); |
61 | } | 61 | } |
62 | 62 | ||
63 | static void b43_phy_lcn_op_software_rfkill(struct b43_wldev *dev, | ||
64 | bool blocked) | ||
65 | { | ||
66 | if (b43_read32(dev, B43_MMIO_MACCTL) & B43_MACCTL_ENABLED) | ||
67 | b43err(dev->wl, "MAC not suspended\n"); | ||
68 | |||
69 | if (blocked) { | ||
70 | b43_phy_mask(dev, B43_PHY_LCN_RF_CTL2, ~0x7c00); | ||
71 | b43_phy_set(dev, B43_PHY_LCN_RF_CTL1, 0x1f00); | ||
72 | |||
73 | b43_phy_mask(dev, B43_PHY_LCN_RF_CTL5, ~0x7f00); | ||
74 | b43_phy_mask(dev, B43_PHY_LCN_RF_CTL4, ~0x2); | ||
75 | b43_phy_set(dev, B43_PHY_LCN_RF_CTL3, 0x808); | ||
76 | |||
77 | b43_phy_mask(dev, B43_PHY_LCN_RF_CTL7, ~0x8); | ||
78 | b43_phy_set(dev, B43_PHY_LCN_RF_CTL6, 0x8); | ||
79 | } else { | ||
80 | /* TODO */ | ||
81 | } | ||
82 | } | ||
83 | |||
63 | static unsigned int b43_phy_lcn_op_get_default_chan(struct b43_wldev *dev) | 84 | static unsigned int b43_phy_lcn_op_get_default_chan(struct b43_wldev *dev) |
64 | { | 85 | { |
65 | if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) | 86 | if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) |
@@ -92,7 +113,9 @@ const struct b43_phy_operations b43_phyops_lcn = { | |||
92 | .phy_maskset = b43_phy_lcn_op_maskset, | 113 | .phy_maskset = b43_phy_lcn_op_maskset, |
93 | .radio_read = b43_phy_lcn_op_radio_read, | 114 | .radio_read = b43_phy_lcn_op_radio_read, |
94 | .radio_write = b43_phy_lcn_op_radio_write, | 115 | .radio_write = b43_phy_lcn_op_radio_write, |
116 | */ | ||
95 | .software_rfkill = b43_phy_lcn_op_software_rfkill, | 117 | .software_rfkill = b43_phy_lcn_op_software_rfkill, |
118 | /* | ||
96 | .switch_analog = b43_phy_lcn_op_switch_analog, | 119 | .switch_analog = b43_phy_lcn_op_switch_analog, |
97 | .switch_channel = b43_phy_lcn_op_switch_channel, | 120 | .switch_channel = b43_phy_lcn_op_switch_channel, |
98 | */ | 121 | */ |
diff --git a/drivers/net/wireless/b43/phy_lcn.h b/drivers/net/wireless/b43/phy_lcn.h index 9e1b291cca38..89f13b2e3370 100644 --- a/drivers/net/wireless/b43/phy_lcn.h +++ b/drivers/net/wireless/b43/phy_lcn.h | |||
@@ -4,6 +4,15 @@ | |||
4 | #include "phy_common.h" | 4 | #include "phy_common.h" |
5 | 5 | ||
6 | 6 | ||
7 | #define B43_PHY_LCN_RF_CTL1 B43_PHY_OFDM(0x04C) | ||
8 | #define B43_PHY_LCN_RF_CTL2 B43_PHY_OFDM(0x04D) | ||
9 | #define B43_PHY_LCN_RF_CTL3 B43_PHY_OFDM(0x0B0) | ||
10 | #define B43_PHY_LCN_RF_CTL4 B43_PHY_OFDM(0x0B1) | ||
11 | #define B43_PHY_LCN_RF_CTL5 B43_PHY_OFDM(0x0B7) | ||
12 | #define B43_PHY_LCN_RF_CTL6 B43_PHY_OFDM(0x0F9) | ||
13 | #define B43_PHY_LCN_RF_CTL7 B43_PHY_OFDM(0x0FA) | ||
14 | |||
15 | |||
7 | struct b43_phy_lcn { | 16 | struct b43_phy_lcn { |
8 | }; | 17 | }; |
9 | 18 | ||