qcacmn: Share Spectral HW gen as part of capability exchange

Spectral scan period is not in terms of tclk periods for
generation 3 Spectral HW. It is directly in micro seconds.
Default value is 224 us. Driver needs to use 224 us as
default value. Application needs to display the unit as
tclk period till generation II and micro second for
generation III. For this driver will be sharing the
Spectral HW generation info to application as part of
the capability exchange.

CRs-Fixed: 2225740
Change-Id: Iaeda8ebb77c2a39824b5f919e8578ff4d56c1aa5
This commit is contained in:
Edayilliam Jayadev 2018-04-11 13:24:00 +05:30 • committed by nshrivas
commit df3100c157
3 changed files with 29 additions and 7 deletions

View file

@ -214,7 +214,12 @@ target_if_spectral_info_init_defaults(struct target_if_spectral *spectral)
/* Parameters */
info->osps_cache.osc_params.ss_count = SPECTRAL_SCAN_COUNT_DEFAULT;
info->osps_cache.osc_params.ss_period = SPECTRAL_SCAN_PERIOD_DEFAULT;
if (spectral->spectral_gen == SPECTRAL_GEN3)
info->osps_cache.osc_params.ss_period =
SPECTRAL_SCAN_PERIOD_GEN_III_DEFAULT;
else
info->osps_cache.osc_params.ss_period =
SPECTRAL_SCAN_PERIOD_GEN_II_DEFAULT;
info->osps_cache.osc_params.ss_spectral_pri =
SPECTRAL_SCAN_PRIORITY_DEFAULT;
@ -1332,6 +1337,7 @@ target_if_init_spectral_capability(struct target_if_spectral *spectral)
pcap->radar_cap = 1;
pcap->spectral_cap = 1;
pcap->advncd_spectral_cap = 1;
pcap->hw_gen = spectral->spectral_gen;
}
#ifdef QCA_SUPPORT_SPECTRAL_SIMULATION
@ -1797,7 +1803,10 @@ target_if_spectral_init_param_defaults(struct target_if_spectral *spectral)
struct spectral_config *params = &spectral->params;
params->ss_count = SPECTRAL_SCAN_COUNT_DEFAULT;
params->ss_period = SPECTRAL_SCAN_PERIOD_DEFAULT;
if (spectral->spectral_gen == SPECTRAL_GEN3)
params->ss_period = SPECTRAL_SCAN_PERIOD_GEN_III_DEFAULT;
else
params->ss_period = SPECTRAL_SCAN_PERIOD_GEN_II_DEFAULT;
params->ss_spectral_pri = SPECTRAL_SCAN_PRIORITY_DEFAULT;
params->ss_fft_size = SPECTRAL_SCAN_FFT_SIZE_DEFAULT;
params->ss_gc_ena = SPECTRAL_SCAN_GC_ENA_DEFAULT;
@ -1983,8 +1992,6 @@ target_if_pdev_spectral_init(struct wlan_objmgr_pdev *pdev)
qdf_spinlock_create(&spectral->noise_pwr_reports_lock);
target_if_spectral_clear_stats(spectral);
/* Set the default values for spectral parameters */
target_if_spectral_init_param_defaults(spectral);
#ifdef CONFIG_WIN
if (target_type == TARGET_TYPE_QCA8074) {
spectral->fftbin_size_war = 1;
@ -2012,6 +2019,10 @@ target_if_pdev_spectral_init(struct wlan_objmgr_pdev *pdev)
spectral->tlvhdr_size = sizeof(struct spectral_phyerr_tlv_gen2);
}
/* Set the default values for spectral parameters */
target_if_spectral_init_param_defaults(spectral);
/* Init spectral capability */
target_if_init_spectral_capability(spectral);
if (target_if_spectral_attach_simulation(spectral) < 0)
return NULL;