aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/carl9170/rx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/carl9170/rx.c')
-rw-r--r--drivers/net/wireless/ath/carl9170/rx.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/carl9170/rx.c b/drivers/net/wireless/ath/carl9170/rx.c
index b813f43061f5..a0b723078547 100644
--- a/drivers/net/wireless/ath/carl9170/rx.c
+++ b/drivers/net/wireless/ath/carl9170/rx.c
@@ -624,7 +624,8 @@ static void carl9170_ba_check(struct ar9170 *ar, void *data, unsigned int len)
624#undef TID_CHECK 624#undef TID_CHECK
625} 625}
626 626
627static bool carl9170_ampdu_check(struct ar9170 *ar, u8 *buf, u8 ms) 627static bool carl9170_ampdu_check(struct ar9170 *ar, u8 *buf, u8 ms,
628 struct ieee80211_rx_status *rx_status)
628{ 629{
629 __le16 fc; 630 __le16 fc;
630 631
@@ -637,6 +638,9 @@ static bool carl9170_ampdu_check(struct ar9170 *ar, u8 *buf, u8 ms)
637 return true; 638 return true;
638 } 639 }
639 640
641 rx_status->flag |= RX_FLAG_AMPDU_DETAILS | RX_FLAG_AMPDU_LAST_KNOWN;
642 rx_status->ampdu_reference = ar->ampdu_ref;
643
640 /* 644 /*
641 * "802.11n - 7.4a.3 A-MPDU contents" describes in which contexts 645 * "802.11n - 7.4a.3 A-MPDU contents" describes in which contexts
642 * certain frame types can be part of an aMPDU. 646 * certain frame types can be part of an aMPDU.
@@ -685,12 +689,15 @@ static void carl9170_handle_mpdu(struct ar9170 *ar, u8 *buf, int len)
685 if (unlikely(len < sizeof(*mac))) 689 if (unlikely(len < sizeof(*mac)))
686 goto drop; 690 goto drop;
687 691
692 memset(&status, 0, sizeof(status));
693
688 mpdu_len = len - sizeof(*mac); 694 mpdu_len = len - sizeof(*mac);
689 695
690 mac = (void *)(buf + mpdu_len); 696 mac = (void *)(buf + mpdu_len);
691 mac_status = mac->status; 697 mac_status = mac->status;
692 switch (mac_status & AR9170_RX_STATUS_MPDU) { 698 switch (mac_status & AR9170_RX_STATUS_MPDU) {
693 case AR9170_RX_STATUS_MPDU_FIRST: 699 case AR9170_RX_STATUS_MPDU_FIRST:
700 ar->ampdu_ref++;
694 /* Aggregated MPDUs start with an PLCP header */ 701 /* Aggregated MPDUs start with an PLCP header */
695 if (likely(mpdu_len >= sizeof(struct ar9170_rx_head))) { 702 if (likely(mpdu_len >= sizeof(struct ar9170_rx_head))) {
696 head = (void *) buf; 703 head = (void *) buf;
@@ -721,12 +728,13 @@ static void carl9170_handle_mpdu(struct ar9170 *ar, u8 *buf, int len)
721 break; 728 break;
722 729
723 case AR9170_RX_STATUS_MPDU_LAST: 730 case AR9170_RX_STATUS_MPDU_LAST:
731 status.flag |= RX_FLAG_AMPDU_IS_LAST;
732
724 /* 733 /*
725 * The last frame of an A-MPDU has an extra tail 734 * The last frame of an A-MPDU has an extra tail
726 * which does contain the phy status of the whole 735 * which does contain the phy status of the whole
727 * aggregate. 736 * aggregate.
728 */ 737 */
729
730 if (likely(mpdu_len >= sizeof(struct ar9170_rx_phystatus))) { 738 if (likely(mpdu_len >= sizeof(struct ar9170_rx_phystatus))) {
731 mpdu_len -= sizeof(struct ar9170_rx_phystatus); 739 mpdu_len -= sizeof(struct ar9170_rx_phystatus);
732 phy = (void *)(buf + mpdu_len); 740 phy = (void *)(buf + mpdu_len);
@@ -774,11 +782,10 @@ static void carl9170_handle_mpdu(struct ar9170 *ar, u8 *buf, int len)
774 if (unlikely(mpdu_len < (2 + 2 + ETH_ALEN + FCS_LEN))) 782 if (unlikely(mpdu_len < (2 + 2 + ETH_ALEN + FCS_LEN)))
775 goto drop; 783 goto drop;
776 784
777 memset(&status, 0, sizeof(status));
778 if (unlikely(carl9170_rx_mac_status(ar, head, mac, &status))) 785 if (unlikely(carl9170_rx_mac_status(ar, head, mac, &status)))
779 goto drop; 786 goto drop;
780 787
781 if (!carl9170_ampdu_check(ar, buf, mac_status)) 788 if (!carl9170_ampdu_check(ar, buf, mac_status, &status))
782 goto drop; 789 goto drop;
783 790
784 if (phy) 791 if (phy)