mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
qcacmn: Add support for chan RF info from service_ready_ext event
Channel RF info contains metrics that signify the throughput availability of all the supported channels. This information is sent in as discrete TLVs (per channel) as part of the WMI extended service ready event. Each TLV contains the frequency, bandwidth represented and the actual channel metric. Add support to read the above-mentioned TLVs from the extended service ready event Change-Id: If947e179c1ca41466997cc48840a8d36b6236780 CRs-Fixed: 2441921
This commit is contained in:
parent
85de96c698
commit
ce928dcd67
9 changed files with 219 additions and 0 deletions
|
|
@ -1361,6 +1361,21 @@ QDF_STATUS wmi_extract_pdev_qvit_event(void *wmi_hdl,
|
|||
uint8_t *evt_buf,
|
||||
struct wmi_host_pdev_qvit_event *param);
|
||||
|
||||
#ifdef WLAN_SUPPORT_RF_CHARACTERIZATION
|
||||
/**
|
||||
* wmi_extract_rf_characterziation_entries - Extract RF characterization metrics
|
||||
* received through extended service ready event.
|
||||
* @wmi_hdl: WMI handle
|
||||
* @evt_buf: Event buffer
|
||||
* @rf_characterization_entries: Pointer to RF characterization metrics
|
||||
*
|
||||
* Return: QDF status of operation
|
||||
*/
|
||||
QDF_STATUS wmi_extract_rf_characterization_entries(wmi_unified_t wmi_hdl,
|
||||
uint8_t *evt_buf,
|
||||
struct wlan_psoc_host_rf_characterization_entry *rf_characterization_entries);
|
||||
#endif
|
||||
|
||||
QDF_STATUS wmi_extract_chainmask_tables(void *wmi_hdl, uint8_t *evt_buf,
|
||||
struct wlan_psoc_host_chainmask_table *chainmask_table);
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1738,6 +1738,12 @@ QDF_STATUS (*extract_reg_ch_avoid_event)(wmi_unified_t wmi_handle,
|
|||
struct ch_avoid_ind_type *ch_avoid_event,
|
||||
uint32_t len);
|
||||
|
||||
#ifdef WLAN_SUPPORT_RF_CHARACTERIZATION
|
||||
QDF_STATUS (*extract_rf_characterization_entries)(wmi_unified_t wmi_handle,
|
||||
uint8_t *evt_buf,
|
||||
struct wlan_psoc_host_rf_characterization_entry *rf_characterization_entries);
|
||||
#endif
|
||||
|
||||
QDF_STATUS (*extract_chainmask_tables)(wmi_unified_t wmi_handle,
|
||||
uint8_t *evt_buf,
|
||||
struct wlan_psoc_host_chainmask_table *chainmask_table);
|
||||
|
|
|
|||
|
|
@ -4237,6 +4237,19 @@ wmi_unified_dfs_phyerr_offload_dis_cmd(void *wmi_hdl,
|
|||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
#ifdef WLAN_SUPPORT_RF_CHARACTERIZATION
|
||||
QDF_STATUS wmi_extract_rf_characterization_entries(wmi_unified_t wmi_hdl,
|
||||
uint8_t *evt_buf,
|
||||
struct wlan_psoc_host_rf_characterization_entry *rf_characterization_entries)
|
||||
{
|
||||
if (wmi_hdl->ops->extract_rf_characterization_entries)
|
||||
return wmi_hdl->ops->extract_rf_characterization_entries(wmi_hdl,
|
||||
evt_buf, rf_characterization_entries);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wmi_extract_chainmask_tables_tlv() - extract chain mask tables
|
||||
* @wmi_handle: wmi handle
|
||||
|
|
|
|||
|
|
@ -9312,6 +9312,48 @@ static QDF_STATUS extract_pdev_utf_event_tlv(wmi_unified_t wmi_handle,
|
|||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef WLAN_SUPPORT_RF_CHARACTERIZATION
|
||||
static QDF_STATUS extract_rf_characterization_entries_tlv(wmi_unified_t wmi_handle,
|
||||
uint8_t *event,
|
||||
struct wlan_psoc_host_rf_characterization_entry *rf_characterization_entries)
|
||||
{
|
||||
WMI_SERVICE_READY_EXT_EVENTID_param_tlvs *param_buf;
|
||||
WMI_CHAN_RF_CHARACTERIZATION_INFO *wmi_rf_characterization_entry;
|
||||
uint8_t ix;
|
||||
|
||||
param_buf = (WMI_SERVICE_READY_EXT_EVENTID_param_tlvs *)event;
|
||||
if (!param_buf)
|
||||
return QDF_STATUS_E_INVAL;
|
||||
|
||||
wmi_rf_characterization_entry =
|
||||
param_buf->wmi_chan_rf_characterization_info;
|
||||
if (!wmi_rf_characterization_entry)
|
||||
return QDF_STATUS_E_INVAL;
|
||||
|
||||
for (ix = 0; ix < param_buf->num_wmi_chan_rf_characterization_info; ix++) {
|
||||
rf_characterization_entries[ix].freq =
|
||||
WMI_CHAN_RF_CHARACTERIZATION_FREQ_GET(
|
||||
&wmi_rf_characterization_entry[ix]);
|
||||
|
||||
rf_characterization_entries[ix].bw =
|
||||
WMI_CHAN_RF_CHARACTERIZATION_BW_GET(
|
||||
&wmi_rf_characterization_entry[ix]);
|
||||
|
||||
rf_characterization_entries[ix].chan_metric =
|
||||
WMI_CHAN_RF_CHARACTERIZATION_CHAN_METRIC_GET(
|
||||
&wmi_rf_characterization_entry[ix]);
|
||||
|
||||
wmi_nofl_debug("rf_characterization_entries[%u]: freq: %u, "
|
||||
"bw: %u, chan_metric: %u",
|
||||
ix, rf_characterization_entries[ix].freq,
|
||||
rf_characterization_entries[ix].bw,
|
||||
rf_characterization_entries[ix].chan_metric);
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* extract_chainmask_tables_tlv() - extract chain mask tables from event
|
||||
* @wmi_handle: wmi handle
|
||||
|
|
@ -9417,6 +9459,22 @@ static QDF_STATUS extract_chainmask_tables_tlv(wmi_unified_t wmi_handle,
|
|||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef WLAN_SUPPORT_RF_CHARACTERIZATION
|
||||
static void populate_num_rf_characterization_entries(
|
||||
struct wlan_psoc_host_service_ext_param *param,
|
||||
WMI_SERVICE_READY_EXT_EVENTID_param_tlvs *param_buf)
|
||||
{
|
||||
param->num_rf_characterization_entries =
|
||||
param_buf->num_wmi_chan_rf_characterization_info;
|
||||
}
|
||||
#else
|
||||
static void populate_num_rf_characterization_entries(
|
||||
struct wlan_psoc_host_service_ext_param *param,
|
||||
WMI_SERVICE_READY_EXT_EVENTID_param_tlvs *param_buf)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* extract_service_ready_ext_tlv() - extract basic extended service ready params
|
||||
* from event
|
||||
|
|
@ -9455,6 +9513,7 @@ static QDF_STATUS extract_service_ready_ext_tlv(wmi_unified_t wmi_handle,
|
|||
param->num_dbr_ring_caps = param_buf->num_dma_ring_caps;
|
||||
param->num_bin_scaling_params = param_buf->num_wmi_bin_scaling_params;
|
||||
param->max_bssid_indicator = ev->max_bssid_indicator;
|
||||
populate_num_rf_characterization_entries(param, param_buf);
|
||||
qdf_mem_copy(¶m->ppet, &ev->ppet, sizeof(param->ppet));
|
||||
|
||||
hw_caps = param_buf->soc_hw_mode_caps;
|
||||
|
|
@ -11825,6 +11884,10 @@ struct wmi_ops tlv_ops = {
|
|||
.send_dfs_phyerr_offload_dis_cmd = send_dfs_phyerr_offload_dis_cmd_tlv,
|
||||
.extract_reg_chan_list_update_event =
|
||||
extract_reg_chan_list_update_event_tlv,
|
||||
#ifdef WLAN_SUPPORT_RF_CHARACTERIZATION
|
||||
.extract_rf_characterization_entries =
|
||||
extract_rf_characterization_entries_tlv,
|
||||
#endif
|
||||
.extract_chainmask_tables =
|
||||
extract_chainmask_tables_tlv,
|
||||
.extract_thermal_stats = extract_thermal_stats_tlv,
|
||||
|
|
|
|||
Loading…
Reference in a new issue