diff --git a/wmi_unified_api.c b/wmi_unified_api.c index 484c55c0a9..8e1e9abf3e 100644 --- a/wmi_unified_api.c +++ b/wmi_unified_api.c @@ -626,7 +626,7 @@ QDF_STATUS wmi_unified_sta_ps_cmd_send(void *wmi_hdl, /** * wmi_crash_inject() - inject fw crash * @wma_handle: wma handle - * @param: ponirt to crash inject paramter structure + * @param: ponirt to crash inject parameter structure * * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure */ @@ -1106,7 +1106,7 @@ QDF_STATUS wmi_unified_get_temperature(void *wmi_hdl) /** * wmi_unified_set_sta_uapsd_auto_trig_cmd() - set uapsd auto trigger command * @wmi_hdl: wmi handle - * @end_set_sta_ps_mode_cmd: cmd paramter strcture + * @end_set_sta_ps_mode_cmd: cmd parameter strcture * * This function sets the trigger * uapsd params such as service interval, delay interval @@ -1266,7 +1266,7 @@ QDF_STATUS wmi_extract_dcc_stats(struct wmi_unified *wmi_hdl, * * This function enable/disable mcc adaptive scheduler in fw. * - * Return: QDF_STATUS_SUCCESS for sucess or error code + * Return: QDF_STATUS_SUCCESS for success or error code */ QDF_STATUS wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd( void *wmi_hdl, uint32_t mcc_adaptive_scheduler, @@ -6210,6 +6210,27 @@ QDF_STATUS wmi_extract_vdev_stats(void *wmi_hdl, void *evt_buf, return QDF_STATUS_E_FAILURE; } +/** + * wmi_extract_per_chain_rssi_stats() - extract rssi stats from event + * @wmi_handle: wmi handle + * @param evt_buf: pointer to event buffer + * @param index: Index into rssi stats + * @param rssi_stats: Pointer to hold rssi stats + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure + */ +QDF_STATUS wmi_extract_per_chain_rssi_stats(void *wmi_hdl, void *evt_buf, + uint32_t index, struct wmi_host_per_chain_rssi_stats *rssi_stats) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->extract_per_chain_rssi_stats) + return wmi_handle->ops->extract_per_chain_rssi_stats(wmi_handle, + evt_buf, index, rssi_stats); + + return QDF_STATUS_E_FAILURE; +} + /** * wmi_extract_rtt_hdr() - extract rtt header from event * @wmi_handle: wmi handle diff --git a/wmi_unified_non_tlv.c b/wmi_unified_non_tlv.c index c0d5d9fea8..18e5dea04e 100644 --- a/wmi_unified_non_tlv.c +++ b/wmi_unified_non_tlv.c @@ -36,7 +36,7 @@ #include /* pdev_id is used to distinguish the radio for which event - * is recieved. Since non-tlv target has only one radio, setting + * is received. Since non-tlv target has only one radio, setting * default pdev_id to one to keep rest of the code using WMI APIs unfiorm. */ #define WMI_NON_TLV_DEFAULT_PDEV_ID WMI_HOST_PDEV_ID_0 @@ -461,7 +461,7 @@ static QDF_STATUS send_setup_install_key_cmd_non_tlv(wmi_unified_t wmi_handle, * @peer_addr: peer mac address * @param: pointer to hold peer flush tid parameter * - * Return: 0 for sucess or error code + * Return: 0 for success or error code */ static QDF_STATUS send_peer_flush_tids_cmd_non_tlv(wmi_unified_t wmi_handle, uint8_t peer_addr[IEEE80211_ADDR_LEN], @@ -1041,7 +1041,7 @@ static QDF_STATUS send_suspend_cmd_non_tlv(wmi_unified_t wmi_handle, wmi_buf_t wmibuf; uint32_t len = sizeof(wmi_pdev_suspend_cmd); - /*send the comand to Target to ignore the + /*send the command to Target to ignore the * PCIE reset so as to ensure that Host and target * states are in sync*/ wmibuf = wmi_buf_alloc(wmi_handle, len); @@ -1329,7 +1329,7 @@ static QDF_STATUS send_set_ps_mode_cmd_non_tlv(wmi_unified_t wmi_handle, /** * send_crash_inject_cmd_non_tlv() - inject fw crash * @param wmi_handle : handle to WMI. - * @param: ponirt to crash inject paramter structure + * @param: ponirt to crash inject parameter structure * * Return: 0 for success or return error */ @@ -5741,7 +5741,7 @@ static QDF_STATUS extract_service_ready_non_tlv(wmi_unified_t wmi_handle, cap->max_bcn_ie_size = ev->max_bcn_ie_size; cap->fw_version = ev->sw_version; cap->fw_version_1 = ev->sw_version_1; - /* Following caps not recieved in older fw/hw + /* Following caps not received in older fw/hw * Initialize it as zero(default). */ cap->max_num_scan_channels = 0; cap->max_supported_macs = 0; @@ -6983,7 +6983,7 @@ static QDF_STATUS extract_rtt_hdr_non_tlv(wmi_unified_t wmi_handle, void *evt_bu /** * copy_rtt_report_cfr * @ev: pointer to destination event pointer - * @report_type: report type recieved in event + * @report_type: report type received in event * @p: pointer to event data * @hdump: pointer to destination buffer * @hdump_len: length of dest buffer @@ -8033,7 +8033,7 @@ static QDF_STATUS extract_chan_stats_non_tlv(wmi_unified_t wmi_handle, void *evt_buf, uint32_t index, wmi_host_chan_stats *chan_stats) { - /* Non-TLV doesnt have num_chan_stats */ + /* Non-TLV doesn't have num_chan_stats */ return QDF_STATUS_SUCCESS; } diff --git a/wmi_unified_ocb_ut.c b/wmi_unified_ocb_ut.c index 00d33b5881..f787ccdf6d 100644 --- a/wmi_unified_ocb_ut.c +++ b/wmi_unified_ocb_ut.c @@ -463,7 +463,7 @@ static QDF_STATUS fake_vdev_set_param_cmd_tlv(wmi_unified_t wmi_handle, * * This function enable/disable mcc adaptive scheduler in fw. * - * Return: QDF_STATUS_SUCCESS for sucess or error code + * Return: QDF_STATUS_SUCCESS for success or error code */ static QDF_STATUS fake_set_enable_disable_mcc_adaptive_scheduler_cmd_tlv( wmi_unified_t wmi_handle, uint32_t mcc_adaptive_scheduler, diff --git a/wmi_unified_tlv.c b/wmi_unified_tlv.c index a54d60359c..d768d3880b 100644 --- a/wmi_unified_tlv.c +++ b/wmi_unified_tlv.c @@ -515,7 +515,7 @@ static QDF_STATUS send_hidden_ssid_vdev_restart_cmd_tlv(wmi_unified_t wmi_handle * @peer_addr: peer mac address * @param: pointer to hold peer flush tid parameter * - * Return: 0 for sucess or error code + * Return: 0 for success or error code */ static QDF_STATUS send_peer_flush_tids_cmd_tlv(wmi_unified_t wmi, uint8_t peer_addr[IEEE80211_ADDR_LEN], @@ -1271,7 +1271,7 @@ static QDF_STATUS send_suspend_cmd_tlv(wmi_unified_t wmi_handle, int32_t ret; /* - * send the comand to Target to ignore the + * send the command to Target to ignore the * PCIE reset so as to ensure that Host and target * states are in sync */ @@ -1545,7 +1545,7 @@ static QDF_STATUS send_set_sta_ps_param_cmd_tlv(wmi_unified_t wmi_handle, /** * send_crash_inject_cmd_tlv() - inject fw crash * @wmi_handle: wmi handle - * @param: ponirt to crash inject paramter structure + * @param: ponirt to crash inject parameter structure * * Return: QDF_STATUS_SUCCESS for success or return error */ @@ -3347,6 +3347,7 @@ static QDF_STATUS send_set_mimops_cmd_tlv(wmi_unified_t wmi_handle, break; default: WMI_LOGE("%s:INVALID Mimo PS CONFIG", __func__); + wmi_buf_free(buf); return QDF_STATUS_E_FAILURE; } @@ -4545,7 +4546,7 @@ static QDF_STATUS extract_ocb_dcc_stats_tlv(wmi_unified_t wmi_handle, * * This function enable/disable mcc adaptive scheduler in fw. * - * Return: QDF_STATUS_SUCCESS for sucess or error code + * Return: QDF_STATUS_SUCCESS for success or error code */ static QDF_STATUS send_set_enable_disable_mcc_adaptive_scheduler_cmd_tlv( wmi_unified_t wmi_handle, uint32_t mcc_adaptive_scheduler, @@ -10760,7 +10761,7 @@ static QDF_STATUS send_set_tdls_offchan_mode_cmd_tlv(wmi_unified_t wmi_handle, * @wmi_handle: wmi handle * @pwmaTdlsparams: TDLS params * - * Return: 0 for sucess or error code + * Return: 0 for success or error code */ static QDF_STATUS send_update_fw_tdls_state_cmd_tlv(wmi_unified_t wmi_handle, void *tdls_param, uint8_t tdls_state) @@ -13362,7 +13363,7 @@ void wmi_copy_resource_config(wmi_resource_config *resource_cfg, /* copy_hw_mode_id_in_init_cmd() - Helper routine to copy hw_mode in init cmd * @wmi_handle: pointer to wmi handle * @buf_ptr: pointer to current position in init command buffer - * @len: pointer to length. This will be updated with current lenght of cmd + * @len: pointer to length. This will be updated with current length of cmd * @param: point host parameters for init command * * Return: Updated pointer of buf_ptr. @@ -17646,7 +17647,7 @@ static QDF_STATUS extract_ndp_confirm_tlv(wmi_unified_t wmi_handle, event = (WMI_NDP_CONFIRM_EVENTID_param_tlvs *) data; fixed_params = (wmi_ndp_confirm_event_fixed_param *)event->fixed_param; - WMI_LOGD("WMI_NDP_CONFIRM_EVENTID(0x%X) recieved. vdev %d, ndp_instance %d, rsp_code %d, reason_code: %d, num_active_ndps_on_peer: %d", + WMI_LOGD("WMI_NDP_CONFIRM_EVENTID(0x%X) received. vdev %d, ndp_instance %d, rsp_code %d, reason_code: %d, num_active_ndps_on_peer: %d", WMI_NDP_CONFIRM_EVENTID, fixed_params->vdev_id, fixed_params->ndp_instance_id, fixed_params->rsp_code, fixed_params->reason_code, @@ -17735,7 +17736,7 @@ static QDF_STATUS extract_ndp_end_rsp_tlv(wmi_unified_t wmi_handle, event = (WMI_NDP_END_RSP_EVENTID_param_tlvs *) data; fixed_params = (wmi_ndp_end_rsp_event_fixed_param *)event->fixed_param; - WMI_LOGD("WMI_NDP_END_RSP_EVENTID(0x%X) recieved. transaction_id: %d, rsp_status: %d, reason_code: %d", + WMI_LOGD("WMI_NDP_END_RSP_EVENTID(0x%X) received. transaction_id: %d, rsp_status: %d, reason_code: %d", WMI_NDP_END_RSP_EVENTID, fixed_params->transaction_id, fixed_params->rsp_status, fixed_params->reason_code); @@ -19515,6 +19516,57 @@ static QDF_STATUS extract_vdev_stats_tlv(wmi_unified_t wmi_handle, return QDF_STATUS_SUCCESS; } +/** + * extract_per_chain_rssi_stats_tlv() - api to extract rssi stats from event + * buffer + * @wmi_handle: wmi handle + * @evt_buf: pointer to event buffer + * @index: Index into vdev stats + * @rssi_stats: Pointer to hold rssi stats + * + * Return: QDF_STATUS_SUCCESS for success or error code + */ +static QDF_STATUS extract_per_chain_rssi_stats_tlv(wmi_unified_t wmi_handle, + void *evt_buf, uint32_t index, + struct wmi_host_per_chain_rssi_stats *rssi_stats) +{ + uint8_t *data; + wmi_rssi_stats *fw_rssi_stats; + wmi_per_chain_rssi_stats *rssi_event; + WMI_UPDATE_STATS_EVENTID_param_tlvs *param_buf; + + if (!evt_buf) { + WMI_LOGE("evt_buf is null"); + return QDF_STATUS_E_NULL_VALUE; + } + + param_buf = (WMI_UPDATE_STATS_EVENTID_param_tlvs *) evt_buf; + rssi_event = param_buf->chain_stats; + + if (index >= rssi_event->num_per_chain_rssi_stats) { + WMI_LOGE("invalid index"); + return QDF_STATUS_E_INVAL; + } + + data = ((uint8_t *)(&rssi_event[1])) + WMI_TLV_HDR_SIZE; + fw_rssi_stats = &((wmi_rssi_stats *)data)[index]; + + rssi_stats->vdev_id = fw_rssi_stats->vdev_id; + qdf_mem_copy(rssi_stats->rssi_avg_beacon, + fw_rssi_stats->rssi_avg_beacon, + sizeof(fw_rssi_stats->rssi_avg_beacon)); + qdf_mem_copy(rssi_stats->rssi_avg_data, + fw_rssi_stats->rssi_avg_data, + sizeof(fw_rssi_stats->rssi_avg_data)); + qdf_mem_copy(&rssi_stats->peer_macaddr, + &fw_rssi_stats->peer_macaddr, + sizeof(fw_rssi_stats->peer_macaddr)); + + return QDF_STATUS_SUCCESS; +} + + + /** * extract_bcn_stats_tlv() - extract bcn stats from event * @wmi_handle: wmi handle @@ -19650,7 +19702,7 @@ static QDF_STATUS extract_chan_stats_tlv(wmi_unified_t wmi_handle, (index * sizeof(wmi_chan_stats))); - /* Non-TLV doesnt have num_chan_stats */ + /* Non-TLV doesn't have num_chan_stats */ chan_stats->chan_mhz = ev->chan_mhz; chan_stats->sampling_period_us = ev->sampling_period_us; chan_stats->rx_clear_count = ev->rx_clear_count; @@ -22804,6 +22856,7 @@ struct wmi_ops tlv_ops = { .extract_unit_test = extract_unit_test_tlv, .extract_pdev_ext_stats = extract_pdev_ext_stats_tlv, .extract_vdev_stats = extract_vdev_stats_tlv, + .extract_per_chain_rssi_stats = extract_per_chain_rssi_stats_tlv, .extract_peer_stats = extract_peer_stats_tlv, .extract_bcn_stats = extract_bcn_stats_tlv, .extract_bcnflt_stats = extract_bcnflt_stats_tlv,