ath9k_htc: use ath9k_cmn_process_rssi
authorOleksij Rempel <linux@rempel-privat.de>
Tue, 4 Feb 2014 09:27:43 +0000 (10:27 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 12 Feb 2014 20:35:59 +0000 (15:35 -0500)
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/htc.h
drivers/net/wireless/ath/ath9k/htc_drv_init.c
drivers/net/wireless/ath/ath9k/htc_drv_main.c
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
drivers/net/wireless/ath/ath9k/mac.h

index 58da3468d1f0ac1b3de6522b7118640f2c80da76..c75493f4236a652bf9f0109c35cb8fdca411715b 100644 (file)
@@ -275,7 +275,6 @@ struct ath9k_htc_rxbuf {
 };
 
 struct ath9k_htc_rx {
-       int last_rssi; /* FIXME: per-STA */
        struct list_head rxbuf;
        spinlock_t rxbuflock;
 };
index f4e1de20d99c02a246b08bfed883acc6418af40e..9db8aefb86006d38560236ee4c1a79cdb6a29105 100644 (file)
@@ -607,6 +607,7 @@ static void ath9k_init_misc(struct ath9k_htc_priv *priv)
 
        memcpy(common->bssidmask, ath_bcast_mac, ETH_ALEN);
 
+       common->last_rssi = ATH_RSSI_DUMMY_MARKER;
        priv->ah->opmode = NL80211_IFTYPE_STATION;
 }
 
index 608d739d13782233db4271f9248c3472601b1a5f..228549a65ab9d17de7fd83f40777abc0975d86db 100644 (file)
@@ -1457,6 +1457,7 @@ static void ath9k_htc_bss_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
 
        if ((vif->type == NL80211_IFTYPE_STATION) && bss_conf->assoc) {
                common->curaid = bss_conf->aid;
+               common->last_rssi = ATH_RSSI_DUMMY_MARKER;
                memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN);
        }
 }
index a3f2201f3e395429c861959bdaf44cdc7dc5a4f9..fcf7f5aeb6826d4cef348eefa26ffc92485b0709 100644 (file)
@@ -927,7 +927,6 @@ void ath9k_host_rx_init(struct ath9k_htc_priv *priv)
        ath9k_hw_rxena(priv->ah);
        ath9k_htc_opmode_init(priv);
        ath9k_hw_startpcureceive(priv->ah, test_bit(OP_SCANNING, &priv->op_flags));
-       priv->rx.last_rssi = ATH_RSSI_DUMMY_MARKER;
 }
 
 static void ath9k_process_rate(struct ieee80211_hw *hw,
@@ -1011,7 +1010,6 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv,
        struct ath_htc_rx_status *rxstatus;
        struct ath_rx_status rx_stats;
        int hdrlen, padsize;
-       int last_rssi = ATH_RSSI_DUMMY_MARKER;
        __le16 fc;
 
        if (skb->len < HTC_RX_FRAME_HEADER_SIZE) {
@@ -1104,24 +1102,9 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv,
        ath9k_process_rate(hw, rx_status, rxbuf->rxstatus.rs_rate,
                           rxbuf->rxstatus.rs_flags);
 
-       if (rxbuf->rxstatus.rs_rssi != ATH9K_RSSI_BAD &&
-           !rxbuf->rxstatus.rs_moreaggr)
-               ATH_RSSI_LPF(priv->rx.last_rssi,
-                            rxbuf->rxstatus.rs_rssi);
 
-       last_rssi = priv->rx.last_rssi;
-
-       if (ath_is_mybeacon(common, hdr)) {
-               s8 rssi = rxbuf->rxstatus.rs_rssi;
-
-               if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER))
-                       rssi = ATH_EP_RND(last_rssi, ATH_RSSI_EP_MULTIPLIER);
-
-               if (rssi < 0)
-                       rssi = 0;
-
-               priv->ah->stats.avgbrssi = rssi;
-       }
+       rx_stats.is_mybeacon = ath_is_mybeacon(common, hdr);
+       ath9k_cmn_process_rssi(common, hw, &rx_stats, rx_status);
 
        rx_status->mactime = be64_to_cpu(rxbuf->rxstatus.rs_tstamp);
        rx_status->band = hw->conf.chandef.chan->band;
index 10271373a0cd1081fa89b53ee35992982fd7679b..89df634e81f9a703d6dcf5eefee8881ef738570b 100644 (file)
@@ -155,12 +155,8 @@ struct ath_htc_rx_status {
        u8 rs_status;
        u8 rs_phyerr;
        int8_t rs_rssi;
-       int8_t rs_rssi_ctl0;
-       int8_t rs_rssi_ctl1;
-       int8_t rs_rssi_ctl2;
-       int8_t rs_rssi_ext0;
-       int8_t rs_rssi_ext1;
-       int8_t rs_rssi_ext2;
+       int8_t rs_rssi_ctl[3];
+       int8_t rs_rssi_ext[3];
        u8 rs_keyix;
        u8 rs_rate;
        u8 rs_antenna;
@@ -170,6 +166,7 @@ struct ath_htc_rx_status {
        u8 rs_num_delims;
        u8 rs_flags;
        u8 rs_dummy;
+       /* FIXME: evm* never used? */
        __be32 evm0;
        __be32 evm1;
        __be32 evm2;