Parcourir la source

qcacmn: Add pktlog decode info WMI handler

Copy software image version, chip information,
pktlog json version and pdev id from the event received
from firmware.

Change-Id: I53c2fceee129fa69126ae8214fb652a744bfcbfa
CRs-Fixed: 3165004
Adwait Nayak il y a 3 ans
Parent
commit
8ccd0d1792

+ 19 - 0
wmi/inc/wmi_unified_api.h

@@ -4708,6 +4708,25 @@ wmi_unified_peer_ppe_ds_param_send(wmi_unified_t wmi_handle,
 				   struct peer_ppe_ds_param *param);
 #endif /* WLAN_SUPPORT_PPEDS */
 
+/**
+ * wmi_extract_pktlog_decode_info_event() - Extract pktlog decode info
+ * @wmi_handle: WMI handle
+ * @evt_buf: event buffer
+ * @pdev_id: pdev_id
+ * @software_image: software image version
+ * @chip_info: chip info
+ * @pktlog_json_version: pktlog json version
+ *
+ * Return: QDF_STATUS_SUCCESS for success or error code
+ */
+QDF_STATUS
+wmi_extract_pktlog_decode_info_event(wmi_unified_t wmi_handle,
+				     void *evt_buf,
+				     uint8_t *pdev_id,
+				     uint8_t *software_image,
+				     uint8_t *chip_info,
+				     uint32_t *pktlog_json_version);
+
 /**
  * wmi_unified_pn_mgmt_rxfilter_send_cmd() - Send PN mgmt RxFilter command to FW
  * @wmi_handle: WMI handle

+ 2 - 0
wmi/inc/wmi_unified_param.h

@@ -4940,6 +4940,7 @@ typedef enum {
 	wmi_resmgr_chan_time_quota_changed_eventid,
 #endif
 	wmi_peer_rx_pn_response_event_id,
+	wmi_extract_pktlog_decode_info_eventid,
 	wmi_events_max,
 } wmi_conv_event_id;
 
@@ -5588,6 +5589,7 @@ typedef enum {
 	wmi_service_rtt_11az_ntb_support,
 	wmi_service_rtt_11az_tb_support,
 #endif
+	wmi_service_pktlog_decode_info_support,
 	wmi_services_max,
 } wmi_conv_service_ids;
 #define WMI_SERVICE_UNAVAILABLE 0xFFFF

+ 6 - 0
wmi/inc/wmi_unified_priv.h

@@ -2965,6 +2965,12 @@ QDF_STATUS
 QDF_STATUS
 (*send_vdev_pn_mgmt_rxfilter_cmd)(wmi_unified_t wmi_handle,
 				  struct vdev_pn_mgmt_rxfilter_params *params);
+
+QDF_STATUS
+(*extract_pktlog_decode_info_event)(wmi_unified_t wmi_handle, void *evt_buf,
+				    uint8_t *pdev_id, uint8_t *software_image,
+				    uint8_t *chip_info,
+				    uint32_t *pktlog_json_version);
 };
 
 /* Forward declartion for psoc*/

+ 15 - 0
wmi/src/wmi_unified_api.c

@@ -3797,3 +3797,18 @@ QDF_STATUS wmi_unified_pn_mgmt_rxfilter_send_cmd(
 					wmi_handle, params);
 	return QDF_STATUS_E_FAILURE;
 }
+
+QDF_STATUS
+wmi_extract_pktlog_decode_info_event(wmi_unified_t wmi_handle,
+				     void *evt_buf, uint8_t *pdev_id,
+				     uint8_t *software_image,
+				     uint8_t *chip_info,
+				     uint32_t *pktlog_json_version)
+{
+	if (wmi_handle->ops->extract_pktlog_decode_info_event)
+		return wmi_handle->ops->extract_pktlog_decode_info_event(
+					wmi_handle, evt_buf, pdev_id,
+					software_image, chip_info,
+					pktlog_json_version);
+	return QDF_STATUS_E_FAILURE;
+}

+ 34 - 0
wmi/src/wmi_unified_tlv.c

@@ -17396,6 +17396,34 @@ send_vdev_pn_mgmt_rxfilter_cmd_tlv(wmi_unified_t wmi_handle,
 	return QDF_STATUS_SUCCESS;
 }
 
+static QDF_STATUS
+extract_pktlog_decode_info_event_tlv(wmi_unified_t wmi_handle, void *evt_buf,
+				     uint8_t *pdev_id, uint8_t *software_image,
+				     uint8_t *chip_info,
+				     uint32_t *pktlog_json_version)
+{
+	WMI_PDEV_PKTLOG_DECODE_INFO_EVENTID_param_tlvs *param_buf;
+	wmi_pdev_pktlog_decode_info_evt_fixed_param *event;
+
+	param_buf =
+		(WMI_PDEV_PKTLOG_DECODE_INFO_EVENTID_param_tlvs *)evt_buf;
+
+	event = param_buf->fixed_param;
+
+	if ((event->software_image[0] == '\0') ||
+	    (event->chip_info[0] == '\0')) {
+		*pdev_id = event->pdev_id;
+		return QDF_STATUS_E_INVAL;
+	}
+
+	qdf_mem_copy(software_image, event->software_image, 40);
+	qdf_mem_copy(chip_info, event->chip_info, 40);
+	*pktlog_json_version = event->pktlog_defs_json_version;
+	*pdev_id = event->pdev_id;
+
+	return QDF_STATUS_SUCCESS;
+}
+
 struct wmi_ops tlv_ops =  {
 	.send_vdev_create_cmd = send_vdev_create_cmd_tlv,
 	.send_vdev_delete_cmd = send_vdev_delete_cmd_tlv,
@@ -17832,6 +17860,8 @@ struct wmi_ops tlv_ops =  {
 #endif /* WLAN_SUPPORT_PPEDS */
 
 	.send_vdev_pn_mgmt_rxfilter_cmd = send_vdev_pn_mgmt_rxfilter_cmd_tlv,
+	.extract_pktlog_decode_info_event =
+		extract_pktlog_decode_info_event_tlv,
 };
 
 /**
@@ -18284,6 +18314,8 @@ event_ids[wmi_roam_scan_chan_list_id] =
 #endif
 	event_ids[wmi_peer_rx_pn_response_event_id] =
 		WMI_PEER_RX_PN_RESPONSE_EVENTID;
+	event_ids[wmi_extract_pktlog_decode_info_eventid] =
+		WMI_PDEV_PKTLOG_DECODE_INFO_EVENTID;
 }
 
 #ifdef WLAN_FEATURE_LINK_LAYER_STATS
@@ -18763,6 +18795,8 @@ static void populate_tlv_service(uint32_t *wmi_service)
 	wmi_service[wmi_service_pdev_rssi_dbm_conv_event_support] =
 			WMI_SERVICE_PDEV_RSSI_DBM_CONV_EVENT_SUPPORT;
 #endif
+	wmi_service[wmi_service_pktlog_decode_info_support] =
+		WMI_SERVICE_PKTLOG_DECODE_INFO_SUPPORT;
 }
 
 /**