Skip to contentSkip to conversation

iwl4965: report A-MPDU status

RFC In review Christian Lamparter 2 participants 2 messages Jan 18, 2013 – Jan 19, 2013 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

RFC 1/1 iwl4965: 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.

---
Just two things.

1. This patch [including commit msg] is a copy of:
commit 12bf6f45d17038589e0eaa8adeb7ee8169c0e4de
Author: Johannes Berg <[email protected]>
Date: Thu Jul 5 13:05:08 2012 +0200
iwlwifi: report A-MPDU status

2. RX_RES_PHY_FLAGS_ANTENNA_MSK
I had the chance to test this with a real 4965. As far as I can tell, the hardware has just 3 antenna connectors. But I have seen frames, which apparently have been received on 4 antennas?!

Note: iwlwifi had this problem as well. It was fixed by:
commit 362b0563b28506d534a82d9c6cd5fdf58783fda6
Author: Johannes Berg <[email protected]>
Date: Fri Aug 24 11:13:17 2012 +0200
iwlwifi: fix antenna bitmask
I suppose 4965 also uses the 4th bit as the AMPDU indicator. It would be very helpful if someone could confirm this assumption. [Otherwise the whole AMPDU status feature patch has little use].

(BTW: wireshark 1.9.0+ already supports the AMPDU_DETAILS radiotap extension.)

Regards

Christian

---
 drivers/net/wireless/iwlegacy/4965-mac.c |   12 ++++++++++++
 drivers/net/wireless/iwlegacy/commands.h |    3 ++-
 drivers/net/wireless/iwlegacy/common.h   |    1 +
 3 files changed, 15 insertions(+), 1 deletion(-)
drivers/net/wireless/iwlegacy/4965-mac.c +11 -0
index 10fc249..cb64126 100644
@@ -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 +747,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));
 }
drivers/net/wireless/iwlegacy/commands.h +2 -1
index 25dd7d2..3b6c994 100644
@@ -1134,8 +1134,9 @@ struct il_wep_cmd {
 #define RX_RES_PHY_FLAGS_MOD_CCK_MSK		cpu_to_le16(1 << 1)
 #define RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK	cpu_to_le16(1 << 2)
 #define RX_RES_PHY_FLAGS_NARROW_BAND_MSK	cpu_to_le16(1 << 3)
-#define RX_RES_PHY_FLAGS_ANTENNA_MSK		0xf0
+#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)
drivers/net/wireless/iwlegacy/common.h +1 -0
index 37fe553..96f2025 100644
@@ -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;
 
Signature · 1 line
1.7.10.4
maintainer
#1 lore raw
Quoted 5 lines · Christian Lamparter

1. This patch [including commit msg] is a copy of:
commit 12bf6f45d17038589e0eaa8adeb7ee8169c0e4de
Author: Johannes Berg <[email protected]>
Date: Thu Jul 5 13:05:08 2012 +0200
iwlwifi: report A-MPDU status

:-)

Quoted 6 lines

2. RX_RES_PHY_FLAGS_ANTENNA_MSK
I had the chance to test this with a real 4965. As far as I can tell, the hardware has just 3 antenna connectors. But I have seen frames, which apparently have been received on 4 antennas?!

Quoted 10 lines

Note: iwlwifi had this problem as well. It was fixed by:
commit 362b0563b28506d534a82d9c6cd5fdf58783fda6
Author: Johannes Berg <[email protected]>
Date: Fri Aug 24 11:13:17 2012 +0200
iwlwifi: fix antenna bitmask
I suppose 4965 also uses the 4th bit as the AMPDU indicator. It would be very helpful if someone could confirm this assumption. [Otherwise the whole AMPDU status feature patch has little use].

I can't easily verify this this right now, but I think it's a safe bet since no iwlegacy/iwlwifi device exists that supports 4 antennas, and the definition in question has always been the same for all hardware. I just didn't fix it for 4965 since it was split off to iwlegacy already.

johannes