diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2010-02-27 07:03:34 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-03-09 15:06:51 -0500 |
commit | c2b7aefdc9b10c64a4e4be2303131006f9dc7013 (patch) | |
tree | b38fbfd11c0f704d1040925f3bd92b1504c5fe96 /drivers/net/wireless | |
parent | 8987a9e98fbc6a8b74c0dfc96a69d5e8c200492a (diff) |
b43: N-PHY: turn radio on/off (rfkill)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/b43/phy_n.c | 50 |
1 files changed, 37 insertions, 13 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index 2d8eda145cb8..dd81e8aec912 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -218,7 +218,10 @@ static void b43_radio_init2055_post(struct b43_wldev *dev) | |||
218 | b43_radio_write16(dev, B2055_C2_RX_BB_MIDACHP, 0x83); | 218 | b43_radio_write16(dev, B2055_C2_RX_BB_MIDACHP, 0x83); |
219 | } | 219 | } |
220 | 220 | ||
221 | /* Initialize a Broadcom 2055 N-radio */ | 221 | /* |
222 | * Initialize a Broadcom 2055 N-radio | ||
223 | * http://bcm-v4.sipsolutions.net/802.11/Radio/2055/Init | ||
224 | */ | ||
222 | static void b43_radio_init2055(struct b43_wldev *dev) | 225 | static void b43_radio_init2055(struct b43_wldev *dev) |
223 | { | 226 | { |
224 | b43_radio_init2055_pre(dev); | 227 | b43_radio_init2055_pre(dev); |
@@ -229,17 +232,6 @@ static void b43_radio_init2055(struct b43_wldev *dev) | |||
229 | b43_radio_init2055_post(dev); | 232 | b43_radio_init2055_post(dev); |
230 | } | 233 | } |
231 | 234 | ||
232 | void b43_nphy_radio_turn_on(struct b43_wldev *dev) | ||
233 | { | ||
234 | b43_radio_init2055(dev); | ||
235 | } | ||
236 | |||
237 | void b43_nphy_radio_turn_off(struct b43_wldev *dev) | ||
238 | { | ||
239 | b43_phy_mask(dev, B43_NPHY_RFCTL_CMD, | ||
240 | ~B43_NPHY_RFCTL_CMD_EN); | ||
241 | } | ||
242 | |||
243 | /* | 235 | /* |
244 | * Upload the N-PHY tables. | 236 | * Upload the N-PHY tables. |
245 | * http://bcm-v4.sipsolutions.net/802.11/PHY/N/InitTables | 237 | * http://bcm-v4.sipsolutions.net/802.11/PHY/N/InitTables |
@@ -3277,9 +3269,41 @@ static void b43_nphy_op_radio_write(struct b43_wldev *dev, u16 reg, u16 value) | |||
3277 | b43_write16(dev, B43_MMIO_RADIO_DATA_LOW, value); | 3269 | b43_write16(dev, B43_MMIO_RADIO_DATA_LOW, value); |
3278 | } | 3270 | } |
3279 | 3271 | ||
3272 | /* http://bcm-v4.sipsolutions.net/802.11/Radio/Switch%20Radio */ | ||
3280 | static void b43_nphy_op_software_rfkill(struct b43_wldev *dev, | 3273 | static void b43_nphy_op_software_rfkill(struct b43_wldev *dev, |
3281 | bool blocked) | 3274 | bool blocked) |
3282 | {//TODO | 3275 | { |
3276 | if (b43_read32(dev, B43_MMIO_MACCTL) & B43_MACCTL_ENABLED) | ||
3277 | b43err(dev->wl, "MAC not suspended\n"); | ||
3278 | |||
3279 | if (blocked) { | ||
3280 | b43_phy_mask(dev, B43_NPHY_RFCTL_CMD, | ||
3281 | ~B43_NPHY_RFCTL_CMD_CHIP0PU); | ||
3282 | if (dev->phy.rev >= 3) { | ||
3283 | b43_radio_mask(dev, 0x09, ~0x2); | ||
3284 | |||
3285 | b43_radio_write(dev, 0x204D, 0); | ||
3286 | b43_radio_write(dev, 0x2053, 0); | ||
3287 | b43_radio_write(dev, 0x2058, 0); | ||
3288 | b43_radio_write(dev, 0x205E, 0); | ||
3289 | b43_radio_mask(dev, 0x2062, ~0xF0); | ||
3290 | b43_radio_write(dev, 0x2064, 0); | ||
3291 | |||
3292 | b43_radio_write(dev, 0x304D, 0); | ||
3293 | b43_radio_write(dev, 0x3053, 0); | ||
3294 | b43_radio_write(dev, 0x3058, 0); | ||
3295 | b43_radio_write(dev, 0x305E, 0); | ||
3296 | b43_radio_mask(dev, 0x3062, ~0xF0); | ||
3297 | b43_radio_write(dev, 0x3064, 0); | ||
3298 | } | ||
3299 | } else { | ||
3300 | if (dev->phy.rev >= 3) { | ||
3301 | /* TODO: b43_radio_init2056(dev); */ | ||
3302 | /* TODO: PHY Set Channel Spec (dev, radio_chanspec) */ | ||
3303 | } else { | ||
3304 | b43_radio_init2055(dev); | ||
3305 | } | ||
3306 | } | ||
3283 | } | 3307 | } |
3284 | 3308 | ||
3285 | static void b43_nphy_op_switch_analog(struct b43_wldev *dev, bool on) | 3309 | static void b43_nphy_op_switch_analog(struct b43_wldev *dev, bool on) |