Browse Source

qcacld-3.0: Get mgmt frame info from frame buffer for logging

Issue scenario, 1st Addba response tx and set is_mgmt_data_valid false.
2nd TX frame happens for valid frame that needs to be logged and set
wma_handle->is_mgmt_data_valid to true. Then the 1st frame TX completion
tried to access wma_handle->mgmt._data. It may access invalid context if
race condition happened.

Move management frames handling from lim_send API to tx_complete_cnf API

Change-Id: Ib5090dcd274160b3a9d7b9975d0839ec06616b86
CRs-Fixed: 3154710
Vinod Kumar Myadam 3 years ago
parent
commit
94da0db1a5

+ 0 - 27
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -2714,31 +2714,4 @@ struct wlan_change_bi {
 	uint8_t session_id;
 };
 
-/**
- * struct mgmt_frame_data  - Management frame related info
- * @mac_hdr: 802.11 Frame MAC header
- * @status_code: Frame status code values as defined in
- * IEEE 802.11 - 2020 standard Table 9-41
- * @vdev_id: Vdev id
- * @frame_subtype: Frame subtype as defined in IEEE 802.11 - 2020
- * standard section 9.2.4.1.3
- * @auth_algo: Authentication algorithm number field as defined in
- * IEEE 802.11 - 2020 standard section 9.4.1.1
- * @auth_type: indicates SAE authentication frame type. Possible values are:
- * 1 - SAE commit frame
- * 2 - SAE confirm frame
- * @auth_seq: Authentication frame transaction sequence number as defined in
- * IEEE 802.11 - 2020 standard section 9.4.1.2
- * @rssi: RSSI in dBm
- */
-struct mgmt_frame_data {
-	struct wlan_frame_hdr mac_hdr;
-	uint16_t status_code;
-	uint8_t vdev_id;
-	uint8_t frame_subtype;
-	uint8_t auth_algo;
-	uint8_t auth_type;
-	uint8_t auth_seq;
-	int16_t rssi;
-};
 #endif

+ 1 - 1
core/mac/src/pe/include/lim_session.h

@@ -623,7 +623,7 @@ struct pe_session {
 	bool sae_pmk_cached;
 	bool recvd_deauth_while_roaming;
 	bool recvd_disassoc_while_roaming;
-	bool deauth_disassoc_rc;
+	uint16_t deauth_disassoc_rc;
 	enum wmi_obss_color_collision_evt_type obss_color_collision_dec_evt;
 	bool is_session_obss_color_collision_det_enabled;
 	tSirMacEdcaParamRecord ap_mu_edca_params[QCA_WLAN_AC_ALL];

+ 4 - 5
core/mac/src/pe/lim/lim_process_tdls.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -665,7 +665,6 @@ static QDF_STATUS lim_send_tdls_dis_req_frame(struct mac_context *mac,
 					TID_AC_VI,
 					lim_tx_complete, pFrame,
 					lim_mgmt_tdls_tx_complete,
-					NULL,
 					HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME |
 					HAL_USE_PEER_STA_REQUESTED_MASK,
 					smeSessionId, false, 0,
@@ -1405,7 +1404,7 @@ static QDF_STATUS lim_send_tdls_dis_rsp_frame(struct mac_context *mac,
 					      ANI_TXDIR_IBSS,
 					      0,
 					      lim_tx_complete, pFrame,
-					      lim_mgmt_tdls_tx_complete, NULL,
+					      lim_mgmt_tdls_tx_complete,
 					      HAL_USE_SELF_STA_REQUESTED_MASK,
 					      smeSessionId, false, 0,
 					      RATEID_DEFAULT, 0);
@@ -1489,7 +1488,7 @@ wma_tx_frame_with_tx_complete_send(struct mac_context *mac, void *pPacket,
 					  ANI_TXDIR_TODS,
 					  tid,
 					  lim_tx_complete, pFrame,
-					  lim_mgmt_tdls_tx_complete, NULL,
+					  lim_mgmt_tdls_tx_complete,
 					  HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME
 					  | HAL_USE_PEER_STA_REQUESTED_MASK,
 					  smeSessionId, flag, 0,
@@ -1510,7 +1509,7 @@ wma_tx_frame_with_tx_complete_send(struct mac_context *mac, void *pPacket,
 					  ANI_TXDIR_TODS,
 					  tid,
 					  lim_tx_complete, pFrame,
-					  lim_mgmt_tdls_tx_complete, NULL,
+					  lim_mgmt_tdls_tx_complete,
 					  HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME
 					  | HAL_USE_PEER_STA_REQUESTED_MASK,
 					  smeSessionId, false, 0,

+ 98 - 150
core/mac/src/pe/lim/lim_send_management_frames.c

@@ -1359,7 +1359,7 @@ void lim_send_mscs_req_action_frame(struct mac_context *mac,
 			   (uint16_t) (sizeof(tSirMacMgmtHdr) + payload),
 			   TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS, 7,
 			   lim_tx_complete, frame, lim_mscs_req_tx_complete_cnf,
-			   NULL, HAL_USE_PEER_STA_REQUESTED_MASK,
+			   HAL_USE_PEER_STA_REQUESTED_MASK,
 			   pe_session->vdev_id, false, 0, RATEID_DEFAULT, 0);
 	if (QDF_IS_STATUS_SUCCESS(qdf_status)) {
 		mlme_set_is_mscs_req_sent(pe_session->vdev, true);
@@ -1872,7 +1872,7 @@ lim_send_assoc_rsp_mgmt_frame(struct mac_context *mac_ctx,
 				TXRX_FRM_802_11_MGMT,
 				ANI_TXDIR_TODS,
 				7, lim_tx_complete, frame,
-				lim_assoc_rsp_tx_complete, NULL, tx_flag,
+				lim_assoc_rsp_tx_complete, tx_flag,
 				sme_session, false, 0, RATEID_DEFAULT, 0);
 	else
 		qdf_status = wma_tx_frame(
@@ -2037,6 +2037,83 @@ lim_send_delts_req_action_frame(struct mac_context *mac,
 
 } /* End lim_send_delts_req_action_frame. */
 
+#define SAE_AUTH_SEQ_NUM_OFFSET         2
+#define SAE_AUTH_STATUS_CODE_OFFSET     4
+#define SAE_AUTH_MESSAGE_TYPE_OFFSET    6
+#define SAE_FRAME_LENGTH \
+	(sizeof(struct wlan_frame_hdr) + SAE_AUTH_MESSAGE_TYPE_OFFSET)
+
+/**
+ * wlan_send_tx_complete_event() - Fill mgmt params
+ *
+ * @context: Pointer to mac context
+ * @buf: skb buffer
+ * @params: Pointer to wmi_mgmt_params
+ * @tx_complete: Sent status
+ * @tag: wlan main tag
+ *
+ * Function is used to send connectivity log event for mgmt ack status
+ *
+ * Return None
+ */
+
+static void wlan_send_tx_complete_event(struct mac_context *mac, qdf_nbuf_t buf,
+					struct wmi_mgmt_params *params,
+					uint8_t tx_complete,
+					enum wlan_main_tag tag)
+{
+	struct pe_session *pe_session = NULL;
+	struct wlan_frame_hdr *mac_hdr;
+	enum qdf_dp_tx_rx_status qdf_tx_complete;
+	uint8_t *frm_body;
+	uint16_t reason_code = 0;
+
+	pe_session = pe_find_session_by_vdev_id(mac, params->vdev_id);
+	if (pe_session && pe_session->opmode == QDF_STA_MODE) {
+		if (qdf_nbuf_len(buf) < sizeof(struct wlan_frame_hdr) + 2)
+			return;
+
+		mac_hdr = (struct wlan_frame_hdr *)qdf_nbuf_data(buf);
+		frm_body = (uint8_t *)mac_hdr + sizeof(struct wlan_frame_hdr);
+
+		if (tx_complete == WMI_MGMT_TX_COMP_TYPE_COMPLETE_OK)
+			qdf_tx_complete = QDF_TX_RX_STATUS_OK;
+		else if (tx_complete  == WMI_MGMT_TX_COMP_TYPE_DISCARD)
+			qdf_tx_complete = QDF_TX_RX_STATUS_FW_DISCARD;
+		else
+			qdf_tx_complete = QDF_TX_RX_STATUS_NO_ACK;
+
+		if (tag == WLAN_AUTH_REQ) {
+			uint16_t algo = 0, type = 0, seq = 0, status = 0;
+
+			if (qdf_nbuf_len(buf) < SAE_FRAME_LENGTH)
+				return;
+
+			algo = *(uint16_t *)frm_body;
+			seq = *(uint16_t *)(frm_body + SAE_AUTH_SEQ_NUM_OFFSET);
+			status =
+			*(uint16_t *)(frm_body + SAE_AUTH_STATUS_CODE_OFFSET);
+
+			if (algo == eSIR_AUTH_TYPE_SAE)
+				type = seq;
+
+			wlan_connectivity_mgmt_event(
+					mac_hdr, params->vdev_id, status,
+					qdf_tx_complete, mac->lim.bss_rssi,
+					algo, type, seq, WLAN_AUTH_REQ);
+			return;
+		}
+
+		if (tag == WLAN_DEAUTH_TX || tag == WLAN_DISASSOC_TX)
+			reason_code = pe_session->deauth_disassoc_rc;
+
+		wlan_connectivity_mgmt_event(
+					mac_hdr, params->vdev_id, reason_code,
+					qdf_tx_complete, mac->lim.bss_rssi,
+					0, 0, 0, tag);
+	}
+}
+
 /**
  * lim_assoc_tx_complete_cnf()- Confirmation for assoc sent over the air
  * @context: pointer to global mac
@@ -2055,28 +2132,14 @@ static QDF_STATUS lim_assoc_tx_complete_cnf(void *context,
 	uint16_t assoc_ack_status;
 	uint16_t reason_code;
 	struct mac_context *mac_ctx = (struct mac_context *)context;
-	struct mgmt_frame_data *data;
-	enum qdf_dp_tx_rx_status qdf_tx_complete;
 
 	pe_nofl_rl_info("Assoc req TX: %s (%d)",
 			(tx_complete == WMI_MGMT_TX_COMP_TYPE_COMPLETE_OK) ?
 			"success" : "fail", tx_complete);
 
-	if (params) {
-		data = params;
-
-		if (tx_complete == WMI_MGMT_TX_COMP_TYPE_COMPLETE_OK)
-			qdf_tx_complete = QDF_TX_RX_STATUS_OK;
-		else if (tx_complete  == WMI_MGMT_TX_COMP_TYPE_DISCARD)
-			qdf_tx_complete = QDF_TX_RX_STATUS_FW_DISCARD;
-		else
-			qdf_tx_complete = QDF_TX_RX_STATUS_NO_ACK;
-
-		wlan_connectivity_mgmt_event(&data->mac_hdr, data->vdev_id,
-					     data->status_code, qdf_tx_complete,
-					     data->rssi, 0, 0, 0,
-					     WLAN_ASSOC_REQ);
-	}
+	if (params)
+		wlan_send_tx_complete_event(context, buf, params, tx_complete,
+					    WLAN_ASSOC_REQ);
 
 	if (tx_complete == WMI_MGMT_TX_COMP_TYPE_COMPLETE_OK) {
 		assoc_ack_status = ACKED;
@@ -2216,7 +2279,6 @@ lim_send_assoc_req_mgmt_frame(struct mac_context *mac_ctx,
 {
 	int ret;
 	tDot11fAssocRequest *frm;
-	struct mgmt_frame_data mgmt_data, *mgmt_frame_info = NULL;
 	uint16_t caps;
 	uint8_t *frame, *rsnx_ie = NULL;
 	QDF_STATUS sir_status;
@@ -2830,24 +2892,14 @@ lim_send_assoc_req_mgmt_frame(struct mac_context *mac_ctx,
 			      pe_session, QDF_STATUS_SUCCESS, QDF_STATUS_SUCCESS);
 	lim_diag_mgmt_tx_event_report(mac_ctx, mac_hdr,
 				      pe_session, QDF_STATUS_SUCCESS, QDF_STATUS_SUCCESS);
-
 	peer_rssi = mac_ctx->lim.bss_rssi;
 
-	if (pe_session->opmode == QDF_STA_MODE) {
-		mgmt_data.mac_hdr = *(struct wlan_frame_hdr *)mac_hdr;
-		mgmt_data.vdev_id = pe_session->vdev_id;
-		mgmt_data.status_code = STATUS_SUCCESS;
-		mgmt_data.frame_subtype = MGMT_SUBTYPE_ASSOC_REQ;
-		mgmt_data.rssi = peer_rssi;
-		mgmt_frame_info = &mgmt_data;
-	}
-
 	qdf_status =
 		wma_tx_frameWithTxComplete(mac_ctx, packet,
 			   (uint16_t) (sizeof(tSirMacMgmtHdr) + payload),
 			   TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS, 7,
 			   lim_tx_complete, frame, lim_assoc_tx_complete_cnf,
-			   mgmt_frame_info, tx_flag, vdev_id, false, 0,
+			   tx_flag, vdev_id, false, 0,
 			   min_rid, peer_rssi);
 	MTRACE(qdf_trace
 		       (QDF_MODULE_ID_PE, TRACE_CODE_TX_COMPLETE,
@@ -2985,28 +3037,13 @@ static QDF_STATUS lim_auth_tx_complete_cnf(void *context,
 					   void *params)
 {
 	struct mac_context *mac_ctx = (struct mac_context *)context;
-	struct mgmt_frame_data *data;
 	uint16_t auth_ack_status;
 	uint16_t reason_code;
 	bool sae_auth_acked;
-	enum qdf_dp_tx_rx_status qdf_tx_complete;
-
-	if (params) {
-		data = params;
 
-		if (tx_complete == WMI_MGMT_TX_COMP_TYPE_COMPLETE_OK)
-			qdf_tx_complete = QDF_TX_RX_STATUS_OK;
-		else if (tx_complete  == WMI_MGMT_TX_COMP_TYPE_DISCARD)
-			qdf_tx_complete = QDF_TX_RX_STATUS_FW_DISCARD;
-		else
-			qdf_tx_complete = QDF_TX_RX_STATUS_NO_ACK;
-
-		wlan_connectivity_mgmt_event(&data->mac_hdr, data->vdev_id,
-					     data->status_code, qdf_tx_complete,
-					     data->rssi, data->auth_algo,
-					     data->auth_type, data->auth_seq,
-					     WLAN_AUTH_REQ);
-	}
+	if (params)
+		wlan_send_tx_complete_event(context, buf, params, tx_complete,
+					    WLAN_AUTH_REQ);
 
 	pe_nofl_rl_info("Auth TX: %s (%d)",
 			(tx_complete == WMI_MGMT_TX_COMP_TYPE_COMPLETE_OK) ?
@@ -3119,7 +3156,6 @@ lim_send_auth_mgmt_frame(struct mac_context *mac_ctx,
 	uint8_t *frame, *body;
 	uint32_t frame_len = 0, body_len = 0;
 	tpSirMacMgmtHdr mac_hdr;
-	struct mgmt_frame_data mgmt_data, *auth_frame_info = NULL;
 	void *packet;
 	QDF_STATUS qdf_status, status;
 	uint8_t tx_flag = 0;
@@ -3409,18 +3445,6 @@ alloc_packet:
 	lim_diag_mgmt_tx_event_report(mac_ctx, mac_hdr,
 				      session, QDF_STATUS_SUCCESS, QDF_STATUS_SUCCESS);
 
-	if (session->opmode == QDF_STA_MODE) {
-		mgmt_data.mac_hdr = *(struct wlan_frame_hdr *)mac_hdr;
-		mgmt_data.vdev_id = session->vdev_id;
-		mgmt_data.status_code = auth_frame->authStatusCode;
-		mgmt_data.rssi = peer_rssi;
-		mgmt_data.frame_subtype = MGMT_SUBTYPE_AUTH;
-		mgmt_data.auth_algo = auth_frame->authAlgoNumber;
-		mgmt_data.auth_seq = MGMT_SUBTYPE_AUTH;
-
-		auth_frame_info = &mgmt_data;
-	}
-
 	if (session->ftPEContext.pFTPreAuthReq)
 		ch_freq_tx_frame = session->ftPEContext.
 				pFTPreAuthReq->pre_auth_channel_freq;
@@ -3429,7 +3453,7 @@ alloc_packet:
 				 (uint16_t)frame_len,
 				 TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS,
 				 7, lim_tx_complete, frame,
-				 lim_auth_tx_complete_cnf, auth_frame_info,
+				 lim_auth_tx_complete_cnf,
 				 tx_flag, vdev_id, false,
 				 ch_freq_tx_frame, min_rid, peer_rssi);
 	MTRACE(qdf_trace(QDF_MODULE_ID_PE, TRACE_CODE_TX_COMPLETE,
@@ -3679,24 +3703,10 @@ static QDF_STATUS lim_disassoc_tx_complete_cnf_handler(void *context,
 	struct mac_context *max_ctx = (struct mac_context *)context;
 	QDF_STATUS status_code;
 	struct scheduler_msg msg = {0};
-	struct mgmt_frame_data *data;
-	enum qdf_dp_tx_rx_status qdf_tx_complete;
 
-	if (params) {
-		data = params;
-
-		if (tx_success == WMI_MGMT_TX_COMP_TYPE_COMPLETE_OK)
-			qdf_tx_complete = QDF_TX_RX_STATUS_OK;
-		else if (tx_success  == WMI_MGMT_TX_COMP_TYPE_DISCARD)
-			qdf_tx_complete = QDF_TX_RX_STATUS_FW_DISCARD;
-		else
-			qdf_tx_complete = QDF_TX_RX_STATUS_NO_ACK;
-
-		wlan_connectivity_mgmt_event(&data->mac_hdr, data->vdev_id,
-					     data->status_code, qdf_tx_complete,
-					     data->rssi, 0, 0, 0,
-					     WLAN_DISASSOC_TX);
-	}
+	if (params)
+		wlan_send_tx_complete_event(context, buf, params, tx_success,
+					    WLAN_DISASSOC_TX);
 
 	pe_debug("tx_success: %d", tx_success);
 
@@ -3734,24 +3744,10 @@ static QDF_STATUS lim_deauth_tx_complete_cnf_handler(void *context,
 	struct scheduler_msg msg = {0};
 	tLimMlmDeauthReq *deauth_req;
 	struct pe_session *session = NULL;
-	struct mgmt_frame_data *data;
-	enum qdf_dp_tx_rx_status qdf_tx_complete;
-
-	if (params) {
-		data = params;
-
-		if (tx_success == WMI_MGMT_TX_COMP_TYPE_COMPLETE_OK)
-			qdf_tx_complete = QDF_TX_RX_STATUS_OK;
-		else if (tx_success  == WMI_MGMT_TX_COMP_TYPE_DISCARD)
-			qdf_tx_complete = QDF_TX_RX_STATUS_FW_DISCARD;
-		else
-			qdf_tx_complete = QDF_TX_RX_STATUS_NO_ACK;
 
-		wlan_connectivity_mgmt_event(&data->mac_hdr, data->vdev_id,
-					     data->status_code, qdf_tx_complete,
-					     data->rssi, 0, 0, 0,
-					     WLAN_DEAUTH_TX);
-	}
+	if (params)
+		wlan_send_tx_complete_event(context, buf, params, tx_success,
+					    WLAN_DEAUTH_TX);
 
 	deauth_req = mac_ctx->lim.limDisassocDeauthCnfReq.pMlmDeauthReq;
 
@@ -3834,7 +3830,6 @@ lim_send_disassoc_mgmt_frame(struct mac_context *mac,
 			     struct pe_session *pe_session, bool waitForAck)
 {
 	tDot11fDisassociation frm;
-	struct mgmt_frame_data mgmt_data, *mgmt_frame_info = NULL;
 	uint8_t *pFrame;
 	tpSirMacMgmtHdr pMacHdr;
 	uint32_t nBytes, nPayload, nStatus;
@@ -3945,6 +3940,7 @@ lim_send_disassoc_mgmt_frame(struct mac_context *mac,
 
 	txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK;
 
+	pe_session->deauth_disassoc_rc = nReason;
 	if (waitForAck) {
 		MTRACE(qdf_trace(QDF_MODULE_ID_PE, TRACE_CODE_TX_MGMT,
 				 pe_session->peSessionId,
@@ -3953,15 +3949,6 @@ lim_send_disassoc_mgmt_frame(struct mac_context *mac,
 					      pe_session, QDF_STATUS_SUCCESS,
 					      QDF_STATUS_SUCCESS);
 
-		if (pe_session->opmode == QDF_STA_MODE) {
-			mgmt_data.mac_hdr = *(struct wlan_frame_hdr *)pMacHdr;
-			mgmt_data.vdev_id = pe_session->vdev_id;
-			mgmt_data.status_code = nReason;
-			mgmt_data.frame_subtype = MGMT_SUBTYPE_DISASSOC;
-			mgmt_data.rssi = mac->lim.bss_rssi;
-			mgmt_frame_info = &mgmt_data;
-		}
-
 		/* Queue Disassociation frame in high priority WQ */
 		/* get the duration from the request */
 		qdf_status =
@@ -3969,7 +3956,6 @@ lim_send_disassoc_mgmt_frame(struct mac_context *mac,
 					 TXRX_FRM_802_11_MGMT,
 					 ANI_TXDIR_TODS, 7, lim_tx_complete,
 					 pFrame, lim_disassoc_tx_complete_cnf_handler,
-					 mgmt_frame_info,
 					 txFlag, smeSessionId, false, 0,
 					 RATEID_DEFAULT, 0);
 		MTRACE(qdf_trace
@@ -4049,8 +4035,6 @@ lim_send_deauth_mgmt_frame(struct mac_context *mac,
 			   struct pe_session *pe_session, bool waitForAck)
 {
 	tDot11fDeAuth frm;
-	struct mgmt_frame_data mgmt_data;
-	void *mgmt_frame_info = NULL;
 	uint8_t *pFrame;
 	tpSirMacMgmtHdr pMacHdr;
 	uint32_t nBytes, nPayload, nStatus;
@@ -4176,6 +4160,7 @@ lim_send_deauth_mgmt_frame(struct mac_context *mac,
 				      &pe_session->dph.dphHashTable);
 #endif
 
+	pe_session->deauth_disassoc_rc = nReason;
 	if (waitForAck) {
 		MTRACE(qdf_trace(QDF_MODULE_ID_PE, TRACE_CODE_TX_MGMT,
 				 pe_session->peSessionId,
@@ -4193,22 +4178,12 @@ lim_send_deauth_mgmt_frame(struct mac_context *mac,
 					 peer, QDF_MAC_ADDR_SIZE);
 		}
 
-		if (pe_session->opmode == QDF_STA_MODE) {
-			mgmt_data.mac_hdr = *(struct wlan_frame_hdr *)pMacHdr;
-			mgmt_data.vdev_id = pe_session->vdev_id;
-			mgmt_data.status_code = nReason;
-			mgmt_data.rssi = mac->lim.bss_rssi;
-			mgmt_data.frame_subtype = MGMT_SUBTYPE_DEAUTH;
-			mgmt_frame_info = &mgmt_data;
-		}
-
 		/* Queue Disassociation frame in high priority WQ */
 		qdf_status =
 			wma_tx_frameWithTxComplete(mac, pPacket, (uint16_t) nBytes,
 					 TXRX_FRM_802_11_MGMT,
 					 ANI_TXDIR_TODS, 7, lim_tx_complete,
 					 pFrame, lim_deauth_tx_complete_cnf_handler,
-					 mgmt_frame_info,
 					 txFlag, smeSessionId, false, 0,
 					 RATEID_DEFAULT, 0);
 		MTRACE(qdf_trace
@@ -4932,7 +4907,7 @@ lim_p2p_oper_chan_change_confirm_action_frame(struct mac_context *mac_ctx,
 			(uint16_t)num_bytes,
 			TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS,
 			7, lim_tx_complete, frame,
-			lim_oper_chan_change_confirm_tx_complete_cnf, NULL,
+			lim_oper_chan_change_confirm_tx_complete_cnf,
 			tx_flag, vdev_id, false, 0, RATEID_DEFAULT, 0);
 
 	MTRACE(qdf_trace(QDF_MODULE_ID_PE, TRACE_CODE_TX_COMPLETE,
@@ -5919,7 +5894,7 @@ QDF_STATUS lim_send_addba_response_frame(struct mac_context *mac_ctx,
 						ANI_TXDIR_TODS, 7,
 						NULL, frame_ptr,
 						lim_addba_rsp_tx_complete_cnf,
-						NULL, tx_flag, vdev_id,
+						tx_flag, vdev_id,
 						false, 0, RATEID_DEFAULT, 0);
 	MTRACE(qdf_trace(QDF_MODULE_ID_PE, TRACE_CODE_TX_COMPLETE,
 			 session->peSessionId, qdf_status));
@@ -6080,7 +6055,7 @@ QDF_STATUS lim_send_delba_action_frame(struct mac_context *mac_ctx,
 						ANI_TXDIR_TODS, 7,
 						NULL, frame_ptr,
 						lim_delba_tx_complete_cnf,
-						NULL, tx_flag, vdev_id,
+						tx_flag, vdev_id,
 						false, 0, RATEID_DEFAULT, 0);
 	if (qdf_status != QDF_STATUS_SUCCESS) {
 		pe_err("delba wma_tx_frame FAILED! Status [%d]", qdf_status);
@@ -6111,13 +6086,11 @@ error_delba:
 static void lim_tx_mgmt_frame(struct mac_context *mac_ctx, uint8_t vdev_id,
 			      uint32_t msg_len, void *packet, uint8_t *frame)
 {
-	struct mgmt_frame_data mgmt_data, *mgmt_frame_info = NULL;
 	tpSirMacFrameCtl fc = (tpSirMacFrameCtl)frame;
 	QDF_STATUS qdf_status;
 	struct pe_session *session;
 	uint16_t auth_ack_status;
 	enum rateid min_rid = RATEID_DEFAULT;
-	uint16_t sae_auth_seq = 0;
 
 	session = pe_find_session_by_vdev_id(mac_ctx, vdev_id);
 	if (!session) {
@@ -6132,36 +6105,11 @@ static void lim_tx_mgmt_frame(struct mac_context *mac_ctx, uint8_t vdev_id,
 
 	min_rid = lim_get_min_session_txrate(session);
 
-	if (fc->subType == SIR_MAC_MGMT_AUTH &&
-	    session->opmode == QDF_STA_MODE &&
-	    msg_len >= (sizeof(struct wlan_frame_hdr) +
-			MAC_AUTH_FRAME_STATUS_CODE_OFFSET + 2)) {
-		mgmt_data.mac_hdr = *(struct wlan_frame_hdr *)frame;
-		mgmt_data.vdev_id = vdev_id;
-		mgmt_data.status_code =
-			*(uint16_t *)(frame + sizeof(struct wlan_frame_hdr) +
-				      MAC_AUTH_FRAME_STATUS_CODE_OFFSET);
-		mgmt_data.rssi = mac_ctx->lim.bss_rssi;
-		mgmt_data.frame_subtype = MGMT_SUBTYPE_AUTH;
-		mgmt_data.auth_algo = *(uint16_t *)(frame +
-					  sizeof(tSirMacMgmtHdr));
-		if (mgmt_data.auth_algo == eSIR_AUTH_TYPE_SAE) {
-			sae_auth_seq =
-			    *(uint16_t *)(frame +
-					  sizeof(struct wlan_frame_hdr) +
-					  SAE_AUTH_SEQ_NUM_OFFSET);
-			mgmt_data.auth_seq = sae_auth_seq;
-			mgmt_data.auth_type = sae_auth_seq;
-		}
-		mgmt_frame_info = &mgmt_data;
-	}
-
 	qdf_status = wma_tx_frameWithTxComplete(mac_ctx, packet,
 					 (uint16_t)msg_len,
 					 TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS,
 					 7, lim_tx_complete, frame,
 					 lim_auth_tx_complete_cnf,
-					 mgmt_frame_info,
 					 0, vdev_id, false, 0, min_rid, 0);
 	MTRACE(qdf_trace(QDF_MODULE_ID_PE, TRACE_CODE_TX_COMPLETE,
 		session->peSessionId, qdf_status));

+ 0 - 4
core/wma/inc/wma.h

@@ -819,8 +819,6 @@ struct wma_wlm_stats_data {
  *   set this and wait will timeout, and code will poll the pending tx
  *   descriptors number to be zero.
  * @umac_ota_ack_cb: Ack Complete Callback registered by umac
- * @is_mgmt_data_valid: Is management frame data valid
- * @mgmt_data: Management frame related data
  * @umac_data_ota_ack_cb: ack complete callback
  * @last_umac_data_ota_timestamp: timestamp when OTA of last umac data
  *   was done
@@ -944,8 +942,6 @@ typedef struct {
 	qdf_event_t tx_frm_download_comp_event;
 	qdf_event_t tx_queue_empty_event;
 	wma_tx_ota_comp_callback umac_data_ota_ack_cb;
-	bool is_mgmt_data_valid;
-	struct mgmt_frame_data mgmt_data;
 	unsigned long last_umac_data_ota_timestamp;
 	qdf_nbuf_t last_umac_data_nbuf;
 	wma_tgt_cfg_cb tgt_cfg_update_cb;

+ 1 - 5
core/wma/inc/wma_types.h

@@ -458,7 +458,6 @@ enum wmamsgtype {
 		      (pCompFunc), \
 		      (pData), \
 		      (NULL), \
-		      (NULL), \
 		      (txFlag), \
 		      (sessionid), \
 		      (false), \
@@ -467,7 +466,7 @@ enum wmamsgtype {
 		      (peer_rssi)))
 
 #define wma_tx_frameWithTxComplete(hHal, pFrmBuf, frmLen, frmType, txDir, tid, \
-	 pCompFunc, pData, pCBackFnTxComp, ota_comp_data, txFlag, sessionid, \
+	 pCompFunc, pData, pCBackFnTxComp, txFlag, sessionid, \
 	 tdlsflag, channel_freq, rid, peer_rssi) \
 	(QDF_STATUS)( wma_tx_packet( \
 		      cds_get_context(QDF_MODULE_ID_WMA), \
@@ -479,7 +478,6 @@ enum wmamsgtype {
 		      (pCompFunc), \
 		      (pData), \
 		      (pCBackFnTxComp), \
-		      (ota_comp_data), \
 		      (txFlag), \
 		      (sessionid), \
 		      (tdlsflag), \
@@ -673,7 +671,6 @@ void wma_tx_abort(uint8_t vdev_id);
  * @tx_frm_download_comp_cb: tx download callback handler
  * @pData: tx packet
  * @tx_frm_ota_comp_cb: OTA completion handler
- * @ota_comp_data: OTA completion data
  * @tx_flag: tx flag
  * @vdev_id: vdev id
  * @tdls_flag: tdls flag
@@ -692,7 +689,6 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
 			 wma_tx_dwnld_comp_callback tx_frm_download_comp_cb,
 			 void *pData,
 			 wma_tx_ota_comp_callback tx_frm_ota_comp_cb,
-			 struct mgmt_frame_data *ota_comp_data,
 			 uint8_t tx_flag, uint8_t vdev_id, bool tdls_flag,
 			 uint16_t channel_freq, enum rateid rid,
 			 int8_t peer_rssi);

+ 0 - 7
core/wma/src/wma_data.c

@@ -2276,7 +2276,6 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
 			 wma_tx_dwnld_comp_callback tx_frm_download_comp_cb,
 			 void *pData,
 			 wma_tx_ota_comp_callback tx_frm_ota_comp_cb,
-			 struct mgmt_frame_data *ota_comp_data,
 			 uint8_t tx_flag, uint8_t vdev_id, bool tdls_flag,
 			 uint16_t channel_freq, enum rateid rid,
 			 int8_t peer_rssi)
@@ -2609,12 +2608,6 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
 				GENERIC_NODOWNLD_NOACK_COMP_INDEX;
 		}
 
-		if (ota_comp_data) {
-			wma_handle->is_mgmt_data_valid = true;
-			wma_handle->mgmt_data = *ota_comp_data;
-		} else {
-			wma_handle->is_mgmt_data_valid = false;
-		}
 	}
 
 	/*

+ 4 - 9
core/wma/src/wma_mgmt.c

@@ -2672,11 +2672,10 @@ static int wma_process_mgmt_tx_completion(tp_wma_handle wma_handle,
 					  uint32_t desc_id, uint32_t status)
 {
 	struct wlan_objmgr_pdev *pdev;
-	void *frame_data;
 	qdf_nbuf_t buf = NULL;
 	QDF_STATUS ret;
-#if !defined(REMOVE_PKT_LOG)
 	uint8_t vdev_id = 0;
+#if !defined(REMOVE_PKT_LOG)
 	ol_txrx_pktdump_cb packetdump_cb;
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 	enum tx_status pktdump_status;
@@ -2701,9 +2700,10 @@ static int wma_process_mgmt_tx_completion(tp_wma_handle wma_handle,
 	if (buf)
 		wma_mgmt_unmap_buf(wma_handle, buf);
 
-#if !defined(REMOVE_PKT_LOG)
 	vdev_id = mgmt_txrx_get_vdev_id(pdev, desc_id);
 	mgmt_params.vdev_id = vdev_id;
+
+#if !defined(REMOVE_PKT_LOG)
 	packetdump_cb = wma_handle->wma_mgmt_tx_packetdump_cb;
 	pktdump_status = wma_mgmt_pktdump_status_map(status);
 	if (packetdump_cb)
@@ -2711,13 +2711,8 @@ static int wma_process_mgmt_tx_completion(tp_wma_handle wma_handle,
 			      buf, pktdump_status, TX_MGMT_PKT);
 #endif
 
-	if (wma_handle->is_mgmt_data_valid)
-		frame_data = &wma_handle->mgmt_data;
-	else
-		frame_data = &mgmt_params;
-
 	ret = mgmt_txrx_tx_completion_handler(pdev, desc_id, status,
-					      frame_data);
+					      &mgmt_params);
 
 	if (ret != QDF_STATUS_SUCCESS) {
 		wma_err("Failed to process mgmt tx completion");