Quellcode durchsuchen

qcacld-3.0: Convert wlan_hdd_main.c to unified logging [4/7]

Currently the HDD code uses a variety of logging APIs.  In qcacld-3.0
HDD should converge on a unified set of logging APIs.  Update
wlan_hdd_main.c to use the unified set of APIs.  Since there are a
large number of changes in this file, perform the conversion in
phases.

For phase 4 update the following functions:
hdd_skip_acs_scan_timer_handler()
hdd_wlan_set_ht2040_mode()
hdd_wlan_notify_modem_power_state()
hdd_post_cds_enable_config()
hdd_exchange_version_and_caps()
hdd_bus_bw_compute_cbk()
wlan_hdd_init_tx_rx_histogram()
wlan_hdd_display_tx_rx_histogram()
wlan_hdd_display_netif_queue_history()

Change-Id: Ibfd53f4f2703dba8c7ce96368392afa3c0c12d5b
CRs-Fixed: 937663
Jeff Johnson vor 8 Jahren
Ursprung
Commit
760350b7b9
1 geänderte Dateien mit 29 neuen und 58 gelöschten Zeilen
  1. 29 58
      core/hdd/src/wlan_hdd_main.c

+ 29 - 58
core/hdd/src/wlan_hdd_main.c

@@ -4517,7 +4517,7 @@ void hdd_skip_acs_scan_timer_handler(void *data)
 {
 	hdd_context_t *hdd_ctx = (hdd_context_t *) data;
 
-	hddLog(LOG1, FL("ACS Scan result expired. Reset ACS scan skip"));
+	hdd_notice("ACS Scan result expired. Reset ACS scan skip");
 	hdd_ctx->skip_acs_scan_status = eSAP_DO_NEW_ACS_SCAN;
 
 	if (!hdd_ctx->hHal)
@@ -4557,7 +4557,7 @@ int hdd_wlan_set_ht2040_mode(hdd_adapter_t *adapter, uint16_t staId,
 	qdf_status = sme_notify_ht2040_mode(hdd_ctx->hHal, staId, macAddrSTA,
 					    adapter->sessionId, channel_type);
 	if (QDF_STATUS_SUCCESS != qdf_status) {
-		hddLog(LOGE, "Fail to send notification with ht2040 mode");
+		hdd_err("Fail to send notification with ht2040 mode");
 		return -EINVAL;
 	}
 
@@ -4589,8 +4589,7 @@ int hdd_wlan_notify_modem_power_state(int state)
 
 	qdf_status = sme_notify_modem_power_state(hdd_ctx->hHal, state);
 	if (QDF_STATUS_SUCCESS != qdf_status) {
-		hddLog(LOGE,
-		       "Fail to send notification with modem power state %d",
+		hdd_err("Fail to send notification with modem power state %d",
 		       state);
 		return -EINVAL;
 	}
@@ -4614,11 +4613,8 @@ QDF_STATUS hdd_post_cds_enable_config(hdd_context_t *hdd_ctx)
 	 */
 	qdf_ret_status = sme_hdd_ready_ind(hdd_ctx->hHal);
 	if (!QDF_IS_STATUS_SUCCESS(qdf_ret_status)) {
-		hddLog(QDF_TRACE_LEVEL_ERROR,
-		       FL(
-			  "sme_hdd_ready_ind() failed with status code %08d [x%08x]"
-			 ),
-		       qdf_ret_status, qdf_ret_status);
+		hdd_err("sme_hdd_ready_ind() failed with status code %08d [x%08x]",
+			qdf_ret_status, qdf_ret_status);
 		return QDF_STATUS_E_FAILURE;
 	}
 
@@ -4676,20 +4672,14 @@ void hdd_exchange_version_and_caps(hdd_context_t *hdd_ctx)
 		vstatus = sme_get_wcnss_wlan_compiled_version(hdd_ctx->hHal,
 							      &versionCompiled);
 		if (!QDF_IS_STATUS_SUCCESS(vstatus)) {
-			hddLog(QDF_TRACE_LEVEL_FATAL,
-			       FL(
-				  "unable to retrieve WCNSS WLAN compiled version"
-				 ));
+			hdd_alert("unable to retrieve WCNSS WLAN compiled version");
 			break;
 		}
 
 		vstatus = sme_get_wcnss_wlan_reported_version(hdd_ctx->hHal,
 							      &versionReported);
 		if (!QDF_IS_STATUS_SUCCESS(vstatus)) {
-			hddLog(QDF_TRACE_LEVEL_FATAL,
-			       FL(
-				  "unable to retrieve WCNSS WLAN reported version"
-				 ));
+			hdd_alert("unable to retrieve WCNSS WLAN reported version");
 			break;
 		}
 
@@ -4721,10 +4711,7 @@ void hdd_exchange_version_and_caps(hdd_context_t *hdd_ctx)
 							 versionString,
 							 sizeof(versionString));
 		if (!QDF_IS_STATUS_SUCCESS(vstatus)) {
-			hddLog(QDF_TRACE_LEVEL_FATAL,
-			       FL(
-				  "unable to retrieve WCNSS software version string"
-				 ));
+			hdd_alert("unable to retrieve WCNSS software version string");
 			break;
 		}
 
@@ -4735,8 +4722,7 @@ void hdd_exchange_version_and_caps(hdd_context_t *hdd_ctx)
 							 versionString,
 							 sizeof(versionString));
 		if (!QDF_IS_STATUS_SUCCESS(vstatus)) {
-			hddLog(QDF_TRACE_LEVEL_FATAL,
-			       FL(
+			hdd_alert(FL(
 				  "unable to retrieve WCNSS hardware version string"
 				 ));
 			break;
@@ -5045,8 +5031,7 @@ static void hdd_bus_bw_compute_cbk(void *priv)
 	rx_packets += (uint64_t)ipa_rx_packets;
 
 	if (!connected) {
-		hddLog(QDF_TRACE_LEVEL_ERROR,
-		       FL("bus bandwidth timer running in disconnected state"));
+		hdd_err("bus bandwidth timer running in disconnected state");
 		return;
 	}
 
@@ -5071,7 +5056,7 @@ int wlan_hdd_init_tx_rx_histogram(hdd_context_t *hdd_ctx)
 	hdd_ctx->hdd_txrx_hist = qdf_mem_malloc(
 		(sizeof(struct hdd_tx_rx_histogram) * NUM_TX_RX_HISTOGRAM));
 	if (hdd_ctx->hdd_txrx_hist == NULL) {
-		hdd_err("%s: Failed malloc for hdd_txrx_hist", __func__);
+		hdd_err("Failed malloc for hdd_txrx_hist");
 		return -ENOMEM;
 	}
 	return 0;
@@ -5120,32 +5105,28 @@ void wlan_hdd_display_tx_rx_histogram(hdd_context_t *hdd_ctx)
 	int i;
 
 #ifdef MSM_PLATFORM
-	hddLog(QDF_TRACE_LEVEL_ERROR, "BW compute Interval: %dms",
+	hdd_err("BW compute Interval: %dms",
 		hdd_ctx->config->busBandwidthComputeInterval);
-	hddLog(QDF_TRACE_LEVEL_ERROR,
-		"BW High TH: %d BW Med TH: %d BW Low TH: %d",
+	hdd_err("BW High TH: %d BW Med TH: %d BW Low TH: %d",
 		hdd_ctx->config->busBandwidthHighThreshold,
 		hdd_ctx->config->busBandwidthMediumThreshold,
 		hdd_ctx->config->busBandwidthLowThreshold);
-	hddLog(QDF_TRACE_LEVEL_ERROR, "Enable TCP DEL ACK: %d",
+	hdd_err("Enable TCP DEL ACK: %d",
 		hdd_ctx->config->enable_tcp_delack);
-	hddLog(QDF_TRACE_LEVEL_ERROR, "TCP DEL High TH: %d TCP DEL Low TH: %d",
+	hdd_err("TCP DEL High TH: %d TCP DEL Low TH: %d",
 		hdd_ctx->config->tcpDelackThresholdHigh,
 		hdd_ctx->config->tcpDelackThresholdLow);
-	hddLog(QDF_TRACE_LEVEL_ERROR,
-		"TCP TX HIGH TP TH: %d (Use to set tcp_output_bytes_limit)",
+	hdd_err("TCP TX HIGH TP TH: %d (Use to set tcp_output_bytes_limit)",
 		hdd_ctx->config->tcp_tx_high_tput_thres);
 #endif
 
-	hddLog(QDF_TRACE_LEVEL_ERROR, "Total entries: %d Current index: %d",
+	hdd_err("Total entries: %d Current index: %d",
 		NUM_TX_RX_HISTOGRAM, hdd_ctx->hdd_txrx_hist_idx);
 
-	hddLog(QDF_TRACE_LEVEL_ERROR,
-		"index, total_rx, interval_rx, total_tx, interval_tx, bus_bw_level, RX TP Level, TX TP Level");
+	hdd_err("index, total_rx, interval_rx, total_tx, interval_tx, bus_bw_level, RX TP Level, TX TP Level");
 
 	for (i = 0; i < NUM_TX_RX_HISTOGRAM; i++) {
-		hddLog(QDF_TRACE_LEVEL_ERROR,
-			"%d: %llu, %llu, %llu, %llu, %s, %s, %s",
+		hdd_err("%d: %llu, %llu, %llu, %llu, %s, %s, %s",
 			i, hdd_ctx->hdd_txrx_hist[i].total_rx,
 			hdd_ctx->hdd_txrx_hist[i].interval_rx,
 			hdd_ctx->hdd_txrx_hist[i].total_tx,
@@ -5192,13 +5173,10 @@ void wlan_hdd_display_netif_queue_history(hdd_context_t *hdd_ctx)
 	while (NULL != adapter_node && QDF_STATUS_SUCCESS == status) {
 		adapter = adapter_node->pAdapter;
 
-		hddLog(QDF_TRACE_LEVEL_ERROR,
-			"\nNetif queue operation statistics:");
-		hddLog(QDF_TRACE_LEVEL_ERROR,
-			"Session_id %d device mode %d",
+		hdd_err("\nNetif queue operation statistics:");
+		hdd_err("Session_id %d device mode %d",
 			adapter->sessionId, adapter->device_mode);
-		hddLog(QDF_TRACE_LEVEL_ERROR,
-			"Current pause_map value %x", adapter->pause_map);
+		hdd_err("Current pause_map value %x", adapter->pause_map);
 		curr_time = qdf_system_ticks();
 		total = curr_time - adapter->start_time;
 		delta = curr_time - adapter->last_time;
@@ -5209,13 +5187,11 @@ void wlan_hdd_display_netif_queue_history(hdd_context_t *hdd_ctx)
 			unpause = adapter->total_unpause_time + delta;
 			pause = adapter->total_pause_time;
 		}
-		hddLog(QDF_TRACE_LEVEL_ERROR,
-			"Total: %ums Pause: %ums Unpause: %ums",
+		hdd_err("Total: %ums Pause: %ums Unpause: %ums",
 			qdf_system_ticks_to_msecs(total),
 			qdf_system_ticks_to_msecs(pause),
 			qdf_system_ticks_to_msecs(unpause));
-		hddLog(QDF_TRACE_LEVEL_ERROR,
-			"reason_type: pause_cnt: unpause_cnt: pause_time");
+		hdd_err("reason_type: pause_cnt: unpause_cnt: pause_time");
 
 		for (i = WLAN_CONTROL_PATH; i < WLAN_REASON_TYPE_MAX; i++) {
 			qdf_time_t pause_delta = 0;
@@ -5223,8 +5199,7 @@ void wlan_hdd_display_netif_queue_history(hdd_context_t *hdd_ctx)
 			if (adapter->pause_map & (1 << i))
 				pause_delta = delta;
 
-			hddLog(QDF_TRACE_LEVEL_ERROR,
-				"%s: %d: %d: %ums",
+			hdd_err("%s: %d: %d: %ums",
 				hdd_reason_type_to_string(i),
 				adapter->queue_oper_stats[i].pause_count,
 				adapter->queue_oper_stats[i].unpause_count,
@@ -5233,18 +5208,14 @@ void wlan_hdd_display_netif_queue_history(hdd_context_t *hdd_ctx)
 				pause_delta));
 		}
 
-		hddLog(QDF_TRACE_LEVEL_ERROR,
-			"\nNetif queue operation history:");
-		hddLog(QDF_TRACE_LEVEL_ERROR,
-			"Total entries: %d current index %d",
+		hdd_err("\nNetif queue operation history:");
+		hdd_err("Total entries: %d current index %d",
 			WLAN_HDD_MAX_HISTORY_ENTRY, adapter->history_index);
 
-		hddLog(QDF_TRACE_LEVEL_ERROR,
-			"index: time: action_type: reason_type: pause_map");
+		hdd_err("index: time: action_type: reason_type: pause_map");
 
 		for (i = 0; i < WLAN_HDD_MAX_HISTORY_ENTRY; i++) {
-			hddLog(QDF_TRACE_LEVEL_ERROR,
-				"%d: %u: %s: %s: %x",
+			hdd_err("%d: %u: %s: %s: %x",
 				i, qdf_system_ticks_to_msecs(
 					adapter->queue_oper_history[i].time),
 				hdd_action_type_to_string(