qcacmn: Add start scan response WMI event
Add support for processing the start scan response WMI event. FW provides the necessary information to segregate FFT bins to pri80, 5 MHz and sec80 in 160/165 MHz. Also, cfreq2 and the channel width is provided to FW via WMI command. CRs-Fixed: 2672081 Change-Id: I666b6c18a63d5d01117aa9cbd611691c6f8b2793
此提交包含在:
@@ -483,6 +483,8 @@ spectral_ctx_deinit(struct spectral_context *sc)
|
||||
sc->sptrlc_ucfg_phyerr_config = NULL;
|
||||
sc->sptrlc_pdev_spectral_init = NULL;
|
||||
sc->sptrlc_pdev_spectral_deinit = NULL;
|
||||
sc->sptrlc_psoc_spectral_init = NULL;
|
||||
sc->sptrlc_psoc_spectral_deinit = NULL;
|
||||
sc->sptrlc_set_spectral_config = NULL;
|
||||
sc->sptrlc_get_spectral_config = NULL;
|
||||
sc->sptrlc_start_spectral_scan = NULL;
|
||||
|
@@ -93,16 +93,21 @@ struct pdev_spectral {
|
||||
uint32_t spectral_pid;
|
||||
};
|
||||
|
||||
struct wmi_spectral_cmd_ops;
|
||||
struct spectral_wmi_ops;
|
||||
struct spectral_tgt_ops;
|
||||
|
||||
/**
|
||||
* struct spectral_context - spectral global context
|
||||
* @psoc_obj: Reference to psoc global object
|
||||
* @psoc_target_handle: Reference to psoc target_if object
|
||||
* @spectral_legacy_cbacks: Spectral legacy callbacks
|
||||
*
|
||||
* Call back functions to invoke independent of OL/DA
|
||||
* @sptrlc_ucfg_phyerr_config: ucfg handler for phyerr
|
||||
* @sptrlc_pdev_spectral_init: Init spectral
|
||||
* @sptrlc_pdev_spectral_deinit: Deinit spectral
|
||||
* @sptrlc_pdev_spectral_init: Init pdev Spectral
|
||||
* @sptrlc_pdev_spectral_deinit: Deinit pdev Spectral
|
||||
* @sptrlc_psoc_spectral_init: Spectral psoc init
|
||||
* @sptrlc_psoc_spectral_deinit: Spectral psoc deinit
|
||||
* @sptrlc_set_spectral_config: Set spectral configurations
|
||||
* @sptrlc_get_spectral_config: Get spectral configurations
|
||||
* @sptrlc_start_spectral_scan: Start spectral scan
|
||||
@@ -113,7 +118,8 @@ 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
|
||||
* @sptrlc_register_spectral_wmi_ops: Register Spectral WMI operations
|
||||
* @ptrlc_register_spectral_tgt_ops: Register Spectral target operations
|
||||
* @sptrlc_register_netlink_cb: Register Netlink callbacks
|
||||
* @sptrlc_use_nl_bcast: Check whether to use Netlink broadcast/unicast
|
||||
* @sptrlc_deregister_netlink_cb: De-register Netlink callbacks
|
||||
@@ -122,6 +128,7 @@ struct wmi_spectral_cmd_ops;
|
||||
*/
|
||||
struct spectral_context {
|
||||
struct wlan_objmgr_psoc *psoc_obj;
|
||||
void *psoc_target_handle;
|
||||
struct spectral_legacy_cbacks legacy_cbacks;
|
||||
QDF_STATUS (*sptrlc_spectral_control)
|
||||
(struct wlan_objmgr_pdev *pdev,
|
||||
@@ -130,6 +137,8 @@ struct spectral_context {
|
||||
void *ad);
|
||||
void * (*sptrlc_pdev_spectral_init)(struct wlan_objmgr_pdev *pdev);
|
||||
void (*sptrlc_pdev_spectral_deinit)(struct wlan_objmgr_pdev *pdev);
|
||||
void * (*sptrlc_psoc_spectral_init)(struct wlan_objmgr_psoc *psoc);
|
||||
void (*sptrlc_psoc_spectral_deinit)(struct wlan_objmgr_psoc *psoc);
|
||||
QDF_STATUS (*sptrlc_set_spectral_config)
|
||||
(struct wlan_objmgr_pdev *pdev,
|
||||
const struct spectral_cp_param *param,
|
||||
@@ -159,9 +168,12 @@ struct spectral_context {
|
||||
QDF_STATUS (*sptrlc_get_spectral_diagstats)
|
||||
(struct wlan_objmgr_pdev *pdev,
|
||||
struct spectral_diag_stats *stats);
|
||||
void (*sptrlc_register_wmi_spectral_cmd_ops)(
|
||||
struct wlan_objmgr_pdev *pdev,
|
||||
struct wmi_spectral_cmd_ops *cmd_ops);
|
||||
QDF_STATUS (*sptrlc_register_spectral_wmi_ops)(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
struct spectral_wmi_ops *wmi_ops);
|
||||
QDF_STATUS (*sptrlc_register_spectral_tgt_ops)(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
struct spectral_tgt_ops *tgt_ops);
|
||||
void (*sptrlc_register_netlink_cb)(
|
||||
struct wlan_objmgr_pdev *pdev,
|
||||
struct spectral_nl_cb *nl_cb);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011,2017-2019 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2011,2017-2020 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
@@ -26,6 +26,14 @@
|
||||
|
||||
MODULE_LICENSE("Dual BSD/GPL");
|
||||
|
||||
struct dispatcher_spectral_ops sops = {
|
||||
.spectral_pdev_open_handler = spectral_pdev_open,
|
||||
.spectral_psoc_open_handler = wlan_spectral_psoc_open,
|
||||
.spectral_psoc_close_handler = wlan_spectral_psoc_close,
|
||||
.spectral_psoc_enable_handler = wlan_spectral_psoc_enable,
|
||||
.spectral_psoc_disable_handler = wlan_spectral_psoc_disable,
|
||||
};
|
||||
|
||||
/**
|
||||
* spectral_init_module() - Initialize Spectral module
|
||||
*
|
||||
@@ -43,9 +51,7 @@ int spectral_init_module(void)
|
||||
/* register spectral rxops */
|
||||
wlan_lmac_if_sptrl_set_rx_ops_register_cb
|
||||
(wlan_lmac_if_sptrl_register_rx_ops);
|
||||
/* register spectral pdev open handler */
|
||||
dispatcher_register_spectral_pdev_open_handler(
|
||||
spectral_pdev_open);
|
||||
dispatcher_register_spectral_ops_handler(&sops);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
@@ -48,6 +48,8 @@ spectral_ctx_init_ol(struct spectral_context *sc)
|
||||
sc->sptrlc_spectral_control = tgt_spectral_control;
|
||||
sc->sptrlc_pdev_spectral_init = tgt_pdev_spectral_init;
|
||||
sc->sptrlc_pdev_spectral_deinit = tgt_pdev_spectral_deinit;
|
||||
sc->sptrlc_psoc_spectral_init = tgt_psoc_spectral_init;
|
||||
sc->sptrlc_psoc_spectral_deinit = tgt_psoc_spectral_deinit;
|
||||
sc->sptrlc_set_spectral_config = tgt_set_spectral_config;
|
||||
sc->sptrlc_get_spectral_config = tgt_get_spectral_config;
|
||||
sc->sptrlc_start_spectral_scan = tgt_start_spectral_scan;
|
||||
@@ -58,8 +60,8 @@ spectral_ctx_init_ol(struct spectral_context *sc)
|
||||
sc->sptrlc_get_debug_level = tgt_get_debug_level;
|
||||
sc->sptrlc_get_spectral_capinfo = tgt_get_spectral_capinfo;
|
||||
sc->sptrlc_get_spectral_diagstats = tgt_get_spectral_diagstats;
|
||||
sc->sptrlc_register_wmi_spectral_cmd_ops =
|
||||
tgt_register_wmi_spectral_cmd_ops;
|
||||
sc->sptrlc_register_spectral_wmi_ops = tgt_register_spectral_wmi_ops;
|
||||
sc->sptrlc_register_spectral_tgt_ops = tgt_register_spectral_tgt_ops;
|
||||
sc->sptrlc_register_netlink_cb = tgt_spectral_register_nl_cb;
|
||||
sc->sptrlc_use_nl_bcast = tgt_spectral_use_nl_bcast;
|
||||
sc->sptrlc_deregister_netlink_cb = tgt_spectral_deregister_nl_cb;
|
||||
|
@@ -25,15 +25,26 @@
|
||||
#include "../../core/spectral_cmn_api_i.h"
|
||||
|
||||
/**
|
||||
* tgt_get_target_handle() - Get target_if handle
|
||||
* tgt_get_pdev_target_handle() - Get pdev target_if handle
|
||||
* @pdev: Pointer to pdev
|
||||
*
|
||||
* Get handle to target_if internal Spectral data
|
||||
* Get handle to pdev target_if internal Spectral data
|
||||
*
|
||||
* Return: Handle to target_if internal Spectral data on success, NULL on
|
||||
* Return: Handle to pdev target_if internal Spectral data on success, NULL on
|
||||
* failure
|
||||
*/
|
||||
void *tgt_get_target_handle(struct wlan_objmgr_pdev *pdev);
|
||||
void *tgt_get_pdev_target_handle(struct wlan_objmgr_pdev *pdev);
|
||||
|
||||
/**
|
||||
* tgt_get_psoc_target_handle() - Get psoc target_if handle
|
||||
* @psoc: Pointer to psoc
|
||||
*
|
||||
* Get handle to psoc target_if internal Spectral data
|
||||
*
|
||||
* Return: Handle to psoc target_if internal Spectral data on success, NULL on
|
||||
* failure
|
||||
*/
|
||||
void *tgt_get_psoc_target_handle(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* tgt_spectral_control()- handler for demultiplexing requests from higher layer
|
||||
@@ -65,6 +76,23 @@ void *tgt_pdev_spectral_init(struct wlan_objmgr_pdev *pdev);
|
||||
*/
|
||||
void tgt_pdev_spectral_deinit(struct wlan_objmgr_pdev *pdev);
|
||||
|
||||
/**
|
||||
* tgt_psoc_spectral_init() - implementation for spectral init
|
||||
* @psoc: Pointer to psoc
|
||||
*
|
||||
* Return: On success, pointer to Spectral psoc target_if internal private data,
|
||||
* on failure, NULL
|
||||
*/
|
||||
void *tgt_psoc_spectral_init(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* tgt_psoc_spectral_deinit() - implementation for spectral de-init
|
||||
* @psoc: Pointer to psoc
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void tgt_psoc_spectral_deinit(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* tgt_set_spectral_config() - Set spectral config
|
||||
* @pdev: Pointer to pdev object
|
||||
@@ -195,17 +223,30 @@ QDF_STATUS tgt_get_spectral_diagstats(struct wlan_objmgr_pdev *pdev,
|
||||
struct spectral_diag_stats *stats);
|
||||
|
||||
/**
|
||||
* tgt_register_wmi_spectral_cmd_ops() - Register wmi_spectral_cmd_ops
|
||||
* @cmd_ops: Pointer to the structure having wmi_spectral_cmd function pointers
|
||||
* @pdev: Pointer to pdev object
|
||||
* tgt_register_spectral_wmi_ops() - Register Spectral WMI operations
|
||||
* @psoc: Pointer to psoc bject
|
||||
* @wmi_ops: Pointer to the structure having Spectral WMI operations
|
||||
*
|
||||
* Implementation to register wmi_spectral_cmd_ops in spectral
|
||||
* Implementation to register Spectral WMI operations in spectral
|
||||
* internal data structure
|
||||
*
|
||||
* Return: void
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
void tgt_register_wmi_spectral_cmd_ops(struct wlan_objmgr_pdev *pdev,
|
||||
struct wmi_spectral_cmd_ops *cmd_ops);
|
||||
QDF_STATUS tgt_register_spectral_wmi_ops(struct wlan_objmgr_psoc *psoc,
|
||||
struct spectral_wmi_ops *wmi_ops);
|
||||
|
||||
/**
|
||||
* tgt_register_spectral_tgt_ops() - Register Spectral target operations
|
||||
* @psoc: Pointer to psoc bject
|
||||
* @tgt_ops: Pointer to the structure having Spectral target operations
|
||||
*
|
||||
* Implementation to register Spectral target operations in spectral
|
||||
* internal data structure
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS tgt_register_spectral_tgt_ops(struct wlan_objmgr_psoc *psoc,
|
||||
struct spectral_tgt_ops *tgt_ops);
|
||||
|
||||
/**
|
||||
* tgt_spectral_register_nl_cb() - Register Netlink callbacks
|
||||
@@ -283,4 +324,22 @@ tgt_spectral_get_target_type(struct wlan_objmgr_psoc *psoc);
|
||||
QDF_STATUS tgt_set_spectral_dma_debug(struct wlan_objmgr_pdev *pdev,
|
||||
enum spectral_dma_debug dma_debug_type,
|
||||
bool dma_debug_enable);
|
||||
|
||||
/**
|
||||
* tgt_spectral_register_events() - Register Spectral WMI event handlers
|
||||
* @psoc: Pointer to psoc object
|
||||
*
|
||||
* Return: QDF_STATUS of operation
|
||||
*/
|
||||
QDF_STATUS
|
||||
tgt_spectral_register_events(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* tgt_spectral_unregister_events() - Unregister Spectral WMI event handlers
|
||||
* @psoc: Pointer to psoc object
|
||||
*
|
||||
* Return: QDF_STATUS of operation
|
||||
*/
|
||||
QDF_STATUS
|
||||
tgt_spectral_unregister_events(struct wlan_objmgr_psoc *psoc);
|
||||
#endif /* _WLAN_SPECTRAL_TGT_API_H_ */
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
@@ -25,7 +25,8 @@
|
||||
|
||||
/* Forward declaration */
|
||||
struct direct_buf_rx_data;
|
||||
struct wmi_spectral_cmd_ops;
|
||||
struct spectral_wmi_ops;
|
||||
struct spectral_tgt_ops;
|
||||
|
||||
/**
|
||||
* wlan_spectral_is_feature_disabled() - Check if spectral feature is disabled
|
||||
@@ -71,19 +72,32 @@ void
|
||||
wlan_lmac_if_sptrl_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops);
|
||||
|
||||
/**
|
||||
* wlan_register_wmi_spectral_cmd_ops() - Register operations related to wmi
|
||||
* commands on spectral parameters
|
||||
* @pdev - the physical device object
|
||||
* @cmd_ops - pointer to the structure holding the operations
|
||||
* related to wmi commands on spectral parameters
|
||||
*
|
||||
* API to register operations related to wmi commands on spectral parameters
|
||||
*
|
||||
* Return: None
|
||||
* wlan_register_spectral_wmi_ops() - Register Spectral WMI operations
|
||||
* @psoc - Pointer to psoc object
|
||||
* @wmi_ops - pointer to the structure holding the Spectral WMI
|
||||
* operations
|
||||
*
|
||||
* API to register Spectral WMI operations
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
void
|
||||
wlan_register_wmi_spectral_cmd_ops(struct wlan_objmgr_pdev *pdev,
|
||||
struct wmi_spectral_cmd_ops *cmd_ops);
|
||||
QDF_STATUS
|
||||
wlan_register_spectral_wmi_ops(struct wlan_objmgr_psoc *psoc,
|
||||
struct spectral_wmi_ops *wmi_ops);
|
||||
|
||||
/**
|
||||
* wlan_register_spectral_tgt_ops() - Register Spectral target operations
|
||||
* @psoc - Pointer to psoc object
|
||||
* @tgt_ops - pointer to the structure holding the Spectral target
|
||||
* operations
|
||||
*
|
||||
* API to register Spectral target operations
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
wlan_register_spectral_tgt_ops(struct wlan_objmgr_psoc *psoc,
|
||||
struct spectral_tgt_ops *tgt_ops);
|
||||
|
||||
/**
|
||||
* struct spectral_legacy_cbacks - Spectral legacy callbacks
|
||||
@@ -164,6 +178,50 @@ spectral_vdev_get_ch_width(struct wlan_objmgr_vdev *vdev);
|
||||
*/
|
||||
QDF_STATUS spectral_pdev_open(struct wlan_objmgr_pdev *pdev);
|
||||
|
||||
/**
|
||||
* wlan_spectral_psoc_open() - Spectral psoc open handler
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* API to execute operations on psoc open
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS upon successful registration,
|
||||
* QDF_STATUS_E_FAILURE upon failure
|
||||
*/
|
||||
QDF_STATUS wlan_spectral_psoc_open(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* wlan_spectral_psoc_close() - Spectral psoc close handler
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* API to execute operations on psoc close
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS upon successful registration,
|
||||
* QDF_STATUS_E_FAILURE upon failure
|
||||
*/
|
||||
QDF_STATUS wlan_spectral_psoc_close(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* wlan_spectral_psoc_enable() - Spectral psoc enable handler
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* API to execute operations on psoc enable
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS upon successful registration,
|
||||
* QDF_STATUS_E_FAILURE upon failure
|
||||
*/
|
||||
QDF_STATUS wlan_spectral_psoc_enable(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* wlan_spectral_psoc_disable() - Spectral psoc disable handler
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* API to execute operations on psoc disable
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS upon successful registration,
|
||||
* QDF_STATUS_E_FAILURE upon failure
|
||||
*/
|
||||
QDF_STATUS wlan_spectral_psoc_disable(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* spectral_register_dbr() - register Spectral event handler with DDMA
|
||||
* @pdev: pointer to pdev object
|
||||
|
@@ -29,7 +29,7 @@
|
||||
#endif
|
||||
|
||||
void *
|
||||
tgt_get_target_handle(struct wlan_objmgr_pdev *pdev)
|
||||
tgt_get_pdev_target_handle(struct wlan_objmgr_pdev *pdev)
|
||||
{
|
||||
struct pdev_spectral *ps;
|
||||
|
||||
@@ -46,6 +46,26 @@ tgt_get_target_handle(struct wlan_objmgr_pdev *pdev)
|
||||
return ps->psptrl_target_handle;
|
||||
}
|
||||
|
||||
void *
|
||||
tgt_get_psoc_target_handle(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct spectral_context *sc;
|
||||
|
||||
if (!psoc) {
|
||||
spectral_err("psoc is NULL!");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
||||
WLAN_UMAC_COMP_SPECTRAL);
|
||||
if (!sc) {
|
||||
spectral_err("psoc Spectral object is NULL!");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return sc->psoc_target_handle;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
tgt_spectral_control(
|
||||
struct wlan_objmgr_pdev *pdev,
|
||||
@@ -84,6 +104,29 @@ tgt_pdev_spectral_deinit(struct wlan_objmgr_pdev *pdev)
|
||||
psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_pdev_spectral_deinit(pdev);
|
||||
}
|
||||
|
||||
void *
|
||||
tgt_psoc_spectral_init(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
if (!psoc) {
|
||||
spectral_err("psoc is null");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_psoc_spectral_init(
|
||||
psoc);
|
||||
}
|
||||
|
||||
void
|
||||
tgt_psoc_spectral_deinit(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
if (!psoc) {
|
||||
spectral_err("psoc is null");
|
||||
return;
|
||||
}
|
||||
|
||||
psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_psoc_spectral_deinit(psoc);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
tgt_set_spectral_config(struct wlan_objmgr_pdev *pdev,
|
||||
const struct spectral_cp_param *param,
|
||||
@@ -199,20 +242,47 @@ tgt_get_spectral_diagstats(struct wlan_objmgr_pdev *pdev,
|
||||
pdev, stats);
|
||||
}
|
||||
|
||||
void
|
||||
tgt_register_wmi_spectral_cmd_ops(
|
||||
struct wlan_objmgr_pdev *pdev,
|
||||
struct wmi_spectral_cmd_ops *cmd_ops)
|
||||
QDF_STATUS
|
||||
tgt_register_spectral_wmi_ops(struct wlan_objmgr_psoc *psoc,
|
||||
struct spectral_wmi_ops *wmi_ops)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc = NULL;
|
||||
struct wlan_lmac_if_sptrl_tx_ops *psptrl_tx_ops = NULL;
|
||||
|
||||
psoc = wlan_pdev_get_psoc(pdev);
|
||||
if (!psoc) {
|
||||
spectral_err("psoc is null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (!wmi_ops) {
|
||||
spectral_err("WMI operations table is null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psptrl_tx_ops = &psoc->soc_cb.tx_ops.sptrl_tx_ops;
|
||||
|
||||
return psptrl_tx_ops->sptrlto_register_wmi_spectral_cmd_ops(pdev,
|
||||
cmd_ops);
|
||||
return psptrl_tx_ops->sptrlto_register_spectral_wmi_ops(psoc, wmi_ops);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
tgt_register_spectral_tgt_ops(struct wlan_objmgr_psoc *psoc,
|
||||
struct spectral_tgt_ops *tgt_ops)
|
||||
{
|
||||
struct wlan_lmac_if_sptrl_tx_ops *psptrl_tx_ops;
|
||||
|
||||
if (!psoc) {
|
||||
spectral_err("psoc is null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (!tgt_ops) {
|
||||
spectral_err("Target operations table is null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psptrl_tx_ops = &psoc->soc_cb.tx_ops.sptrl_tx_ops;
|
||||
|
||||
return psptrl_tx_ops->sptrlto_register_spectral_tgt_ops(psoc,
|
||||
tgt_ops);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -393,3 +463,34 @@ QDF_STATUS tgt_set_spectral_dma_debug(struct wlan_objmgr_pdev *pdev,
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
QDF_STATUS
|
||||
tgt_spectral_register_events(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_lmac_if_sptrl_tx_ops *psptrl_tx_ops;
|
||||
|
||||
if (!psoc) {
|
||||
spectral_err("psoc is null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psptrl_tx_ops = &psoc->soc_cb.tx_ops.sptrl_tx_ops;
|
||||
|
||||
return psptrl_tx_ops->sptrlto_register_events(psoc);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
tgt_spectral_unregister_events(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_lmac_if_sptrl_tx_ops *psptrl_tx_ops;
|
||||
|
||||
if (!psoc) {
|
||||
spectral_err("psoc is null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psptrl_tx_ops = &psoc->soc_cb.tx_ops.sptrl_tx_ops;
|
||||
|
||||
return psptrl_tx_ops->sptrlto_unregister_events(psoc);
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
@@ -193,7 +193,10 @@ wlan_lmac_if_sptrl_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
|
||||
struct wlan_lmac_if_sptrl_rx_ops *sptrl_rx_ops = &rx_ops->sptrl_rx_ops;
|
||||
|
||||
/* Spectral rx ops */
|
||||
sptrl_rx_ops->sptrlro_get_target_handle = tgt_get_target_handle;
|
||||
sptrl_rx_ops->sptrlro_get_pdev_target_handle =
|
||||
tgt_get_pdev_target_handle;
|
||||
sptrl_rx_ops->sptrlro_get_psoc_target_handle =
|
||||
tgt_get_psoc_target_handle;
|
||||
sptrl_rx_ops->sptrlro_vdev_get_chan_freq = spectral_vdev_get_chan_freq;
|
||||
sptrl_rx_ops->sptrlro_vdev_get_chan_freq_seg2 =
|
||||
spectral_vdev_get_chan_freq_seg2;
|
||||
@@ -204,26 +207,122 @@ wlan_lmac_if_sptrl_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
|
||||
wlan_spectral_is_feature_disabled;
|
||||
}
|
||||
|
||||
void
|
||||
wlan_register_wmi_spectral_cmd_ops(struct wlan_objmgr_pdev *pdev,
|
||||
struct wmi_spectral_cmd_ops *cmd_ops)
|
||||
QDF_STATUS
|
||||
wlan_register_spectral_wmi_ops(struct wlan_objmgr_psoc *psoc,
|
||||
struct spectral_wmi_ops *wmi_ops)
|
||||
{
|
||||
struct spectral_context *sc;
|
||||
|
||||
if (!pdev) {
|
||||
spectral_err("PDEV is NULL!");
|
||||
return;
|
||||
if (!psoc) {
|
||||
spectral_err("psoc is NULL!");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
sc = spectral_get_spectral_ctx_from_pdev(pdev);
|
||||
sc = spectral_get_spectral_ctx_from_psoc(psoc);
|
||||
if (!sc) {
|
||||
spectral_err("spectral context is NULL!");
|
||||
return;
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return sc->sptrlc_register_wmi_spectral_cmd_ops(pdev, cmd_ops);
|
||||
return sc->sptrlc_register_spectral_wmi_ops(psoc, wmi_ops);
|
||||
}
|
||||
|
||||
qdf_export_symbol(wlan_register_spectral_wmi_ops);
|
||||
|
||||
QDF_STATUS
|
||||
wlan_register_spectral_tgt_ops(struct wlan_objmgr_psoc *psoc,
|
||||
struct spectral_tgt_ops *tgt_ops)
|
||||
{
|
||||
struct spectral_context *sc;
|
||||
|
||||
if (!psoc) {
|
||||
spectral_err("psoc is NULL!");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
sc = spectral_get_spectral_ctx_from_psoc(psoc);
|
||||
if (!sc) {
|
||||
spectral_err("spectral context is NULL!");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return sc->sptrlc_register_spectral_tgt_ops(psoc, tgt_ops);
|
||||
}
|
||||
|
||||
qdf_export_symbol(wlan_register_spectral_tgt_ops);
|
||||
|
||||
/**
|
||||
* wlan_spectral_psoc_target_attach() - Spectral psoc target attach
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* API to initialize Spectral psoc target object
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS upon successful registration,
|
||||
* QDF_STATUS_E_FAILURE upon failure
|
||||
*/
|
||||
static QDF_STATUS
|
||||
wlan_spectral_psoc_target_attach(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct spectral_context *sc = NULL;
|
||||
|
||||
if (!psoc) {
|
||||
spectral_err("psoc is null");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
sc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
||||
WLAN_UMAC_COMP_SPECTRAL);
|
||||
if (!sc) {
|
||||
spectral_err("Spectral context is null");
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
if (sc->sptrlc_psoc_spectral_init) {
|
||||
void *target_handle;
|
||||
|
||||
target_handle = sc->sptrlc_psoc_spectral_init(psoc);
|
||||
if (!target_handle) {
|
||||
spectral_err("Spectral psoc lmac object is NULL!");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
sc->psoc_target_handle = target_handle;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_spectral_psoc_target_detach() - Spectral psoc target detach
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* API to destroy Spectral psoc target object
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS upon successful registration,
|
||||
* QDF_STATUS_E_FAILURE upon failure
|
||||
*/
|
||||
static QDF_STATUS
|
||||
wlan_spectral_psoc_target_detach(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct spectral_context *sc = NULL;
|
||||
|
||||
if (!psoc) {
|
||||
spectral_err("psoc is null");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
sc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
||||
WLAN_UMAC_COMP_SPECTRAL);
|
||||
if (!sc) {
|
||||
spectral_err("Spectral context is null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (sc->sptrlc_psoc_spectral_deinit)
|
||||
sc->sptrlc_psoc_spectral_deinit(psoc);
|
||||
sc->psoc_target_handle = NULL;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
qdf_export_symbol(wlan_register_wmi_spectral_cmd_ops);
|
||||
|
||||
#ifdef DIRECT_BUF_RX_ENABLE
|
||||
bool spectral_dbr_event_handler(struct wlan_objmgr_pdev *pdev,
|
||||
@@ -283,3 +382,63 @@ QDF_STATUS spectral_unregister_dbr(struct wlan_objmgr_pdev *pdev)
|
||||
}
|
||||
|
||||
qdf_export_symbol(spectral_unregister_dbr);
|
||||
|
||||
QDF_STATUS wlan_spectral_psoc_open(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
if (!psoc) {
|
||||
spectral_err("psoc is null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (wlan_spectral_is_feature_disabled(psoc)) {
|
||||
spectral_info("Spectral is disabled");
|
||||
return QDF_STATUS_COMP_DISABLED;
|
||||
}
|
||||
|
||||
return wlan_spectral_psoc_target_attach(psoc);
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_spectral_psoc_close(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
if (!psoc) {
|
||||
spectral_err("psoc is null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (wlan_spectral_is_feature_disabled(psoc)) {
|
||||
spectral_info("Spectral is disabled");
|
||||
return QDF_STATUS_COMP_DISABLED;
|
||||
}
|
||||
|
||||
return wlan_spectral_psoc_target_detach(psoc);
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_spectral_psoc_enable(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
if (!psoc) {
|
||||
spectral_err("psoc is null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (wlan_spectral_is_feature_disabled(psoc)) {
|
||||
spectral_info("Spectral is disabled");
|
||||
return QDF_STATUS_COMP_DISABLED;
|
||||
}
|
||||
|
||||
return tgt_spectral_register_events(psoc);
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_spectral_psoc_disable(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
if (!psoc) {
|
||||
spectral_err("psoc is null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (wlan_spectral_is_feature_disabled(psoc)) {
|
||||
spectral_info("Spectral is disabled");
|
||||
return QDF_STATUS_COMP_DISABLED;
|
||||
}
|
||||
|
||||
return tgt_spectral_unregister_events(psoc);
|
||||
}
|
||||
|
新增問題並參考
封鎖使用者