diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/htc_drv_txrx.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c index 306c55019e77..6bd0e92ea2aa 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | |||
@@ -966,7 +966,7 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv, | |||
966 | struct sk_buff *skb = rxbuf->skb; | 966 | struct sk_buff *skb = rxbuf->skb; |
967 | struct ath_common *common = ath9k_hw_common(priv->ah); | 967 | struct ath_common *common = ath9k_hw_common(priv->ah); |
968 | struct ath_htc_rx_status *rxstatus; | 968 | struct ath_htc_rx_status *rxstatus; |
969 | int hdrlen, padpos, padsize; | 969 | int hdrlen, padsize; |
970 | int last_rssi = ATH_RSSI_DUMMY_MARKER; | 970 | int last_rssi = ATH_RSSI_DUMMY_MARKER; |
971 | __le16 fc; | 971 | __le16 fc; |
972 | 972 | ||
@@ -996,11 +996,9 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv, | |||
996 | fc = hdr->frame_control; | 996 | fc = hdr->frame_control; |
997 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); | 997 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); |
998 | 998 | ||
999 | padpos = ath9k_cmn_padpos(fc); | 999 | padsize = hdrlen & 3; |
1000 | 1000 | if (padsize && skb->len >= hdrlen+padsize+FCS_LEN) { | |
1001 | padsize = padpos & 3; | 1001 | memmove(skb->data + padsize, skb->data, hdrlen); |
1002 | if (padsize && skb->len >= padpos+padsize+FCS_LEN) { | ||
1003 | memmove(skb->data + padsize, skb->data, padpos); | ||
1004 | skb_pull(skb, padsize); | 1002 | skb_pull(skb, padsize); |
1005 | } | 1003 | } |
1006 | 1004 | ||
@@ -1067,15 +1065,19 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv, | |||
1067 | 1065 | ||
1068 | last_rssi = priv->rx.last_rssi; | 1066 | last_rssi = priv->rx.last_rssi; |
1069 | 1067 | ||
1070 | if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER)) | 1068 | if (ieee80211_is_beacon(hdr->frame_control) && |
1071 | rxbuf->rxstatus.rs_rssi = ATH_EP_RND(last_rssi, | 1069 | !is_zero_ether_addr(common->curbssid) && |
1072 | ATH_RSSI_EP_MULTIPLIER); | 1070 | ether_addr_equal(hdr->addr3, common->curbssid)) { |
1071 | s8 rssi = rxbuf->rxstatus.rs_rssi; | ||
1072 | |||
1073 | if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER)) | ||
1074 | rssi = ATH_EP_RND(last_rssi, ATH_RSSI_EP_MULTIPLIER); | ||
1073 | 1075 | ||
1074 | if (rxbuf->rxstatus.rs_rssi < 0) | 1076 | if (rssi < 0) |
1075 | rxbuf->rxstatus.rs_rssi = 0; | 1077 | rssi = 0; |
1076 | 1078 | ||
1077 | if (ieee80211_is_beacon(fc)) | 1079 | priv->ah->stats.avgbrssi = rssi; |
1078 | priv->ah->stats.avgbrssi = rxbuf->rxstatus.rs_rssi; | 1080 | } |
1079 | 1081 | ||
1080 | rx_status->mactime = be64_to_cpu(rxbuf->rxstatus.rs_tstamp); | 1082 | rx_status->mactime = be64_to_cpu(rxbuf->rxstatus.rs_tstamp); |
1081 | rx_status->band = hw->conf.chandef.chan->band; | 1083 | rx_status->band = hw->conf.chandef.chan->band; |