Explorar o código

qcacmn: wmi logging - buffer offset for multi-radio

Move buffer offset to wmi soc as buffer offsets are same for all
pdevs in soc.

Change-Id: I7822ae18212d66420ce6c68341c38c9737de2f58
CRs-Fixed: 2330630
Pratik Gandhi %!s(int64=6) %!d(string=hai) anos
pai
achega
5526a55fa2

+ 4 - 4
wmi/inc/wmi_unified_priv.h

@@ -220,8 +220,6 @@ struct wmi_log_buf_t {
  * @wmi_diag_event_log_buf_info - Buffer info for WMI diag event log
  * @wmi_record_lock - Lock WMI recording
  * @wmi_logging_enable - Enable/Disable state for WMI logging
- * @buf_offset_command - Offset from where WMI command data should be logged
- * @buf_offset_event - Offset from where WMI event data should be logged
  * @wmi_id_to_name - Function refernce to API to convert Command id to
  * string name
  * @wmi_log_debugfs_dir - refernce to debugfs directory
@@ -240,8 +238,6 @@ struct wmi_debug_log_info {
 
 	qdf_spinlock_t wmi_record_lock;
 	bool wmi_logging_enable;
-	uint32_t buf_offset_command;
-	uint32_t buf_offset_event;
 	struct dentry *wmi_log_debugfs_dir;
 };
 
@@ -1941,6 +1937,10 @@ struct wmi_soc {
 	uint32_t services[wmi_services_max];
 	uint16_t wmi_max_cmds;
 	uint32_t soc_idx;
+#ifdef WMI_INTERFACE_EVENT_LOGGING
+	uint32_t buf_offset_command;
+	uint32_t buf_offset_event;
+#endif /*WMI_INTERFACE_EVENT_LOGGING */
 };
 
 /**

+ 7 - 7
wmi/src/wmi_unified.c

@@ -1739,7 +1739,7 @@ QDF_STATUS wmi_unified_cmd_send_fl(wmi_unified_t wmi_handle, wmi_buf_t buf,
 		if (wmi_handle->ops->is_management_record(cmd_id) == false) {
 			WMI_COMMAND_RECORD(wmi_handle, cmd_id,
 					qdf_nbuf_data(buf) +
-			 wmi_handle->log_info.buf_offset_command);
+			 wmi_handle->soc->buf_offset_command);
 		}
 		qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock);
 	}
@@ -2119,14 +2119,14 @@ static void wmi_control_rx(void *ctx, HTC_PACKET *htc_packet)
 		if (wmi_handle->ops->is_diag_event(id)) {
 			WMI_DIAG_RX_EVENT_RECORD(wmi_handle, id,
 				((uint8_t *) data +
-				wmi_handle->log_info.buf_offset_event));
+				wmi_handle->soc->buf_offset_event));
 		} else if (wmi_handle->ops->is_management_record(id)) {
 			WMI_MGMT_RX_EVENT_RECORD(wmi_handle, id,
 				((uint8_t *) data +
-				wmi_handle->log_info.buf_offset_event));
+				wmi_handle->soc->buf_offset_event));
 		} else {
 			WMI_RX_EVENT_RECORD(wmi_handle, id, ((uint8_t *) data +
-				wmi_handle->log_info.buf_offset_event));
+				wmi_handle->soc->buf_offset_event));
 		}
 		qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock);
 	}
@@ -2227,7 +2227,7 @@ void __wmi_control_rx(struct wmi_unified *wmi_handle, wmi_buf_t evt_buf)
 			 */
 		} else {
 			WMI_EVENT_RECORD(wmi_handle, id, ((uint8_t *) data +
-					wmi_handle->log_info.buf_offset_event));
+					wmi_handle->soc->buf_offset_event));
 		}
 		qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock);
 	}
@@ -2741,11 +2741,11 @@ static void wmi_htc_tx_complete(void *ctx, HTC_PACKET *htc_pkt)
 	if (wmi_handle->ops->is_management_record(cmd_id)) {
 		WMI_MGMT_COMMAND_TX_CMP_RECORD(wmi_handle, cmd_id,
 			qdf_nbuf_data(wmi_cmd_buf) +
-			wmi_handle->log_info.buf_offset_command);
+			wmi_handle->soc->buf_offset_command);
 	} else {
 		WMI_COMMAND_TX_CMP_RECORD(wmi_handle, cmd_id,
 			qdf_nbuf_data(wmi_cmd_buf) +
-			wmi_handle->log_info.buf_offset_command);
+			wmi_handle->soc->buf_offset_command);
 	}
 
 	qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock);

+ 2 - 2
wmi/src/wmi_unified_non_tlv.c

@@ -9679,8 +9679,8 @@ void wmi_non_tlv_attach(struct wmi_unified *wmi_handle)
 	populate_vdev_param_non_tlv(wmi_handle->vdev_param);
 
 #ifdef WMI_INTERFACE_EVENT_LOGGING
-	wmi_handle->log_info.buf_offset_command = 0;
-	wmi_handle->log_info.buf_offset_event = 0;
+	wmi_handle->soc->buf_offset_command = 0;
+	wmi_handle->soc->buf_offset_event = 0;
 	/*(uint8 *)(*wmi_id_to_name)(uint32_t cmd_id);*/
 #endif
 #else

+ 2 - 2
wmi/src/wmi_unified_tlv.c

@@ -12104,9 +12104,9 @@ void wmi_tlv_attach(wmi_unified_t wmi_handle)
 	wmi_handle->soc->svc_ids = &multi_svc_ids[0];
 #ifdef WMI_INTERFACE_EVENT_LOGGING
 	/* Skip saving WMI_CMD_HDR and TLV HDR */
-	wmi_handle->log_info.buf_offset_command = 8;
+	wmi_handle->soc->buf_offset_command = 8;
 	/* WMI_CMD_HDR is already stripped, skip saving TLV HDR */
-	wmi_handle->log_info.buf_offset_event = 4;
+	wmi_handle->soc->buf_offset_event = 4;
 #endif
 	populate_tlv_events_id(wmi_handle->wmi_events);
 	populate_tlv_service(wmi_handle->services);