iwlwifi: report A-MPDU status
authorJohannes Berg <johannes.berg@intel.com>
Thu, 5 Jul 2012 11:05:08 +0000 (13:05 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 5 Sep 2012 14:17:53 +0000 (16:17 +0200)
Since the firmware will give us an A-MPDU bit and
only a single PHY information packet for all the
subframes in an A-MPDU, we can easily report the
minimal A-MPDU information for radiotap.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/iwlwifi/dvm/commands.h
drivers/net/wireless/iwlwifi/dvm/dev.h
drivers/net/wireless/iwlwifi/dvm/rx.c

index cee8a05b5f697844d1224709d350902f75ce9f95..01128c96b5d8c309e800bd08b01f378ceb382613 100644 (file)
@@ -1057,6 +1057,7 @@ struct iwl_wep_cmd {
 #define RX_RES_PHY_FLAGS_NARROW_BAND_MSK       cpu_to_le16(1 << 3)
 #define RX_RES_PHY_FLAGS_ANTENNA_MSK           0x70
 #define RX_RES_PHY_FLAGS_ANTENNA_POS           4
+#define RX_RES_PHY_FLAGS_AGG_MSK               cpu_to_le16(1 << 7)
 
 #define RX_RES_STATUS_SEC_TYPE_MSK     (0x7 << 8)
 #define RX_RES_STATUS_SEC_TYPE_NONE    (0x0 << 8)
index 054f728f6266fb6f4f4425e7824f62a0e910730c..8141f91c3725bd3c8f26d9830e61574dd3b4586f 100644 (file)
@@ -771,6 +771,7 @@ struct iwl_priv {
        u8 agg_tids_count;
 
        struct iwl_rx_phy_res last_phy_res;
+       u32 ampdu_ref;
        bool last_phy_res_valid;
 
        /*
index fee5cffa166998c30437ac37b7490e0b85972dc1..5a9c325804f6dcdc8d47d44faf15dec1051d4471 100644 (file)
@@ -667,6 +667,7 @@ static int iwlagn_rx_reply_rx_phy(struct iwl_priv *priv,
        struct iwl_rx_packet *pkt = rxb_addr(rxb);
 
        priv->last_phy_res_valid = true;
+       priv->ampdu_ref++;
        memcpy(&priv->last_phy_res, pkt->data,
               sizeof(struct iwl_rx_phy_res));
        return 0;
@@ -981,6 +982,16 @@ static int iwlagn_rx_reply_rx(struct iwl_priv *priv,
        if (phy_res->phy_flags & RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK)
                rx_status.flag |= RX_FLAG_SHORTPRE;
 
+       if (phy_res->phy_flags & RX_RES_PHY_FLAGS_AGG_MSK) {
+               /*
+                * We know which subframes of an A-MPDU belong
+                * together since we get a single PHY response
+                * from the firmware for all of them
+                */
+               rx_status.flag |= RX_FLAG_AMPDU_DETAILS;
+               rx_status.ampdu_reference = priv->ampdu_ref;
+       }
+
        /* Set up the HT phy flags */
        if (rate_n_flags & RATE_MCS_HT_MSK)
                rx_status.flag |= RX_FLAG_HT;