diff options
author | Nick Kossifidis <mick@madwifi-project.org> | 2009-02-08 23:03:41 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-13 13:44:43 -0500 |
commit | 6f3b414aca060a847e243f676b8601731938eb48 (patch) | |
tree | 51345c9930dbb9281d2f3dd0ebf0268870caa357 /drivers/net/wireless/ath5k/ath5k.h | |
parent | 33a31826b4fe9f26d6b383bad19b7ae522fda006 (diff) |
ath5k: Update gain_F calibration code and add documentation
* Update and cleanup rf gain optimization code
* Add comments and refferences to docs and use sane function names
* Use only step index on ath5k_gain, no need to have a pointer to
the current step since we can determine te step from it's index,
this also allows us to put all other structs on rfgain.h and cleanup
ath5k.h a little
* No need for ah_rfgain variable, we use ah_gain.g_state for everything
* Tested on RF2112B chip but gain_F calibration is not yet done
(we will finish this on the next patch where we'll rewrite rf-buffer
handling)
* Use initial rf gain settings for 2316 and 2317 SoCs introduced on a previous patch
It seems big but it's mostly cleanup, very few functional changes have been made on phy.c
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath5k/ath5k.h')
-rw-r--r-- | drivers/net/wireless/ath5k/ath5k.h | 51 |
1 files changed, 11 insertions, 40 deletions
diff --git a/drivers/net/wireless/ath5k/ath5k.h b/drivers/net/wireless/ath5k/ath5k.h index 0eda785fe62f..c870e2ae575a 100644 --- a/drivers/net/wireless/ath5k/ath5k.h +++ b/drivers/net/wireless/ath5k/ath5k.h | |||
@@ -649,49 +649,21 @@ struct ath5k_beacon_state { | |||
649 | 649 | ||
650 | enum ath5k_rfgain { | 650 | enum ath5k_rfgain { |
651 | AR5K_RFGAIN_INACTIVE = 0, | 651 | AR5K_RFGAIN_INACTIVE = 0, |
652 | AR5K_RFGAIN_ACTIVE, | ||
652 | AR5K_RFGAIN_READ_REQUESTED, | 653 | AR5K_RFGAIN_READ_REQUESTED, |
653 | AR5K_RFGAIN_NEED_CHANGE, | 654 | AR5K_RFGAIN_NEED_CHANGE, |
654 | }; | 655 | }; |
655 | 656 | ||
656 | #define AR5K_GAIN_CRN_FIX_BITS_5111 4 | ||
657 | #define AR5K_GAIN_CRN_FIX_BITS_5112 7 | ||
658 | #define AR5K_GAIN_CRN_MAX_FIX_BITS AR5K_GAIN_CRN_FIX_BITS_5112 | ||
659 | #define AR5K_GAIN_DYN_ADJUST_HI_MARGIN 15 | ||
660 | #define AR5K_GAIN_DYN_ADJUST_LO_MARGIN 20 | ||
661 | #define AR5K_GAIN_CCK_PROBE_CORR 5 | ||
662 | #define AR5K_GAIN_CCK_OFDM_GAIN_DELTA 15 | ||
663 | #define AR5K_GAIN_STEP_COUNT 10 | ||
664 | #define AR5K_GAIN_PARAM_TX_CLIP 0 | ||
665 | #define AR5K_GAIN_PARAM_PD_90 1 | ||
666 | #define AR5K_GAIN_PARAM_PD_84 2 | ||
667 | #define AR5K_GAIN_PARAM_GAIN_SEL 3 | ||
668 | #define AR5K_GAIN_PARAM_MIX_ORN 0 | ||
669 | #define AR5K_GAIN_PARAM_PD_138 1 | ||
670 | #define AR5K_GAIN_PARAM_PD_137 2 | ||
671 | #define AR5K_GAIN_PARAM_PD_136 3 | ||
672 | #define AR5K_GAIN_PARAM_PD_132 4 | ||
673 | #define AR5K_GAIN_PARAM_PD_131 5 | ||
674 | #define AR5K_GAIN_PARAM_PD_130 6 | ||
675 | #define AR5K_GAIN_CHECK_ADJUST(_g) \ | ||
676 | ((_g)->g_current <= (_g)->g_low || (_g)->g_current >= (_g)->g_high) | ||
677 | |||
678 | struct ath5k_gain_opt_step { | ||
679 | s16 gos_param[AR5K_GAIN_CRN_MAX_FIX_BITS]; | ||
680 | s32 gos_gain; | ||
681 | }; | ||
682 | |||
683 | struct ath5k_gain { | 657 | struct ath5k_gain { |
684 | u32 g_step_idx; | 658 | u8 g_step_idx; |
685 | u32 g_current; | 659 | u8 g_current; |
686 | u32 g_target; | 660 | u8 g_target; |
687 | u32 g_low; | 661 | u8 g_low; |
688 | u32 g_high; | 662 | u8 g_high; |
689 | u32 g_f_corr; | 663 | u8 g_f_corr; |
690 | u32 g_active; | 664 | u8 g_state; |
691 | const struct ath5k_gain_opt_step *g_step; | ||
692 | }; | 665 | }; |
693 | 666 | ||
694 | |||
695 | /********************\ | 667 | /********************\ |
696 | COMMON DEFINITIONS | 668 | COMMON DEFINITIONS |
697 | \********************/ | 669 | \********************/ |
@@ -1053,7 +1025,6 @@ struct ath5k_hw { | |||
1053 | bool ah_running; | 1025 | bool ah_running; |
1054 | bool ah_single_chip; | 1026 | bool ah_single_chip; |
1055 | bool ah_combined_mic; | 1027 | bool ah_combined_mic; |
1056 | enum ath5k_rfgain ah_rf_gain; | ||
1057 | 1028 | ||
1058 | u32 ah_mac_srev; | 1029 | u32 ah_mac_srev; |
1059 | u16 ah_mac_version; | 1030 | u16 ah_mac_version; |
@@ -1262,9 +1233,9 @@ extern int ath5k_hw_write_initvals(struct ath5k_hw *ah, u8 mode, bool change_cha | |||
1262 | 1233 | ||
1263 | /* Initialize RF */ | 1234 | /* Initialize RF */ |
1264 | extern int ath5k_hw_rfregs(struct ath5k_hw *ah, struct ieee80211_channel *channel, unsigned int mode); | 1235 | extern int ath5k_hw_rfregs(struct ath5k_hw *ah, struct ieee80211_channel *channel, unsigned int mode); |
1265 | extern int ath5k_hw_rfgain(struct ath5k_hw *ah, unsigned int freq); | 1236 | extern int ath5k_hw_rfgain_init(struct ath5k_hw *ah, unsigned int freq); |
1266 | extern enum ath5k_rfgain ath5k_hw_get_rf_gain(struct ath5k_hw *ah); | 1237 | extern enum ath5k_rfgain ath5k_hw_gainf_calibrate(struct ath5k_hw *ah); |
1267 | extern int ath5k_hw_set_rfgain_opt(struct ath5k_hw *ah); | 1238 | extern int ath5k_hw_rfgain_opt_init(struct ath5k_hw *ah); |
1268 | /* PHY/RF channel functions */ | 1239 | /* PHY/RF channel functions */ |
1269 | extern bool ath5k_channel_ok(struct ath5k_hw *ah, u16 freq, unsigned int flags); | 1240 | extern bool ath5k_channel_ok(struct ath5k_hw *ah, u16 freq, unsigned int flags); |
1270 | extern int ath5k_hw_channel(struct ath5k_hw *ah, struct ieee80211_channel *channel); | 1241 | extern int ath5k_hw_channel(struct ath5k_hw *ah, struct ieee80211_channel *channel); |