Parcourir la source

qcacmn: Add HE SU Radiotap Support

Keeping up with changes in radiotap header definitions
and spec. This change reads preamble info for HE SU from
phy tlv and populates the radiotap structure

Change-Id: I0663d1923f2a8277c62ab6c8378aaca026ce18db
Crs-fixed: 2144302
sumedh baikady il y a 7 ans
Parent
commit
f7bbb3512f
2 fichiers modifiés avec 214 ajouts et 16 suppressions
  1. 141 16
      hal/wifi3.0/hal_api_mon.h
  2. 73 0
      qdf/inc/qdf_nbuf.h

+ 141 - 16
hal/wifi3.0/hal_api_mon.h

@@ -103,6 +103,13 @@
 #define HAL_11A_RATE_6MCS	18
 #define HAL_11A_RATE_7MCS	9
 
+#define HE_GI_0_8 0
+#define HE_GI_1_6 1
+#define HE_GI_3_2 2
+
+#define HE_LTF_1_X 0
+#define HE_LTF_2_X 1
+#define HE_LTF_4_X 2
 enum {
 	HAL_HW_RX_DECAP_FORMAT_RAW = 0,
 	HAL_HW_RX_DECAP_FORMAT_NWIFI,
@@ -467,6 +474,8 @@ hal_rx_status_get_tlv_info(void *rx_tlv, struct hal_rx_ppdu_info *ppdu_info)
 {
 	uint32_t tlv_tag, user_id, tlv_len, value;
 	uint8_t group_id = 0;
+	uint16_t he_gi = 0;
+	uint16_t he_ltf = 0;
 
 	tlv_tag = HAL_RX_GET_USER_TLV32_TYPE(rx_tlv);
 	user_id = HAL_RX_GET_USER_TLV32_USERID(rx_tlv);
@@ -657,24 +666,140 @@ hal_rx_status_get_tlv_info(void *rx_tlv, struct hal_rx_ppdu_info *ppdu_info)
 		break;
 	}
 	case WIFIPHYRX_HE_SIG_A_SU_E:
-		ppdu_info->rx_status.he_sig_A1 =
-			*((uint32_t *)((uint8_t *)rx_tlv +
+	{
+		uint8_t *he_sig_a_su_info = (uint8_t *)rx_tlv +
 			HAL_RX_OFFSET(PHYRX_HE_SIG_A_SU_0,
-			HE_SIG_A_SU_INFO_PHYRX_HE_SIG_A_SU_INFO_DETAILS)));
-		ppdu_info->rx_status.he_sig_A1 |=
-			QDF_MON_STATUS_HE_SIG_A1_HE_FORMAT_SU;
-		/* TODO: Enabling all known bits. Check if this should be
-		 * enabled selectively
-		 */
-		ppdu_info->rx_status.he_sig_A1_known =
-			QDF_MON_STATUS_HE_SIG_A1_SU_KNOWN_ALL;
-		ppdu_info->rx_status.he_sig_A2 =
-			*((uint32_t *)((uint8_t *)rx_tlv +
-			HAL_RX_OFFSET(PHYRX_HE_SIG_A_SU_1,
-			HE_SIG_A_SU_INFO_PHYRX_HE_SIG_A_SU_INFO_DETAILS)));
-		ppdu_info->rx_status.he_sig_A2_known =
-			QDF_MON_STATUS_HE_SIG_A2_SU_KNOWN_ALL;
+			HE_SIG_A_SU_INFO_PHYRX_HE_SIG_A_SU_INFO_DETAILS);
+		ppdu_info->rx_status.he_flags = 1;
+		value = HAL_RX_GET(he_sig_a_su_info, HE_SIG_A_SU_INFO_0,
+			FORMAT_INDICATION);
+		if (value == 0) {
+			ppdu_info->rx_status.he_data1 =
+				QDF_MON_STATUS_HE_TRIG_FORMAT_TYPE;
+		} else {
+			 ppdu_info->rx_status.he_data1 =
+				 QDF_MON_STATUS_HE_SU_OR_EXT_SU_FORMAT_TYPE;
+		}
+
+		/*data1*/
+		ppdu_info->rx_status.he_data1 |=
+			QDF_MON_STATUS_HE_BSS_COLOR_KNOWN |
+			QDF_MON_STATUS_HE_BEAM_CHANGE_KNOWN |
+			QDF_MON_STATUS_HE_DL_UL_KNOWN |
+			QDF_MON_STATUS_HE_MCS_KNOWN |
+			QDF_MON_STATUS_HE_DCM_KNOWN |
+			QDF_MON_STATUS_HE_CODING_KNOWN |
+			QDF_MON_STATUS_HE_LDPC_EXTRA_SYMBOL_KNOWN |
+			QDF_MON_STATUS_HE_STBC_KNOWN |
+			QDF_MON_STATUS_HE_DATA_BW_RU_KNOWN |
+			QDF_MON_STATUS_HE_DOPPLER_KNOWN;
+
+		/*data2*/
+		ppdu_info->rx_status.he_data2 =
+			QDF_MON_STATUS_HE_GI_KNOWN;
+		ppdu_info->rx_status.he_data2 =
+			QDF_MON_STATUS_TXBF_KNOWN |
+			QDF_MON_STATUS_PE_DISAMBIGUITY_KNOWN |
+			QDF_MON_STATUS_TXOP_KNOWN |
+			QDF_MON_STATUS_LTF_SYMBOLS_KNOWN |
+			QDF_MON_STATUS_PRE_FEC_PADDING_KNOWN |
+			QDF_MON_STATUS_MIDABLE_PERIODICITY_KNOWN;
+
+		/*data3*/
+		value = HAL_RX_GET(he_sig_a_su_info,
+				HE_SIG_A_SU_INFO_0, BSS_COLOR_ID);
+		ppdu_info->rx_status.he_data3 = value;
+		value = HAL_RX_GET(he_sig_a_su_info,
+				HE_SIG_A_SU_INFO_0, BEAM_CHANGE);
+		value = value << QDF_MON_STATUS_BEAM_CHANGE_SHIFT;
+		ppdu_info->rx_status.he_data3 |= value;
+		value = HAL_RX_GET(he_sig_a_su_info,
+				HE_SIG_A_SU_INFO_0, DL_UL_FLAG);
+		value = value << QDF_MON_STATUS_DL_UL_SHIFT;
+		ppdu_info->rx_status.he_data3 |= value;
+		value = HAL_RX_GET(he_sig_a_su_info,
+				HE_SIG_A_SU_INFO_0, TRANSMIT_MCS);
+		value = value << QDF_MON_STATUS_TRANSMIT_MCS_SHIFT;
+		ppdu_info->rx_status.he_data3 |= value;
+		value = HAL_RX_GET(he_sig_a_su_info,
+				HE_SIG_A_SU_INFO_0, DCM);
+		value = value << QDF_MON_STATUS_DCM_SHIFT;
+		ppdu_info->rx_status.he_data3 |= value;
+		value = HAL_RX_GET(he_sig_a_su_info,
+				HE_SIG_A_SU_INFO_1, CODING);
+		value = value << QDF_MON_STATUS_CODING_SHIFT;
+		ppdu_info->rx_status.he_data3 |= value;
+		value = HAL_RX_GET(he_sig_a_su_info,
+				HE_SIG_A_SU_INFO_1,
+				LDPC_EXTRA_SYMBOL);
+		value = value << QDF_MON_STATUS_LDPC_EXTRA_SYMBOL_SHIFT;
+		ppdu_info->rx_status.he_data3 |= value;
+		value = HAL_RX_GET(he_sig_a_su_info,
+				HE_SIG_A_SU_INFO_1, STBC);
+		value = value << QDF_MON_STATUS_STBC_SHIFT;
+		ppdu_info->rx_status.he_data3 |= value;
+
+		/*data4*/
+		value = HAL_RX_GET(he_sig_a_su_info, HE_SIG_A_SU_INFO_0,
+							SPATIAL_REUSE);
+		ppdu_info->rx_status.he_data4 = value;
+
+		/*data5*/
+		value = HAL_RX_GET(he_sig_a_su_info,
+				HE_SIG_A_SU_INFO_0, TRANSMIT_BW);
+		ppdu_info->rx_status.he_data5 = value;
+		value = HAL_RX_GET(he_sig_a_su_info,
+				HE_SIG_A_SU_INFO_0, CP_LTF_SIZE);
+		switch (value) {
+		case 0:
+				he_gi = HE_GI_0_8;
+				he_ltf = HE_LTF_1_X;
+				break;
+		case 1:
+				he_gi = HE_GI_0_8;
+				he_ltf = HE_LTF_2_X;
+				break;
+		case 2:
+				he_gi = HE_GI_1_6;
+				he_ltf = HE_LTF_2_X;
+				break;
+		case 3:
+				he_gi = HE_GI_3_2;
+				he_ltf = HE_LTF_4_X;
+				break;
+		}
+		value = he_gi << QDF_MON_STATUS_GI_SHIFT;
+		ppdu_info->rx_status.he_data5 |= value;
+		value = he_ltf << QDF_MON_STATUS_HE_LTF_SHIFT;
+		ppdu_info->rx_status.he_data5 |= value;
+		value = HAL_RX_GET(he_sig_a_su_info, HE_SIG_A_SU_INFO_1,
+							PACKET_EXTENSION_A_FACTOR);
+		value = value << QDF_MON_STATUS_PRE_FEC_PAD_SHIFT;
+		ppdu_info->rx_status.he_data5 |= value;
+
+		value = HAL_RX_GET(he_sig_a_su_info, HE_SIG_A_SU_INFO_1, TXBF);
+		value = value << QDF_MON_STATUS_TXBF_SHIFT;
+		ppdu_info->rx_status.he_data5 |= value;
+		value = HAL_RX_GET(he_sig_a_su_info, HE_SIG_A_SU_INFO_1,
+							PACKET_EXTENSION_PE_DISAMBIGUITY);
+		value = value << QDF_MON_STATUS_PE_DISAMBIGUITY_SHIFT;
+		ppdu_info->rx_status.he_data5 |= value;
+
+		/*data6*/
+		value = HAL_RX_GET(he_sig_a_su_info, HE_SIG_A_SU_INFO_0, NSTS);
+		value++;
+		ppdu_info->rx_status.he_data6 = value;
+		value = HAL_RX_GET(he_sig_a_su_info, HE_SIG_A_SU_INFO_1,
+							DOPPLER_INDICATION);
+		value = value << QDF_MON_STATUS_DOPPLER_SHIFT;
+		ppdu_info->rx_status.he_data6 |= value;
+		value = HAL_RX_GET(he_sig_a_su_info, HE_SIG_A_SU_INFO_1,
+							TXOP_DURATION);
+		value = value << QDF_MON_STATUS_TXOP_SHIFT;
+		ppdu_info->rx_status.he_data6 |= value;
+
 		break;
+	}
 	case WIFIPHYRX_HE_SIG_A_MU_DL_E:
 		ppdu_info->rx_status.he_sig_A1 =
 			*((uint32_t *)((uint8_t *)rx_tlv +

+ 73 - 0
qdf/inc/qdf_nbuf.h

@@ -310,6 +310,79 @@ struct mon_rx_status {
 
 #define QDF_NBUF_IPA_CHECK_MASK		0x80000000
 
+/* HE Radiotap data1 Mask */
+#define QDF_MON_STATUS_HE_TRIG_FORMAT_TYPE 0x0003
+#define QDF_MON_STATUS_HE_SU_OR_EXT_SU_FORMAT_TYPE 0x0000
+#define QDF_MON_STATUS_HE_BEAM_CHANGE_KNOWN 0x0008
+#define QDF_MON_STATUS_HE_DL_UL_KNOWN 0x0010
+#define QDF_MON_STATUS_HE_MCS_KNOWN 0x0020
+#define QDF_MON_STATUS_HE_DCM_KNOWN 0x0040
+#define QDF_MON_STATUS_HE_CODING_KNOWN 0x0080
+#define QDF_MON_STATUS_HE_LDPC_EXTRA_SYMBOL_KNOWN 0x0100
+#define QDF_MON_STATUS_HE_STBC_KNOWN 0x0200
+#define QDF_MON_STATUS_HE_DATA_BW_RU_KNOWN 0x4000
+#define QDF_MON_STATUS_HE_DOPPLER_KNOWN 0x8000
+#define QDF_MON_STATUS_HE_BSS_COLOR_KNOWN 0x0004
+
+/* HE Radiotap data2 Mask */
+#define QDF_MON_STATUS_HE_GI_KNOWN 0x0002
+#define QDF_MON_STATUS_TXBF_KNOWN 0x0010
+#define QDF_MON_STATUS_PE_DISAMBIGUITY_KNOWN 0x0020
+#define QDF_MON_STATUS_TXOP_KNOWN 0x0040
+#define QDF_MON_STATUS_LTF_SYMBOLS_KNOWN 0x0004
+#define QDF_MON_STATUS_PRE_FEC_PADDING_KNOWN 0x0008
+#define QDF_MON_STATUS_MIDABLE_PERIODICITY_KNOWN 0x0080
+
+/* HE radiotap data3 shift values */
+#define QDF_MON_STATUS_BEAM_CHANGE_SHIFT 6
+#define QDF_MON_STATUS_DL_UL_SHIFT 7
+#define QDF_MON_STATUS_TRANSMIT_MCS_SHIFT 8
+#define QDF_MON_STATUS_DCM_SHIFT 12
+#define QDF_MON_STATUS_CODING_SHIFT 13
+#define QDF_MON_STATUS_LDPC_EXTRA_SYMBOL_SHIFT 14
+#define QDF_MON_STATUS_STBC_SHIFT 15
+
+/* HE radiotap data5 */
+#define QDF_MON_STATUS_GI_SHIFT 4
+#define QDF_MON_STATUS_HE_LTF_SHIFT 8
+#define QDF_MON_STATUS_TXBF_SHIFT 14
+#define QDF_MON_STATUS_PE_DISAMBIGUITY_SHIFT 15
+#define QDF_MON_STATUS_PRE_FEC_PAD_SHIFT 12
+
+/* HE radiotap data6 */
+#define QDF_MON_STATUS_DOPPLER_SHIFT 4
+#define QDF_MON_STATUS_TXOP_SHIFT 8
+
+/* HE radiotap HE-MU flags1 */
+#define QDF_MON_STATUS_SIG_B_MCS_KNOWN 0x0010
+#define QDF_MON_STATUS_DCM_FLAG_1_SHIFT 5
+#define QDF_MON_STATUS_QDF_KNOWN 0x0040
+#define QDF_MON_STATUS_BW_KNOWN 0x0080
+#define QDF_MON_STATUS_SPATIAL_REUSE_MU_KNOWN 0x0100
+#define QDF_MON_STATUS_SIG_B_COMPRESSION_FLAG_1_KNOWN 0x4000
+
+/* HE radiotap HE-MU flags2 */
+#define QDF_MON_STATUS_SIG_B_COMPRESSION_FLAG_2_SHIFT 3
+#define QDF_MON_STATUS_SYMBOLS_SHIFT 4
+#define QDF_MON_STATUS_SIG_B_COMPRESSION_FLAG_2_KNOWN 0x0100
+#define QDF_MON_STATUS_NUM_SIG_B_FLAG_2_SHIFT 9
+#define QDF_MON_STATUS_LTF_FLAG_2_SYMBOLS_SHIFT 12
+#define QDF_MON_STATUS_LTF_KNOWN 0x8000
+
+/* HE radiotap per_user_1 */
+#define QDF_MON_STATUS_STA_SPATIAL_SHIFT 11
+#define QDF_MON_STATUS_RESERVED_SET_TO_1_SHIFT 19
+#define QDF_MON_STATUS_STA_CODING_SHIFT 20
+
+/* HE radiotap per user known */
+#define QDF_MON_STATUS_STA_ID_PER_USER_KNOWN 0x02
+#define QDF_MON_STATUS_STA_NSTS_KNOWN 0x04
+#define QDF_MON_STATUS_STA_TX_BF_KNOWN 0x08
+#define QDF_MON_STATUS_STA_SPATIAL_CONFIG_KNOWN 0x10
+#define QDF_MON_STATUS_STA_MCS_KNOWN 0x20
+#define QDF_MON_STATUS_STA_DCM_KNOWN 0x40
+#define QDF_MON_STATUS_STA_CODING_KNOWN 0x80
+
 /**
  * qdf_proto_type - protocol type
  * @QDF_PROTO_TYPE_DHCP - DHCP