diff options
author | Oleksij Rempel <linux@rempel-privat.de> | 2014-02-04 04:27:43 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-02-12 15:35:59 -0500 |
commit | e5ba18c6901631237c49ec54ce54397369dea7fa (patch) | |
tree | 3afa709e1f965963c18339234fc9a4a0de62cfb5 /drivers/net | |
parent | 1f83b0492939ec94bcab868f338139a7de521863 (diff) |
ath9k_htc: use ath9k_cmn_process_rssi
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_init.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_main.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 21 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/mac.h | 9 |
5 files changed, 7 insertions, 26 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index 58da3468d1f0..c75493f4236a 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h | |||
@@ -275,7 +275,6 @@ struct ath9k_htc_rxbuf { | |||
275 | }; | 275 | }; |
276 | 276 | ||
277 | struct ath9k_htc_rx { | 277 | struct ath9k_htc_rx { |
278 | int last_rssi; /* FIXME: per-STA */ | ||
279 | struct list_head rxbuf; | 278 | struct list_head rxbuf; |
280 | spinlock_t rxbuflock; | 279 | spinlock_t rxbuflock; |
281 | }; | 280 | }; |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index f4e1de20d99c..9db8aefb8600 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c | |||
@@ -607,6 +607,7 @@ static void ath9k_init_misc(struct ath9k_htc_priv *priv) | |||
607 | 607 | ||
608 | memcpy(common->bssidmask, ath_bcast_mac, ETH_ALEN); | 608 | memcpy(common->bssidmask, ath_bcast_mac, ETH_ALEN); |
609 | 609 | ||
610 | common->last_rssi = ATH_RSSI_DUMMY_MARKER; | ||
610 | priv->ah->opmode = NL80211_IFTYPE_STATION; | 611 | priv->ah->opmode = NL80211_IFTYPE_STATION; |
611 | } | 612 | } |
612 | 613 | ||
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index 608d739d1378..228549a65ab9 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c | |||
@@ -1457,6 +1457,7 @@ static void ath9k_htc_bss_iter(void *data, u8 *mac, struct ieee80211_vif *vif) | |||
1457 | 1457 | ||
1458 | if ((vif->type == NL80211_IFTYPE_STATION) && bss_conf->assoc) { | 1458 | if ((vif->type == NL80211_IFTYPE_STATION) && bss_conf->assoc) { |
1459 | common->curaid = bss_conf->aid; | 1459 | common->curaid = bss_conf->aid; |
1460 | common->last_rssi = ATH_RSSI_DUMMY_MARKER; | ||
1460 | memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN); | 1461 | memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN); |
1461 | } | 1462 | } |
1462 | } | 1463 | } |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c index a3f2201f3e39..fcf7f5aeb682 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | |||
@@ -927,7 +927,6 @@ void ath9k_host_rx_init(struct ath9k_htc_priv *priv) | |||
927 | ath9k_hw_rxena(priv->ah); | 927 | ath9k_hw_rxena(priv->ah); |
928 | ath9k_htc_opmode_init(priv); | 928 | ath9k_htc_opmode_init(priv); |
929 | ath9k_hw_startpcureceive(priv->ah, test_bit(OP_SCANNING, &priv->op_flags)); | 929 | ath9k_hw_startpcureceive(priv->ah, test_bit(OP_SCANNING, &priv->op_flags)); |
930 | priv->rx.last_rssi = ATH_RSSI_DUMMY_MARKER; | ||
931 | } | 930 | } |
932 | 931 | ||
933 | static void ath9k_process_rate(struct ieee80211_hw *hw, | 932 | static void ath9k_process_rate(struct ieee80211_hw *hw, |
@@ -1011,7 +1010,6 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv, | |||
1011 | struct ath_htc_rx_status *rxstatus; | 1010 | struct ath_htc_rx_status *rxstatus; |
1012 | struct ath_rx_status rx_stats; | 1011 | struct ath_rx_status rx_stats; |
1013 | int hdrlen, padsize; | 1012 | int hdrlen, padsize; |
1014 | int last_rssi = ATH_RSSI_DUMMY_MARKER; | ||
1015 | __le16 fc; | 1013 | __le16 fc; |
1016 | 1014 | ||
1017 | if (skb->len < HTC_RX_FRAME_HEADER_SIZE) { | 1015 | if (skb->len < HTC_RX_FRAME_HEADER_SIZE) { |
@@ -1104,24 +1102,9 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv, | |||
1104 | ath9k_process_rate(hw, rx_status, rxbuf->rxstatus.rs_rate, | 1102 | ath9k_process_rate(hw, rx_status, rxbuf->rxstatus.rs_rate, |
1105 | rxbuf->rxstatus.rs_flags); | 1103 | rxbuf->rxstatus.rs_flags); |
1106 | 1104 | ||
1107 | if (rxbuf->rxstatus.rs_rssi != ATH9K_RSSI_BAD && | ||
1108 | !rxbuf->rxstatus.rs_moreaggr) | ||
1109 | ATH_RSSI_LPF(priv->rx.last_rssi, | ||
1110 | rxbuf->rxstatus.rs_rssi); | ||
1111 | 1105 | ||
1112 | last_rssi = priv->rx.last_rssi; | 1106 | rx_stats.is_mybeacon = ath_is_mybeacon(common, hdr); |
1113 | 1107 | ath9k_cmn_process_rssi(common, hw, &rx_stats, rx_status); | |
1114 | if (ath_is_mybeacon(common, hdr)) { | ||
1115 | s8 rssi = rxbuf->rxstatus.rs_rssi; | ||
1116 | |||
1117 | if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER)) | ||
1118 | rssi = ATH_EP_RND(last_rssi, ATH_RSSI_EP_MULTIPLIER); | ||
1119 | |||
1120 | if (rssi < 0) | ||
1121 | rssi = 0; | ||
1122 | |||
1123 | priv->ah->stats.avgbrssi = rssi; | ||
1124 | } | ||
1125 | 1108 | ||
1126 | rx_status->mactime = be64_to_cpu(rxbuf->rxstatus.rs_tstamp); | 1109 | rx_status->mactime = be64_to_cpu(rxbuf->rxstatus.rs_tstamp); |
1127 | rx_status->band = hw->conf.chandef.chan->band; | 1110 | rx_status->band = hw->conf.chandef.chan->band; |
diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h index 10271373a0cd..89df634e81f9 100644 --- a/drivers/net/wireless/ath/ath9k/mac.h +++ b/drivers/net/wireless/ath/ath9k/mac.h | |||
@@ -155,12 +155,8 @@ struct ath_htc_rx_status { | |||
155 | u8 rs_status; | 155 | u8 rs_status; |
156 | u8 rs_phyerr; | 156 | u8 rs_phyerr; |
157 | int8_t rs_rssi; | 157 | int8_t rs_rssi; |
158 | int8_t rs_rssi_ctl0; | 158 | int8_t rs_rssi_ctl[3]; |
159 | int8_t rs_rssi_ctl1; | 159 | int8_t rs_rssi_ext[3]; |
160 | int8_t rs_rssi_ctl2; | ||
161 | int8_t rs_rssi_ext0; | ||
162 | int8_t rs_rssi_ext1; | ||
163 | int8_t rs_rssi_ext2; | ||
164 | u8 rs_keyix; | 160 | u8 rs_keyix; |
165 | u8 rs_rate; | 161 | u8 rs_rate; |
166 | u8 rs_antenna; | 162 | u8 rs_antenna; |
@@ -170,6 +166,7 @@ struct ath_htc_rx_status { | |||
170 | u8 rs_num_delims; | 166 | u8 rs_num_delims; |
171 | u8 rs_flags; | 167 | u8 rs_flags; |
172 | u8 rs_dummy; | 168 | u8 rs_dummy; |
169 | /* FIXME: evm* never used? */ | ||
173 | __be32 evm0; | 170 | __be32 evm0; |
174 | __be32 evm1; | 171 | __be32 evm1; |
175 | __be32 evm2; | 172 | __be32 evm2; |