aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-07-05 07:05:08 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-09-05 10:17:53 -0400
commit12bf6f45d17038589e0eaa8adeb7ee8169c0e4de (patch)
tree70536b591205e0f69740c9db4199e370b95ef2d8
parent188ce5abebf56ec732f652abe608b94c317e4963 (diff)
iwlwifi: report A-MPDU status
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>
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/commands.h1
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/dev.h1
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/rx.c11
3 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/dvm/commands.h b/drivers/net/wireless/iwlwifi/dvm/commands.h
index cee8a05b5f69..01128c96b5d8 100644
--- a/drivers/net/wireless/iwlwifi/dvm/commands.h
+++ b/drivers/net/wireless/iwlwifi/dvm/commands.h
@@ -1057,6 +1057,7 @@ struct iwl_wep_cmd {
1057#define RX_RES_PHY_FLAGS_NARROW_BAND_MSK cpu_to_le16(1 << 3) 1057#define RX_RES_PHY_FLAGS_NARROW_BAND_MSK cpu_to_le16(1 << 3)
1058#define RX_RES_PHY_FLAGS_ANTENNA_MSK 0x70 1058#define RX_RES_PHY_FLAGS_ANTENNA_MSK 0x70
1059#define RX_RES_PHY_FLAGS_ANTENNA_POS 4 1059#define RX_RES_PHY_FLAGS_ANTENNA_POS 4
1060#define RX_RES_PHY_FLAGS_AGG_MSK cpu_to_le16(1 << 7)
1060 1061
1061#define RX_RES_STATUS_SEC_TYPE_MSK (0x7 << 8) 1062#define RX_RES_STATUS_SEC_TYPE_MSK (0x7 << 8)
1062#define RX_RES_STATUS_SEC_TYPE_NONE (0x0 << 8) 1063#define RX_RES_STATUS_SEC_TYPE_NONE (0x0 << 8)
diff --git a/drivers/net/wireless/iwlwifi/dvm/dev.h b/drivers/net/wireless/iwlwifi/dvm/dev.h
index 054f728f6266..8141f91c3725 100644
--- a/drivers/net/wireless/iwlwifi/dvm/dev.h
+++ b/drivers/net/wireless/iwlwifi/dvm/dev.h
@@ -771,6 +771,7 @@ struct iwl_priv {
771 u8 agg_tids_count; 771 u8 agg_tids_count;
772 772
773 struct iwl_rx_phy_res last_phy_res; 773 struct iwl_rx_phy_res last_phy_res;
774 u32 ampdu_ref;
774 bool last_phy_res_valid; 775 bool last_phy_res_valid;
775 776
776 /* 777 /*
diff --git a/drivers/net/wireless/iwlwifi/dvm/rx.c b/drivers/net/wireless/iwlwifi/dvm/rx.c
index fee5cffa1669..5a9c325804f6 100644
--- a/drivers/net/wireless/iwlwifi/dvm/rx.c
+++ b/drivers/net/wireless/iwlwifi/dvm/rx.c
@@ -667,6 +667,7 @@ static int iwlagn_rx_reply_rx_phy(struct iwl_priv *priv,
667 struct iwl_rx_packet *pkt = rxb_addr(rxb); 667 struct iwl_rx_packet *pkt = rxb_addr(rxb);
668 668
669 priv->last_phy_res_valid = true; 669 priv->last_phy_res_valid = true;
670 priv->ampdu_ref++;
670 memcpy(&priv->last_phy_res, pkt->data, 671 memcpy(&priv->last_phy_res, pkt->data,
671 sizeof(struct iwl_rx_phy_res)); 672 sizeof(struct iwl_rx_phy_res));
672 return 0; 673 return 0;
@@ -981,6 +982,16 @@ static int iwlagn_rx_reply_rx(struct iwl_priv *priv,
981 if (phy_res->phy_flags & RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK) 982 if (phy_res->phy_flags & RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK)
982 rx_status.flag |= RX_FLAG_SHORTPRE; 983 rx_status.flag |= RX_FLAG_SHORTPRE;
983 984
985 if (phy_res->phy_flags & RX_RES_PHY_FLAGS_AGG_MSK) {
986 /*
987 * We know which subframes of an A-MPDU belong
988 * together since we get a single PHY response
989 * from the firmware for all of them
990 */
991 rx_status.flag |= RX_FLAG_AMPDU_DETAILS;
992 rx_status.ampdu_reference = priv->ampdu_ref;
993 }
994
984 /* Set up the HT phy flags */ 995 /* Set up the HT phy flags */
985 if (rate_n_flags & RATE_MCS_HT_MSK) 996 if (rate_n_flags & RATE_MCS_HT_MSK)
986 rx_status.flag |= RX_FLAG_HT; 997 rx_status.flag |= RX_FLAG_HT;