aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtl818x/rtl8180_grf5101.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2010-07-21 16:26:40 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-07-26 15:09:03 -0400
commit8b73fb8e29e9ae0458d36cc0dc25e2717587dfd4 (patch)
treea711485ca5e49078386f624ecbf4942288b77d89 /drivers/net/wireless/rtl818x/rtl8180_grf5101.c
parent1ab36d68e37faa431d99a07cbfb477a48879934e (diff)
rtl8180: improve signal reporting for actual rtl8180 hardware
Adapted from Realtek-provided driver... Signed-off-by: John W. Linville <linville@tuxdriver.com> Tested-by: Pauli Nieminen <suokkos@gmail.com>
Diffstat (limited to 'drivers/net/wireless/rtl818x/rtl8180_grf5101.c')
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180_grf5101.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/net/wireless/rtl818x/rtl8180_grf5101.c b/drivers/net/wireless/rtl818x/rtl8180_grf5101.c
index 947ee55f18b2..5cab9dfa8c07 100644
--- a/drivers/net/wireless/rtl818x/rtl8180_grf5101.c
+++ b/drivers/net/wireless/rtl818x/rtl8180_grf5101.c
@@ -69,6 +69,15 @@ static void grf5101_write_phy_antenna(struct ieee80211_hw *dev, short chan)
69 rtl8180_write_phy(dev, 0x10, ant); 69 rtl8180_write_phy(dev, 0x10, ant);
70} 70}
71 71
72static u8 grf5101_rf_calc_rssi(u8 agc, u8 sq)
73{
74 if (agc > 60)
75 return 65;
76
77 /* TODO(?): just return agc (or agc + 5) to avoid mult / div */
78 return 65 * agc / 60;
79}
80
72static void grf5101_rf_set_channel(struct ieee80211_hw *dev, 81static void grf5101_rf_set_channel(struct ieee80211_hw *dev,
73 struct ieee80211_conf *conf) 82 struct ieee80211_conf *conf)
74{ 83{
@@ -176,5 +185,6 @@ const struct rtl818x_rf_ops grf5101_rf_ops = {
176 .name = "GCT", 185 .name = "GCT",
177 .init = grf5101_rf_init, 186 .init = grf5101_rf_init,
178 .stop = grf5101_rf_stop, 187 .stop = grf5101_rf_stop,
179 .set_chan = grf5101_rf_set_channel 188 .set_chan = grf5101_rf_set_channel,
189 .calc_rssi = grf5101_rf_calc_rssi,
180}; 190};