diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index ef21b4125c..180c760bc9 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -688,16 +688,37 @@ QDF_STATUS wmi_unified_pno_start_cmd(void *wmi_hdl, QDF_STATUS wmi_unified_nlo_mawc_cmd(void *wmi_hdl, struct nlo_mawc_params *params); -QDF_STATUS wmi_unified_process_ll_stats_clear_cmd - (void *wmi_hdl, const struct ll_stats_clear_params *clear_req, - uint8_t addr[IEEE80211_ADDR_LEN]); +#ifdef WLAN_FEATURE_LINK_LAYER_STATS +/** + * wmi_unified_process_ll_stats_clear_cmd() - clear link layer stats + * @wmi_handle: wmi handle + * @clear_req: ll stats clear request command params + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure + */ +QDF_STATUS wmi_unified_process_ll_stats_clear_cmd(wmi_unified_t wmi_handle, + const struct ll_stats_clear_params *clear_req); -QDF_STATUS wmi_unified_process_ll_stats_set_cmd - (void *wmi_hdl, const struct ll_stats_set_params *set_req); +/** + * wmi_unified_process_ll_stats_set_cmd() - link layer stats set request + * @wmi_handle: wmi handle + * @set_req: ll stats set request command params + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure + */ +QDF_STATUS wmi_unified_process_ll_stats_set_cmd(wmi_unified_t wmi_handle, + const struct ll_stats_set_params *set_req); -QDF_STATUS wmi_unified_process_ll_stats_get_cmd - (void *wmi_hdl, const struct ll_stats_get_params *get_req, - uint8_t addr[IEEE80211_ADDR_LEN]); +/** + * wmi_unified_process_ll_stats_get_cmd() - link layer stats get request + * @wmi_handle: wmi handle + * @get_req: ll stats get request command params + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure + */ +QDF_STATUS wmi_unified_process_ll_stats_get_cmd(wmi_unified_t wmi_handle, + const struct ll_stats_get_params *get_req); +#endif /* WLAN_FEATURE_LINK_LAYER_STATS */ /** * wmi_unified_congestion_request_cmd() - send request to fw to get CCA diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index f7f7b3d17f..be255ae870 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -2428,27 +2428,27 @@ struct del_ts_params { /** * struct ll_stats_clear_params - ll stats clear parameter * @req_id: request id - * @sta_id: sta id + * @vdev_id: vdev id * @stats_clear_mask: stats clear mask * @stop_req: stop request + * @peer_macaddr: MAC address of the peer for which stats are to be cleared */ struct ll_stats_clear_params { uint32_t req_id; - uint8_t sta_id; + uint8_t vdev_id; uint32_t stats_clear_mask; uint8_t stop_req; + struct qdf_mac_addr peer_macaddr; }; /** * struct ll_stats_set_params - ll stats get parameter * @req_id: request id - * @sta_id: sta id - * @mpdu_size_threshold: mpdu sixe threshold + * @mpdu_size_threshold: mpdu size threshold * @aggressive_statistics_gathering: aggressive_statistics_gathering */ struct ll_stats_set_params { uint32_t req_id; - uint8_t sta_id; uint32_t mpdu_size_threshold; uint32_t aggressive_statistics_gathering; }; @@ -2456,13 +2456,15 @@ struct ll_stats_set_params { /** * struct ll_stats_get_params - ll stats parameter * @req_id: request id - * @sta_id: sta id + * @vdev_id: vdev id * @param_id_mask: param is mask + * @peer_macaddr: MAC address of the peer for which stats are desired */ struct ll_stats_get_params { uint32_t req_id; - uint8_t sta_id; + uint8_t vdev_id; uint32_t param_id_mask; + struct qdf_mac_addr peer_macaddr; }; diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index 1dee1dbd77..591cd7837d 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -660,21 +660,19 @@ QDF_STATUS (*send_ipa_offload_control_cmd)(wmi_unified_t wmi_handle, struct ipa_uc_offload_control_params *ipa_offload); #endif -QDF_STATUS (*send_process_ll_stats_clear_cmd) - (wmi_unified_t wmi_handle, - const struct ll_stats_clear_params *clear_req, - uint8_t addr[IEEE80211_ADDR_LEN]); +#ifdef WLAN_FEATURE_LINK_LAYER_STATS +QDF_STATUS (*send_process_ll_stats_clear_cmd)(wmi_unified_t wmi_handle, + const struct ll_stats_clear_params *clear_req); -QDF_STATUS (*send_process_ll_stats_set_cmd) - (wmi_unified_t wmi_handle, const struct ll_stats_set_params *set_req); - -QDF_STATUS (*send_process_ll_stats_get_cmd) - (wmi_unified_t wmi_handle, const struct ll_stats_get_params *get_req, - uint8_t addr[IEEE80211_ADDR_LEN]); +QDF_STATUS (*send_process_ll_stats_set_cmd)(wmi_unified_t wmi_handle, + const struct ll_stats_set_params *set_req); +QDF_STATUS (*send_process_ll_stats_get_cmd)(wmi_unified_t wmi_handle, + const struct ll_stats_get_params *get_req); +#endif QDF_STATUS (*send_congestion_cmd)(wmi_unified_t wmi_handle, - uint8_t vdev_id); + uint8_t vdev_id); QDF_STATUS (*send_snr_request_cmd)(wmi_unified_t wmi_handle); diff --git a/wmi/src/wmi_unified_api.c b/wmi/src/wmi_unified_api.c index 410c6244d1..a21c68b28a 100644 --- a/wmi/src/wmi_unified_api.c +++ b/wmi/src/wmi_unified_api.c @@ -1292,43 +1292,32 @@ QDF_STATUS wmi_unified_nlo_mawc_cmd(void *wmi_hdl, } #ifdef WLAN_FEATURE_LINK_LAYER_STATS -/** - * wmi_unified_process_ll_stats_clear_cmd() - clear link layer stats - * @wmi_hdl: wmi handle - * @clear_req: ll stats clear request command params - * @addr: mac address - * - * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure - */ -QDF_STATUS wmi_unified_process_ll_stats_clear_cmd(void *wmi_hdl, - const struct ll_stats_clear_params *clear_req, - uint8_t addr[IEEE80211_ADDR_LEN]) +QDF_STATUS wmi_unified_process_ll_stats_clear_cmd(wmi_unified_t wmi_handle, + const struct ll_stats_clear_params *clear_req) { - wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; - if (wmi_handle->ops->send_process_ll_stats_clear_cmd) return wmi_handle->ops->send_process_ll_stats_clear_cmd(wmi_handle, - clear_req, addr); + clear_req); return QDF_STATUS_E_FAILURE; } -/** - * wmi_unified_process_ll_stats_get_cmd() - link layer stats get request - * @wmi_hdl:wmi handle - * @get_req:ll stats get request command params - * - * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure - */ -QDF_STATUS wmi_unified_process_ll_stats_get_cmd(void *wmi_hdl, - const struct ll_stats_get_params *get_req, - uint8_t addr[IEEE80211_ADDR_LEN]) +QDF_STATUS wmi_unified_process_ll_stats_set_cmd(wmi_unified_t wmi_handle, + const struct ll_stats_set_params *set_req) { - wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + if (wmi_handle->ops->send_process_ll_stats_set_cmd) + return wmi_handle->ops->send_process_ll_stats_set_cmd(wmi_handle, + set_req); + return QDF_STATUS_E_FAILURE; +} + +QDF_STATUS wmi_unified_process_ll_stats_get_cmd(wmi_unified_t wmi_handle, + const struct ll_stats_get_params *get_req) +{ if (wmi_handle->ops->send_process_ll_stats_get_cmd) return wmi_handle->ops->send_process_ll_stats_get_cmd(wmi_handle, - get_req, addr); + get_req); return QDF_STATUS_E_FAILURE; } @@ -1353,27 +1342,6 @@ QDF_STATUS wmi_unified_congestion_request_cmd(void *wmi_hdl, return QDF_STATUS_E_FAILURE; } -#ifdef WLAN_FEATURE_LINK_LAYER_STATS -/** - * wmi_unified_process_ll_stats_set_cmd() - link layer stats set request - * @wmi_handle: wmi handle - * @set_req: ll stats set request command params - * - * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure - */ -QDF_STATUS wmi_unified_process_ll_stats_set_cmd(void *wmi_hdl, - const struct ll_stats_set_params *set_req) -{ - wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; - - if (wmi_handle->ops->send_process_ll_stats_set_cmd) - return wmi_handle->ops->send_process_ll_stats_set_cmd(wmi_handle, - set_req); - - return QDF_STATUS_E_FAILURE; -} -#endif /* WLAN_FEATURE_LINK_LAYER_STATS */ - /** * wmi_unified_snr_request_cmd() - send request to fw to get RSSI stats * @wmi_handle: wmi handle diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 8835b9538c..a1696713a7 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -4471,8 +4471,7 @@ static QDF_STATUS send_pno_start_cmd_tlv(wmi_unified_t wmi_handle, * Return: QDF_STATUS_SUCCESS for success or error code */ static QDF_STATUS send_process_ll_stats_clear_cmd_tlv(wmi_unified_t wmi_handle, - const struct ll_stats_clear_params *clear_req, - uint8_t addr[IEEE80211_ADDR_LEN]) + const struct ll_stats_clear_params *clear_req) { wmi_clear_link_stats_cmd_fixed_param *cmd; int32_t len; @@ -4496,18 +4495,18 @@ static QDF_STATUS send_process_ll_stats_clear_cmd_tlv(wmi_unified_t wmi_handle, (wmi_clear_link_stats_cmd_fixed_param)); cmd->stop_stats_collection_req = clear_req->stop_req; - cmd->vdev_id = clear_req->sta_id; + cmd->vdev_id = clear_req->vdev_id; cmd->stats_clear_req_mask = clear_req->stats_clear_mask; - WMI_CHAR_ARRAY_TO_MAC_ADDR(addr, + WMI_CHAR_ARRAY_TO_MAC_ADDR(clear_req->peer_macaddr.bytes, &cmd->peer_macaddr); WMI_LOGD("LINK_LAYER_STATS - Clear Request Params"); - WMI_LOGD("StopReq : %d", cmd->stop_stats_collection_req); - WMI_LOGD("Vdev Id : %d", cmd->vdev_id); - WMI_LOGD("Clear Stat Mask : %d", cmd->stats_clear_req_mask); - /* WMI_LOGD("Peer MAC Addr : %pM", - cmd->peer_macaddr); */ + WMI_LOGD("StopReq: %d", cmd->stop_stats_collection_req); + WMI_LOGD("Vdev Id: %d", cmd->vdev_id); + WMI_LOGD("Clear Stat Mask: %d", cmd->stats_clear_req_mask); + WMI_LOGD("Peer MAC Addr: %pM", clear_req->peer_macaddr.bytes); + wmi_mtrace(WMI_CLEAR_LINK_STATS_CMDID, cmd->vdev_id, 0); ret = wmi_unified_cmd_send(wmi_handle, buf, len, WMI_CLEAR_LINK_STATS_CMDID); @@ -4523,8 +4522,8 @@ static QDF_STATUS send_process_ll_stats_clear_cmd_tlv(wmi_unified_t wmi_handle, /** * send_process_ll_stats_set_cmd_tlv() - link layer stats set request - * @wmi_handle: wmi handle - * @setReq: ll stats set request command params + * @wmi_handle: wmi handle + * @set_req: ll stats set request command params * * Return: QDF_STATUS_SUCCESS for success or error code */ @@ -4574,15 +4573,13 @@ static QDF_STATUS send_process_ll_stats_set_cmd_tlv(wmi_unified_t wmi_handle, /** * send_process_ll_stats_get_cmd_tlv() - link layer stats get request - * @wmi_handle:wmi handle - * @get_req:ll stats get request command params - * @addr: mac address + * @wmi_handle: wmi handle + * @get_req: ll stats get request command params * * Return: QDF_STATUS_SUCCESS for success or error code */ static QDF_STATUS send_process_ll_stats_get_cmd_tlv(wmi_unified_t wmi_handle, - const struct ll_stats_get_params *get_req, - uint8_t addr[IEEE80211_ADDR_LEN]) + const struct ll_stats_get_params *get_req) { wmi_request_link_stats_cmd_fixed_param *cmd; int32_t len; @@ -4607,16 +4604,16 @@ static QDF_STATUS send_process_ll_stats_get_cmd_tlv(wmi_unified_t wmi_handle, cmd->request_id = get_req->req_id; cmd->stats_type = get_req->param_id_mask; - cmd->vdev_id = get_req->sta_id; + cmd->vdev_id = get_req->vdev_id; - WMI_CHAR_ARRAY_TO_MAC_ADDR(addr, + WMI_CHAR_ARRAY_TO_MAC_ADDR(get_req->peer_macaddr.bytes, &cmd->peer_macaddr); WMI_LOGD("LINK_LAYER_STATS - Get Request Params"); - WMI_LOGD("Request ID : %u", cmd->request_id); - WMI_LOGD("Stats Type : %0x", cmd->stats_type); - WMI_LOGD("Vdev ID : %d", cmd->vdev_id); - WMI_LOGD("Peer MAC Addr : %pM", addr); + WMI_LOGD("Request ID: %u", cmd->request_id); + WMI_LOGD("Stats Type: %0x", cmd->stats_type); + WMI_LOGD("Vdev ID: %d", cmd->vdev_id); + WMI_LOGD("Peer MAC Addr: %pM", get_req->peer_macaddr.bytes); wmi_mtrace(WMI_REQUEST_LINK_STATS_CMDID, cmd->vdev_id, 0); ret = wmi_unified_cmd_send(wmi_handle, buf, len,