qcacmn: Add green ap params
Add green AP params in green ap ctx in respect to CFG convergence Change-Id: I7a0b1352cb76464a82d727852f9a0df101d8ec4c CRs-Fixed: 2322125
This commit is contained in:

committed by
nshrivas

parent
8c93d5d032
commit
4d51e9bb73
@@ -26,11 +26,13 @@
|
||||
#include <wlan_scan_cfg.h>
|
||||
#include "cfg_dp.h"
|
||||
#include <wlan_extscan_cfg.h>
|
||||
#include "cfg_green_ap_params.h"
|
||||
|
||||
#define CFG_CONVERGED_ALL \
|
||||
CFG_SCAN_ALL \
|
||||
CFG_DP \
|
||||
CFG_EXTSCAN_ALL
|
||||
CFG_EXTSCAN_ALL \
|
||||
CFG_GREEN_AP_ALL
|
||||
|
||||
#endif /* __CFG_CONVERGED_H */
|
||||
|
||||
|
@@ -845,6 +845,11 @@ static QDF_STATUS dispatcher_green_ap_init(void)
|
||||
return wlan_green_ap_init();
|
||||
}
|
||||
|
||||
static QDF_STATUS dispatcher_green_ap_pdev_open(
|
||||
struct wlan_objmgr_pdev *pdev)
|
||||
{
|
||||
return wlan_green_ap_pdev_open(pdev);
|
||||
}
|
||||
static QDF_STATUS dispatcher_green_ap_deinit(void)
|
||||
{
|
||||
return wlan_green_ap_deinit();
|
||||
@@ -854,6 +859,11 @@ static QDF_STATUS dispatcher_green_ap_init(void)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
static QDF_STATUS dispatcher_green_ap_pdev_open(
|
||||
struct wlan_objmgr_pdev *pdev)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static QDF_STATUS dispatcher_green_ap_deinit(void)
|
||||
{
|
||||
@@ -1318,6 +1328,8 @@ QDF_STATUS dispatcher_pdev_open(struct wlan_objmgr_pdev *pdev)
|
||||
|
||||
if (QDF_STATUS_SUCCESS != wlan_mgmt_txrx_pdev_open(pdev))
|
||||
goto out;
|
||||
if (QDF_IS_STATUS_ERROR(dispatcher_green_ap_pdev_open(pdev)))
|
||||
goto out;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
||||
|
159
umac/green_ap/dispatcher/inc/cfg_green_ap_params.h
Normal file
159
umac/green_ap/dispatcher/inc/cfg_green_ap_params.h
Normal file
@@ -0,0 +1,159 @@
|
||||
/*
|
||||
* Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: This file contains centralized definitions of converged configuration.
|
||||
*/
|
||||
|
||||
#ifndef __CFG_GREEN_AP_PARAMS_H
|
||||
#define __CFG_GREEN_AP_PARAMS_H
|
||||
|
||||
/*
|
||||
* <ini>
|
||||
* enable_green_ap - Enable green ap feature
|
||||
* @Min: 0
|
||||
* @Max: 1
|
||||
* @Default: 0
|
||||
*
|
||||
* This ini is used to enable green ap feature
|
||||
*
|
||||
* Related: None
|
||||
*
|
||||
* Supported Feature: SAP
|
||||
*
|
||||
* Usage: Internal/External
|
||||
*
|
||||
* </ini>
|
||||
*/
|
||||
|
||||
#define CFG_ENABLE_GREEN_AP_FEATURE CFG_INI_BOOL( \
|
||||
"gEnableGreenAp", \
|
||||
MCL_OR_WIN_VALUE(1, 0), \
|
||||
"enable green ap")
|
||||
|
||||
/*
|
||||
* <ini>
|
||||
* enable_egap - Enable the enhanced green ap feature
|
||||
* @Min: 0
|
||||
* @Max: 1
|
||||
* @Default: 1
|
||||
*
|
||||
* This ini is used to enable the enhanced green ap feature
|
||||
*
|
||||
* Related: None
|
||||
*
|
||||
* Supported Feature: SAP
|
||||
*
|
||||
* Usage: Internal/External
|
||||
*
|
||||
* </ini>
|
||||
*/
|
||||
|
||||
#define CFG_ENABLE_EGAP_FEATURE CFG_INI_BOOL( \
|
||||
"gEnableEGAP", \
|
||||
MCL_OR_WIN_VALUE(1,0), \
|
||||
"enable e-gap")
|
||||
/*
|
||||
* <ini>
|
||||
* egap_inact_time - configure the inactive time for EGAP
|
||||
* @Min: 0
|
||||
* @Max: 300000
|
||||
* @Default: 2000
|
||||
*
|
||||
* This ini is used to configure the inactive time for EGAP
|
||||
*
|
||||
* Related: None
|
||||
*
|
||||
* Supported Feature: SAP
|
||||
*
|
||||
* Usage: Internal/External
|
||||
*
|
||||
* </ini>
|
||||
*/
|
||||
|
||||
#define CFG_EGAP_INACT_TIME_FEATURE CFG_INI_UINT( \
|
||||
"gEGAPInactTime", \
|
||||
0, \
|
||||
300000, \
|
||||
2000, \
|
||||
CFG_VALUE_OR_DEFAULT, \
|
||||
"egap inactivity time")
|
||||
/*
|
||||
* <ini>
|
||||
* egap_wait_time - configure the wait time for EGAP
|
||||
* @Min: 0
|
||||
* @Max: 1
|
||||
* @Default: 0
|
||||
*
|
||||
* This ini is used to configure the wait time for EGAP
|
||||
*
|
||||
* Related: None
|
||||
*
|
||||
* Supported Feature: SAP
|
||||
*
|
||||
* Usage: Internal/External
|
||||
*
|
||||
* </ini>
|
||||
*/
|
||||
|
||||
#define CFG_EGAP_WAIT_TIME_FEATURE CFG_INI_UINT( \
|
||||
"gEGAPWaitTime", \
|
||||
0, \
|
||||
300000, \
|
||||
150, \
|
||||
CFG_VALUE_OR_DEFAULT, \
|
||||
"egap wait time")
|
||||
/*
|
||||
* <ini>
|
||||
* egap_flag - Configure the EGAP flags
|
||||
* @Min: 0
|
||||
* @Max: 1
|
||||
* @Default: 0
|
||||
*
|
||||
* This ini is used to configure the EGAP flags
|
||||
*
|
||||
* Related: None
|
||||
*
|
||||
* Supported Feature: SAP
|
||||
*
|
||||
* Usage: Internal/External
|
||||
*
|
||||
* </ini>
|
||||
*/
|
||||
|
||||
#define CFG_EGAP_FLAGS_FEATURE CFG_INI_UINT( \
|
||||
"gEGAPFeatures", \
|
||||
0, \
|
||||
15, \
|
||||
3, \
|
||||
CFG_VALUE_OR_DEFAULT, \
|
||||
"egap flag")
|
||||
|
||||
#ifdef WLAN_SUPPORT_GREEN_AP
|
||||
#define CFG_GREEN_AP_ALL \
|
||||
CFG(CFG_ENABLE_GREEN_AP_FEATURE) \
|
||||
CFG(CFG_ENABLE_EGAP_FEATURE) \
|
||||
CFG(CFG_EGAP_INACT_TIME_FEATURE) \
|
||||
CFG(CFG_EGAP_WAIT_TIME_FEATURE) \
|
||||
CFG(CFG_EGAP_FLAGS_FEATURE)
|
||||
#else
|
||||
#define CFG_GREEN_AP_ALL
|
||||
#endif
|
||||
|
||||
#endif /* __CFG_GREEN_AP_PARAMS_H */
|
||||
|
@@ -91,6 +91,14 @@ QDF_STATUS wlan_green_ap_start(struct wlan_objmgr_pdev *pdev);
|
||||
*/
|
||||
QDF_STATUS wlan_green_ap_stop(struct wlan_objmgr_pdev *pdev);
|
||||
|
||||
/**
|
||||
* wlan_green_ap_pdev_open() - open component and update config params
|
||||
* @pdev: pdev pointer
|
||||
*
|
||||
* Return: Success or Failure
|
||||
*/
|
||||
QDF_STATUS wlan_green_ap_pdev_open(struct wlan_objmgr_pdev *pdev);
|
||||
|
||||
/**
|
||||
* wlan_green_ap_add_sta() - On association
|
||||
* @pdev: pdev pointer
|
||||
|
@@ -28,31 +28,6 @@
|
||||
#include <qdf_status.h>
|
||||
#include "wlan_utility.h"
|
||||
|
||||
/**
|
||||
* struct green_ap_user_cfg - green ap user cfg
|
||||
* @host_enable_egap: HOST enhance green ap support
|
||||
* @egap_inactivity_time: inactivity time
|
||||
* @egap_wait_time: wait time
|
||||
* @egap_feature_flags: feature flags
|
||||
*/
|
||||
struct green_ap_user_cfg {
|
||||
bool host_enable_egap;
|
||||
uint32_t egap_inactivity_time;
|
||||
uint32_t egap_wait_time;
|
||||
uint32_t egap_feature_flags;
|
||||
};
|
||||
|
||||
/**
|
||||
* ucfg_green_ap_update_user_config() - Updates user cfg for green ap
|
||||
* @pdev: pdev pointer
|
||||
* @green_ap_cfg: pointer to green ap user cfg structure
|
||||
*
|
||||
* Return: Success or Failure
|
||||
*/
|
||||
QDF_STATUS ucfg_green_ap_update_user_config(
|
||||
struct wlan_objmgr_pdev *pdev,
|
||||
struct green_ap_user_cfg *green_ap_cfg);
|
||||
|
||||
/**
|
||||
* ucfg_green_ap_enable_egap() - Enable enhanced green ap
|
||||
* @pdev: pdev pointer
|
||||
|
@@ -22,6 +22,8 @@
|
||||
#include <wlan_green_ap_api.h>
|
||||
#include <../../core/src/wlan_green_ap_main_i.h>
|
||||
#include <wlan_objmgr_global_obj.h>
|
||||
#include "cfg_green_ap_params.h"
|
||||
#include "cfg_ucfg_api.h"
|
||||
|
||||
QDF_STATUS wlan_green_ap_get_capab(
|
||||
struct wlan_objmgr_pdev *pdev)
|
||||
@@ -215,6 +217,47 @@ QDF_STATUS wlan_green_ap_deinit(void)
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_green_ap_pdev_open(struct wlan_objmgr_pdev *pdev)
|
||||
{
|
||||
struct wlan_pdev_green_ap_ctx *green_ap_ctx;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
|
||||
if (!pdev) {
|
||||
green_ap_err("pdev is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_pdev_get_psoc(pdev);
|
||||
|
||||
if (!psoc) {
|
||||
green_ap_err("psoc is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
green_ap_ctx = wlan_objmgr_pdev_get_comp_private_obj(
|
||||
pdev, WLAN_UMAC_COMP_GREEN_AP);
|
||||
if (!green_ap_ctx) {
|
||||
green_ap_err("green ap context obtained is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
qdf_spin_lock_bh(&green_ap_ctx->lock);
|
||||
green_ap_ctx->ps_enable = cfg_get(psoc,
|
||||
CFG_ENABLE_GREEN_AP_FEATURE);
|
||||
green_ap_ctx->egap_params.host_enable_egap = cfg_get(psoc,
|
||||
CFG_ENABLE_EGAP_FEATURE);
|
||||
green_ap_ctx->egap_params.egap_inactivity_time = cfg_get(psoc,
|
||||
CFG_EGAP_INACT_TIME_FEATURE);
|
||||
green_ap_ctx->egap_params.egap_wait_time = cfg_get(psoc,
|
||||
CFG_EGAP_WAIT_TIME_FEATURE);
|
||||
green_ap_ctx->egap_params.egap_feature_flags = cfg_get(psoc,
|
||||
CFG_EGAP_FLAGS_FEATURE);
|
||||
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_green_ap_start(struct wlan_objmgr_pdev *pdev)
|
||||
{
|
||||
struct wlan_pdev_green_ap_ctx *green_ap_ctx;
|
||||
|
@@ -24,37 +24,6 @@
|
||||
#include <wlan_green_ap_ucfg_api.h>
|
||||
#include <../../core/src/wlan_green_ap_main_i.h>
|
||||
|
||||
QDF_STATUS ucfg_green_ap_update_user_config(
|
||||
struct wlan_objmgr_pdev *pdev,
|
||||
struct green_ap_user_cfg *green_ap_cfg)
|
||||
{
|
||||
struct wlan_pdev_green_ap_ctx *green_ap_ctx;
|
||||
struct wlan_green_ap_egap_params *egap_params;
|
||||
|
||||
if (!pdev) {
|
||||
green_ap_err("pdev context passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
green_ap_ctx = wlan_objmgr_pdev_get_comp_private_obj(
|
||||
pdev, WLAN_UMAC_COMP_GREEN_AP);
|
||||
if (!green_ap_ctx) {
|
||||
green_ap_err("green ap context obtained is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
qdf_spin_lock_bh(&green_ap_ctx->lock);
|
||||
egap_params = &green_ap_ctx->egap_params;
|
||||
|
||||
egap_params->host_enable_egap = green_ap_cfg->host_enable_egap;
|
||||
egap_params->egap_inactivity_time = green_ap_cfg->egap_inactivity_time;
|
||||
egap_params->egap_wait_time = green_ap_cfg->egap_wait_time;
|
||||
egap_params->egap_feature_flags = green_ap_cfg->egap_feature_flags;
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_green_ap_enable_egap(struct wlan_objmgr_pdev *pdev)
|
||||
{
|
||||
struct wlan_pdev_green_ap_ctx *green_ap_ctx;
|
||||
|
Reference in New Issue
Block a user