diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2013-03-07 10:47:23 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-03-13 14:27:50 -0400 |
commit | 371ec465a3589b27a81af7e5bf39b614aeab202c (patch) | |
tree | b0c3ea9943aa673c3d669617ffb052dedf5a61c9 /drivers/net/wireless/b43 | |
parent | 60e8fb9233e13e98b13a380ecc1cc05515e6e34c (diff) |
b43: HT-PHY: implement stopping sample tone playback
It was another sequence I recognized in HT-PHY dump:
phy_read(0x00c7) -> 0x0001
phy_read(0x00c3) -> 0x0000
phy_write(0x00c3) <- 0x0002
phy_read(0x00c3) -> 0x0000
phy_write(0x00c3) <- 0x0000
The difference to N-PHY is that it writes to 6 tables instead of a one
(after above).
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r-- | drivers/net/wireless/b43/phy_ht.c | 41 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_ht.h | 6 |
2 files changed, 47 insertions, 0 deletions
diff --git a/drivers/net/wireless/b43/phy_ht.c b/drivers/net/wireless/b43/phy_ht.c index 1663551f9428..e511f595929c 100644 --- a/drivers/net/wireless/b43/phy_ht.c +++ b/drivers/net/wireless/b43/phy_ht.c | |||
@@ -294,6 +294,36 @@ static void b43_phy_ht_bphy_init(struct b43_wldev *dev) | |||
294 | } | 294 | } |
295 | 295 | ||
296 | /************************************************** | 296 | /************************************************** |
297 | * Samples | ||
298 | **************************************************/ | ||
299 | |||
300 | #if 0 | ||
301 | static void b43_phy_ht_stop_playback(struct b43_wldev *dev) | ||
302 | { | ||
303 | struct b43_phy_ht *phy_ht = dev->phy.ht; | ||
304 | u16 tmp; | ||
305 | int i; | ||
306 | |||
307 | tmp = b43_phy_read(dev, B43_PHY_HT_SAMP_STAT); | ||
308 | if (tmp & 0x1) | ||
309 | b43_phy_set(dev, B43_PHY_HT_SAMP_CMD, B43_PHY_HT_SAMP_CMD_STOP); | ||
310 | else if (tmp & 0x2) | ||
311 | b43_phy_mask(dev, B43_PHY_HT_IQLOCAL_CMDGCTL, 0x7FFF); | ||
312 | |||
313 | b43_phy_mask(dev, B43_PHY_HT_SAMP_CMD, ~0x0004); | ||
314 | |||
315 | for (i = 0; i < 3; i++) { | ||
316 | if (phy_ht->bb_mult_save[i] >= 0) { | ||
317 | b43_httab_write(dev, B43_HTTAB16(13, 0x63 + i * 4), | ||
318 | phy_ht->bb_mult_save[i]); | ||
319 | b43_httab_write(dev, B43_HTTAB16(13, 0x67 + i * 4), | ||
320 | phy_ht->bb_mult_save[i]); | ||
321 | } | ||
322 | } | ||
323 | } | ||
324 | #endif | ||
325 | |||
326 | /************************************************** | ||
297 | * Tx/Rx | 327 | * Tx/Rx |
298 | **************************************************/ | 328 | **************************************************/ |
299 | 329 | ||
@@ -357,6 +387,13 @@ static void b43_phy_ht_tx_power_ctl(struct b43_wldev *dev, bool enable) | |||
357 | 387 | ||
358 | phy_ht->tx_pwr_ctl = enable; | 388 | phy_ht->tx_pwr_ctl = enable; |
359 | } | 389 | } |
390 | |||
391 | static void b43_phy_ht_tx_power_ctl_idle_tssi(struct b43_wldev *dev) | ||
392 | { | ||
393 | /* TODO */ | ||
394 | b43_phy_ht_stop_playback(dev); | ||
395 | /* TODO */ | ||
396 | } | ||
360 | #endif | 397 | #endif |
361 | 398 | ||
362 | /************************************************** | 399 | /************************************************** |
@@ -502,6 +539,9 @@ static void b43_phy_ht_op_prepare_structs(struct b43_wldev *dev) | |||
502 | phy_ht->tx_pwr_ctl = true; | 539 | phy_ht->tx_pwr_ctl = true; |
503 | for (i = 0; i < 3; i++) | 540 | for (i = 0; i < 3; i++) |
504 | phy_ht->tx_pwr_idx[i] = B43_PHY_HT_TXPCTL_CMD_C1_INIT + 1; | 541 | phy_ht->tx_pwr_idx[i] = B43_PHY_HT_TXPCTL_CMD_C1_INIT + 1; |
542 | |||
543 | for (i = 0; i < 3; i++) | ||
544 | phy_ht->bb_mult_save[i] = -1; | ||
505 | } | 545 | } |
506 | 546 | ||
507 | static int b43_phy_ht_op_init(struct b43_wldev *dev) | 547 | static int b43_phy_ht_op_init(struct b43_wldev *dev) |
@@ -640,6 +680,7 @@ static int b43_phy_ht_op_init(struct b43_wldev *dev) | |||
640 | b43_phy_ht_tx_power_fix(dev); | 680 | b43_phy_ht_tx_power_fix(dev); |
641 | #if 0 | 681 | #if 0 |
642 | b43_phy_ht_tx_power_ctl(dev, false); | 682 | b43_phy_ht_tx_power_ctl(dev, false); |
683 | b43_phy_ht_tx_power_ctl_idle_tssi(dev); | ||
643 | /* TODO */ | 684 | /* TODO */ |
644 | b43_phy_ht_tx_power_ctl(dev, saved_tx_pwr_ctl); | 685 | b43_phy_ht_tx_power_ctl(dev, saved_tx_pwr_ctl); |
645 | #endif | 686 | #endif |
diff --git a/drivers/net/wireless/b43/phy_ht.h b/drivers/net/wireless/b43/phy_ht.h index bc7a43f58c61..7ec794b70f03 100644 --- a/drivers/net/wireless/b43/phy_ht.h +++ b/drivers/net/wireless/b43/phy_ht.h | |||
@@ -16,6 +16,10 @@ | |||
16 | #define B43_PHY_HT_CLASS_CTL_CCK_EN 0x0001 /* CCK enable */ | 16 | #define B43_PHY_HT_CLASS_CTL_CCK_EN 0x0001 /* CCK enable */ |
17 | #define B43_PHY_HT_CLASS_CTL_OFDM_EN 0x0002 /* OFDM enable */ | 17 | #define B43_PHY_HT_CLASS_CTL_OFDM_EN 0x0002 /* OFDM enable */ |
18 | #define B43_PHY_HT_CLASS_CTL_WAITED_EN 0x0004 /* Waited enable */ | 18 | #define B43_PHY_HT_CLASS_CTL_WAITED_EN 0x0004 /* Waited enable */ |
19 | #define B43_PHY_HT_IQLOCAL_CMDGCTL 0x0C2 /* I/Q LO cal command G control */ | ||
20 | #define B43_PHY_HT_SAMP_CMD 0x0C3 /* Sample command */ | ||
21 | #define B43_PHY_HT_SAMP_CMD_STOP 0x0002 /* Stop */ | ||
22 | #define B43_PHY_HT_SAMP_STAT 0x0C7 /* Sample status */ | ||
19 | #define B43_PHY_HT_BW1 0x1CE | 23 | #define B43_PHY_HT_BW1 0x1CE |
20 | #define B43_PHY_HT_BW2 0x1CF | 24 | #define B43_PHY_HT_BW2 0x1CF |
21 | #define B43_PHY_HT_BW3 0x1D0 | 25 | #define B43_PHY_HT_BW3 0x1D0 |
@@ -80,6 +84,8 @@ struct b43_phy_ht { | |||
80 | 84 | ||
81 | bool tx_pwr_ctl; | 85 | bool tx_pwr_ctl; |
82 | u8 tx_pwr_idx[3]; | 86 | u8 tx_pwr_idx[3]; |
87 | |||
88 | s32 bb_mult_save[3]; | ||
83 | }; | 89 | }; |
84 | 90 | ||
85 | 91 | ||