qcacmn: Green AP UMAC componentization
Add APIs, structures for Green AP component. Change-Id: I4a39470104c89c20eec5440b7ae251a764151fd5 CRs-Fixed: 2166428
This commit is contained in:

committed by
snandini

szülő
73554f9a8c
commit
b3c81ac057
@@ -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
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -23,7 +23,25 @@
|
||||
#ifndef _WLAN_GREEN_AP_API_H_
|
||||
#define _WLAN_GREEN_AP_API_H_
|
||||
|
||||
#include <wlan_objmgr_cmn.h>
|
||||
#include <wlan_objmgr_pdev_obj.h>
|
||||
#include <qdf_status.h>
|
||||
|
||||
/**
|
||||
* struct wlan_green_ap_egap_params - enhance green ap params
|
||||
* @fw_egap_support: fw enhance green ap support
|
||||
* @host_enable_egap: HOST enhance green ap support
|
||||
* @egap_inactivity_time: inactivity time
|
||||
* @egap_wait_time: wait time
|
||||
* @egap_feature_flags: feature flags
|
||||
*/
|
||||
struct wlan_green_ap_egap_params {
|
||||
bool fw_egap_support;
|
||||
bool host_enable_egap;
|
||||
uint32_t egap_inactivity_time;
|
||||
uint32_t egap_wait_time;
|
||||
uint32_t egap_feature_flags;
|
||||
};
|
||||
|
||||
/**
|
||||
* wlan_green_ap_init() - initialize green ap component
|
||||
@@ -43,7 +61,7 @@ QDF_STATUS wlan_green_ap_deinit(void);
|
||||
* wlan_green_ap_start() - Start green ap
|
||||
* @pdev: pdev pointer
|
||||
*
|
||||
* Call this function when the first vdev comes up
|
||||
* Call this function when the first SAP comes up
|
||||
*
|
||||
* Return: Success or Failure
|
||||
*/
|
||||
@@ -53,7 +71,7 @@ QDF_STATUS wlan_green_ap_start(struct wlan_objmgr_pdev *pdev);
|
||||
* wlan_green_ap_stop() - Stop green ap
|
||||
* @pdev: pdev pointer
|
||||
*
|
||||
* Call this function when the last vdev goes down
|
||||
* Call this function when the last SAP goes down
|
||||
*
|
||||
* Return: Success or Failure
|
||||
*/
|
||||
@@ -73,10 +91,9 @@ QDF_STATUS wlan_green_ap_add_sta(struct wlan_objmgr_pdev *pdev);
|
||||
* wlan_green_ap_del_sta() - On disassociation
|
||||
* @pdev: pdev pointer
|
||||
*
|
||||
* Call this function when new node is associated
|
||||
* Call this function when new node is disassociated
|
||||
*
|
||||
* Return: Success or Failure
|
||||
*/
|
||||
QDF_STATUS wlan_green_ap_del_sta(struct wlan_objmgr_pdev *pdev);
|
||||
|
||||
#endif /* _WLAN_GREEN_AP_API_H_ */
|
||||
|
@@ -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
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -23,7 +23,97 @@
|
||||
#ifndef _WLAN_GREEN_AP_UCFG_API_H_
|
||||
#define _WLAN_GREEN_AP_UCFG_API_H_
|
||||
|
||||
#include <wlan_objmgr_cmn.h>
|
||||
#include <wlan_objmgr_pdev_obj.h>
|
||||
#include <qdf_status.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
|
||||
*
|
||||
* Return: Success or Failure
|
||||
*/
|
||||
QDF_STATUS ucfg_green_ap_enable_egap(struct wlan_objmgr_pdev *pdev);
|
||||
|
||||
/**
|
||||
* ucfg_green_ap_target_config() - Handle Green AP target configuration
|
||||
* @pdev: pdev pointer
|
||||
* @fw_egap_support: fw egap support
|
||||
*
|
||||
* This API stores the fw enhanced green AP support capability
|
||||
* in green ap ctx.
|
||||
*
|
||||
* Return: Success or Failure
|
||||
*/
|
||||
QDF_STATUS ucfg_green_ap_target_config(struct wlan_objmgr_pdev *pdev,
|
||||
bool fw_egap_support);
|
||||
|
||||
/**
|
||||
* ucfg_green_ap_set_ps_config() - Set ps value
|
||||
* @pdev: pdev pointer
|
||||
* @value - value to be set
|
||||
*
|
||||
* Return: Success or Failure
|
||||
*/
|
||||
QDF_STATUS ucfg_green_ap_set_ps_config(struct wlan_objmgr_pdev *pdev,
|
||||
uint8_t value);
|
||||
/**
|
||||
* ucfg_green_ap_get_ps_config() - Check if ps is enabled or not
|
||||
* @pdev: pdev pointer
|
||||
* @ps_enable: pointer to ps enable config value
|
||||
*
|
||||
* Return: Success or Failure
|
||||
*/
|
||||
QDF_STATUS ucfg_green_ap_get_ps_config(struct wlan_objmgr_pdev *pdev,
|
||||
uint8_t *ps_enable);
|
||||
|
||||
/**
|
||||
* ucfg_green_ap_set_transition_time() - Set transition time
|
||||
* @pdev: pdev pointer
|
||||
* @val: transition time
|
||||
*
|
||||
* This API sets custom transition time
|
||||
*
|
||||
* Return: Success or Failure
|
||||
*/
|
||||
QDF_STATUS ucfg_green_ap_set_transition_time(struct wlan_objmgr_pdev *pdev,
|
||||
uint32_t val);
|
||||
|
||||
/**
|
||||
* ucfg_green_ap_get_transition_time() - Get transition time
|
||||
* @pdev: pdev pointer
|
||||
* @ps_trans_time: pointer to transition time
|
||||
*
|
||||
* This API gets transition time
|
||||
*
|
||||
* Return: Success or Failure
|
||||
*/
|
||||
QDF_STATUS ucfg_green_ap_get_transition_time(struct wlan_objmgr_pdev *pdev,
|
||||
uint32_t *ps_trans_time);
|
||||
|
||||
#endif /* _WLAN_GREEN_AP_UCFG_API_H_ */
|
||||
|
@@ -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
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -19,48 +19,307 @@
|
||||
/**
|
||||
* DOC: This file contains green ap north bound interface definitions
|
||||
*/
|
||||
|
||||
#include <qdf_status.h>
|
||||
#include <wlan_green_ap_api.h>
|
||||
#include <../../core/src/wlan_green_ap_main_i.h>
|
||||
#include <wlan_objmgr_global_obj.h>
|
||||
|
||||
/**
|
||||
* wlan_green_ap_pdev_obj_create_notification() - called from objmgr when pdev
|
||||
* is created
|
||||
* @pdev: pdev context
|
||||
* @arg: argument
|
||||
*
|
||||
* This function gets called from object manager when pdev is being created and
|
||||
* creates green ap context and attach it to objmgr.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
static QDF_STATUS wlan_green_ap_pdev_obj_create_notification(
|
||||
struct wlan_objmgr_pdev *pdev, void *arg)
|
||||
{
|
||||
struct wlan_pdev_green_ap_ctx *green_ap_ctx;
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
|
||||
if (!pdev) {
|
||||
green_ap_err("pdev context passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
green_ap_ctx = qdf_mem_malloc(sizeof(*green_ap_ctx));
|
||||
if (!green_ap_ctx) {
|
||||
green_ap_err("Memory allocation for Green AP context failed!");
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
green_ap_ctx->ps_state = WLAN_GREEN_AP_PS_IDLE_STATE;
|
||||
green_ap_ctx->ps_event = WLAN_GREEN_AP_PS_WAIT_EVENT;
|
||||
green_ap_ctx->num_nodes = 0;
|
||||
green_ap_ctx->ps_on_time = WLAN_GREEN_AP_PS_ON_TIME * 1000;
|
||||
green_ap_ctx->ps_trans_time = WLAN_GREEN_AP_PS_TRANS_TIME * 1000;
|
||||
|
||||
green_ap_ctx->pdev = pdev;
|
||||
|
||||
qdf_timer_init(NULL, &green_ap_ctx->ps_timer,
|
||||
wlan_green_ap_timer_fn,
|
||||
pdev, QDF_TIMER_TYPE_WAKE_APPS);
|
||||
|
||||
qdf_spinlock_create(&green_ap_ctx->lock);
|
||||
if (wlan_objmgr_pdev_component_obj_attach(pdev,
|
||||
WLAN_UMAC_COMP_GREEN_AP,
|
||||
green_ap_ctx, QDF_STATUS_SUCCESS)
|
||||
!= QDF_STATUS_SUCCESS) {
|
||||
green_ap_err("Failed to attach green ap ctx in pdev ctx");
|
||||
status = QDF_STATUS_E_FAILURE;
|
||||
goto err_pdev_attach;
|
||||
}
|
||||
|
||||
green_ap_info("Green AP creation successful, green ap ctx: %pK, pdev: %pK",
|
||||
green_ap_ctx, pdev);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
||||
err_pdev_attach:
|
||||
qdf_spinlock_destroy(&green_ap_ctx->lock);
|
||||
qdf_timer_free(&green_ap_ctx->ps_timer);
|
||||
qdf_mem_free(green_ap_ctx);
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_green_ap_pdev_obj_destroy_notification() - called from objmgr when
|
||||
* pdev is destroyed
|
||||
* @pdev: pdev context
|
||||
* @arg: argument
|
||||
*
|
||||
* This function gets called from object manager when pdev is being destroyed
|
||||
* and deletes green ap context and detach it from objmgr.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
static QDF_STATUS wlan_green_ap_pdev_obj_destroy_notification(
|
||||
struct wlan_objmgr_pdev *pdev, void *arg)
|
||||
{
|
||||
struct wlan_pdev_green_ap_ctx *green_ap_ctx;
|
||||
|
||||
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 is already NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
green_ap_info("Deleting green ap pdev obj, green ap ctx: %pK, pdev: %pK",
|
||||
green_ap_ctx, pdev);
|
||||
|
||||
if (wlan_objmgr_pdev_component_obj_detach(pdev,
|
||||
WLAN_UMAC_COMP_GREEN_AP, green_ap_ctx) !=
|
||||
QDF_STATUS_SUCCESS) {
|
||||
green_ap_err("Failed to detach green ap ctx in psoc ctx");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
qdf_timer_free(&green_ap_ctx->ps_timer);
|
||||
qdf_spinlock_destroy(&green_ap_ctx->lock);
|
||||
|
||||
qdf_mem_free(green_ap_ctx);
|
||||
green_ap_info("green ap deletion successful, pdev: %pK", pdev);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_green_ap_init(void)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
|
||||
status = wlan_objmgr_register_pdev_create_handler(
|
||||
WLAN_UMAC_COMP_GREEN_AP,
|
||||
wlan_green_ap_pdev_obj_create_notification,
|
||||
NULL);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
green_ap_err("Failed to register green ap obj create handler");
|
||||
goto err_pdev_create;
|
||||
}
|
||||
|
||||
status = wlan_objmgr_register_pdev_destroy_handler(
|
||||
WLAN_UMAC_COMP_GREEN_AP,
|
||||
wlan_green_ap_pdev_obj_destroy_notification,
|
||||
NULL);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
green_ap_err("Failed to register green ap obj destroy handler");
|
||||
goto err_pdev_delete;
|
||||
}
|
||||
|
||||
green_ap_info("Successfully registered create and destroy handlers with objmgr");
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
||||
err_pdev_delete:
|
||||
wlan_objmgr_unregister_pdev_create_handler(
|
||||
WLAN_UMAC_COMP_GREEN_AP,
|
||||
wlan_green_ap_pdev_obj_create_notification,
|
||||
NULL);
|
||||
err_pdev_create:
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_green_ap_deinit(void)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
if (wlan_objmgr_unregister_pdev_create_handler(
|
||||
WLAN_UMAC_COMP_GREEN_AP,
|
||||
wlan_green_ap_pdev_obj_create_notification,
|
||||
NULL)
|
||||
!= QDF_STATUS_SUCCESS) {
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return status;
|
||||
if (wlan_objmgr_unregister_pdev_destroy_handler(
|
||||
WLAN_UMAC_COMP_GREEN_AP,
|
||||
wlan_green_ap_pdev_obj_destroy_notification,
|
||||
NULL)
|
||||
!= QDF_STATUS_SUCCESS) {
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
green_ap_info("Successfully unregistered create and destroy handlers with objmgr");
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_green_ap_start(struct wlan_objmgr_pdev *pdev)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
struct wlan_pdev_green_ap_ctx *green_ap_ctx;
|
||||
|
||||
return status;
|
||||
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;
|
||||
}
|
||||
|
||||
green_ap_debug("Green AP start received");
|
||||
|
||||
/* Make sure the start function does not get called 2 times */
|
||||
qdf_spin_lock_bh(&green_ap_ctx->lock);
|
||||
|
||||
if (wlan_is_egap_enabled(green_ap_ctx)) {
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
green_ap_debug("enhanced green ap support is enabled");
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (green_ap_ctx->ps_state == WLAN_GREEN_AP_PS_IDLE_STATE) {
|
||||
if (green_ap_ctx->ps_enable) {
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
return wlan_green_ap_state_mc(green_ap_ctx,
|
||||
WLAN_GREEN_AP_PS_START_EVENT);
|
||||
}
|
||||
}
|
||||
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
return QDF_STATUS_E_ALREADY;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_green_ap_stop(struct wlan_objmgr_pdev *pdev)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
struct wlan_pdev_green_ap_ctx *green_ap_ctx;
|
||||
|
||||
return status;
|
||||
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;
|
||||
}
|
||||
|
||||
green_ap_debug("Green AP stop received");
|
||||
|
||||
qdf_spin_lock_bh(&green_ap_ctx->lock);
|
||||
|
||||
if (wlan_is_egap_enabled(green_ap_ctx)) {
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
green_ap_debug("enhanced green ap support is enabled");
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* Delete the timer just to be sure */
|
||||
qdf_timer_stop(&green_ap_ctx->ps_timer);
|
||||
|
||||
/* Disable the power save */
|
||||
green_ap_ctx->ps_enable = 0;
|
||||
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
return wlan_green_ap_state_mc(green_ap_ctx,
|
||||
WLAN_GREEN_AP_PS_STOP_EVENT);
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_green_ap_add_sta(struct wlan_objmgr_pdev *pdev)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
struct wlan_pdev_green_ap_ctx *green_ap_ctx;
|
||||
|
||||
return status;
|
||||
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;
|
||||
}
|
||||
|
||||
green_ap_debug("Green AP add sta received");
|
||||
|
||||
qdf_spin_lock_bh(&green_ap_ctx->lock);
|
||||
if (wlan_is_egap_enabled(green_ap_ctx)) {
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
green_ap_debug("enhanced green ap support is enabled");
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
|
||||
return wlan_green_ap_state_mc(green_ap_ctx,
|
||||
WLAN_GREEN_AP_ADD_STA_EVENT);
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_green_ap_del_sta(struct wlan_objmgr_pdev *pdev)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
struct wlan_pdev_green_ap_ctx *green_ap_ctx;
|
||||
|
||||
return status;
|
||||
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;
|
||||
}
|
||||
|
||||
green_ap_debug("Green AP del sta received");
|
||||
|
||||
qdf_spin_lock_bh(&green_ap_ctx->lock);
|
||||
if (wlan_is_egap_enabled(green_ap_ctx)) {
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
green_ap_info("enhanced green ap support is enabled");
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
|
||||
return wlan_green_ap_state_mc(green_ap_ctx,
|
||||
WLAN_GREEN_AP_DEL_STA_EVENT);
|
||||
}
|
||||
|
@@ -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
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -22,4 +22,209 @@
|
||||
|
||||
#include <qdf_status.h>
|
||||
#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;
|
||||
struct wlan_lmac_if_green_ap_tx_ops *green_ap_tx_ops;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
green_ap_tx_ops = wlan_psoc_get_green_ap_tx_ops(green_ap_ctx);
|
||||
if (!green_ap_tx_ops) {
|
||||
green_ap_err("green ap tx ops obtained are NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!green_ap_tx_ops->enable_egap) {
|
||||
green_ap_err("tx op for sending enbale/disable green ap is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return green_ap_tx_ops->enable_egap(pdev, &green_ap_ctx->egap_params);
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_green_ap_target_config(struct wlan_objmgr_pdev *pdev,
|
||||
bool fw_egap_support)
|
||||
{
|
||||
struct wlan_pdev_green_ap_ctx *green_ap_ctx;
|
||||
|
||||
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);
|
||||
green_ap_ctx->egap_params.fw_egap_support = fw_egap_support;
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_green_ap_set_ps_config(struct wlan_objmgr_pdev *pdev,
|
||||
uint8_t value)
|
||||
{
|
||||
struct wlan_pdev_green_ap_ctx *green_ap_ctx;
|
||||
|
||||
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);
|
||||
if (wlan_is_egap_enabled(green_ap_ctx)) {
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
green_ap_ctx->ps_enable = value;
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_green_ap_get_ps_config(struct wlan_objmgr_pdev *pdev,
|
||||
uint8_t *ps_enable)
|
||||
{
|
||||
struct wlan_pdev_green_ap_ctx *green_ap_ctx;
|
||||
|
||||
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);
|
||||
if (wlan_is_egap_enabled(green_ap_ctx)) {
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
*ps_enable = green_ap_ctx->ps_enable;
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_green_ap_set_transition_time(struct wlan_objmgr_pdev *pdev,
|
||||
uint32_t val)
|
||||
{
|
||||
struct wlan_pdev_green_ap_ctx *green_ap_ctx;
|
||||
|
||||
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);
|
||||
if (wlan_is_egap_enabled(green_ap_ctx)) {
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
green_ap_ctx->ps_trans_time = val;
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_green_ap_get_transition_time(struct wlan_objmgr_pdev *pdev,
|
||||
uint32_t *ps_trans_time)
|
||||
{
|
||||
struct wlan_pdev_green_ap_ctx *green_ap_ctx;
|
||||
|
||||
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);
|
||||
if (wlan_is_egap_enabled(green_ap_ctx)) {
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
*ps_trans_time = green_ap_ctx->ps_trans_time;
|
||||
qdf_spin_unlock_bh(&green_ap_ctx->lock);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user