diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index e6ac5c82c6..94cafdbd30 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -3118,6 +3118,21 @@ QDF_STATUS wmi_extract_vdev_nac_rssi_stats( wmi_unified_t wmi_handle, void *evt_buf, struct wmi_host_vdev_nac_rssi_event *vdev_nac_rssi_stats); +/** + * wmi_extract_vdev_prb_fils_stats() - extract probe and fils vdev + * stats from event + * @wmi_handle: wmi handle + * @evt_buf: pointer to event buffer + * @index: Index into extended vdev stats + * @vdev_prb_fils_stats: Pointer to hold probe and fils vdev stats + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure + */ +QDF_STATUS wmi_extract_vdev_prb_fils_stats( + wmi_unified_t wmi_handle, void *evt_buf, + uint32_t index, + struct wmi_host_vdev_prb_fils_stats *vdev_prb_fils_stats); + /** * wmi_extract_peer_retry_stats() - extract peer retry stats from event * @wmi_handle: wmi handle diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 9955ddb521..cf48c60a46 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -799,6 +799,7 @@ typedef enum { WMI_HOST_REQUEST_PEER_RETRY_STAT = 0x2000, WMI_HOST_REQUEST_PEER_ADV_STATS = 0x4000, WMI_HOST_REQUEST_PMF_BCN_PROTECT_STAT = 0x8000, + WMI_HOST_REQUEST_VDEV_PRB_FILS_STAT = 0x10000, } wmi_host_stats_id; typedef struct { @@ -3900,6 +3901,7 @@ struct rx_reorder_queue_remove_params { * @num_mib_stats: number of mib stats * @num_mib_extd_stats: number of extended mib stats * @num_peer_stats_info_ext: number of peer extended stats info + * @num_vdev_extd_stats: number of vdev extended stats info * @last_event: specify if the current event is the last event */ typedef struct { @@ -3918,6 +3920,7 @@ typedef struct { uint32_t num_mib_stats; uint32_t num_mib_extd_stats; uint32_t num_peer_stats_info_ext; + uint32_t num_vdev_extd_stats; uint32_t last_event; } wmi_host_stats_event; @@ -4327,6 +4330,22 @@ typedef struct { uint32_t reserved[13]; } wmi_host_vdev_extd_stats; +/** + * struct wmi_host_vdev_prb_fils_stats - VDEV probe response fils stats + * @vdev_id: unique id identifying the VDEV, generated by the caller + * @fd_succ_cnt: Total number of successfully transmitted Fils Discovery frames + * @fd_fail_cnt: Toatl number of Fils discovery failed count + * @unsolicited_prb_succ_cnt: Successful unsolicited probe response frames cnt + * @unsolicited_prb_fail_cnt: Failed unsolictied probe response frames cnt + */ +struct wmi_host_vdev_prb_fils_stats { + uint32_t vdev_id; + uint32_t fd_succ_cnt; + uint32_t fd_fail_cnt; + uint32_t unsolicited_prb_succ_cnt; + uint32_t unsolicited_prb_fail_cnt; +}; + /** * struct wmi_host_vdev_nac_rssi_event - VDEV nac rssi stats * @vdev_id: unique id identifying the VDEV, generated by the caller diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index dd8b640310..ed8000ffca 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -1820,6 +1820,11 @@ QDF_STATUS (*extract_peer_stats_info)(wmi_unified_t wmi_handle, void *evt_buf, uint32_t index, wmi_host_peer_stats_info *peer_stats_info); #endif /* QCA_SUPPORT_MC_CP_STATS */ +QDF_STATUS +(*extract_vdev_prb_fils_stats)(wmi_unified_t wmi_handle, + void *evt_buf, uint32_t index, + struct wmi_host_vdev_prb_fils_stats *vdev_stats); + #ifdef OL_ATH_SMART_LOGGING QDF_STATUS (*extract_smartlog_event)(wmi_unified_t wmi_handle, void *evt_buf, struct wmi_debug_fatal_events *event); diff --git a/wmi/src/wmi_unified_api.c b/wmi/src/wmi_unified_api.c index a4d0784edc..d46123007c 100644 --- a/wmi/src/wmi_unified_api.c +++ b/wmi/src/wmi_unified_api.c @@ -2302,6 +2302,18 @@ QDF_STATUS wmi_extract_vdev_nac_rssi_stats( return QDF_STATUS_E_FAILURE; } +QDF_STATUS wmi_extract_vdev_prb_fils_stats( + wmi_unified_t wmi_handle, void *evt_buf, + uint32_t index, + struct wmi_host_vdev_prb_fils_stats *vdev_prb_fils_stats) +{ + if (wmi_handle->ops->extract_vdev_prb_fils_stats) + return wmi_handle->ops->extract_vdev_prb_fils_stats(wmi_handle, + evt_buf, index, vdev_prb_fils_stats); + + return QDF_STATUS_E_FAILURE; +} + QDF_STATUS wmi_unified_send_power_dbg_cmd(wmi_unified_t wmi_handle, struct wmi_power_dbg_params *param) { diff --git a/wmi/src/wmi_unified_cp_stats_tlv.c b/wmi/src/wmi_unified_cp_stats_tlv.c index 6655803b6e..ee6c180083 100644 --- a/wmi/src/wmi_unified_cp_stats_tlv.c +++ b/wmi/src/wmi_unified_cp_stats_tlv.c @@ -85,6 +85,7 @@ extract_all_stats_counts_tlv(wmi_unified_t wmi_handle, void *evt_buf, wmi_per_chain_rssi_stats *rssi_event; WMI_UPDATE_STATS_EVENTID_param_tlvs *param_buf; uint64_t min_data_len; + uint32_t i; qdf_mem_zero(stats_param, sizeof(*stats_param)); param_buf = (WMI_UPDATE_STATS_EVENTID_param_tlvs *) evt_buf; @@ -100,50 +101,55 @@ extract_all_stats_counts_tlv(wmi_unified_t wmi_handle, void *evt_buf, return QDF_STATUS_E_FAULT; } - switch (ev->stats_id) { - case WMI_REQUEST_PEER_STAT: - stats_param->stats_id |= WMI_HOST_REQUEST_PEER_STAT; - break; + for (i = 1; i <= WMI_REQUEST_VDEV_EXTD_STAT; i = i << 1) { + switch (ev->stats_id & i) { + case WMI_REQUEST_PEER_STAT: + stats_param->stats_id |= WMI_HOST_REQUEST_PEER_STAT; + break; - case WMI_REQUEST_AP_STAT: - stats_param->stats_id |= WMI_HOST_REQUEST_AP_STAT; - break; + case WMI_REQUEST_AP_STAT: + stats_param->stats_id |= WMI_HOST_REQUEST_AP_STAT; + break; - case WMI_REQUEST_PDEV_STAT: - stats_param->stats_id |= WMI_HOST_REQUEST_PDEV_STAT; - break; + case WMI_REQUEST_PDEV_STAT: + stats_param->stats_id |= WMI_HOST_REQUEST_PDEV_STAT; + break; - case WMI_REQUEST_VDEV_STAT: - stats_param->stats_id |= WMI_HOST_REQUEST_VDEV_STAT; - break; + case WMI_REQUEST_VDEV_STAT: + stats_param->stats_id |= WMI_HOST_REQUEST_VDEV_STAT; + break; - case WMI_REQUEST_BCNFLT_STAT: - stats_param->stats_id |= WMI_HOST_REQUEST_BCNFLT_STAT; - break; + case WMI_REQUEST_BCNFLT_STAT: + stats_param->stats_id |= WMI_HOST_REQUEST_BCNFLT_STAT; + break; - case WMI_REQUEST_VDEV_RATE_STAT: - stats_param->stats_id |= WMI_HOST_REQUEST_VDEV_RATE_STAT; - break; + case WMI_REQUEST_VDEV_RATE_STAT: + stats_param->stats_id |= + WMI_HOST_REQUEST_VDEV_RATE_STAT; + break; - case WMI_REQUEST_BCN_STAT: - stats_param->stats_id |= WMI_HOST_REQUEST_BCN_STAT; - break; - case WMI_REQUEST_PEER_EXTD_STAT: - stats_param->stats_id |= WMI_REQUEST_PEER_EXTD_STAT; - break; + case WMI_REQUEST_BCN_STAT: + stats_param->stats_id |= WMI_HOST_REQUEST_BCN_STAT; + break; + case WMI_REQUEST_PEER_EXTD_STAT: + stats_param->stats_id |= WMI_REQUEST_PEER_EXTD_STAT; + break; - case WMI_REQUEST_PEER_EXTD2_STAT: - stats_param->stats_id |= WMI_HOST_REQUEST_PEER_ADV_STATS; - break; + case WMI_REQUEST_PEER_EXTD2_STAT: + stats_param->stats_id |= + WMI_HOST_REQUEST_PEER_ADV_STATS; + break; - case WMI_REQUEST_PMF_BCN_PROTECT_STAT: - stats_param->stats_id |= WMI_HOST_REQUEST_PMF_BCN_PROTECT_STAT; - break; - - default: - stats_param->stats_id = 0; - break; + case WMI_REQUEST_PMF_BCN_PROTECT_STAT: + stats_param->stats_id |= + WMI_HOST_REQUEST_PMF_BCN_PROTECT_STAT; + break; + case WMI_REQUEST_VDEV_EXTD_STAT: + stats_param->stats_id |= + WMI_HOST_REQUEST_VDEV_PRB_FILS_STAT; + break; + } } /* ev->num_*_stats may cause uint32_t overflow, so use uint64_t @@ -203,11 +209,14 @@ extract_all_stats_counts_tlv(wmi_unified_t wmi_handle, void *evt_buf, } stats_param->num_rssi_stats = rssi_event->num_per_chain_rssi_stats; - /* if peer_adv_stats is not populated */ - if (!param_buf->num_peer_extd2_stats) - return QDF_STATUS_SUCCESS; + if (param_buf->vdev_extd_stats) + stats_param->num_vdev_extd_stats = + param_buf->num_vdev_extd_stats; - stats_param->num_peer_adv_stats = param_buf->num_peer_extd2_stats; + /* if peer_adv_stats is not populated */ + if (param_buf->num_peer_extd2_stats) + stats_param->num_peer_adv_stats = + param_buf->num_peer_extd2_stats; return QDF_STATUS_SUCCESS; } diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index d986973b33..a12ecf0bff 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -10222,6 +10222,45 @@ static QDF_STATUS extract_bcn_stats_tlv(wmi_unified_t wmi_handle, return QDF_STATUS_SUCCESS; } +/** + * extract_vdev_prb_fils_stats_tlv() - extract vdev probe and fils + * stats from event + * @wmi_handle: wmi handle + * @param evt_buf: pointer to event buffer + * @param index: Index into vdev stats + * @param vdev_prb_fd_stats: Pointer to hold vdev probe and fils stats + * + * Return: QDF_STATUS_SUCCESS for success or error code + */ +static QDF_STATUS +extract_vdev_prb_fils_stats_tlv(wmi_unified_t wmi_handle, + void *evt_buf, uint32_t index, + struct wmi_host_vdev_prb_fils_stats *vdev_stats) +{ + WMI_UPDATE_STATS_EVENTID_param_tlvs *param_buf; + wmi_vdev_extd_stats *ev; + + param_buf = (WMI_UPDATE_STATS_EVENTID_param_tlvs *)evt_buf; + + if (param_buf->vdev_extd_stats) { + ev = (wmi_vdev_extd_stats *)(param_buf->vdev_extd_stats + + index); + vdev_stats->vdev_id = ev->vdev_id; + vdev_stats->fd_succ_cnt = ev->fd_succ_cnt; + vdev_stats->fd_fail_cnt = ev->fd_fail_cnt; + vdev_stats->unsolicited_prb_succ_cnt = + ev->unsolicited_prb_succ_cnt; + vdev_stats->unsolicited_prb_fail_cnt = + ev->unsolicited_prb_fail_cnt; + WMI_LOGD("vdev: %d, fd_s: %d, fd_f: %d, prb_s: %d, prb_f: %d", + ev->vdev_id, ev->fd_succ_cnt, ev->fd_fail_cnt, + ev->unsolicited_prb_succ_cnt, + ev->unsolicited_prb_fail_cnt); + } + + return QDF_STATUS_SUCCESS; +} + /** * extract_bcnflt_stats_tlv() - extract bcn fault stats from event * @wmi_handle: wmi handle @@ -13900,6 +13939,7 @@ struct wmi_ops tlv_ops = { .extract_bcn_stats = extract_bcn_stats_tlv, .extract_bcnflt_stats = extract_bcnflt_stats_tlv, .extract_chan_stats = extract_chan_stats_tlv, + .extract_vdev_prb_fils_stats = extract_vdev_prb_fils_stats_tlv, .extract_profile_ctx = extract_profile_ctx_tlv, .extract_profile_data = extract_profile_data_tlv, .send_fw_test_cmd = send_fw_test_cmd_tlv,