mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 05:29:04 -04:00
qcacmn: Add api to get dfs offload service bit in target_if
Add api to get dfs offload service bit in target_if. Change-Id: I771ae8a2194250769d6e6d609b0a1863012110ea CRs-Fixed: 2264477
This commit is contained in:
parent
a173a184ae
commit
ecef5a4024
9 changed files with 24 additions and 133 deletions
|
|
@ -195,9 +195,14 @@ static QDF_STATUS target_if_reg_phyerr_events_dfs2(
|
|||
}
|
||||
#endif
|
||||
|
||||
static bool target_if_dfs_offload(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return wmi_service_enabled(get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_service_dfs_phyerr_offload);
|
||||
}
|
||||
|
||||
static QDF_STATUS target_if_dfs_register_event_handler(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
bool dfs_offload)
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct target_psoc_info *tgt_psoc_info;
|
||||
|
||||
|
|
@ -206,7 +211,7 @@ static QDF_STATUS target_if_dfs_register_event_handler(
|
|||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!dfs_offload) {
|
||||
if (!target_if_dfs_offload(psoc)) {
|
||||
tgt_psoc_info = wlan_psoc_get_tgt_if_handle(psoc);
|
||||
if (!tgt_psoc_info) {
|
||||
target_if_err("null tgt_psoc_info");
|
||||
|
|
@ -359,6 +364,7 @@ QDF_STATUS target_if_register_dfs_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
|
|||
dfs_tx_ops->dfs_get_caps = &target_if_dfs_get_caps;
|
||||
dfs_tx_ops->dfs_send_avg_radar_params_to_fw =
|
||||
&target_if_dfs_send_avg_params_to_fw;
|
||||
dfs_tx_ops->dfs_is_tgt_offload = &target_if_dfs_offload;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,41 +25,6 @@
|
|||
#ifndef _INIT_DEINIT_LMAC_H_
|
||||
#define _INIT_DEINIT_LMAC_H_
|
||||
|
||||
/**
|
||||
* lmac_get_service_param() - get service param
|
||||
* @psoc: pointer to psoc
|
||||
*
|
||||
* API to get service parameters
|
||||
*
|
||||
* Return: service parameter array pointer
|
||||
*/
|
||||
uint32_t *lmac_get_service_param(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* lmac_is_service_param_bit_enabled() - check service param bit enabled
|
||||
* @service_param: Service bitmap array
|
||||
* @bit_idx: Service bit index to be checked
|
||||
*
|
||||
* API to check service param bitmap
|
||||
*
|
||||
* Return: true, if service is enabled
|
||||
* false, if service is not enabled
|
||||
*/
|
||||
bool lmac_is_service_param_bit_enabled(uint32_t *service_param,
|
||||
uint16_t bit_idx);
|
||||
|
||||
/**
|
||||
* lmac_get_dfs_offload() - get dfs offload
|
||||
* @psoc: pointer to psoc
|
||||
* @is_tgt_offload: boolean flag for offload enabled/disabled
|
||||
*
|
||||
* API to get dfs offload
|
||||
*
|
||||
* Return: SUCCESS, if API is invoked without any failures
|
||||
*/
|
||||
QDF_STATUS lmac_get_dfs_offload(struct wlan_objmgr_psoc *psoc,
|
||||
bool *is_tgt_offload);
|
||||
|
||||
/**
|
||||
* lmac_get_tgt_res_cfg() - get target resource config
|
||||
* @psoc: pointer to psoc
|
||||
|
|
|
|||
|
|
@ -29,24 +29,6 @@
|
|||
#include <init_deinit_lmac.h>
|
||||
#include <qdf_module.h>
|
||||
|
||||
uint32_t *lmac_get_service_param(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct target_psoc_info *tgt_hdl;
|
||||
|
||||
if (!psoc) {
|
||||
target_if_err("psoc is null");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc);
|
||||
if (!tgt_hdl) {
|
||||
target_if_err("target_psoc_info is null");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return target_psoc_get_service_bitmap(tgt_hdl);
|
||||
}
|
||||
|
||||
struct wlan_psoc_target_capability_info *lmac_get_target_cap(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
|
|
@ -66,45 +48,6 @@ struct wlan_psoc_target_capability_info *lmac_get_target_cap(
|
|||
return target_psoc_get_target_caps(tgt_hdl);
|
||||
}
|
||||
|
||||
bool lmac_is_service_param_bit_enabled(uint32_t *service_param,
|
||||
uint16_t bit_idx)
|
||||
{
|
||||
bool retval = false;
|
||||
|
||||
if (((service_param)[(bit_idx) / (sizeof(uint32_t))] &
|
||||
(1 << ((bit_idx) % (sizeof(uint32_t))))) != 0)
|
||||
retval = true;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* dfs offload service bit */
|
||||
#define DFS_SERVICE_PHYERR_OFFLOAD 113
|
||||
|
||||
QDF_STATUS lmac_get_dfs_offload(struct wlan_objmgr_psoc *psoc,
|
||||
bool *is_tgt_offload)
|
||||
{
|
||||
uint32_t *service_bitmap;
|
||||
|
||||
*is_tgt_offload = false;
|
||||
|
||||
if (!psoc) {
|
||||
target_if_err("psoc is null");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
service_bitmap = lmac_get_service_param(psoc);
|
||||
if (!service_bitmap) {
|
||||
target_if_err("pdev is null");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
*is_tgt_offload = lmac_is_service_param_bit_enabled(service_bitmap,
|
||||
DFS_SERVICE_PHYERR_OFFLOAD);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
target_resource_config *lmac_get_tgt_res_cfg(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct target_psoc_info *tgt_hdl;
|
||||
|
|
|
|||
|
|
@ -83,14 +83,6 @@ bool lmac_is_mode_offload(struct wlan_objmgr_pdev *pdev);
|
|||
*/
|
||||
uint16_t lmac_get_ah_devid(struct wlan_objmgr_pdev *pdev);
|
||||
|
||||
/**
|
||||
* lmac_is_mode_dfs_offload() - Check the DFS offload is enabled.
|
||||
* @psoc: Pointer to PSOC structure.
|
||||
*
|
||||
* returns true if DFS offload is enabled, otherwise returns false
|
||||
*/
|
||||
bool lmac_is_mode_dfs_offload(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* lmac_get_ext_busy() - Get ext_busy.
|
||||
* @pdev: Pointer to PDEV structure.
|
||||
|
|
|
|||
|
|
@ -298,14 +298,12 @@ QDF_STATUS tgt_dfs_cac_complete(struct wlan_objmgr_pdev *pdev,
|
|||
/**
|
||||
* tgt_dfs_reg_ev_handler() - Register dfs events.
|
||||
* @psoc: Pointer to psoc.
|
||||
* @dfs_offload: phy err processing offloaded to firmware.
|
||||
*
|
||||
* Register dfs events.
|
||||
*
|
||||
* Return: QDF_STATUS.
|
||||
*/
|
||||
QDF_STATUS tgt_dfs_reg_ev_handler(struct wlan_objmgr_psoc *psoc,
|
||||
bool dfs_offload);
|
||||
QDF_STATUS tgt_dfs_reg_ev_handler(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* tgt_dfs_stop() - Clear dfs timers.
|
||||
|
|
|
|||
|
|
@ -337,9 +337,16 @@ QDF_STATUS wlan_dfs_pdev_obj_create_notification(struct wlan_objmgr_pdev *pdev,
|
|||
global_dfs_to_mlme.pdev_component_obj_attach(pdev,
|
||||
WLAN_UMAC_COMP_DFS, (void *)dfs, QDF_STATUS_SUCCESS);
|
||||
dfs->dfs_pdev_obj = pdev;
|
||||
dfs->dfs_is_offload_enabled = lmac_is_mode_dfs_offload(psoc);
|
||||
|
||||
if (!dfs_tx_ops->dfs_is_tgt_offload) {
|
||||
dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS,
|
||||
"dfs_is_tgt_offload is null");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
dfs->dfs_is_offload_enabled = dfs_tx_ops->dfs_is_tgt_offload(psoc);
|
||||
dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs_offload %d",
|
||||
dfs->dfs_is_offload_enabled);
|
||||
dfs->dfs_is_offload_enabled);
|
||||
|
||||
dfs = wlan_pdev_get_dfs_obj(pdev);
|
||||
if (dfs_attach(dfs) == 1) {
|
||||
|
|
@ -441,12 +448,8 @@ static void dfs_scan_serialization_comp_info_cb(
|
|||
QDF_STATUS wifi_dfs_psoc_enable(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
bool dfs_offload;
|
||||
|
||||
dfs_offload = lmac_is_mode_dfs_offload(psoc);
|
||||
dfs_info(NULL, WLAN_DEBUG_DFS_ALWAYS, "dfs_offload %d", dfs_offload);
|
||||
|
||||
status = tgt_dfs_reg_ev_handler(psoc, dfs_offload);
|
||||
status = tgt_dfs_reg_ev_handler(psoc);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
dfs_err(NULL, WLAN_DEBUG_DFS_ALWAYS, "tgt_dfs_reg_ev_handler failed");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
|
|
|||
|
|
@ -133,19 +133,6 @@ uint16_t lmac_get_ah_devid(struct wlan_objmgr_pdev *pdev)
|
|||
return devid;
|
||||
}
|
||||
|
||||
bool lmac_is_mode_dfs_offload(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_lmac_if_dfs_tx_ops *dfs_tx_ops;
|
||||
bool is_offload = false;
|
||||
|
||||
dfs_tx_ops = &psoc->soc_cb.tx_ops.dfs_tx_ops;
|
||||
|
||||
if (dfs_tx_ops->dfs_is_tgt_offload)
|
||||
dfs_tx_ops->dfs_is_tgt_offload(psoc, &is_offload);
|
||||
|
||||
return is_offload;
|
||||
}
|
||||
|
||||
uint32_t lmac_get_ext_busy(struct wlan_objmgr_pdev *pdev)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
|
|
|
|||
|
|
@ -367,8 +367,7 @@ QDF_STATUS tgt_dfs_cac_complete(struct wlan_objmgr_pdev *pdev, uint32_t vdev_id)
|
|||
#endif
|
||||
qdf_export_symbol(tgt_dfs_cac_complete);
|
||||
|
||||
QDF_STATUS tgt_dfs_reg_ev_handler(struct wlan_objmgr_psoc *psoc,
|
||||
bool dfs_offload)
|
||||
QDF_STATUS tgt_dfs_reg_ev_handler(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_lmac_if_dfs_tx_ops *dfs_tx_ops;
|
||||
|
||||
|
|
@ -384,7 +383,7 @@ QDF_STATUS tgt_dfs_reg_ev_handler(struct wlan_objmgr_psoc *psoc,
|
|||
}
|
||||
|
||||
if (dfs_tx_ops->dfs_reg_ev_handler)
|
||||
return dfs_tx_ops->dfs_reg_ev_handler(psoc, dfs_offload);
|
||||
return dfs_tx_ops->dfs_reg_ev_handler(psoc);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -607,8 +607,7 @@ struct wlan_lmac_if_dfs_tx_ops {
|
|||
uint32_t chan_mode,
|
||||
uint32_t *mode_info,
|
||||
bool is_2gvht_en);
|
||||
QDF_STATUS (*dfs_reg_ev_handler)(struct wlan_objmgr_psoc *psoc,
|
||||
bool dfs_offload);
|
||||
QDF_STATUS (*dfs_reg_ev_handler)(struct wlan_objmgr_psoc *psoc);
|
||||
QDF_STATUS (*dfs_process_emulate_bang_radar_cmd)(
|
||||
struct wlan_objmgr_pdev *pdev,
|
||||
struct dfs_emulate_bang_radar_test_cmd *dfs_unit_test);
|
||||
|
|
@ -617,8 +616,7 @@ struct wlan_lmac_if_dfs_tx_ops {
|
|||
QDF_STATUS (*dfs_set_phyerr_filter_offload)(
|
||||
struct wlan_objmgr_pdev *pdev,
|
||||
bool dfs_phyerr_filter_offload);
|
||||
QDF_STATUS (*dfs_is_tgt_offload)(struct wlan_objmgr_psoc *psoc,
|
||||
bool *is_tgt_offload);
|
||||
bool (*dfs_is_tgt_offload)(struct wlan_objmgr_psoc *psoc);
|
||||
QDF_STATUS (*dfs_send_offload_enable_cmd)(
|
||||
struct wlan_objmgr_pdev *pdev,
|
||||
bool enable);
|
||||
|
|
|
|||
Loading…
Reference in a new issue