|
@@ -4819,184 +4819,6 @@ static QDF_STATUS send_cp_stats_cmd_tlv(wmi_unified_t wmi_handle,
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|
|
|
-#ifdef WLAN_SUPPORT_INFRA_CTRL_PATH_STATS
|
|
|
-#ifdef WLAN_SUPPORT_TWT
|
|
|
-static inline
|
|
|
-void wmi_extract_ctrl_path_twt_stats_tlv(void *tag_buf,
|
|
|
- struct twt_infra_cp_stats_event *param)
|
|
|
-{
|
|
|
- wmi_ctrl_path_twt_stats_struct *wmi_stats_buf =
|
|
|
- (wmi_ctrl_path_twt_stats_struct *)tag_buf;
|
|
|
-
|
|
|
- param->dialog_id = wmi_stats_buf->dialog_id;
|
|
|
- param->status = wmi_stats_buf->status;
|
|
|
- param->num_sp_cycles = wmi_stats_buf->num_sp_cycles;
|
|
|
- param->avg_sp_dur_us = wmi_stats_buf->avg_sp_dur_us;
|
|
|
- param->min_sp_dur_us = wmi_stats_buf->min_sp_dur_us;
|
|
|
- param->max_sp_dur_us = wmi_stats_buf->max_sp_dur_us;
|
|
|
- param->tx_mpdu_per_sp = wmi_stats_buf->tx_mpdu_per_sp;
|
|
|
- param->rx_mpdu_per_sp = wmi_stats_buf->rx_mpdu_per_sp;
|
|
|
- param->tx_bytes_per_sp = wmi_stats_buf->tx_bytes_per_sp;
|
|
|
- param->rx_bytes_per_sp = wmi_stats_buf->rx_bytes_per_sp;
|
|
|
-
|
|
|
- wmi_debug("dialog_id = %u status = %u", wmi_stats_buf->dialog_id,
|
|
|
- wmi_stats_buf->status);
|
|
|
- wmi_debug("num_sp_cycles = %u avg_sp_dur_us = 0x%x, \
|
|
|
- min_sp_dur_us = 0x%x, max_sp_dur_us = 0x%x",
|
|
|
- wmi_stats_buf->num_sp_cycles, wmi_stats_buf->avg_sp_dur_us,
|
|
|
- wmi_stats_buf->min_sp_dur_us, wmi_stats_buf->max_sp_dur_us);
|
|
|
- wmi_debug("tx_mpdu_per_sp 0x%x, rx_mpdu_per_sp = 0x%x, \
|
|
|
- tx_bytes_per_sp = 0x%x, rx_bytes_per_sp = 0x%x",
|
|
|
- wmi_stats_buf->tx_mpdu_per_sp, wmi_stats_buf->rx_mpdu_per_sp,
|
|
|
- wmi_stats_buf->tx_bytes_per_sp,
|
|
|
- wmi_stats_buf->rx_bytes_per_sp);
|
|
|
-}
|
|
|
-
|
|
|
-static void wmi_twt_extract_stats_struct(void *tag_buf,
|
|
|
- struct infra_cp_stats_event *params)
|
|
|
-{
|
|
|
- struct twt_infra_cp_stats_event *twt_params;
|
|
|
-
|
|
|
- twt_params = params->twt_infra_cp_stats +
|
|
|
- params->num_twt_infra_cp_stats;
|
|
|
-
|
|
|
- wmi_debug("TWT stats struct found - num_twt_cp_stats %d",
|
|
|
- params->num_twt_infra_cp_stats);
|
|
|
-
|
|
|
- params->num_twt_infra_cp_stats++;
|
|
|
- wmi_extract_ctrl_path_twt_stats_tlv(tag_buf, twt_params);
|
|
|
-}
|
|
|
-#else
|
|
|
-static void wmi_twt_extract_stats_struct(void *tag_buf,
|
|
|
- struct infra_cp_stats_event *params)
|
|
|
-{
|
|
|
-}
|
|
|
-#endif
|
|
|
-
|
|
|
-/*
|
|
|
- * wmi_stats_extract_tag_struct: function to extract tag structs
|
|
|
- * @tag_type: tag type that is to be printed
|
|
|
- * @tag_buf: pointer to the tag structure
|
|
|
- * @params: buffer to hold parameters extracted from response event
|
|
|
- *
|
|
|
- * Return: None
|
|
|
- */
|
|
|
-static void wmi_stats_extract_tag_struct(uint32_t tag_type, void *tag_buf,
|
|
|
- struct infra_cp_stats_event *params)
|
|
|
-{
|
|
|
- wmi_debug("tag_type %d", tag_type);
|
|
|
-
|
|
|
- switch (tag_type) {
|
|
|
- case WMITLV_TAG_STRUC_wmi_ctrl_path_pdev_stats_struct:
|
|
|
- break;
|
|
|
-
|
|
|
- case WMITLV_TAG_STRUC_wmi_ctrl_path_mem_stats_struct:
|
|
|
- break;
|
|
|
-
|
|
|
- case WMITLV_TAG_STRUC_wmi_ctrl_path_twt_stats_struct:
|
|
|
- wmi_twt_extract_stats_struct(tag_buf, params);
|
|
|
- break;
|
|
|
-
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-/*
|
|
|
- * wmi_stats_handler: parse the wmi event and fill the stats values
|
|
|
- * @buff: Buffer containing wmi event
|
|
|
- * @len: length of event buffer
|
|
|
- * @params: buffer to hold parameters extracted from response event
|
|
|
- *
|
|
|
- * Return: QDF_STATUS_SUCCESS on success, else other qdf error values
|
|
|
- */
|
|
|
-static QDF_STATUS wmi_stats_handler(void *buff, int32_t len,
|
|
|
- struct infra_cp_stats_event *params)
|
|
|
-{
|
|
|
- WMI_CTRL_PATH_STATS_EVENTID_param_tlvs *param_buf;
|
|
|
- wmi_ctrl_path_stats_event_fixed_param *ev;
|
|
|
- uint8_t *buf_ptr = (uint8_t *)buff;
|
|
|
- uint32_t curr_tlv_tag;
|
|
|
- uint32_t curr_tlv_len;
|
|
|
- uint8_t *tag_start_ptr;
|
|
|
-
|
|
|
- param_buf = (WMI_CTRL_PATH_STATS_EVENTID_param_tlvs *)buff;
|
|
|
- if (!param_buf)
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
- ev = (wmi_ctrl_path_stats_event_fixed_param *)param_buf->fixed_param;
|
|
|
-
|
|
|
- curr_tlv_tag = WMITLV_GET_TLVTAG(ev->tlv_header);
|
|
|
- curr_tlv_len = WMITLV_GET_TLVLEN(ev->tlv_header);
|
|
|
- buf_ptr = (uint8_t *)param_buf->fixed_param;
|
|
|
- wmi_debug("Fixed param more %d req_id %d status %d", ev->more,
|
|
|
- ev->request_id, ev->status);
|
|
|
- params->request_id = ev->request_id;
|
|
|
- params->status = ev->status;
|
|
|
-
|
|
|
- /* buffer should point to next TLV in event */
|
|
|
- buf_ptr += (curr_tlv_len + WMI_TLV_HDR_SIZE);
|
|
|
- len -= (curr_tlv_len + WMI_TLV_HDR_SIZE);
|
|
|
-
|
|
|
- curr_tlv_tag = WMITLV_GET_TLVTAG(WMITLV_GET_HDR(buf_ptr));
|
|
|
- curr_tlv_len = WMITLV_GET_TLVLEN(WMITLV_GET_HDR(buf_ptr));
|
|
|
-
|
|
|
- wmi_debug("curr_tlv_len %d curr_tlv_tag %d rem_len %d", len,
|
|
|
- curr_tlv_len, curr_tlv_tag);
|
|
|
-
|
|
|
- while ((len >= curr_tlv_len) &&
|
|
|
- (curr_tlv_tag >= WMITLV_TAG_FIRST_ARRAY_ENUM)) {
|
|
|
- if (curr_tlv_tag == WMITLV_TAG_ARRAY_STRUC) {
|
|
|
- /* Move to next WMITLV_TAG_ARRAY_STRUC */
|
|
|
- buf_ptr += WMI_TLV_HDR_SIZE;
|
|
|
- len -= WMI_TLV_HDR_SIZE;
|
|
|
- if (len <= 0)
|
|
|
- break;
|
|
|
- }
|
|
|
- curr_tlv_tag = WMITLV_GET_TLVTAG(WMITLV_GET_HDR(buf_ptr));
|
|
|
- curr_tlv_len = WMITLV_GET_TLVLEN(WMITLV_GET_HDR(buf_ptr));
|
|
|
-
|
|
|
- wmi_debug("curr_tlv_len %d curr_tlv_tag %d rem_len %d",
|
|
|
- len, curr_tlv_len, curr_tlv_tag);
|
|
|
- if (curr_tlv_len) {
|
|
|
- /* point to the tag inside WMITLV_TAG_ARRAY_STRUC */
|
|
|
- tag_start_ptr = buf_ptr + WMI_TLV_HDR_SIZE;
|
|
|
- curr_tlv_tag = WMITLV_GET_TLVTAG(
|
|
|
- WMITLV_GET_HDR(tag_start_ptr));
|
|
|
- wmi_stats_extract_tag_struct(curr_tlv_tag,
|
|
|
- (void *)tag_start_ptr,
|
|
|
- params);
|
|
|
- }
|
|
|
- /* Move to next tag */
|
|
|
- buf_ptr += curr_tlv_len + WMI_TLV_HDR_SIZE;
|
|
|
- len -= (curr_tlv_len + WMI_TLV_HDR_SIZE);
|
|
|
-
|
|
|
- if (len <= 0)
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- return QDF_STATUS_SUCCESS;
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * extract_infra_cp_stats_tlv - api to extract stats information from
|
|
|
- * event buffer
|
|
|
- * @wmi_handle: wmi handle
|
|
|
- * @evt_buf: event buffer
|
|
|
- * @evt_buf_len: length of the event buffer
|
|
|
- * @params: buffer to populate more flag
|
|
|
- *
|
|
|
- * Return: QDF_STATUS_SUCCESS on success, else other qdf error values
|
|
|
- */
|
|
|
-static QDF_STATUS
|
|
|
-extract_infra_cp_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf,
|
|
|
- uint32_t evt_buf_len,
|
|
|
- struct infra_cp_stats_event *params)
|
|
|
-{
|
|
|
- wmi_stats_handler(evt_buf, evt_buf_len, params);
|
|
|
- return QDF_STATUS_SUCCESS;
|
|
|
-}
|
|
|
-#endif /* WLAN_SUPPORT_INFRA_CTRL_PATH_STATS */
|
|
|
-
|
|
|
/**
|
|
|
* extract_cp_stats_more_pending_tlv - api to extract more flag from event data
|
|
|
* @wmi_handle: wmi handle
|