aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Kossifidis <mickflemm@gmail.com>2010-11-23 14:28:15 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-11-30 13:53:23 -0500
commita2677fe4298c61f0e93c063e59815bf21c530c4a (patch)
treea0248b1aee28ab1b7a532a1d477845e0a4066a9a
parentb2b4c69f682a2868411899a77842061dd745884f (diff)
ath5k: Update spur mitigation filter for turbo/half/quarter
* Add spur mitigation filter support for half/quarter and turbo. Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath5k/phy.c53
1 files changed, 32 insertions, 21 deletions
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
index 6913a52cecc5..b9089151e7dc 100644
--- a/drivers/net/wireless/ath/ath5k/phy.c
+++ b/drivers/net/wireless/ath/ath5k/phy.c
@@ -1622,7 +1622,7 @@ ath5k_hw_set_spur_mitigation_filter(struct ath5k_hw *ah,
1622 spur_chan_fbin = AR5K_EEPROM_NO_SPUR; 1622 spur_chan_fbin = AR5K_EEPROM_NO_SPUR;
1623 spur_detection_window = AR5K_SPUR_CHAN_WIDTH; 1623 spur_detection_window = AR5K_SPUR_CHAN_WIDTH;
1624 /* XXX: Half/Quarter channels ?*/ 1624 /* XXX: Half/Quarter channels ?*/
1625 if (channel->hw_value & CHANNEL_TURBO) 1625 if (ah->ah_bwmode == AR5K_BWMODE_40MHZ)
1626 spur_detection_window *= 2; 1626 spur_detection_window *= 2;
1627 1627
1628 for (i = 0; i < AR5K_EEPROM_N_SPUR_CHANS; i++) { 1628 for (i = 0; i < AR5K_EEPROM_N_SPUR_CHANS; i++) {
@@ -1651,32 +1651,43 @@ ath5k_hw_set_spur_mitigation_filter(struct ath5k_hw *ah,
1651 * Calculate deltas: 1651 * Calculate deltas:
1652 * spur_freq_sigma_delta -> spur_offset / sample_freq << 21 1652 * spur_freq_sigma_delta -> spur_offset / sample_freq << 21
1653 * spur_delta_phase -> spur_offset / chip_freq << 11 1653 * spur_delta_phase -> spur_offset / chip_freq << 11
1654 * Note: Both values have 100KHz resolution 1654 * Note: Both values have 100Hz resolution
1655 */ 1655 */
1656 /* XXX: Half/Quarter rate channels ? */ 1656 switch (ah->ah_bwmode) {
1657 switch (channel->hw_value) { 1657 case AR5K_BWMODE_40MHZ:
1658 case CHANNEL_A:
1659 /* Both sample_freq and chip_freq are 40MHz */
1660 spur_delta_phase = (spur_offset << 17) / 25;
1661 spur_freq_sigma_delta = (spur_delta_phase >> 10);
1662 symbol_width = AR5K_SPUR_SYMBOL_WIDTH_BASE_100Hz;
1663 break;
1664 case CHANNEL_G:
1665 /* sample_freq -> 40MHz chip_freq -> 44MHz
1666 * (for b compatibility) */
1667 spur_freq_sigma_delta = (spur_offset << 8) / 55;
1668 spur_delta_phase = (spur_offset << 17) / 25;
1669 symbol_width = AR5K_SPUR_SYMBOL_WIDTH_BASE_100Hz;
1670 break;
1671 case CHANNEL_T:
1672 case CHANNEL_TG:
1673 /* Both sample_freq and chip_freq are 80MHz */ 1658 /* Both sample_freq and chip_freq are 80MHz */
1674 spur_delta_phase = (spur_offset << 16) / 25; 1659 spur_delta_phase = (spur_offset << 16) / 25;
1675 spur_freq_sigma_delta = (spur_delta_phase >> 10); 1660 spur_freq_sigma_delta = (spur_delta_phase >> 10);
1676 symbol_width = AR5K_SPUR_SYMBOL_WIDTH_TURBO_100Hz; 1661 symbol_width = AR5K_SPUR_SYMBOL_WIDTH_BASE_100Hz * 2;
1677 break; 1662 break;
1663 case AR5K_BWMODE_10MHZ:
1664 /* Both sample_freq and chip_freq are 20MHz (?) */
1665 spur_delta_phase = (spur_offset << 18) / 25;
1666 spur_freq_sigma_delta = (spur_delta_phase >> 10);
1667 symbol_width = AR5K_SPUR_SYMBOL_WIDTH_BASE_100Hz / 2;
1668 case AR5K_BWMODE_5MHZ:
1669 /* Both sample_freq and chip_freq are 10MHz (?) */
1670 spur_delta_phase = (spur_offset << 19) / 25;
1671 spur_freq_sigma_delta = (spur_delta_phase >> 10);
1672 symbol_width = AR5K_SPUR_SYMBOL_WIDTH_BASE_100Hz / 4;
1678 default: 1673 default:
1679 return; 1674 if (channel->hw_value == CHANNEL_A) {
1675 /* Both sample_freq and chip_freq are 40MHz */
1676 spur_delta_phase = (spur_offset << 17) / 25;
1677 spur_freq_sigma_delta =
1678 (spur_delta_phase >> 10);
1679 symbol_width =
1680 AR5K_SPUR_SYMBOL_WIDTH_BASE_100Hz;
1681 } else {
1682 /* sample_freq -> 40MHz chip_freq -> 44MHz
1683 * (for b compatibility) */
1684 spur_delta_phase = (spur_offset << 17) / 25;
1685 spur_freq_sigma_delta =
1686 (spur_offset << 8) / 55;
1687 symbol_width =
1688 AR5K_SPUR_SYMBOL_WIDTH_BASE_100Hz;
1689 }
1690 break;
1680 } 1691 }
1681 1692
1682 /* Calculate pilot and magnitude masks */ 1693 /* Calculate pilot and magnitude masks */