Jelajahi Sumber

qcacld-3.0: Replace QDF_TRACE in LIM with pe_debug/pe_err APIs

Replace QDF_TRACE in LIM with pe_debug/pe_err APIs

Change-Id: I9c5de054cc1df7182b641f9abc22c787abb05cb5
CRs-Fixed: 3192102
Abhishek Singh 2 tahun lalu
induk
melakukan
d3f59b3630

+ 11 - 16
core/mac/src/pe/lim/lim_ft_preauth.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 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
@@ -101,10 +102,8 @@ void lim_ft_cleanup_pre_auth_info(struct mac_context *mac,
 		if (pReAssocSessionEntry->valid &&
 		    pReAssocSessionEntry->limSmeState ==
 		    eLIM_SME_WT_REASSOC_STATE) {
-			QDF_TRACE(QDF_MODULE_ID_PE,
-				  QDF_TRACE_LEVEL_DEBUG,
-				  FL("Deleting Preauth session(%d)"),
-				  pReAssocSessionEntry->peSessionId);
+			pe_debug("Deleting Preauth session(%d)",
+				 pReAssocSessionEntry->peSessionId);
 			pe_delete_session(mac, pReAssocSessionEntry);
 		}
 	}
@@ -684,16 +683,15 @@ QDF_STATUS lim_send_preauth_scan_offload(struct mac_context *mac_ctx,
 {
 	struct scan_start_request *req;
 	struct wlan_objmgr_vdev *vdev;
-	uint8_t session_id;
+	uint8_t vdev_id;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
 	if (!session_entry) {
-		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR,
-			  FL("Session entry is NULL"));
+		pe_err("Session entry is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	session_id = session_entry->smeSessionId;
+	vdev_id = session_entry->smeSessionId;
 
 	req = qdf_mem_malloc(sizeof(*req));
 	if (!req)
@@ -702,11 +700,10 @@ QDF_STATUS lim_send_preauth_scan_offload(struct mac_context *mac_ctx,
 	qdf_mem_zero(req, sizeof(*req));
 
 	vdev = wlan_objmgr_get_vdev_by_id_from_pdev(mac_ctx->pdev,
-						    session_id,
+						    vdev_id,
 						    WLAN_LEGACY_MAC_ID);
 	if (!vdev) {
-		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR,
-			  FL("vdev object is NULL"));
+		pe_err("vdev_id %d: vdev is NULL", vdev_id);
 		qdf_mem_free(req);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -721,12 +718,11 @@ QDF_STATUS lim_send_preauth_scan_offload(struct mac_context *mac_ctx,
 	if (!req->scan_req.scan_id) {
 		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID);
 		qdf_mem_free(req);
-		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR,
-			  FL("Invalid scan ID"));
+		pe_err("Invalid scan ID");
 		return QDF_STATUS_E_FAILURE;
 	}
 	ft_preauth_req->scan_id = req->scan_req.scan_id;
-	req->scan_req.vdev_id = session_id;
+	req->scan_req.vdev_id = vdev_id;
 	req->scan_req.scan_req_id = mac_ctx->lim.req_id | PREAUTH_REQUESTOR_ID;
 	req->scan_req.scan_priority = SCAN_PRIORITY_VERY_HIGH;
 	req->scan_req.scan_f_passive = true;
@@ -741,8 +737,7 @@ QDF_STATUS lim_send_preauth_scan_offload(struct mac_context *mac_ctx,
 	status = ucfg_scan_start(req);
 	if (status != QDF_STATUS_SUCCESS)
 		/* Don't free req here, ucfg_scan_start will do free */
-		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO_HIGH,
-			  FL("Issue scan req failed"));
+		pe_info("Issue scan req failed");
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID);
 	return status;
 }

+ 2 - 3
core/mac/src/pe/lim/lim_process_fils.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017-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
@@ -43,8 +43,7 @@
 static void lim_fils_data_dump(char *type, uint8_t *data, uint32_t len)
 {
 
-	QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
-		 ("%s : length %d"), type, len);
+	pe_debug("%s : length %d", type, len);
 	qdf_trace_hex_dump(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, data, len);
 }
 #else

+ 9 - 18
core/mac/src/pe/lim/lim_process_message_queue.c

@@ -598,8 +598,7 @@ static bool def_msg_decision(struct mac_context *mac_ctx,
 				 lim_msg_str(lim_msg->type));
 			/* Defer processing this message */
 			if (lim_defer_msg(mac_ctx, lim_msg) != TX_SUCCESS) {
-				QDF_TRACE(QDF_MODULE_ID_PE, LOGE,
-					  FL("Unable to Defer Msg"));
+				pe_err("Unable to Defer Msg");
 				lim_log_session_states(mac_ctx);
 				lim_handle_defer_msg_error(mac_ctx, lim_msg);
 			}
@@ -1053,14 +1052,12 @@ static void lim_handle_unknown_a2_index_frames(struct mac_context *mac_ctx,
 	mac_hdr = WMA_GET_RX_MPDUHEADER3A(rx_pkt_buffer);
 
 	if (IEEE80211_IS_MULTICAST(mac_hdr->addr2)) {
-		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
-			FL("Ignoring A2 Invalid Packet received for MC/BC:"));
+		pe_debug("Ignoring A2 Invalid Packet received for MC/BC:");
 		lim_print_mac_addr(mac_ctx, mac_hdr->addr2, LOGD);
 		return;
 	}
-	QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
-			FL("type=0x%x, subtype=0x%x"),
-		mac_hdr->fc.type, mac_hdr->fc.subType);
+	pe_debug("type=0x%x, subtype=0x%x",
+		 mac_hdr->fc.type, mac_hdr->fc.subType);
 	/* Currently only following type and subtype are handled.
 	 * If there are more combinations, then add switch-case
 	 * statements.
@@ -1121,9 +1118,7 @@ lim_check_mgmt_registered_frames(struct mac_context *mac_ctx, uint8_t *buff_desc
 		if ((type == SIR_MAC_MGMT_FRAME)
 		    && (fc.type == SIR_MAC_MGMT_FRAME)
 		    && (sub_type == SIR_MAC_MGMT_RESERVED15)) {
-			QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
-				FL
-				("rcvd frm match for SIR_MAC_MGMT_RESERVED15"));
+			pe_debug("rcvd frm match for SIR_MAC_MGMT_RESERVED15");
 			match = true;
 			break;
 		}
@@ -1707,11 +1702,9 @@ static void lim_process_messages(struct mac_context *mac_ctx,
 		lim_handle80211_frames(mac_ctx, &new_msg, &defer_msg);
 
 		if (defer_msg == true) {
-			QDF_TRACE(QDF_MODULE_ID_PE, LOGD,
-					FL("Defer Msg type=%x"), msg->type);
+			pe_debug("Defer Msg type=%x", msg->type);
 			if (lim_defer_msg(mac_ctx, msg) != TX_SUCCESS) {
-				QDF_TRACE(QDF_MODULE_ID_PE, LOGE,
-						FL("Unable to Defer Msg"));
+				pe_err("Unable to Defer Msg %x", msg->type);
 				lim_log_session_states(mac_ctx);
 				lim_decrement_pending_mgmt_count(mac_ctx);
 				cds_pkt_return_packet(body_ptr);
@@ -2337,11 +2330,9 @@ void lim_log_session_states(struct mac_context *mac_ctx)
 
 	for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
 		if (mac_ctx->lim.gpSession[i].valid) {
-			QDF_TRACE(QDF_MODULE_ID_PE, LOGD,
-				FL("sysRole(%d) Session (%d)"),
+			pe_debug("sysRole(%d) Session (%d)",
 				mac_ctx->lim.gLimSystemRole, i);
-			QDF_TRACE(QDF_MODULE_ID_PE, LOGD,
-				FL("SME: Curr %s,Prev %s,MLM: Curr %s,Prev %s"),
+			pe_debug("SME: Curr %s,Prev %s,MLM: Curr %s,Prev %s",
 				lim_sme_state_str(
 				mac_ctx->lim.gpSession[i].limSmeState),
 				lim_sme_state_str(

+ 5 - 9
core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c

@@ -254,10 +254,9 @@ void lim_process_mlm_start_cnf(struct mac_context *mac, uint32_t *msg_buf)
 
 		if (send_bcon_ind) {
 			/* Configure beacon and send beacons to HAL */
-			QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
-					"Start Beacon with ssid %s Ch freq %d",
-					pe_session->ssId.ssId,
-					pe_session->curr_op_freq);
+			pe_debug("Start Beacon with ssid %s Ch freq %d",
+				 pe_session->ssId.ssId,
+				 pe_session->curr_op_freq);
 			lim_send_beacon(mac, pe_session);
 			lim_enable_obss_detection_config(mac, pe_session);
 			lim_send_obss_color_collision_cfg(mac, pe_session,
@@ -3182,9 +3181,7 @@ void lim_process_rx_channel_status_event(struct mac_context *mac_ctx, void *buf)
 	struct lim_channel_status *chan_status = buf;
 
 	if (!chan_status) {
-		QDF_TRACE(QDF_MODULE_ID_PE,
-			  QDF_TRACE_LEVEL_ERROR,
-			  "%s: ACS evt report buf NULL", __func__);
+		pe_err("ACS evt report buf NULL");
 		return;
 	}
 
@@ -3192,8 +3189,7 @@ void lim_process_rx_channel_status_event(struct mac_context *mac_ctx, void *buf)
 		lim_add_channel_status_info(mac_ctx, chan_status,
 					    chan_status->channel_id);
 	else
-		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_WARN,
-			  "%s: Error evt report", __func__);
+		pe_warn("Error evt report");
 
 	qdf_mem_free(buf);
 

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

@@ -8131,10 +8131,8 @@ static void lim_process_sme_start_beacon_req(struct mac_context *mac, uint32_t *
 		 * Tx right after the WMA_ADD_BSS_RSP.
 		 */
 		lim_apply_configuration(mac, pe_session);
-		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
-			  FL("Start Beacon with ssid %s Ch freq %d"),
-			  pe_session->ssId.ssId,
-			  pe_session->curr_op_freq);
+		pe_debug("Start Beacon with ssid %s Ch freq %d",
+			 pe_session->ssId.ssId, pe_session->curr_op_freq);
 		lim_send_beacon(mac, pe_session);
 		lim_enable_obss_detection_config(mac, pe_session);
 		lim_send_obss_color_collision_cfg(mac, pe_session,
@@ -8501,12 +8499,8 @@ static void lim_process_modify_add_ies(struct mac_context *mac_ctx,
 		break;
 	case eUPDATE_IE_ASSOC_RESP:
 		/* assoc resp IE */
-		if (add_ie_params->assocRespDataLen == 0) {
-			QDF_TRACE(QDF_MODULE_ID_PE,
-					QDF_TRACE_LEVEL_ERROR, FL(
-				"assoc resp add ie not present %d"),
-				add_ie_params->assocRespDataLen);
-		}
+		if (!add_ie_params->assocRespDataLen)
+			pe_err("assoc resp add ie not present");
 		/* search through the buffer and modify the IE */
 		break;
 	case eUPDATE_IE_PROBE_BCN:

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

@@ -416,9 +416,7 @@ QDF_STATUS lim_add_ft_sta_self(struct mac_context *mac_ctx, uint16_t assoc_id,
 	msg_q.bodyptr = add_sta_params;
 	msg_q.bodyval = 0;
 
-	QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
-			"Sending WMA_ADD_STA_REQ (aid %d)",
-			 add_sta_params->assocId);
+	pe_debug("Sending WMA_ADD_STA_REQ (aid %d)", add_sta_params->assocId);
 	MTRACE(mac_trace_msg_tx(mac_ctx, session_entry->peSessionId,
 			 msg_q.type));
 

+ 7 - 10
core/mac/src/pe/lim/lim_send_frames_host_roam.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 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
@@ -802,10 +803,9 @@ void lim_process_rx_scan_handler(struct wlan_objmgr_vdev *vdev,
 	struct mac_context *mac_ctx;
 	enum sir_scan_event_type event_type;
 
-	QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
-		  "event: %u, id: 0x%x, requestor: 0x%x, freq: %u, reason: %u",
-		  event->type, event->scan_id, event->requester,
-		  event->chan_freq, event->reason);
+	pe_debug("event: %u, id: 0x%x, requestor: 0x%x, freq: %u, reason: %u",
+		 event->type, event->scan_id, event->requester,
+		 event->chan_freq, event->reason);
 
 	mac_ctx = (struct mac_context *)arg;
 	event_type = 0x1 << event->type;
@@ -817,9 +817,8 @@ void lim_process_rx_scan_handler(struct wlan_objmgr_vdev *vdev,
 	case SIR_SCAN_EVENT_STARTED:
 		break;
 	case SIR_SCAN_EVENT_COMPLETED:
-		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
-			  "No.of beacons and probe response received per scan %d",
-			  mac_ctx->lim.beacon_probe_rsp_cnt_per_scan);
+		pe_debug("No.of beacons and probe response received per scan %d",
+			 mac_ctx->lim.beacon_probe_rsp_cnt_per_scan);
 	/* Fall through */
 	case SIR_SCAN_EVENT_FOREIGN_CHANNEL:
 	case SIR_SCAN_EVENT_START_FAILED:
@@ -834,8 +833,6 @@ void lim_process_rx_scan_handler(struct wlan_objmgr_vdev *vdev,
 	case SIR_SCAN_EVENT_DEQUEUED:
 	case SIR_SCAN_EVENT_PREEMPTED:
 	default:
-		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
-			  "Received unhandled scan event %u",
-			  event_type);
+		pe_debug("Received unhandled scan event %u", event_type);
 	}
 }

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

@@ -737,8 +737,7 @@ lim_send_probe_rsp_mgmt_frame(struct mac_context *mac_ctx,
 	if (((pe_session->opmode == QDF_SAP_MODE) ||
 	    (pe_session->opmode == QDF_P2P_GO_MODE)) &&
 	    (true == mac_ctx->sap.SapDfsInfo.is_dfs_cac_timer_running)) {
-		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
-			  FL("CAC timer is running, probe response dropped"));
+		pe_info("CAC timer is running, probe response dropped");
 		return;
 	}
 	if (wlan_vdev_is_up(pe_session->vdev) != QDF_STATUS_SUCCESS)
@@ -3951,8 +3950,7 @@ lim_send_disassoc_mgmt_frame(struct mac_context *mac,
 	if (((pe_session->opmode == QDF_SAP_MODE) ||
 	     (pe_session->opmode == QDF_P2P_GO_MODE)) &&
 	    (true == mac->sap.SapDfsInfo.is_dfs_cac_timer_running)) {
-		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
-			  FL("CAC timer is running, drop disassoc from going out"));
+		pe_info("CAC timer is running, drop disassoc from going out");
 		if (waitForAck)
 			lim_send_disassoc_cnf(mac);
 		return;
@@ -4163,15 +4161,11 @@ lim_send_deauth_mgmt_frame(struct mac_context *mac,
 	if ((pe_session->opmode == QDF_SAP_MODE) ||
 	    (pe_session->opmode == QDF_P2P_GO_MODE)) {
 		if (mac->sap.SapDfsInfo.is_dfs_cac_timer_running) {
-			QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
-				  FL
-				  ("CAC timer is running, drop the deauth from going out"));
+			pe_info("CAC timer is running, drop the deauth from going out");
 			drop_deauth = true;
 		}
 		if (nReason == REASON_HOST_TRIGGERED_SILENT_DEAUTH) {
-			QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
-				  FL
-				  ("Silent deauth, remove the peer"));
+			pe_info("Silent deauth, remove the peer");
 			drop_deauth = true;
 		}
 		if (drop_deauth) {

+ 3 - 6
core/mac/src/pe/lim/lim_session.c

@@ -310,14 +310,12 @@ void pe_delete_fils_info(struct pe_session *session)
 	struct pe_fils_session *fils_info;
 
 	if (!session || (session && !session->valid)) {
-		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
-			  FL("session is not valid"));
+		pe_debug("session is not valid");
 		return;
 	}
 	fils_info = session->fils_info;
 	if (!fils_info) {
-		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
-			  FL("fils info not found"));
+		pe_debug("fils info not found");
 		return;
 	}
 	if (fils_info->keyname_nai_data)
@@ -354,8 +352,7 @@ static void pe_init_fils_info(struct pe_session *session)
 	struct pe_fils_session *fils_info;
 
 	if (!session || (session && !session->valid)) {
-		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
-			  FL("session is not valid"));
+		pe_debug("session is not valid");
 		return;
 	}
 	session->fils_info = qdf_mem_malloc(sizeof(struct pe_fils_session));

+ 8 - 11
core/mac/src/pe/sch/sch_beacon_process.c

@@ -118,12 +118,10 @@ ap_beacon_process_24_ghz(struct mac_context *mac_ctx, uint8_t *rx_pkt_info,
 			return;
 #ifdef FEATURE_WLAN_ESE
 		if (session->isESEconnection)
-			QDF_TRACE(QDF_MODULE_ID_PE,
-				  QDF_TRACE_LEVEL_INFO,
-				  FL("[INFOLOG]ESE 11g erpPresent=%d useProtection=%d nonErpPresent=%d"),
-				  bcn_struct->erpPresent,
-				  bcn_struct->erpIEInfo.useProtection,
-				  bcn_struct->erpIEInfo.nonErpPresent);
+			pe_info("[INFOLOG]ESE 11g erpPresent=%d useProtection=%d nonErpPresent=%d",
+				bcn_struct->erpPresent,
+				bcn_struct->erpIEInfo.useProtection,
+				bcn_struct->erpIEInfo.nonErpPresent);
 #endif
 		lim_enable_overlap11g_protection(mac_ctx, bcn_prm,
 						 mac_hdr, session);
@@ -145,11 +143,10 @@ ap_beacon_process_24_ghz(struct mac_context *mac_ctx, uint8_t *rx_pkt_info,
 	if (tmp_exp) {
 #ifdef FEATURE_WLAN_ESE
 		if (session->isESEconnection) {
-			QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO,
-				  FL("[INFOLOG]ESE 11g erpPresent=%d useProtection=%d nonErpPresent=%d"),
-				  bcn_struct->erpPresent,
-				  bcn_struct->erpIEInfo.useProtection,
-				  bcn_struct->erpIEInfo.nonErpPresent);
+			pe_info("[INFOLOG]ESE 11g erpPresent=%d useProtection=%d nonErpPresent=%d",
+				bcn_struct->erpPresent,
+				bcn_struct->erpIEInfo.useProtection,
+				bcn_struct->erpIEInfo.nonErpPresent);
 		}
 #endif
 		lim_enable_overlap11g_protection(mac_ctx, bcn_prm,