ath9k_htc: fix signal strength reporting issues
authorFelix Fietkau <nbd@openwrt.org>
Fri, 22 Feb 2013 20:13:24 +0000 (20:13 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 22 Feb 2013 20:13:24 +0000 (20:13 +0000)
Backport of r35749

SVN-Revision: 35751

package/mac80211/patches/300-pending_work.patch

index 69c32b8760e2e9c525b9c364c08e0c40e84e4589..a601aeb02beca3f35f9274fd0e5fe97b10de1b6c 100644 (file)
  
  #define AR_SREV_9330(_ah) \
        (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9330))
+--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
++++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+@@ -1067,15 +1067,19 @@ static bool ath9k_rx_prepare(struct ath9
+       last_rssi = priv->rx.last_rssi;
+-      if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER))
+-              rxbuf->rxstatus.rs_rssi = ATH_EP_RND(last_rssi,
+-                                                   ATH_RSSI_EP_MULTIPLIER);
++      if (ieee80211_is_beacon(hdr->frame_control) &&
++          !is_zero_ether_addr(common->curbssid) &&
++          ether_addr_equal(hdr->addr3, common->curbssid)) {
++              s8 rssi = rxbuf->rxstatus.rs_rssi;
+-      if (rxbuf->rxstatus.rs_rssi < 0)
+-              rxbuf->rxstatus.rs_rssi = 0;
++              if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER))
++                      rssi = ATH_EP_RND(last_rssi, ATH_RSSI_EP_MULTIPLIER);
+-      if (ieee80211_is_beacon(fc))
+-              priv->ah->stats.avgbrssi = rxbuf->rxstatus.rs_rssi;
++              if (rssi < 0)
++                      rssi = 0;
++
++              priv->ah->stats.avgbrssi = rssi;
++      }
+       rx_status->mactime = be64_to_cpu(rxbuf->rxstatus.rs_tstamp);
+       rx_status->band = hw->conf.channel->band;