diff --git a/dp/inc/cdp_txrx_stats_struct.h b/dp/inc/cdp_txrx_stats_struct.h index 84fafc8b75..1091581939 100644 --- a/dp/inc/cdp_txrx_stats_struct.h +++ b/dp/inc/cdp_txrx_stats_struct.h @@ -1565,7 +1565,7 @@ enum _ol_ath_param_t { OL_ATH_PARAM_HE_SR = 401, OL_ATH_PARAM_HE_UL_PPDU_DURATION = 402, OL_ATH_PARAM_HE_UL_RU_ALLOCATION = 403, - + OL_ATH_PARAM_PERIODIC_CFR_CAPTURE = 404, }; /* Enumeration of PDEV Configuration parameter */ diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 0370d83115..7f72523b3c 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -1730,4 +1730,18 @@ enum cdp_sec_type wlan_crypto_cipher_to_cdp_sec_type( enum wlan_crypto_cipher_type crypto_cipher); #endif + +#ifdef WLAN_CFR_ENABLE +/** + * wmi_unified_send_peer_cfr_capture_cmd() - WMI function to start CFR capture + * for a peer + * @wmi_hdl: WMI handle + * @param: configuration params for capture + * + * Return: QDF_STATUS_SUCCESS if success, else returns proper error code. + */ +QDF_STATUS +wmi_unified_send_peer_cfr_capture_cmd(void *wmi_hdl, + struct peer_cfr_params *param); +#endif /* WLAN_CFR_ENABLE */ #endif /* _WMI_UNIFIED_API_H_ */ diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index abcf7a21ef..63429c0dfe 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -875,6 +875,31 @@ struct hidden_ssid_vdev_restart_params { #endif }; +#ifdef WLAN_CFR_ENABLE + +#define WMI_HOST_PEER_CFR_TIMER_ENABLE 1 +#define WMI_HOST_PEER_CFR_TIMER_DISABLE 0 + +/** + * struct peer_cfr_params - peer cfr capture cmd parameter + * @request: enable/disable cfr capture + * @macaddr: macaddr of the client + * @vdev_id: vdev id + * @periodicity: cfr capture period + * @bandwidth: bandwidth of cfr capture + * @capture_method: cfr capture method/type + */ +struct peer_cfr_params { + uint32_t request; + uint8_t *macaddr; + uint32_t vdev_id; + uint32_t periodicity; + uint32_t bandwidth; + uint32_t capture_method; +}; + +#endif /* WLAN_CFR_ENABLE */ + #ifndef CMN_VDEV_MGR_TGT_IF_ENABLE /** * struct vdev_set_params - vdev set cmd parameter @@ -4882,7 +4907,7 @@ typedef enum { wmi_pdev_param_sub_channel_marking, wmi_pdev_param_ul_ppdu_duration, wmi_pdev_param_equal_ru_allocation_enable, - + wmi_pdev_param_per_peer_prd_cfr_enable, wmi_pdev_param_max, } wmi_conv_pdev_params_id; @@ -5198,6 +5223,7 @@ typedef enum { wmi_service_hw_db2dbm_support, wmi_service_wlm_stats_support, wmi_service_ul_ru26_allowed, + wmi_service_cfr_capture_support, wmi_services_max, } wmi_conv_service_ids; #define WMI_SERVICE_UNAVAILABLE 0xFFFF diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index 8a7ceda5f9..cee8d3e577 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -1896,6 +1896,10 @@ QDF_STATUS QDF_STATUS (*send_peer_del_all_wds_entries_cmd)(wmi_unified_t wmi_handle, struct peer_del_all_wds_entries_params *param); +#ifdef WLAN_CFR_ENABLE +QDF_STATUS (*send_peer_cfr_capture_cmd)(wmi_unified_t wmi_handle, + struct peer_cfr_params *param); +#endif }; /* Forward declartion for psoc*/ diff --git a/wmi/src/wmi_unified_api.c b/wmi/src/wmi_unified_api.c index 055ace1fe4..a974eafa34 100644 --- a/wmi/src/wmi_unified_api.c +++ b/wmi/src/wmi_unified_api.c @@ -4622,3 +4622,17 @@ QDF_STATUS wmi_unified_extract_obss_color_collision_info(void *wmi_hdl, return QDF_STATUS_E_FAILURE; } + +#ifdef WLAN_CFR_ENABLE +QDF_STATUS wmi_unified_send_peer_cfr_capture_cmd(void *wmi_hdl, + struct peer_cfr_params *param) +{ + wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl; + + if (wmi_handle->ops->send_peer_cfr_capture_cmd) + return wmi_handle->ops->send_peer_cfr_capture_cmd(wmi_hdl, + param); + + return QDF_STATUS_E_FAILURE; +} +#endif /* WLAN_CFR_ENABLE */ diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 6132148ebb..bf77513351 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -10676,6 +10676,52 @@ static QDF_STATUS extract_single_phyerr_tlv(wmi_unified_t wmi_handle, return QDF_STATUS_SUCCESS; } +#ifdef WLAN_CFR_ENABLE +/** + * send_peer_cfr_capture_cmd_tlv() - configure cfr params in fw + * @wmi_handle: wmi handle + * @param: pointer to hold peer cfr config parameter + * + * Return: 0 for success or error code + */ +static QDF_STATUS send_peer_cfr_capture_cmd_tlv(wmi_unified_t wmi_handle, + struct peer_cfr_params *param) +{ + wmi_peer_cfr_capture_cmd_fixed_param *cmd; + wmi_buf_t buf; + int len = sizeof(*cmd); + int ret; + + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + qdf_print("%s:wmi_buf_alloc failed\n", __func__); + return QDF_STATUS_E_NOMEM; + } + + cmd = (wmi_peer_cfr_capture_cmd_fixed_param *)wmi_buf_data(buf); + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_peer_cfr_capture_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_peer_cfr_capture_cmd_fixed_param)); + + WMI_CHAR_ARRAY_TO_MAC_ADDR(param->macaddr, &cmd->mac_addr); + cmd->request = param->request; + cmd->vdev_id = param->vdev_id; + cmd->periodicity = param->periodicity; + cmd->bandwidth = param->bandwidth; + cmd->capture_method = param->capture_method; + + ret = wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_PEER_CFR_CAPTURE_CMDID); + if (QDF_IS_STATUS_ERROR(ret)) { + WMI_LOGE("Failed to send WMI_PEER_CFR_CAPTURE_CMDID"); + wmi_buf_free(buf); + } + + return ret; +} +#endif /* WLAN_CFR_ENABLE */ + /** * extract_esp_estimation_ev_param_tlv() - extract air time from event * @wmi_handle: wmi handle @@ -11137,6 +11183,11 @@ struct wmi_ops tlv_ops = { .extract_offload_bcn_tx_status_evt = extract_offload_bcn_tx_status_evt, .extract_ctl_failsafe_check_ev_param = extract_ctl_failsafe_check_ev_param_tlv, +#ifdef WLAN_CFR_ENABLE + .send_peer_cfr_capture_cmd = + send_peer_cfr_capture_cmd_tlv, +#endif + }; /** @@ -11689,6 +11740,8 @@ static void populate_tlv_service(uint32_t *wmi_service) WMI_SERVICE_WLM_STATS_REQUEST; wmi_service[wmi_service_infra_mbssid] = WMI_SERVICE_INFRA_MBSSID; wmi_service[wmi_service_ul_ru26_allowed] = WMI_SERVICE_UL_RU26_ALLOWED; + wmi_service[wmi_service_cfr_capture_support] = + WMI_SERVICE_CFR_CAPTURE_SUPPORT; } #ifndef CONFIG_MCL @@ -11948,6 +12001,8 @@ static void populate_pdev_param_tlv(uint32_t *pdev_param) WMI_PDEV_PARAM_SET_UL_PPDU_DURATION; pdev_param[wmi_pdev_param_equal_ru_allocation_enable] = WMI_PDEV_PARAM_EQUAL_RU_ALLOCATION_ENABLE; + pdev_param[wmi_pdev_param_per_peer_prd_cfr_enable] = + WMI_PDEV_PARAM_PER_PEER_PERIODIC_CFR_ENABLE; } /**