From 6b0c64ff8c8bb3e8aec5c83f9fb04328dc2575d6 Mon Sep 17 00:00:00 2001 From: Rakesh Pillai Date: Wed, 27 Dec 2017 14:08:59 +0530 Subject: [PATCH] qcacmn: Unify the wmi command and event record offset The wmi data buffer offset passed to record command and event buffer uses different offset and type for command and event. Change the recorded wmi data buffer type to uin8_t pointer for both, wmi command and wmi event record. CRs-Fixed: 2164395 Change-Id: Ie759248a6a32632dd93f751a856a0588d9a11c25 --- wmi/src/wmi_unified.c | 32 ++++++++++++++++---------------- wmi/src/wmi_unified_tlv.c | 4 +++- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index db2b082e9bec..ec0a3e9f4667 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -1171,7 +1171,7 @@ void wmi_mgmt_cmd_record(wmi_unified_t wmi_handle, uint32_t cmd, qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock); - WMI_MGMT_COMMAND_RECORD(wmi_handle, cmd, data); + WMI_MGMT_COMMAND_RECORD(wmi_handle, cmd, (uint8_t *)data); qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock); } @@ -1410,12 +1410,12 @@ QDF_STATUS wmi_unified_cmd_send(wmi_unified_t wmi_handle, wmi_buf_t buf, * * exclude TLV and WMI headers */ if (wmi_handle->ops->is_management_record(cmd_id)) { WMI_MGMT_COMMAND_RECORD(wmi_handle, cmd_id, - ((uint32_t *) qdf_nbuf_data(buf) + - wmi_handle->log_info.buf_offset_command)); + qdf_nbuf_data(buf) + + wmi_handle->log_info.buf_offset_command); } else { WMI_COMMAND_RECORD(wmi_handle, cmd_id, - ((uint32_t *) qdf_nbuf_data(buf) + - wmi_handle->log_info.buf_offset_command)); + qdf_nbuf_data(buf) + + wmi_handle->log_info.buf_offset_command); } qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock); } @@ -1754,8 +1754,8 @@ static void wmi_control_rx(void *ctx, HTC_PACKET *htc_packet) qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock); /* Exclude 4 bytes of TLV header */ - WMI_RX_EVENT_RECORD(wmi_handle, id, ((uint8_t *) data + - wmi_handle->log_info.buf_offset_event)); + WMI_RX_EVENT_RECORD(wmi_handle, id, data + + wmi_handle->log_info.buf_offset_event); qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock); } #endif @@ -1841,11 +1841,11 @@ void __wmi_control_rx(struct wmi_unified *wmi_handle, wmi_buf_t evt_buf) qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock); /* Exclude 4 bytes of TLV header */ if (wmi_handle->ops->is_management_record(id)) { - WMI_MGMT_EVENT_RECORD(wmi_handle, id, ((uint8_t *) data - + wmi_handle->log_info.buf_offset_event)); + WMI_MGMT_EVENT_RECORD(wmi_handle, id, data + + wmi_handle->log_info.buf_offset_event); } else { - WMI_EVENT_RECORD(wmi_handle, id, ((uint8_t *) data + - wmi_handle->log_info.buf_offset_event)); + WMI_EVENT_RECORD(wmi_handle, id, data + + wmi_handle->log_info.buf_offset_event); } qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock); } @@ -2293,12 +2293,12 @@ static void wmi_htc_tx_complete(void *ctx, HTC_PACKET *htc_pkt) - exclude TLV and WMI headers */ if (wmi_handle->ops->is_management_record(cmd_id)) { WMI_MGMT_COMMAND_TX_CMP_RECORD(wmi_handle, cmd_id, - ((uint32_t *) qdf_nbuf_data(wmi_cmd_buf) + - wmi_handle->log_info.buf_offset_command)); + qdf_nbuf_data(wmi_cmd_buf) + + wmi_handle->log_info.buf_offset_command); } else { WMI_COMMAND_TX_CMP_RECORD(wmi_handle, cmd_id, - ((uint32_t *) qdf_nbuf_data(wmi_cmd_buf) + - wmi_handle->log_info.buf_offset_command)); + qdf_nbuf_data(wmi_cmd_buf) + + wmi_handle->log_info.buf_offset_command); } qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock); diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 53b5e6f342b1..0afe9984f39d 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -22225,7 +22225,9 @@ void wmi_tlv_attach(wmi_unified_t wmi_handle) { wmi_handle->ops = &tlv_ops; #ifdef WMI_INTERFACE_EVENT_LOGGING - wmi_handle->log_info.buf_offset_command = 2; + /* Skip saving WMI_CMD_HDR and TLV HDR */ + wmi_handle->log_info.buf_offset_command = 8; + /* WMI_CMD_HDR is already stripped, skip saving TLV HDR */ wmi_handle->log_info.buf_offset_event = 4; #endif populate_tlv_events_id(wmi_handle->wmi_events);