qcacmn: Green AP UMAC componentization

Add APIs, structures for Green AP component.

Change-Id: I4a39470104c89c20eec5440b7ae251a764151fd5
CRs-Fixed: 2166428
This commit is contained in:
Himanshu Agarwal
2018-01-10 14:21:53 +05:30
committed by snandini
parent 73554f9a8c
commit b3c81ac057
22 changed files with 1139 additions and 110 deletions

View File

@@ -58,6 +58,9 @@
#ifdef WLAN_OFFCHAN_TXRX_ENABLE
#include <target_if_offchan_txrx_api.h>
#endif
#ifdef WLAN_SUPPORT_GREEN_AP
#include <target_if_green_ap.h>
#endif
#ifdef DIRECT_BUF_RX_ENABLE
#include <target_if_direct_buf_rx_api.h>
@@ -259,6 +262,20 @@ static void target_if_direct_buf_rx_tx_ops_register(
}
#endif /* DIRECT_BUF_RX_ENABLE */
#ifdef WLAN_SUPPORT_GREEN_AP
static QDF_STATUS target_if_green_ap_tx_ops_register(
struct wlan_lmac_if_tx_ops *tx_ops)
{
return target_if_register_green_ap_tx_ops(tx_ops);
}
#else
static QDF_STATUS target_if_green_ap_tx_ops_register(
struct wlan_lmac_if_tx_ops *tx_ops)
{
return QDF_STATUS_SUCCESS;
}
#endif /* WLAN_SUPPORT_GREEN_AP */
static void target_if_target_tx_ops_register(
struct wlan_lmac_if_tx_ops *tx_ops)
{
@@ -314,6 +331,8 @@ QDF_STATUS target_if_register_umac_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
target_if_offchan_txrx_ops_register(tx_ops);
target_if_green_ap_tx_ops_register(tx_ops);
/* Converged UMAC components to register their TX-ops here */
return QDF_STATUS_SUCCESS;
}

View File

@@ -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,23 +22,40 @@
#ifndef __TARGET_IF_GREEN_AP_H__
#define __TARGET_IF_GREEN_AP_H__
#include <wlan_objmgr_cmn.h>
#include <wlan_objmgr_pdev_obj.h>
#include <qdf_status.h>
#include <wlan_lmac_if_def.h>
/**
* target_if_green_ap_enable_egap() - Enable egap
* @pdev: pdev pointer
* target_if_register_green_ap_tx_ops() - lmac handler to register
* green ap tx_ops callback functions
* @tx_ops: wlan_lmac_if_tx_ops object
*
* @Return: None
* Return: QDF_STATUS in case of success
*/
void target_if_green_ap_enable_egap(struct wlan_objmgr_pdev *pdev);
QDF_STATUS target_if_register_green_ap_tx_ops(
struct wlan_lmac_if_tx_ops *tx_ops);
/**
* target_if_green_ap_set_ps_on_off() - PS toggle
* target_if_green_ap_enable_egap() - enable enhanced green ap
* @pdev: pdev pointer
* @egap_params: enhanced green ap params
*
* @Return: QDF_STATUS_SUCCESS in case of success
*/
QDF_STATUS target_if_green_ap_enable_egap(
struct wlan_objmgr_pdev *pdev,
struct wlan_green_ap_egap_params *egap_params);
/**
* target_if_green_ap_set_ps_on_off() - Green AP PS toggle
* @pdev: pdev pointer
* @value: Value to send PS on/off to FW
* @pdev_id: pdev id
*
* @Return: None
* @Return: QDF_STATUS_SUCCESS in case of success
*/
void target_if_green_ap_set_ps_on_off(struct wlan_objmgr_pdev *pdev,
uint32_t value);
QDF_STATUS target_if_green_ap_set_ps_on_off(struct wlan_objmgr_pdev *pdev,
bool value, uint8_t pdev_id);
#endif

View File

@@ -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
@@ -21,16 +21,67 @@
*/
#include <target_if_green_ap.h>
#include <wlan_objmgr_pdev_obj.h>
#include <wlan_green_ap_api.h>
#include <../../core/src/wlan_green_ap_main_i.h>
#include <target_if.h>
#include <wmi_unified_api.h>
void target_if_green_ap_enable_egap(struct wlan_objmgr_pdev *pdev)
QDF_STATUS target_if_register_green_ap_tx_ops(
struct wlan_lmac_if_tx_ops *tx_ops)
{
struct wlan_lmac_if_green_ap_tx_ops *green_ap_tx_ops;
if (!tx_ops) {
target_if_err("invalid tx_ops");
return QDF_STATUS_E_FAILURE;
}
green_ap_tx_ops = &tx_ops->green_ap_tx_ops;
green_ap_tx_ops->enable_egap = target_if_green_ap_enable_egap;
green_ap_tx_ops->ps_on_off_send = target_if_green_ap_set_ps_on_off;
return QDF_STATUS_SUCCESS;
}
void target_if_green_ap_set_ps_on_off(struct wlan_objmgr_pdev *pdev,
uint32_t value)
QDF_STATUS target_if_green_ap_enable_egap(
struct wlan_objmgr_pdev *pdev,
struct wlan_green_ap_egap_params *egap_params)
{
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)) {
green_ap_info("enhanced green ap support is not present");
qdf_spin_unlock_bh(&green_ap_ctx->lock);
return QDF_STATUS_SUCCESS;
}
qdf_spin_unlock_bh(&green_ap_ctx->lock);
return wmi_unified_egap_conf_params_cmd(GET_WMI_HDL_FROM_PDEV(pdev),
egap_params);
}
QDF_STATUS target_if_green_ap_set_ps_on_off(struct wlan_objmgr_pdev *pdev,
bool value, uint8_t pdev_id)
{
if (!pdev) {
green_ap_err("pdev context passed is NULL");
return QDF_STATUS_E_INVAL;
}
return wmi_unified_green_ap_ps_send(GET_WMI_HDL_FROM_PDEV(pdev),
value, pdev_id);
}