qcacmn: Fix the coding convention issues in Spectral core

Current Spectral core functionality is not following coding
convention rules in some places.

Change-Id: I2109e510351d254652cbab16f09e52ec463abebb
CRs-Fixed: 2151550
This commit is contained in:
Shiva Krishna Pittala
2018-01-25 18:51:58 +05:30
committed by snandini
부모 57a7ff2f9b
커밋 f57c0b6262
8개의 변경된 파일829개의 추가작업 그리고 542개의 파일을 삭제

파일 보기

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -23,7 +23,7 @@
#include "spectral_defs_i.h"
/**
* wlan_spectral_psoc_obj_create_handler(): handler for psoc object create
* wlan_spectral_psoc_obj_create_handler() - handler for psoc object create
* @psoc: reference to global psoc object
* @arg: reference to argument provided during registration of handler
*
@@ -38,7 +38,7 @@ QDF_STATUS wlan_spectral_psoc_obj_create_handler(struct wlan_objmgr_psoc *psoc,
void *arg);
/**
* wlan_spectral_psoc_obj_destroy_handler(): handler for psoc object delete
* wlan_spectral_psoc_obj_destroy_handler() - handler for psoc object delete
* @psoc: reference to global psoc object
* @arg: reference to argument provided during registration of handler
*
@@ -53,7 +53,7 @@ QDF_STATUS wlan_spectral_psoc_obj_destroy_handler(struct wlan_objmgr_psoc *psoc,
void *arg);
/**
* wlan_spectral_pdev_obj_create_handler(): handler for pdev object create
* wlan_spectral_pdev_obj_create_handler() - handler for pdev object create
* @pdev: reference to global pdev object
* @arg: reference to argument provided during registration of handler
*
@@ -68,7 +68,7 @@ QDF_STATUS wlan_spectral_pdev_obj_create_handler(struct wlan_objmgr_pdev *pdev,
void *arg);
/**
* wlan_spectral_pdev_obj_destroy_handler(): handler for pdev object delete
* wlan_spectral_pdev_obj_destroy_handler() - handler for pdev object delete
* @pdev: reference to global pdev object
* @arg: reference to argument provided during registration of handler
*
@@ -83,7 +83,7 @@ QDF_STATUS wlan_spectral_pdev_obj_destroy_handler(struct wlan_objmgr_pdev *pdev,
void *arg);
/**
* spectral_control_cmn(): common handler for demultiplexing requests from
* spectral_control_cmn()- common handler for demultiplexing requests from
* higher layer
* @pdev: reference to global pdev object
* @id: spectral config command id
@@ -97,12 +97,10 @@ QDF_STATUS wlan_spectral_pdev_obj_destroy_handler(struct wlan_objmgr_pdev *pdev,
*
* Return: 0 success else failure
*/
int spectral_control_cmn(
struct wlan_objmgr_pdev *pdev,
int spectral_control_cmn(struct wlan_objmgr_pdev *pdev,
u_int id,
void *indata,
u_int32_t insize,
void *outdata, u_int32_t *outsize);
uint32_t insize, void *outdata, uint32_t *outsize);
/**
* spectral_control_ol(): Offload handler for demultiplexing requests from
@@ -121,7 +119,7 @@ int spectral_control_cmn(
*/
int spectral_control_ol(
struct wlan_objmgr_pdev *pdev, u_int id,
void *indata, u_int32_t insize, void *outdata, u_int32_t *outsize);
void *indata, uint32_t insize, void *outdata, uint32_t *outsize);
/**
* spectral_get_spectral_ctx_from_pdev() - API to get spectral context object
@@ -133,9 +131,8 @@ int spectral_control_ol(
*
* Return : Reference to spectral_context object
*/
static inline
struct spectral_context *spectral_get_spectral_ctx_from_pdev(
struct wlan_objmgr_pdev *pdev)
static inline struct spectral_context *
spectral_get_spectral_ctx_from_pdev(struct wlan_objmgr_pdev *pdev)
{
struct wlan_objmgr_psoc *psoc = NULL;
struct spectral_context *sc = NULL;
@@ -160,9 +157,8 @@ struct spectral_context *spectral_get_spectral_ctx_from_pdev(
*
* Return : Reference to spectral_context object
*/
static inline
struct spectral_context *spectral_get_spectral_ctx_from_psoc(
struct wlan_objmgr_psoc *psoc)
static inline struct spectral_context *
spectral_get_spectral_ctx_from_psoc(struct wlan_objmgr_psoc *psoc)
{
struct spectral_context *sc = NULL;
@@ -185,9 +181,8 @@ struct spectral_context *spectral_get_spectral_ctx_from_psoc(
*
* Return : Reference to spectral_context object
*/
static inline
struct spectral_context *spectral_get_spectral_ctx_from_vdev(
struct wlan_objmgr_vdev *vdev)
static inline struct spectral_context *
spectral_get_spectral_ctx_from_vdev(struct wlan_objmgr_vdev *vdev)
{
struct wlan_objmgr_psoc *psoc = NULL;
struct spectral_context *sc = NULL;
@@ -202,4 +197,3 @@ struct spectral_context *spectral_get_spectral_ctx_from_vdev(
return sc;
}
#endif /* _SPECTRAL_CMN_API_I_H_ */

파일 보기

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011,2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2011,2017-2018 The Linux Foundation. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -68,7 +68,17 @@ spectral_get_vdev(struct wlan_objmgr_pdev *pdev)
}
#ifndef CONFIG_MCL
static void spectral_register_cfg80211_handlers(struct wlan_objmgr_pdev *pdev)
/**
* spectral_register_cfg80211_handlers() - Register spectral cfg80211 handlers
* @pdev: Pointer to pdev
*
* Register spectral cfg80211 handlers
* Handlers can be different for WIN and MCL
*
* Return: None
*/
static void
spectral_register_cfg80211_handlers(struct wlan_objmgr_pdev *pdev)
{
wlan_cfg80211_register_spectral_cmd_handler(
pdev,
@@ -96,17 +106,17 @@ static void spectral_register_cfg80211_handlers(struct wlan_objmgr_pdev *pdev)
wlan_cfg80211_spectral_scan_get_status);
}
#else
static void spectral_register_cfg80211_handlers(struct wlan_objmgr_pdev *pdev)
static void
spectral_register_cfg80211_handlers(struct wlan_objmgr_pdev *pdev)
{
}
#endif
int spectral_control_cmn(
struct wlan_objmgr_pdev *pdev,
int
spectral_control_cmn(struct wlan_objmgr_pdev *pdev,
u_int id,
void *indata,
u_int32_t insize,
void *outdata, u_int32_t *outsize)
uint32_t insize, void *outdata, uint32_t *outsize)
{
int error = 0;
int temp_debug;
@@ -115,7 +125,7 @@ int spectral_control_cmn(
struct spectral_config *spectralparams;
struct spectral_context *sc;
struct wlan_objmgr_vdev *vdev = NULL;
u_int8_t vdev_rxchainmask = 0;
uint8_t vdev_rxchainmask = 0;
if (!pdev) {
spectral_err("PDEV is NULL!\n");
@@ -132,21 +142,24 @@ int spectral_control_cmn(
switch (id) {
case SPECTRAL_SET_CONFIG:
{
if (insize < sizeof(struct spectral_config) || !indata) {
if (insize < sizeof(struct spectral_config) ||
!indata) {
error = -EINVAL;
break;
}
sp_in = (struct spectral_config *)indata;
if (sp_in->ss_count != SPECTRAL_PHYERR_PARAM_NOVAL) {
if (!sc->sptrlc_set_spectral_config(
if (sp_in->ss_count !=
SPECTRAL_PHYERR_PARAM_NOVAL) {
if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_SCAN_COUNT,
sp_in->ss_count))
error = -EINVAL;
}
if (sp_in->ss_fft_period != SPECTRAL_PHYERR_PARAM_NOVAL) {
if (!sc->sptrlc_set_spectral_config(
if (sp_in->ss_fft_period !=
SPECTRAL_PHYERR_PARAM_NOVAL) {
if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_FFT_PERIOD,
sp_in->ss_fft_period))
@@ -154,31 +167,34 @@ int spectral_control_cmn(
}
if (sp_in->ss_period != SPECTRAL_PHYERR_PARAM_NOVAL) {
if (!sc->sptrlc_set_spectral_config(
if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_SCAN_PERIOD,
sp_in->ss_period))
error = -EINVAL;
}
if (sp_in->ss_short_report != SPECTRAL_PHYERR_PARAM_NOVAL) {
if (!sc->sptrlc_set_spectral_config(
if (sp_in->ss_short_report !=
SPECTRAL_PHYERR_PARAM_NOVAL) {
if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_SHORT_REPORT,
(u_int32_t)(sp_in->ss_short_report ? 1 : 0)))
(uint32_t)
(sp_in->ss_short_report ? 1 : 0)))
error = -EINVAL;
}
if (sp_in->ss_spectral_pri != SPECTRAL_PHYERR_PARAM_NOVAL) {
if (!sc->sptrlc_set_spectral_config(
if (sp_in->ss_spectral_pri !=
SPECTRAL_PHYERR_PARAM_NOVAL) {
if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_SPECT_PRI,
(u_int32_t)(sp_in->ss_spectral_pri)))
(uint32_t)(sp_in->ss_spectral_pri)))
error = -EINVAL;
}
if (sp_in->ss_fft_size != SPECTRAL_PHYERR_PARAM_NOVAL) {
if (!sc->sptrlc_set_spectral_config(
if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_FFT_SIZE,
sp_in->ss_fft_size))
@@ -186,63 +202,70 @@ int spectral_control_cmn(
}
if (sp_in->ss_gc_ena != SPECTRAL_PHYERR_PARAM_NOVAL) {
if (!sc->sptrlc_set_spectral_config(
if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_GC_ENA,
sp_in->ss_gc_ena))
error = -EINVAL;
}
if (sp_in->ss_restart_ena != SPECTRAL_PHYERR_PARAM_NOVAL) {
if (!sc->sptrlc_set_spectral_config(
if (sp_in->ss_restart_ena !=
SPECTRAL_PHYERR_PARAM_NOVAL) {
if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_RESTART_ENA,
sp_in->ss_restart_ena))
error = -EINVAL;
}
if (sp_in->ss_noise_floor_ref != SPECTRAL_PHYERR_PARAM_NOVAL) {
if (!sc->sptrlc_set_spectral_config(
if (sp_in->ss_noise_floor_ref !=
SPECTRAL_PHYERR_PARAM_NOVAL) {
if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_NOISE_FLOOR_REF,
sp_in->ss_noise_floor_ref))
error = -EINVAL;
}
if (sp_in->ss_init_delay != SPECTRAL_PHYERR_PARAM_NOVAL) {
if (!sc->sptrlc_set_spectral_config(
if (sp_in->ss_init_delay !=
SPECTRAL_PHYERR_PARAM_NOVAL) {
if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_INIT_DELAY,
sp_in->ss_init_delay))
error = -EINVAL;
}
if (sp_in->ss_nb_tone_thr != SPECTRAL_PHYERR_PARAM_NOVAL) {
if (!sc->sptrlc_set_spectral_config(
if (sp_in->ss_nb_tone_thr !=
SPECTRAL_PHYERR_PARAM_NOVAL) {
if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_NB_TONE_THR,
sp_in->ss_nb_tone_thr))
error = -EINVAL;
}
if (sp_in->ss_str_bin_thr != SPECTRAL_PHYERR_PARAM_NOVAL) {
if (!sc->sptrlc_set_spectral_config(
if (sp_in->ss_str_bin_thr !=
SPECTRAL_PHYERR_PARAM_NOVAL) {
if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_STR_BIN_THR,
sp_in->ss_str_bin_thr))
error = -EINVAL;
}
if (sp_in->ss_wb_rpt_mode != SPECTRAL_PHYERR_PARAM_NOVAL) {
if (!sc->sptrlc_set_spectral_config(
if (sp_in->ss_wb_rpt_mode !=
SPECTRAL_PHYERR_PARAM_NOVAL) {
if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_WB_RPT_MODE,
sp_in->ss_wb_rpt_mode))
error = -EINVAL;
}
if (sp_in->ss_rssi_rpt_mode != SPECTRAL_PHYERR_PARAM_NOVAL) {
if (!sc->sptrlc_set_spectral_config(
if (sp_in->ss_rssi_rpt_mode !=
SPECTRAL_PHYERR_PARAM_NOVAL) {
if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_RSSI_RPT_MODE,
sp_in->ss_rssi_rpt_mode))
@@ -250,15 +273,16 @@ int spectral_control_cmn(
}
if (sp_in->ss_rssi_thr != SPECTRAL_PHYERR_PARAM_NOVAL) {
if (!sc->sptrlc_set_spectral_config(
if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_RSSI_THR,
sp_in->ss_rssi_thr))
error = -EINVAL;
}
if (sp_in->ss_pwr_format != SPECTRAL_PHYERR_PARAM_NOVAL) {
if (!sc->sptrlc_set_spectral_config(
if (sp_in->ss_pwr_format !=
SPECTRAL_PHYERR_PARAM_NOVAL) {
if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_PWR_FORMAT,
sp_in->ss_pwr_format))
@@ -266,15 +290,16 @@ int spectral_control_cmn(
}
if (sp_in->ss_rpt_mode != SPECTRAL_PHYERR_PARAM_NOVAL) {
if (!sc->sptrlc_set_spectral_config(
if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_RPT_MODE,
sp_in->ss_rpt_mode))
error = -EINVAL;
}
if (sp_in->ss_bin_scale != SPECTRAL_PHYERR_PARAM_NOVAL) {
if (!sc->sptrlc_set_spectral_config(
if (sp_in->ss_bin_scale !=
SPECTRAL_PHYERR_PARAM_NOVAL) {
if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_BIN_SCALE,
sp_in->ss_bin_scale))
@@ -282,7 +307,7 @@ int spectral_control_cmn(
}
if (sp_in->ss_dbm_adj != SPECTRAL_PHYERR_PARAM_NOVAL) {
if (!sc->sptrlc_set_spectral_config(
if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_DBM_ADJ,
sp_in->ss_dbm_adj))
@@ -290,9 +315,9 @@ int spectral_control_cmn(
}
if (sp_in->ss_chn_mask != SPECTRAL_PHYERR_PARAM_NOVAL) {
/* Check if any of the inactive Rx antenna chains is
* set active in
* spectral chainmask
/*
* Check if any of the inactive Rx antenna
* chains is set active in spectral chainmask
*/
vdev = spectral_get_vdev(pdev);
if (!vdev) {
@@ -300,17 +325,22 @@ int spectral_control_cmn(
break;
}
vdev_rxchainmask = wlan_vdev_mlme_get_rxchainmask(vdev);
wlan_objmgr_vdev_release_ref(vdev, WLAN_SPECTRAL_ID);
vdev_rxchainmask =
wlan_vdev_mlme_get_rxchainmask(vdev);
wlan_objmgr_vdev_release_ref(vdev,
WLAN_SPECTRAL_ID);
if (!(sp_in->ss_chn_mask & vdev_rxchainmask)) {
qdf_print("Invalid Spectral Chainmask - "
qdf_print
("Invalid Spectral Chainmask - "
"Inactive Rx antenna chain cannot "
"be an active spectral chain\n");
error = -EINVAL;
break;
} else if (!sc->sptrlc_set_spectral_config(pdev,
SPECTRAL_PARAM_CHN_MASK, sp_in->ss_chn_mask)) {
} else if (sc->sptrlc_set_spectral_config(
pdev,
SPECTRAL_PARAM_CHN_MASK,
sp_in->ss_chn_mask)) {
error = -EINVAL;
}
}
@@ -319,8 +349,8 @@ int spectral_control_cmn(
case SPECTRAL_GET_CONFIG:
{
if (!outdata || !outsize || (*outsize < sizeof(
struct spectral_config))) {
if (!outdata || !outsize ||
(*outsize < sizeof(struct spectral_config))) {
error = -EINVAL;
break;
}
@@ -330,17 +360,21 @@ int spectral_control_cmn(
spectralparams->ss_fft_period = sp_out.ss_fft_period;
spectralparams->ss_period = sp_out.ss_period;
spectralparams->ss_count = sp_out.ss_count;
spectralparams->ss_short_report = sp_out.ss_short_report;
spectralparams->ss_spectral_pri = sp_out.ss_spectral_pri;
spectralparams->ss_short_report =
sp_out.ss_short_report;
spectralparams->ss_spectral_pri =
sp_out.ss_spectral_pri;
spectralparams->ss_fft_size = sp_out.ss_fft_size;
spectralparams->ss_gc_ena = sp_out.ss_gc_ena;
spectralparams->ss_restart_ena = sp_out.ss_restart_ena;
spectralparams->ss_noise_floor_ref = sp_out.ss_noise_floor_ref;
spectralparams->ss_noise_floor_ref =
sp_out.ss_noise_floor_ref;
spectralparams->ss_init_delay = sp_out.ss_init_delay;
spectralparams->ss_nb_tone_thr = sp_out.ss_nb_tone_thr;
spectralparams->ss_str_bin_thr = sp_out.ss_str_bin_thr;
spectralparams->ss_wb_rpt_mode = sp_out.ss_wb_rpt_mode;
spectralparams->ss_rssi_rpt_mode = sp_out.ss_rssi_rpt_mode;
spectralparams->ss_rssi_rpt_mode =
sp_out.ss_rssi_rpt_mode;
spectralparams->ss_rssi_thr = sp_out.ss_rssi_thr;
spectralparams->ss_pwr_format = sp_out.ss_pwr_format;
spectralparams->ss_rpt_mode = sp_out.ss_rpt_mode;
@@ -352,48 +386,51 @@ int spectral_control_cmn(
case SPECTRAL_IS_ACTIVE:
{
if (!outdata || !outsize || *outsize < sizeof(u_int32_t)) {
if (!outdata || !outsize ||
*outsize < sizeof(uint32_t)) {
error = -EINVAL;
break;
}
*outsize = sizeof(u_int32_t);
*((u_int32_t *)outdata) =
(u_int32_t)sc->sptrlc_is_spectral_active(pdev);
*outsize = sizeof(uint32_t);
*((uint32_t *)outdata) =
(uint32_t)sc->sptrlc_is_spectral_active(pdev);
}
break;
case SPECTRAL_IS_ENABLED:
{
if (!outdata || !outsize || *outsize < sizeof(u_int32_t)) {
if (!outdata || !outsize ||
*outsize < sizeof(uint32_t)) {
error = -EINVAL;
break;
}
*outsize = sizeof(u_int32_t);
*((u_int32_t *)outdata) =
(u_int32_t)sc->sptrlc_is_spectral_enabled(pdev);
*outsize = sizeof(uint32_t);
*((uint32_t *)outdata) =
(uint32_t)sc->sptrlc_is_spectral_enabled(pdev);
}
break;
case SPECTRAL_SET_DEBUG_LEVEL:
{
if (insize < sizeof(u_int32_t) || !indata) {
if (insize < sizeof(uint32_t) || !indata) {
error = -EINVAL;
break;
}
temp_debug = *(u_int32_t *)indata;
temp_debug = *(uint32_t *)indata;
sc->sptrlc_set_debug_level(pdev, temp_debug);
}
break;
case SPECTRAL_GET_DEBUG_LEVEL:
{
if (!outdata || !outsize || *outsize < sizeof(u_int32_t)) {
if (!outdata || !outsize ||
*outsize < sizeof(uint32_t)) {
error = -EINVAL;
break;
}
*outsize = sizeof(u_int32_t);
*((u_int32_t *)outdata) =
(u_int32_t)sc->sptrlc_get_debug_level(pdev);
*outsize = sizeof(uint32_t);
*((uint32_t *)outdata) =
(uint32_t)sc->sptrlc_get_debug_level(pdev);
}
break;
@@ -435,7 +472,7 @@ case SPECTRAL_GET_DEBUG_LEVEL:
case SPECTRAL_GET_CHAN_WIDTH:
{
u_int32_t chan_width;
uint32_t chan_width;
vdev = spectral_get_vdev(pdev);
if (!vdev)
@@ -450,7 +487,7 @@ case SPECTRAL_GET_DEBUG_LEVEL:
break;
}
*outsize = sizeof(chan_width);
*((u_int32_t *)outdata) = (u_int32_t)chan_width;
*((uint32_t *)outdata) = (uint32_t)chan_width;
}
break;
@@ -463,7 +500,14 @@ bad:
return error;
}
static void spectral_ctx_deinit(struct spectral_context *sc)
/**
* spectral_ctx_deinit() - De-initialize function pointers from spectral context
* @sc - Reference to spectral_context object
*
* Return: None
*/
static void
spectral_ctx_deinit(struct spectral_context *sc)
{
if (sc) {
sc->sptrlc_ucfg_phyerr_config = NULL;
@@ -491,8 +535,8 @@ wlan_spectral_psoc_obj_create_handler(struct wlan_objmgr_psoc *psoc, void *arg)
spectral_err("PSOC is NULL\n");
return QDF_STATUS_E_FAILURE;
}
sc = (struct spectral_context *)qdf_mem_malloc(
sizeof(struct spectral_context));
sc = (struct spectral_context *)
qdf_mem_malloc(sizeof(struct spectral_context));
if (!sc) {
spectral_err("Failed to allocate spectral_ctx object\n");
return QDF_STATUS_E_NOMEM;
@@ -511,8 +555,8 @@ wlan_spectral_psoc_obj_create_handler(struct wlan_objmgr_psoc *psoc, void *arg)
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_spectral_psoc_obj_destroy_handler(
struct wlan_objmgr_psoc *psoc,
QDF_STATUS
wlan_spectral_psoc_obj_destroy_handler(struct wlan_objmgr_psoc *psoc,
void *arg)
{
struct spectral_context *sc = NULL;
@@ -521,12 +565,10 @@ QDF_STATUS wlan_spectral_psoc_obj_destroy_handler(
spectral_err("PSOC is NULL\n");
return QDF_STATUS_E_FAILURE;
}
sc = wlan_objmgr_psoc_get_comp_private_obj(
psoc,
sc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_SPECTRAL);
if (sc) {
wlan_objmgr_psoc_component_obj_detach(
psoc,
wlan_objmgr_psoc_component_obj_detach(psoc,
WLAN_UMAC_COMP_SPECTRAL,
(void *)sc);
/* Deinitilise function pointers from spectral context */
@@ -548,8 +590,8 @@ wlan_spectral_pdev_obj_create_handler(struct wlan_objmgr_pdev *pdev, void *arg)
spectral_err("PDEV is NULL\n");
return QDF_STATUS_E_FAILURE;
}
ps = (struct pdev_spectral *)qdf_mem_malloc(
sizeof(struct pdev_spectral));
ps = (struct pdev_spectral *)
qdf_mem_malloc(sizeof(struct pdev_spectral));
if (!ps) {
spectral_err("Failed to allocate pdev_spectral object\n");
return QDF_STATUS_E_NOMEM;
@@ -582,7 +624,8 @@ cleanup:
}
QDF_STATUS
wlan_spectral_pdev_obj_destroy_handler(struct wlan_objmgr_pdev *pdev, void *arg)
wlan_spectral_pdev_obj_destroy_handler(struct wlan_objmgr_pdev *pdev,
void *arg)
{
struct pdev_spectral *ps = NULL;
struct spectral_context *sc = NULL;
@@ -596,15 +639,13 @@ wlan_spectral_pdev_obj_destroy_handler(struct wlan_objmgr_pdev *pdev, void *arg)
spectral_err("Spectral context is NULL!\n");
return QDF_STATUS_E_FAILURE;
}
ps = wlan_objmgr_pdev_get_comp_private_obj(
pdev,
ps = wlan_objmgr_pdev_get_comp_private_obj(pdev,
WLAN_UMAC_COMP_SPECTRAL);
if (ps) {
if (sc->sptrlc_pdev_spectral_deinit)
sc->sptrlc_pdev_spectral_deinit(pdev);
ps->psptrl_target_handle = NULL;
wlan_objmgr_pdev_component_obj_detach(
pdev,
wlan_objmgr_pdev_component_obj_detach(pdev,
WLAN_UMAC_COMP_SPECTRAL,
(void *)ps);
qdf_mem_free(ps);
@@ -612,4 +653,3 @@ wlan_spectral_pdev_obj_destroy_handler(struct wlan_objmgr_pdev *pdev, void *arg)
return QDF_STATUS_SUCCESS;
}

파일 보기

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -23,11 +23,14 @@
#include "spectral_defs_i.h"
/**
* spectral_ctx_init_da() - Internal function to initialise spectral context
* spectral_ctx_init_da() - Internal function to initialize spectral context
* with direct attach specific functions
* @sc : spectral context
*
* Return : void
* Internal function to initialize spectral context with direct attach
* specific functions
*
* Return : None
*/
void spectral_ctx_init_da(struct spectral_context *sc);

파일 보기

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -67,9 +67,9 @@ struct pdev_spectral {
struct wmi_spectral_cmd_ops;
/**
* struct spectral_context : spectral global context
*
* struct spectral_context - spectral global context
* @psoc_obj: Reference to psoc global object
* @spectral_legacy_cbacks: Spectral legacy callbacks
*
* Call back functions to invoke independent of OL/DA
* @sptrlc_ucfg_phyerr_config: ucfg handler for phyerr
@@ -85,20 +85,22 @@ struct wmi_spectral_cmd_ops;
* @sptrlc_get_debug_level: Get debug level
* @sptrlc_get_spectral_capinfo: Get spectral capability info
* @sptrlc_get_spectral_diagstats: Get spectral diag status
* @sptrlc_register_wmi_spectral_cmd_ops: Register wmi_spectral_cmd operations
*/
struct spectral_context {
struct wlan_objmgr_psoc *psoc_obj;
struct spectral_legacy_cbacks legacy_cbacks;
int (*sptrlc_spectral_control)(struct wlan_objmgr_pdev *pdev, u_int id,
void *indata, u_int32_t insize,
void *outdata, u_int32_t *outsize);
int (*sptrlc_spectral_control)(struct wlan_objmgr_pdev *pdev,
u_int id, void *indata,
uint32_t insize, void *outdata,
uint32_t *outsize);
int (*sptrlc_ucfg_phyerr_config)(struct wlan_objmgr_pdev *pdev,
void *ad);
void * (*sptrlc_pdev_spectral_init)(struct wlan_objmgr_pdev *pdev);
void (*sptrlc_pdev_spectral_deinit)(struct wlan_objmgr_pdev *pdev);
int (*sptrlc_set_spectral_config)(
struct wlan_objmgr_pdev *pdev,
const u_int32_t threshtype, const u_int32_t value);
int (*sptrlc_set_spectral_config)(struct wlan_objmgr_pdev *pdev,
const uint32_t threshtype,
const uint32_t value);
void (*sptrlc_get_spectral_config)(
struct wlan_objmgr_pdev *pdev,
struct spectral_config *sptrl_config);
@@ -107,8 +109,8 @@ struct spectral_context {
bool (*sptrlc_is_spectral_active)(struct wlan_objmgr_pdev *pdev);
bool (*sptrlc_is_spectral_enabled)(struct wlan_objmgr_pdev *pdev);
int (*sptrlc_set_debug_level)(struct wlan_objmgr_pdev *pdev,
u_int32_t debug_level);
u_int32_t (*sptrlc_get_debug_level)(struct wlan_objmgr_pdev *pdev);
uint32_t debug_level);
uint32_t (*sptrlc_get_debug_level)(struct wlan_objmgr_pdev *pdev);
void (*sptrlc_get_spectral_capinfo)(struct wlan_objmgr_pdev *pdev,
void *outdata);
void (*sptrlc_get_spectral_diagstats)(struct wlan_objmgr_pdev *pdev,
@@ -119,4 +121,3 @@ struct spectral_context {
};
#endif /* _SPECTRAL_DEFS_I_H_ */

파일 보기

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011,2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2011,2017-2018 The Linux Foundation. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -19,8 +19,23 @@
#include "spectral_cmn_api_i.h"
int spectral_control_da(struct wlan_objmgr_pdev *pdev, u_int id, void *indata,
u_int32_t insize, void *outdata, u_int32_t *outsize)
/**
* spectral_control_da()- handler for demultiplexing requests from higher layer
* @pdev: reference to global pdev object
* @id: spectral config command id
* @indata: reference to input data
* @insize: input data size
* @outdata: reference to output data
* @outsize: output data size
*
* This function processes the spectral config command
* and appropriate handlers are invoked.
*
* Return: 0 success else failure
*/
int
spectral_control_da(struct wlan_objmgr_pdev *pdev, u_int id, void *indata,
uint32_t insize, void *outdata, uint32_t *outsize)
{
struct spectral_context *sc;
int error = 0;
@@ -34,32 +49,29 @@ int spectral_control_da(struct wlan_objmgr_pdev *pdev, u_int id, void *indata,
spectral_err("spectral context is NULL!\n");
return -EPERM;
}
switch (id) {
#if ATH_SUPPORT_RAW_ADC_CAPTURE
case SPECTRAL_ADC_ENABLE_TEST_ADDAC_MODE:
error = spectral_enter_raw_capture_mode(dev, indata);
break;
case SPECTRAL_ADC_DISABLE_TEST_ADDAC_MODE:
error = spectral_exit_raw_capture_mode(dev);
break;
case SPECTRAL_ADC_RETRIEVE_DATA:
error = spectral_retrieve_raw_capture(dev, outdata, outsize);
break;
#endif
default:
error = spectral_control_cmn(
pdev,
/*
* Note: Add handling for the cases SPECTRAL_ADC_ENABLE_TEST_ADDAC_MODE
* SPECTRAL_ADC_DISABLE_TEST_ADDAC_MODE and SPECTRAL_ADC_RETRIEVE_DATA,
* when raw ADC capture is needed.
* This is only applicable for direct attach chipsets.
*/
error = spectral_control_cmn(pdev,
id,
indata,
insize,
outdata,
outsize);
break;
}
indata, insize, outdata, outsize);
return error;
}
static void *pdev_spectral_init_da(struct wlan_objmgr_pdev *pdev)
/**
* pdev_spectral_init_da() - offload implementation for spectral init
* @pdev: Pointer to pdev
*
* Return: On success, pointer to Spectral target_if internal private data, on
* failure, NULL
*/
static void *
pdev_spectral_init_da(struct wlan_objmgr_pdev *pdev)
{
struct wlan_objmgr_psoc *psoc = NULL;
@@ -69,7 +81,14 @@ static void *pdev_spectral_init_da(struct wlan_objmgr_pdev *pdev)
pdev);
}
static void pdev_spectral_deinit_da(struct wlan_objmgr_pdev *pdev)
/**
* pdev_spectral_deinit_da() - offload implementation for spectral de-init
* @pdev: Pointer to pdev
*
* Return: None
*/
static void
pdev_spectral_deinit_da(struct wlan_objmgr_pdev *pdev)
{
struct wlan_objmgr_psoc *psoc = NULL;
@@ -78,32 +97,61 @@ static void pdev_spectral_deinit_da(struct wlan_objmgr_pdev *pdev)
psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_pdev_spectral_deinit(pdev);
}
static int set_spectral_config_da(
struct wlan_objmgr_pdev *pdev,
const u_int32_t threshtype, const u_int32_t value)
/**
* set_spectral_config_da() - Set spectral config
* @pdev: Pointer to pdev object
* @threshtype: spectral parameter type
* @value: value to be configured for the given spectral parameter
*
* DA implementation for setting spectral config
*
* Return: 0 on success else failure
*/
static int
set_spectral_config_da(struct wlan_objmgr_pdev *pdev,
const uint32_t threshtype, const uint32_t value)
{
struct wlan_objmgr_psoc *psoc = NULL;
psoc = wlan_pdev_get_psoc(pdev);
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_set_spectral_config(
pdev,
threshtype,
value);
pdev, threshtype, value);
}
static void get_spectral_config_da(struct wlan_objmgr_pdev *pdev,
/**
* get_spectral_config_da() - Get spectral configuration
* @pdev: Pointer to pdev object
* @param: Pointer to spectral_config structure in which the configuration
* should be returned
*
* DA implementation for getting the current spectral configuration
*
* Return: None
*/
static void
get_spectral_config_da(struct wlan_objmgr_pdev *pdev,
struct spectral_config *sptrl_config)
{
struct wlan_objmgr_psoc *psoc = NULL;
psoc = wlan_pdev_get_psoc(pdev);
psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_get_spectral_config(pdev,
psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_get_spectral_config(
pdev,
sptrl_config);
}
static int start_spectral_scan_da(struct wlan_objmgr_pdev *pdev)
/**
* start_spectral_scan_da() - Start spectral scan
* @pdev: Pointer to pdev object
*
* DA implementation for starting spectral scan
*
* Return: 0 in case of success, -1 on failure
*/
static int
start_spectral_scan_da(struct wlan_objmgr_pdev *pdev)
{
struct wlan_objmgr_psoc *psoc = NULL;
@@ -113,7 +161,16 @@ static int start_spectral_scan_da(struct wlan_objmgr_pdev *pdev)
pdev);
}
static void stop_spectral_scan_da(struct wlan_objmgr_pdev *pdev)
/**
* stop_spectral_scan_da() - Stop spectral scan
* @pdev: Pointer to pdev object
*
* DA implementation for stop spectral scan
*
* Return: None
*/
static void
stop_spectral_scan_da(struct wlan_objmgr_pdev *pdev)
{
struct wlan_objmgr_psoc *psoc = NULL;
@@ -122,7 +179,16 @@ static void stop_spectral_scan_da(struct wlan_objmgr_pdev *pdev)
psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_stop_spectral_scan(pdev);
}
static bool is_spectral_active_da(struct wlan_objmgr_pdev *pdev)
/**
* is_spectral_active_da() - Get whether Spectral is active
* @pdev: Pointer to pdev object
*
* DA implementation to get whether Spectral is active
*
* Return: True if Spectral is active, false if Spectral is not active
*/
static bool
is_spectral_active_da(struct wlan_objmgr_pdev *pdev)
{
struct wlan_objmgr_psoc *psoc = NULL;
@@ -132,7 +198,16 @@ static bool is_spectral_active_da(struct wlan_objmgr_pdev *pdev)
pdev);
}
static bool is_spectral_enabled_da(struct wlan_objmgr_pdev *pdev)
/**
* is_spectral_enabled_da() - Get whether Spectral is active
* @pdev: Pointer to pdev object
*
* DA implementation to get whether Spectral is active
*
* Return: True if Spectral is active, false if Spectral is not active
*/
static bool
is_spectral_enabled_da(struct wlan_objmgr_pdev *pdev)
{
struct wlan_objmgr_psoc *psoc = NULL;
@@ -142,18 +217,37 @@ static bool is_spectral_enabled_da(struct wlan_objmgr_pdev *pdev)
pdev);
}
static int set_debug_level_da(struct wlan_objmgr_pdev *pdev,
u_int32_t debug_level)
/**
* set_debug_level_da() - Set debug level for Spectral
* @pdev: Pointer to pdev object
* @debug_level: Debug level
*
* DA implementation to set the debug level for Spectral
*
* Return: 0 in case of success
*/
static int
set_debug_level_da(struct wlan_objmgr_pdev *pdev, uint32_t debug_level)
{
struct wlan_objmgr_psoc *psoc = NULL;
psoc = wlan_pdev_get_psoc(pdev);
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_set_debug_level(pdev,
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_set_debug_level(
pdev,
debug_level);
}
static u_int32_t get_debug_level_da(struct wlan_objmgr_pdev *pdev)
/**
* get_debug_level_da() - Get debug level for Spectral
* @pdev: Pointer to pdev object
*
* DA implementation to get the debug level for Spectral
*
* Return: Current debug level
*/
static uint32_t
get_debug_level_da(struct wlan_objmgr_pdev *pdev)
{
struct wlan_objmgr_psoc *psoc = NULL;
@@ -162,32 +256,58 @@ static u_int32_t get_debug_level_da(struct wlan_objmgr_pdev *pdev)
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_get_debug_level(pdev);
}
static void get_spectral_capinfo_da(struct wlan_objmgr_pdev *pdev,
void *outdata)
/**
* get_spectral_capinfo_da() - Get Spectral capability information
* @pdev: Pointer to pdev object
* @outdata: Buffer into which data should be copied
*
* DA implementation to get the spectral capability information
*
* Return: void
*/
static void
get_spectral_capinfo_da(struct wlan_objmgr_pdev *pdev, void *outdata)
{
struct wlan_objmgr_psoc *psoc = NULL;
psoc = wlan_pdev_get_psoc(pdev);
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_get_spectral_capinfo(
pdev,
outdata);
pdev, outdata);
}
static void get_spectral_diagstats_da(struct wlan_objmgr_pdev *pdev,
void *outdata)
/**
* get_spectral_diagstats_da() - Get Spectral diagnostic statistics
* @pdev: Pointer to pdev object
* @outdata: Buffer into which data should be copied
*
* DA implementation to get the spectral diagnostic statistics
*
* Return: void
*/
static void
get_spectral_diagstats_da(struct wlan_objmgr_pdev *pdev, void *outdata)
{
struct wlan_objmgr_psoc *psoc = NULL;
psoc = wlan_pdev_get_psoc(pdev);
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_get_spectral_diagstats(
pdev,
outdata);
pdev, outdata);
}
static void register_wmi_spectral_cmd_ops_da(
struct wlan_objmgr_pdev *pdev,
/**
* register_wmi_spectral_cmd_ops_da() - Register wmi_spectral_cmd_ops
* @cmd_ops: Pointer to the structure having wmi_spectral_cmd function pointers
* @pdev: Pointer to pdev object
*
* DA implementation to register wmi_spectral_cmd_ops in spectral
* internal data structure
*
* Return: void
*/
static void
register_wmi_spectral_cmd_ops_da(struct wlan_objmgr_pdev *pdev,
struct wmi_spectral_cmd_ops *cmd_ops)
{
struct wlan_objmgr_psoc *psoc = NULL;
@@ -197,13 +317,12 @@ static void register_wmi_spectral_cmd_ops_da(
psptrl_tx_ops = &psoc->soc_cb.tx_ops.sptrl_tx_ops;
return psptrl_tx_ops->sptrlto_register_wmi_spectral_cmd_ops(
pdev,
return psptrl_tx_ops->sptrlto_register_wmi_spectral_cmd_ops(pdev,
cmd_ops);
}
void spectral_ctx_init_da(struct spectral_context *sc)
void
spectral_ctx_init_da(struct spectral_context *sc)
{
if (!sc) {
spectral_err("spectral context is null!\n");
@@ -225,4 +344,3 @@ void spectral_ctx_init_da(struct spectral_context *sc)
sc->sptrlc_register_wmi_spectral_cmd_ops =
register_wmi_spectral_cmd_ops_da;
}

파일 보기

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011,2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2011,2017-2018 The Linux Foundation. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -35,8 +35,8 @@ spectral_init_module(void)
qdf_print("qca_spectral module loaded\n");
wlan_spectral_init();
/* register spectral rxops */
wlan_lmac_if_sptrl_set_rx_ops_register_cb(
wlan_lmac_if_sptrl_register_rx_ops);
wlan_lmac_if_sptrl_set_rx_ops_register_cb
(wlan_lmac_if_sptrl_register_rx_ops);
return 0;
}
@@ -54,4 +54,3 @@ spectral_exit_module(void)
module_init(spectral_init_module);
module_exit(spectral_exit_module);

파일 보기

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -20,12 +20,25 @@
#include "spectral_cmn_api_i.h"
#include "spectral_ol_api_i.h"
int spectral_control_ol(
struct wlan_objmgr_pdev *pdev,
/**
* spectral_control_ol()- handler for demultiplexing requests from higher layer
* @pdev: reference to global pdev object
* @id: spectral config command id
* @indata: reference to input data
* @insize: input data size
* @outdata: reference to output data
* @outsize: output data size
*
* This function processes the spectral config command
* and appropriate handlers are invoked.
*
* Return: 0 success else failure
*/
int
spectral_control_ol(struct wlan_objmgr_pdev *pdev,
u_int id,
void *indata,
u_int32_t insize,
void *outdata, u_int32_t *outsize)
uint32_t insize, void *outdata, uint32_t *outsize)
{
struct spectral_context *sc;
@@ -41,7 +54,15 @@ int spectral_control_ol(
return spectral_control_cmn(pdev, id, indata, insize, outdata, outsize);
}
static void *pdev_spectral_init_ol(struct wlan_objmgr_pdev *pdev)
/**
* pdev_spectral_init_ol() - offload implementation for spectral init
* @pdev: Pointer to pdev
*
* Return: On success, pointer to Spectral target_if internal private data, on
* failure, NULL
*/
static void *
pdev_spectral_init_ol(struct wlan_objmgr_pdev *pdev)
{
struct wlan_objmgr_psoc *psoc = NULL;
@@ -50,7 +71,14 @@ static void *pdev_spectral_init_ol(struct wlan_objmgr_pdev *pdev)
pdev);
}
static void pdev_spectral_deinit_ol(struct wlan_objmgr_pdev *pdev)
/**
* pdev_spectral_deinit_ol() - offload implementation for spectral de-init
* @pdev: Pointer to pdev
*
* Return: None
*/
static void
pdev_spectral_deinit_ol(struct wlan_objmgr_pdev *pdev)
{
struct wlan_objmgr_psoc *psoc = NULL;
@@ -58,29 +86,59 @@ static void pdev_spectral_deinit_ol(struct wlan_objmgr_pdev *pdev)
psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_pdev_spectral_deinit(pdev);
}
static int set_spectral_config_ol(
struct wlan_objmgr_pdev *pdev,
const u_int32_t threshtype, const u_int32_t value)
/**
* set_spectral_config_ol() - Set spectral config
* @pdev: Pointer to pdev object
* @threshtype: spectral parameter type
* @value: value to be configured for the given spectral parameter
*
* Offload implementation for setting spectral config
*
* Return: 0 on success else failure
*/
static int
set_spectral_config_ol(struct wlan_objmgr_pdev *pdev,
const uint32_t threshtype, const uint32_t value)
{
struct wlan_objmgr_psoc *psoc = NULL;
psoc = wlan_pdev_get_psoc(pdev);
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_set_spectral_config(
pdev,
threshtype, value);
pdev, threshtype, value);
}
static void get_spectral_config_ol(struct wlan_objmgr_pdev *pdev,
/**
* get_spectral_config_ol() - Get spectral configuration
* @pdev: Pointer to pdev object
* @param: Pointer to spectral_config structure in which the configuration
* should be returned
*
* Offload implementation for getting the current spectral configuration
*
* Return: None
*/
static void
get_spectral_config_ol(struct wlan_objmgr_pdev *pdev,
struct spectral_config *sptrl_config)
{
struct wlan_objmgr_psoc *psoc = NULL;
psoc = wlan_pdev_get_psoc(pdev);
psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_get_spectral_config(pdev,
psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_get_spectral_config(
pdev,
sptrl_config);
}
static int start_spectral_scan_ol(struct wlan_objmgr_pdev *pdev)
/**
* start_spectral_scan_ol() - Start spectral scan
* @pdev: Pointer to pdev object
*
* Offload implementation for starting spectral scan
*
* Return: 0 in case of success, -1 on failure
*/
static int
start_spectral_scan_ol(struct wlan_objmgr_pdev *pdev)
{
struct wlan_objmgr_psoc *psoc = NULL;
@@ -89,7 +147,16 @@ static int start_spectral_scan_ol(struct wlan_objmgr_pdev *pdev)
pdev);
}
static void stop_spectral_scan_ol(struct wlan_objmgr_pdev *pdev)
/**
* stop_spectral_scan_ol() - Stop spectral scan
* @pdev: Pointer to pdev object
*
* Offload implementation for stop spectral scan
*
* Return: None
*/
static void
stop_spectral_scan_ol(struct wlan_objmgr_pdev *pdev)
{
struct wlan_objmgr_psoc *psoc = NULL;
@@ -97,7 +164,16 @@ static void stop_spectral_scan_ol(struct wlan_objmgr_pdev *pdev)
psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_stop_spectral_scan(pdev);
}
static bool is_spectral_active_ol(struct wlan_objmgr_pdev *pdev)
/**
* is_spectral_active_ol() - Get whether Spectral is active
* @pdev: Pointer to pdev object
*
* Offload implementation to get whether Spectral is active
*
* Return: True if Spectral is active, false if Spectral is not active
*/
static bool
is_spectral_active_ol(struct wlan_objmgr_pdev *pdev)
{
struct wlan_objmgr_psoc *psoc = NULL;
@@ -106,7 +182,16 @@ static bool is_spectral_active_ol(struct wlan_objmgr_pdev *pdev)
pdev);
}
static bool is_spectral_enabled_ol(struct wlan_objmgr_pdev *pdev)
/**
* is_spectral_enabled_ol() - Get whether Spectral is active
* @pdev: Pointer to pdev object
*
* Offload implementation to get whether Spectral is active
*
* Return: True if Spectral is active, false if Spectral is not active
*/
static bool
is_spectral_enabled_ol(struct wlan_objmgr_pdev *pdev)
{
struct wlan_objmgr_psoc *psoc = NULL;
@@ -115,17 +200,36 @@ static bool is_spectral_enabled_ol(struct wlan_objmgr_pdev *pdev)
pdev);
}
static int set_debug_level_ol(struct wlan_objmgr_pdev *pdev,
u_int32_t debug_level)
/**
* set_debug_level_ol() - Set debug level for Spectral
* @pdev: Pointer to pdev object
* @debug_level: Debug level
*
* Offload implementation to set the debug level for Spectral
*
* Return: 0 in case of success
*/
static int
set_debug_level_ol(struct wlan_objmgr_pdev *pdev, uint32_t debug_level)
{
struct wlan_objmgr_psoc *psoc = NULL;
psoc = wlan_pdev_get_psoc(pdev);
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_set_debug_level(pdev,
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_set_debug_level(
pdev,
debug_level);
}
static u_int32_t get_debug_level_ol(struct wlan_objmgr_pdev *pdev)
/**
* get_debug_level_ol() - Get debug level for Spectral
* @pdev: Pointer to pdev object
*
* Offload implementation to get the debug level for Spectral
*
* Return: Current debug level
*/
static uint32_t
get_debug_level_ol(struct wlan_objmgr_pdev *pdev)
{
struct wlan_objmgr_psoc *psoc = NULL;
@@ -133,30 +237,56 @@ static u_int32_t get_debug_level_ol(struct wlan_objmgr_pdev *pdev)
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_get_debug_level(pdev);
}
static void get_spectral_capinfo_ol(struct wlan_objmgr_pdev *pdev,
void *outdata)
/**
* get_spectral_capinfo_ol() - Get Spectral capability information
* @pdev: Pointer to pdev object
* @outdata: Buffer into which data should be copied
*
* Offload implementation to get the spectral capability information
*
* Return: void
*/
static void
get_spectral_capinfo_ol(struct wlan_objmgr_pdev *pdev, void *outdata)
{
struct wlan_objmgr_psoc *psoc = NULL;
psoc = wlan_pdev_get_psoc(pdev);
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_get_spectral_capinfo(
pdev,
outdata);
pdev, outdata);
}
static void get_spectral_diagstats_ol(struct wlan_objmgr_pdev *pdev,
void *outdata)
/**
* get_spectral_diagstats_ol() - Get Spectral diagnostic statistics
* @pdev: Pointer to pdev object
* @outdata: Buffer into which data should be copied
*
* Offload implementation to get the spectral diagnostic statistics
*
* Return: void
*/
static void
get_spectral_diagstats_ol(struct wlan_objmgr_pdev *pdev, void *outdata)
{
struct wlan_objmgr_psoc *psoc = NULL;
psoc = wlan_pdev_get_psoc(pdev);
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_get_spectral_diagstats(
pdev,
outdata);
pdev, outdata);
}
static void register_wmi_spectral_cmd_ops_ol(
struct wlan_objmgr_pdev *pdev,
/**
* register_wmi_spectral_cmd_ops_ol() - Register wmi_spectral_cmd_ops
* @cmd_ops: Pointer to the structure having wmi_spectral_cmd function pointers
* @pdev: Pointer to pdev object
*
* Offload implementation to register wmi_spectral_cmd_ops in spectral
* internal data structure
*
* Return: void
*/
static void
register_wmi_spectral_cmd_ops_ol(struct wlan_objmgr_pdev *pdev,
struct wmi_spectral_cmd_ops *cmd_ops)
{
struct wlan_objmgr_psoc *psoc = NULL;
@@ -166,12 +296,12 @@ static void register_wmi_spectral_cmd_ops_ol(
psptrl_tx_ops = &psoc->soc_cb.tx_ops.sptrl_tx_ops;
return psptrl_tx_ops->sptrlto_register_wmi_spectral_cmd_ops(
pdev,
return psptrl_tx_ops->sptrlto_register_wmi_spectral_cmd_ops(pdev,
cmd_ops);
}
void spectral_ctx_init_ol(struct spectral_context *sc)
void
spectral_ctx_init_ol(struct spectral_context *sc)
{
if (!sc) {
spectral_err("spectral context is null!\n");
@@ -193,4 +323,3 @@ void spectral_ctx_init_ol(struct spectral_context *sc)
sc->sptrlc_register_wmi_spectral_cmd_ops =
register_wmi_spectral_cmd_ops_ol;
}

파일 보기

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -23,11 +23,14 @@
#include "spectral_defs_i.h"
/**
* spectral_ctx_init_ol() - Internal function to initialise spectral context
* spectral_ctx_init_ol() - Internal function to initialize spectral context
* with offload specific functions
* @sc : spectral context
*
* Return : void
* Internal function to initialize spectral context with offload specific
* functions
*
* Return : None
*/
void spectral_ctx_init_ol(struct spectral_context *sc);