diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-12-14 12:03:36 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-12-18 15:23:19 -0500 |
commit | e45e91d8812c1cd4dac98efd6fb6d0dd27fa3d4a (patch) | |
tree | 729b637e74af3de63b8ea177df6af7b6a5bf80ad /drivers/net/wireless/ath/ath9k/recv.c | |
parent | f40c46082717cea32ba1852c8217cbb9693fe80f (diff) |
ath9k: add support for reporting per-chain signal strength
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/recv.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/recv.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 95ddca5495d4..2410224b6def 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -906,6 +906,7 @@ static void ath9k_process_rssi(struct ath_common *common, | |||
906 | struct ath_hw *ah = common->ah; | 906 | struct ath_hw *ah = common->ah; |
907 | int last_rssi; | 907 | int last_rssi; |
908 | int rssi = rx_stats->rs_rssi; | 908 | int rssi = rx_stats->rs_rssi; |
909 | int i, j; | ||
909 | 910 | ||
910 | /* | 911 | /* |
911 | * RSSI is not available for subframes in an A-MPDU. | 912 | * RSSI is not available for subframes in an A-MPDU. |
@@ -924,6 +925,20 @@ static void ath9k_process_rssi(struct ath_common *common, | |||
924 | return; | 925 | return; |
925 | } | 926 | } |
926 | 927 | ||
928 | for (i = 0, j = 0; i < ARRAY_SIZE(rx_stats->rs_rssi_ctl); i++) { | ||
929 | s8 rssi; | ||
930 | |||
931 | if (!(ah->rxchainmask & BIT(i))) | ||
932 | continue; | ||
933 | |||
934 | rssi = rx_stats->rs_rssi_ctl[i]; | ||
935 | if (rssi != ATH9K_RSSI_BAD) { | ||
936 | rxs->chains |= BIT(j); | ||
937 | rxs->chain_signal[j] = ah->noise + rssi; | ||
938 | } | ||
939 | j++; | ||
940 | } | ||
941 | |||
927 | /* | 942 | /* |
928 | * Update Beacon RSSI, this is used by ANI. | 943 | * Update Beacon RSSI, this is used by ANI. |
929 | */ | 944 | */ |
@@ -1073,14 +1088,14 @@ static int ath_process_fft(struct ath_softc *sc, struct ieee80211_hdr *hdr, | |||
1073 | fft_sample_40.channel_type = chan_type; | 1088 | fft_sample_40.channel_type = chan_type; |
1074 | 1089 | ||
1075 | if (chan_type == NL80211_CHAN_HT40PLUS) { | 1090 | if (chan_type == NL80211_CHAN_HT40PLUS) { |
1076 | lower_rssi = fix_rssi_inv_only(rs->rs_rssi_ctl0); | 1091 | lower_rssi = fix_rssi_inv_only(rs->rs_rssi_ctl[0]); |
1077 | upper_rssi = fix_rssi_inv_only(rs->rs_rssi_ext0); | 1092 | upper_rssi = fix_rssi_inv_only(rs->rs_rssi_ext[0]); |
1078 | 1093 | ||
1079 | fft_sample_40.lower_noise = ah->noise; | 1094 | fft_sample_40.lower_noise = ah->noise; |
1080 | fft_sample_40.upper_noise = ext_nf; | 1095 | fft_sample_40.upper_noise = ext_nf; |
1081 | } else { | 1096 | } else { |
1082 | lower_rssi = fix_rssi_inv_only(rs->rs_rssi_ext0); | 1097 | lower_rssi = fix_rssi_inv_only(rs->rs_rssi_ext[0]); |
1083 | upper_rssi = fix_rssi_inv_only(rs->rs_rssi_ctl0); | 1098 | upper_rssi = fix_rssi_inv_only(rs->rs_rssi_ctl[0]); |
1084 | 1099 | ||
1085 | fft_sample_40.lower_noise = ext_nf; | 1100 | fft_sample_40.lower_noise = ext_nf; |
1086 | fft_sample_40.upper_noise = ah->noise; | 1101 | fft_sample_40.upper_noise = ah->noise; |
@@ -1116,7 +1131,7 @@ static int ath_process_fft(struct ath_softc *sc, struct ieee80211_hdr *hdr, | |||
1116 | fft_sample_20.tlv.length = __cpu_to_be16(length); | 1131 | fft_sample_20.tlv.length = __cpu_to_be16(length); |
1117 | fft_sample_20.freq = __cpu_to_be16(freq); | 1132 | fft_sample_20.freq = __cpu_to_be16(freq); |
1118 | 1133 | ||
1119 | fft_sample_20.rssi = fix_rssi_inv_only(rs->rs_rssi_ctl0); | 1134 | fft_sample_20.rssi = fix_rssi_inv_only(rs->rs_rssi_ctl[0]); |
1120 | fft_sample_20.noise = ah->noise; | 1135 | fft_sample_20.noise = ah->noise; |
1121 | 1136 | ||
1122 | mag_info = ((struct ath_ht20_mag_info *)radar_info) - 1; | 1137 | mag_info = ((struct ath_ht20_mag_info *)radar_info) - 1; |