aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/recv.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-11-16 12:17:12 -0500
committerDavid S. Miller <davem@davemloft.net>2010-11-16 12:17:12 -0500
commitb5e4156743c5d42b736936be7a9ee8d72e0e4ac9 (patch)
treef0edde33e7b2502ab35a4f63be1a8be31f5f4b6a /drivers/net/wireless/ath/ath9k/recv.c
parent6b35308850e1679741e8b646cfb7bb3ab5369888 (diff)
parentb1d771ee33c6e4006676002b9d74abf45b71d3d6 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/recv.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c42
1 files changed, 15 insertions, 27 deletions
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index c76ea53c20ce..c5c80764a94a 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -317,7 +317,7 @@ int ath_rx_init(struct ath_softc *sc, int nbufs)
317 struct ath_buf *bf; 317 struct ath_buf *bf;
318 int error = 0; 318 int error = 0;
319 319
320 spin_lock_init(&sc->rx.pcu_lock); 320 spin_lock_init(&sc->sc_pcu_lock);
321 sc->sc_flags &= ~SC_OP_RXFLUSH; 321 sc->sc_flags &= ~SC_OP_RXFLUSH;
322 spin_lock_init(&sc->rx.rxbuflock); 322 spin_lock_init(&sc->rx.rxbuflock);
323 323
@@ -528,6 +528,8 @@ bool ath_stoprecv(struct ath_softc *sc)
528 sc->rx.rxlink = NULL; 528 sc->rx.rxlink = NULL;
529 spin_unlock_bh(&sc->rx.rxbuflock); 529 spin_unlock_bh(&sc->rx.rxbuflock);
530 530
531 ATH_DBG_WARN(!stopped, "Could not stop RX, we could be "
532 "confusing the DMA engine when we start RX up\n");
531 return stopped; 533 return stopped;
532} 534}
533 535
@@ -962,36 +964,23 @@ static void ath9k_process_rssi(struct ath_common *common,
962 struct ieee80211_hdr *hdr, 964 struct ieee80211_hdr *hdr,
963 struct ath_rx_status *rx_stats) 965 struct ath_rx_status *rx_stats)
964{ 966{
967 struct ath_wiphy *aphy = hw->priv;
965 struct ath_hw *ah = common->ah; 968 struct ath_hw *ah = common->ah;
966 struct ieee80211_sta *sta; 969 int last_rssi;
967 struct ath_node *an;
968 int last_rssi = ATH_RSSI_DUMMY_MARKER;
969 __le16 fc; 970 __le16 fc;
970 971
972 if (ah->opmode != NL80211_IFTYPE_STATION)
973 return;
974
971 fc = hdr->frame_control; 975 fc = hdr->frame_control;
976 if (!ieee80211_is_beacon(fc) ||
977 compare_ether_addr(hdr->addr3, common->curbssid))
978 return;
972 979
973 rcu_read_lock(); 980 if (rx_stats->rs_rssi != ATH9K_RSSI_BAD && !rx_stats->rs_moreaggr)
974 /* 981 ATH_RSSI_LPF(aphy->last_rssi, rx_stats->rs_rssi);
975 * XXX: use ieee80211_find_sta! This requires quite a bit of work
976 * under the current ath9k virtual wiphy implementation as we have
977 * no way of tying a vif to wiphy. Typically vifs are attached to
978 * at least one sdata of a wiphy on mac80211 but with ath9k virtual
979 * wiphy you'd have to iterate over every wiphy and each sdata.
980 */
981 if (is_multicast_ether_addr(hdr->addr1))
982 sta = ieee80211_find_sta_by_ifaddr(hw, hdr->addr2, NULL);
983 else
984 sta = ieee80211_find_sta_by_ifaddr(hw, hdr->addr2, hdr->addr1);
985
986 if (sta) {
987 an = (struct ath_node *) sta->drv_priv;
988 if (rx_stats->rs_rssi != ATH9K_RSSI_BAD &&
989 !rx_stats->rs_moreaggr)
990 ATH_RSSI_LPF(an->last_rssi, rx_stats->rs_rssi);
991 last_rssi = an->last_rssi;
992 }
993 rcu_read_unlock();
994 982
983 last_rssi = aphy->last_rssi;
995 if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER)) 984 if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER))
996 rx_stats->rs_rssi = ATH_EP_RND(last_rssi, 985 rx_stats->rs_rssi = ATH_EP_RND(last_rssi,
997 ATH_RSSI_EP_MULTIPLIER); 986 ATH_RSSI_EP_MULTIPLIER);
@@ -999,8 +988,7 @@ static void ath9k_process_rssi(struct ath_common *common,
999 rx_stats->rs_rssi = 0; 988 rx_stats->rs_rssi = 0;
1000 989
1001 /* Update Beacon RSSI, this is used by ANI. */ 990 /* Update Beacon RSSI, this is used by ANI. */
1002 if (ieee80211_is_beacon(fc)) 991 ah->stats.avgbrssi = rx_stats->rs_rssi;
1003 ah->stats.avgbrssi = rx_stats->rs_rssi;
1004} 992}
1005 993
1006/* 994/*