iwl4965: report A-MPDU status
authorChristian Lamparter <chunkeey@googlemail.com>
Fri, 18 Jan 2013 22:47:19 +0000 (23:47 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 1 Feb 2013 19:27:21 +0000 (14:27 -0500)
This patch is based on "iwlwifi: report A-MPDU status".
(12bf6f45d1703858)

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.

Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlegacy/4965-mac.c
drivers/net/wireless/iwlegacy/commands.h
drivers/net/wireless/iwlegacy/common.h

index d665a3d9f08f8faf242852ca4406f1699c6e9318..d2d5aae21d389316db3c2907f28fea4524f4aae2 100644 (file)
@@ -725,6 +725,16 @@ il4965_hdl_rx(struct il_priv *il, struct il_rx_buf *rxb)
        if (rate_n_flags & RATE_MCS_SGI_MSK)
                rx_status.flag |= RX_FLAG_SHORT_GI;
 
+       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 = il->_4965.ampdu_ref;
+       }
+
        il4965_pass_packet_to_mac80211(il, header, len, ampdu_status, rxb,
                                       &rx_status);
 }
@@ -736,6 +746,7 @@ il4965_hdl_rx_phy(struct il_priv *il, struct il_rx_buf *rxb)
 {
        struct il_rx_pkt *pkt = rxb_addr(rxb);
        il->_4965.last_phy_res_valid = true;
+       il->_4965.ampdu_ref++;
        memcpy(&il->_4965.last_phy_res, pkt->u.raw,
               sizeof(struct il_rx_phy_res));
 }
index 829d3b9aaa17f568e5fcc16e0b95aa4ebd9fe646..3b6c994008920e76ee455ef3512a8e380d20b4b6 100644 (file)
@@ -1136,6 +1136,7 @@ struct il_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 37fe553b25e0e86e8b0f772ba08da42d8808b920..96f2025d936e340dcbc0cb3693f5d38bb8817c0c 100644 (file)
@@ -1356,6 +1356,7 @@ struct il_priv {
                struct {
                        struct il_rx_phy_res last_phy_res;
                        bool last_phy_res_valid;
+                       u32 ampdu_ref;
 
                        struct completion firmware_loading_complete;