Explorar o código

qcacld-3.0: Use mgmt_txrx_frame_hex_dump to dump mgmt frame

Use mgmt_txrx_frame_hex_dump to dump mgmt frame and optimize
frame dump and logs

Change-Id: I56f244fecfa2602c6b763f5734d36199b8c3f165
CRs-Fixed: 3838935
Abhishek Singh hai 1 ano
pai
achega
89f532d762

+ 4 - 14
core/mac/src/pe/lim/lim_api.c

@@ -1856,12 +1856,8 @@ static void pe_update_crypto_params(struct mac_context *mac_ctx,
 	hdr = (tpSirMacMgmtHdr)((uint8_t *)roam_synch +
 		roam_synch->reassoc_req_offset);
 	if (hdr->fc.type == SIR_MAC_MGMT_FRAME &&
-	    hdr->fc.subType == SIR_MAC_MGMT_ASSOC_REQ) {
+	    hdr->fc.subType == SIR_MAC_MGMT_ASSOC_REQ)
 		ies_offset = WLAN_ASSOC_REQ_IES_OFFSET;
-		pe_debug("roam assoc req frm");
-	} else {
-		pe_debug("roam reassoc req frm");
-	}
 
 	if (roam_synch->reassoc_req_length <
 	    (sizeof(tSirMacMgmtHdr) + ies_offset)) {
@@ -1869,10 +1865,6 @@ static void pe_update_crypto_params(struct mac_context *mac_ctx,
 		       roam_synch->reassoc_req_length);
 		return;
 	}
-	qdf_trace_hex_dump(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
-			   (uint8_t *)roam_synch +
-				roam_synch->reassoc_req_offset,
-			   roam_synch->reassoc_req_length);
 
 	ft_session->limRmfEnabled = false;
 
@@ -2227,10 +2219,7 @@ lim_roam_fill_bss_descr(struct mac_context *mac,
 			roam_synch_ind->is_beacon,
 		 QDF_MAC_ADDR_REF(bssid.bytes),
 		 QDF_MAC_ADDR_REF(mac_hdr->bssId));
-
-	QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
-			   bcn_proberesp_ptr,
-			   bcn_proberesp_len);
+	mgmt_txrx_frame_hex_dump(bcn_proberesp_ptr, bcn_proberesp_len, false);
 
 	status = lim_roam_gen_beacon_descr(mac, bcn_proberesp_ptr,
 					   bcn_proberesp_len, is_mlo_link,
@@ -3043,7 +3032,8 @@ pe_roam_synch_callback(struct mac_context *mac_ctx,
 
 	reassoc_resp = (uint8_t *)roam_sync_ind_ptr +
 			roam_sync_ind_ptr->reassoc_resp_offset;
-
+	mgmt_txrx_frame_hex_dump(reassoc_resp,
+				 roam_sync_ind_ptr->reassoc_resp_length, false);
 	if (wlan_vdev_mlme_get_is_mlo_link(mac_ctx->psoc, vdev_id)) {
 		status = lim_gen_link_specific_assoc_rsp(mac_ctx,
 						ft_session_ptr,

+ 3 - 1
core/mac/src/pe/lim/lim_process_beacon_frame.c

@@ -609,7 +609,9 @@ lim_process_beacon_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_info,
 			qdf_mem_copy(session->beacon,
 				WMA_GET_RX_MAC_HEADER(rx_pkt_info),
 				session->bcnLen);
-
+		mgmt_txrx_frame_hex_dump((uint8_t *)mac_hdr,
+					 WMA_GET_RX_MPDU_LEN(rx_pkt_info),
+					 false);
 		lim_check_and_announce_join_success(mac_ctx, bcn_ptr,
 				mac_hdr, session);
 	}

+ 4 - 10
core/mac/src/pe/lim/lim_process_message_queue.c

@@ -1346,16 +1346,10 @@ lim_handle80211_frames(struct mac_context *mac, struct scheduler_msg *limMsg,
 		    (fc.subType != SIR_MAC_MGMT_PROBE_REQ) &&
 		    (fc.subType != SIR_MAC_MGMT_PROBE_RSP) &&
 		    (fc.subType != SIR_MAC_MGMT_BEACON) &&
-		    (fc.subType != SIR_MAC_MGMT_ACTION)) {
-			pe_debug("RX MGMT - Type %hu, SubType %hu, seq num[%d]",
-				 fc.type, fc.subType,
-				 ((pHdr->seqControl.seqNumHi << HIGH_SEQ_NUM_OFFSET) |
-				 pHdr->seqControl.seqNumLo));
-			QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE,
-					   QDF_TRACE_LEVEL_DEBUG, pHdr,
-					   WMA_GET_RX_PAYLOAD_LEN(pRxPacketInfo)
-					   + SIR_MAC_HDR_LEN_3A);
-		}
+		    (fc.subType != SIR_MAC_MGMT_ACTION))
+			mgmt_txrx_frame_hex_dump((uint8_t *)pHdr,
+					 WMA_GET_RX_MPDU_LEN(pRxPacketInfo),
+					 false);
 	}
 
 #ifdef FEATURE_WLAN_EXTSCAN

+ 5 - 5
core/mac/src/pe/lim/lim_process_probe_rsp_frame.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 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
@@ -343,9 +343,6 @@ lim_process_probe_rsp_frame(struct mac_context *mac_ctx, uint8_t *rx_Packet_info
 	if (!lim_validate_probe_rsp_mld_addr(session_entry, probe_rsp))
 		goto mem_free;
 
-	qdf_trace_hex_dump(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, body,
-			   frame_len);
-
 	lim_update_mlo_mgr_prb_info(mac_ctx, session_entry,
 				    (struct qdf_mac_addr *)header->bssId,
 				    probe_rsp);
@@ -394,7 +391,10 @@ lim_process_probe_rsp_frame(struct mac_context *mac_ctx, uint8_t *rx_Packet_info
 					     (rx_Packet_info),
 				     session_entry->bcnLen);
 		}
-			/* STA in WT_JOIN_BEACON_STATE */
+		/* STA in WT_JOIN_BEACON_STATE */
+		mgmt_txrx_frame_hex_dump((uint8_t *)header,
+					 WMA_GET_RX_MPDU_LEN(rx_Packet_info),
+					 false);
 		lim_check_and_announce_join_success(mac_ctx, probe_rsp,
 						header,
 						session_entry);

+ 3 - 5
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -4530,11 +4530,9 @@ lim_fill_session_params(struct mac_context *mac_ctx,
 
 	pe_join_req = session->lim_join_req;
 	bss_desc = &session->lim_join_req->bssDescription;
-	pe_debug("Beacon/probe frame received:");
-	QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
-			   util_scan_entry_frame_ptr(req->entry),
-			   util_scan_entry_frame_len(req->entry));
-
+	mgmt_txrx_frame_hex_dump(util_scan_entry_frame_ptr(req->entry),
+				 util_scan_entry_frame_len(req->entry),
+				 false);
 	status = wlan_fill_bss_desc_from_scan_entry(mac_ctx, bss_desc,
 						    req->entry);
 	if (QDF_IS_STATUS_ERROR(status)) {

+ 5 - 25
core/mac/src/pe/lim/lim_send_management_frames.c

@@ -483,8 +483,7 @@ lim_send_probe_req_mgmt_frame(struct mac_context *mac_ctx,
 		      vdev_id, mac_ctx->mgmtSeqNum,
 		      QDF_MAC_ADDR_REF(bssid),
 		      (int)sizeof(tSirMacMgmtHdr) + payload);
-	qdf_trace_hex_dump(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, frame,
-			   sizeof(tSirMacMgmtHdr) + payload);
+	mgmt_txrx_frame_hex_dump(frame, sizeof(tSirMacMgmtHdr) + payload, true);
 
 	/* If this probe request is sent during P2P Search State, then we need
 	 * to send it at OFDM rate.
@@ -6680,10 +6679,9 @@ lim_send_epcs_action_req_frame(struct wlan_objmgr_vdev *vdev,
 	frm.Action.action = args->action;
 	frm.DialogToken.token = args->arg1;
 
-	pe_debug("Sending a EPCS negotiation Request from " QDF_MAC_ADDR_FMT " to " QDF_MAC_ADDR_FMT,
-		 QDF_MAC_ADDR_REF(session->self_mac_addr),
+	pe_debug("Sending a EPCS negotiation Request token %d from " QDF_MAC_ADDR_FMT " to " QDF_MAC_ADDR_FMT,
+		 frm.DialogToken.token, QDF_MAC_ADDR_REF(session->self_mac_addr),
 		 QDF_MAC_ADDR_REF(peer_mac));
-	pe_debug("Dialog token %d", frm.DialogToken.token);
 
 	status = dot11f_get_packed_epcs_neg_reqSize(mac_ctx, &frm,
 						    &payload_size);
@@ -6729,10 +6727,6 @@ lim_send_epcs_action_req_frame(struct wlan_objmgr_vdev *vdev,
 			status);
 	}
 
-	pe_debug("Dump EPCS TX req action frame");
-	qdf_trace_hex_dump(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, frame_ptr,
-			   num_bytes);
-
 	if (!wlan_reg_is_24ghz_ch_freq(session->curr_op_freq) ||
 	    session->opmode == QDF_P2P_CLIENT_MODE ||
 	    session->opmode == QDF_P2P_GO_MODE)
@@ -6840,10 +6834,6 @@ lim_send_epcs_action_teardown_frame(struct wlan_objmgr_vdev *vdev,
 			status);
 	}
 
-	pe_debug("Dump EPCS TX tear down action frame");
-	qdf_trace_hex_dump(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, frame_ptr,
-			   num_bytes);
-
 	if (!wlan_reg_is_24ghz_ch_freq(session->curr_op_freq) ||
 	    session->opmode == QDF_P2P_CLIENT_MODE ||
 	    session->opmode == QDF_P2P_GO_MODE)
@@ -7171,11 +7161,6 @@ lim_send_t2lm_action_req_frame(struct wlan_objmgr_vdev *vdev,
 	}
 
 	frm.t2lm_ie[0].num_data = ie_buf->elem_len - 1;
-
-	pe_debug("Dump T2LM IE buff len %d", ie_buf->elem_len);
-	qdf_trace_hex_dump(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, ie_buf,
-			   ie_buf->elem_len +  sizeof(struct ie_header));
-
 	qdf_mem_copy(&frm.t2lm_ie[0].data, ie_buf->data,
 		     frm.t2lm_ie[0].num_data);
 
@@ -7187,10 +7172,9 @@ lim_send_t2lm_action_req_frame(struct wlan_objmgr_vdev *vdev,
 	frm.num_t2lm_ie = 1;
 	frm.t2lm_ie[0].present = 1;
 
-	pe_debug("Sending a T2LM negotiation Request from " QDF_MAC_ADDR_FMT " to " QDF_MAC_ADDR_FMT,
-		 QDF_MAC_ADDR_REF(session->self_mac_addr),
+	pe_debug("Sending a T2LM negotiation Request token %d from " QDF_MAC_ADDR_FMT " to " QDF_MAC_ADDR_FMT,
+		 frm.DialogToken.token, QDF_MAC_ADDR_REF(session->self_mac_addr),
 		 QDF_MAC_ADDR_REF(peer_mac));
-	pe_debug("Dialog token %d", frm.DialogToken.token);
 
 	status = dot11f_get_packed_t2lm_neg_reqSize(mac_ctx, &frm,
 						    &payload_size);
@@ -7237,10 +7221,6 @@ lim_send_t2lm_action_req_frame(struct wlan_objmgr_vdev *vdev,
 			status);
 	}
 
-	pe_debug("Dump T2LM TX req action frame");
-	qdf_trace_hex_dump(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, frame_ptr,
-			   num_bytes);
-
 	if (!wlan_reg_is_24ghz_ch_freq(session->curr_op_freq) ||
 	    session->opmode == QDF_P2P_CLIENT_MODE ||
 	    session->opmode == QDF_P2P_GO_MODE)

+ 0 - 5
core/sme/src/csr/csr_api_roam.c

@@ -5536,11 +5536,6 @@ static void csr_fill_connected_profile(struct mac_context *mac_ctx,
 		goto purge_list;
 
 	wlan_fill_bss_desc_from_scan_entry(mac_ctx, bss_desc, cur_node->entry);
-	pe_debug("Dump scan entry frm:");
-	QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
-			   cur_node->entry->raw_frame.ptr,
-			   cur_node->entry->raw_frame.len);
-
 	src_cfg.uint_value = bss_desc->mbo_oce_enabled_ap;
 	wlan_cm_roam_cfg_set_value(mac_ctx->psoc, vdev_id, MBO_OCE_ENABLED_AP,
 				   &src_cfg);

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

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 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
@@ -2686,31 +2686,16 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
 	}
 
 	if (pFc->type == SIR_MAC_MGMT_FRAME) {
-		if ((mac->mlme_cfg->gen.debug_packet_log &
+		if (((mac->mlme_cfg->gen.debug_packet_log &
 		    DEBUG_PKTLOG_TYPE_MGMT) &&
 		    (pFc->subType != SIR_MAC_MGMT_PROBE_REQ) &&
 		    (pFc->subType != SIR_MAC_MGMT_PROBE_RSP) &&
-		    (pFc->subType != SIR_MAC_MGMT_ACTION)) {
-			wma_debug("TX MGMT - Type %hu, SubType %hu seq_num[%d]",
-				  pFc->type, pFc->subType,
-				  ((mHdr->seqControl.seqNumHi << 4) |
-				  mHdr->seqControl.seqNumLo));
-			qdf_trace_hex_dump(QDF_MODULE_ID_WMA,
-					   QDF_TRACE_LEVEL_DEBUG, pData,
-					   frmLen);
-		} else if ((mac->mlme_cfg->gen.debug_packet_log &
-			   DEBUG_PKTLOG_TYPE_ACTION) &&
-			   (pFc->subType == SIR_MAC_MGMT_ACTION)) {
-			wma_debug("TX MGMT - Type %hu, SubType %hu seq_num[%d]",
-				  pFc->type, pFc->subType,
-				 ((mHdr->seqControl.seqNumHi << 4) |
-				 mHdr->seqControl.seqNumLo));
-			qdf_trace_hex_dump(QDF_MODULE_ID_WMA,
-					   QDF_TRACE_LEVEL_DEBUG, pData,
-					   frmLen);
-		}
+		    (pFc->subType != SIR_MAC_MGMT_ACTION)) ||
+		    ((mac->mlme_cfg->gen.debug_packet_log &
+		      DEBUG_PKTLOG_TYPE_ACTION) &&
+		     (pFc->subType == SIR_MAC_MGMT_ACTION)))
+			mgmt_txrx_frame_hex_dump(pData, frmLen, true);
 	}
-
 	if (wlan_reg_is_5ghz_ch_freq(wma_handle->interfaces[vdev_id].ch_freq))
 		is_5g = true;