qcacld-3.0: Add CFG/INI items to mlme component

Add following mlme CFG items to mlme component

1.CFG_RTS_THRESHOLD
2.CFG_FRAGMENTATION_THRESHOLD

Change-Id: I07b5dcffe8d3d03fa2cbecc7be563c407dc4d61e
CRs-Fixed: 2313600
This commit is contained in:
Harprit Chhabada
2018-09-10 10:21:15 -07:00
committed by nshrivas
parent 56274a1ba7
commit 1e536eab0c
7 changed files with 303 additions and 1 deletions

View File

@@ -22,6 +22,8 @@
#include "wlan_mlme_main.h"
#include "cfg_ucfg_api.h"
#include "wmi_unified.h"
#include "wlan_scan_public_structs.h"
#include "cfg_mlme_threshold.h"
struct wlan_mlme_psoc_obj *mlme_get_psoc_obj(struct wlan_objmgr_psoc *psoc)
{
@@ -593,6 +595,12 @@ static void mlme_init_obss_ht40_cfg(struct wlan_objmgr_psoc *psoc,
obss_ht40->scan_activity_threshold = (uint32_t)
cfg_default(CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD);
}
static void mlme_init_threshold_cfg(struct wlan_objmgr_psoc *psoc,
struct wlan_mlme_threshold *threshold)
{
threshold->rts_threshold = cfg_get(psoc, CFG_RTS_THRESHOLD);
threshold->frag_threshold = cfg_get(psoc, CFG_FRAG_THRESHOLD);
}
static void mlme_init_sta_cfg(struct wlan_objmgr_psoc *psoc,
struct wlan_mlme_sta_cfg *sta)
@@ -969,6 +977,7 @@ QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
mlme_init_lfr_cfg(psoc, &mlme_cfg->lfr);
mlme_init_feature_flag_in_cfg(psoc, &mlme_cfg->feature_flags);
mlme_init_scoring_cfg(psoc, &mlme_cfg->scoring);
mlme_init_threshold_cfg(psoc, &mlme_cfg->threshold);
mlme_init_oce_cfg(psoc, &mlme_cfg->oce);
mlme_init_wep_cfg(&mlme_cfg->wep_params);

View File

@@ -39,6 +39,7 @@
#include "cfg_mlme_sap.h"
#include "cfg_mlme_scoring.h"
#include "cfg_mlme_oce.h"
#include "cfg_mlme_threshold.h"
#include "cfg_mlme_feature_flag.h"
#include "cfg_mlme_wep_params.h"
@@ -61,6 +62,8 @@
CFG_SCORING_ALL \
CFG_STA_ALL \
CFG_VHT_CAPS_ALL \
CFG_WEP_PARAMS_ALL
CFG_WEP_PARAMS_ALL \
CFG_THRESHOLD_ALL \
CFG_VHT_CAPS_ALL
#endif /* __CFG_MLME_H */

View File

@@ -0,0 +1,86 @@
/*
* 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_MLME_THRESHOLD_H
#define __CFG_MLME_THRESHOLD_H
#include "wni_cfg.h"
/*
* <ini>
* RTSThreshold - Will provide RTSThreshold
* @Min: 0
* @Max: 1048576
* @Default: 2347
*
* This ini is used to set default RTSThreshold
* If minimum value 0 is selectd then it will use always RTS
* max is the max frame size
*
* Related: None
*
* Supported Feature: STA
*
* Usage: Internal/External
*
* </ini>
*/
#define CFG_RTS_THRESHOLD CFG_INI_UINT( \
"RTSThreshold", \
0, \
1048576, \
2347, \
CFG_VALUE_OR_DEFAULT, \
"Default RTS Threshold")
/*
* <ini>
* gFragmentationThreshold - It will set fragmentation threshold
* @Min: 256
* @Max: 8000
* @Default: 8000
*
* This ini is used to indicate default fragmentation threshold
*
* Related: None
*
* Supported Feature: STA
*
* Usage: Internal/External
*
* </ini>
*/
#define CFG_FRAG_THRESHOLD CFG_INI_UINT( \
"gFragmentationThreshold", \
256, \
8000, \
8000, \
CFG_VALUE_OR_DEFAULT, \
"Default Fragmentation Threshold")
#define CFG_THRESHOLD_ALL \
CFG(CFG_RTS_THRESHOLD) \
CFG(CFG_FRAG_THRESHOLD)
#endif /* __CFG_MLME_MAIN_H */

View File

@@ -329,6 +329,48 @@ QDF_STATUS wlan_mlme_get_oce_sta_enabled_info(struct wlan_objmgr_psoc *psoc,
QDF_STATUS wlan_mlme_get_oce_sap_enabled_info(struct wlan_objmgr_psoc *psoc,
bool *value);
/**
* wlan_mlme_get_rts_threshold() - Get the RTS threshold config
* @psoc: pointer to psoc object
* @value: pointer to the value which will be filled for the caller
*
* Return: QDF Status
*/
QDF_STATUS wlan_mlme_get_rts_threshold(struct wlan_objmgr_psoc *psoc,
uint32_t *value);
/**
* wlan_mlme_set_rts_threshold() - Set the RTS threshold config
* @psoc: pointer to psoc object
* @value: Value that needs to be set from the caller
*
* Return: QDF Status
*/
QDF_STATUS wlan_mlme_set_rts_threshold(struct wlan_objmgr_psoc *psoc,
uint32_t value);
/**
* wlan_mlme_get_frag_threshold() - Get the Fragmentation threshold
* config
* @psoc: pointer to psoc object
* @value: pointer to the value which will be filled for the caller
*
* Return: QDF Status
*/
QDF_STATUS wlan_mlme_get_frag_threshold(struct wlan_objmgr_psoc *psoc,
uint32_t *value);
/**
* wlan_mlme_set_frag_threshold() - Set the Fragmentation threshold
* config
* @psoc: pointer to psoc object
* @value: Value that needs to be set from the caller
*
* Return: QDF Status
*/
QDF_STATUS wlan_mlme_set_frag_threshold(struct wlan_objmgr_psoc *psoc,
uint32_t value);
/**
* wlan_mlme_get_fils_enabled_info() - Get the fils enable info for driver
* @psoc: pointer to psoc object

View File

@@ -792,6 +792,15 @@ struct wlan_mlme_scoring_cfg {
uint32_t band_weight_per_index;
};
/* struct wlan_mlme_threshold - Threshold related config items
* @rts_threshold: set rts threshold
* @frag_threshold: set fragmentation threshold
*/
struct wlan_mlme_threshold {
uint32_t rts_threshold;
uint32_t frag_threshold;
};
/**
* struct wlan_mlme_oce - OCE related config items
* @enable_bcast_probe_rsp: enable broadcast probe response
@@ -847,6 +856,7 @@ struct wlan_mlme_wep_cfg {
* @sap_protection_cfg: SAP erp protection related CFG items
* @sta: sta CFG Items
* @scoring: BSS Scoring related CFG Items
* @threshold: threshold related cfg items
* @feature_flags: Feature flag config items
* @wep_params: WEP related config items
*/
@@ -867,6 +877,7 @@ struct wlan_mlme_cfg {
struct wlan_mlme_sta_cfg sta;
struct wlan_mlme_scoring_cfg scoring;
struct wlan_mlme_oce oce;
struct wlan_mlme_threshold threshold;
struct wlan_mlme_feature_flag feature_flags;
struct wlan_mlme_wep_cfg wep_params;
};

View File

@@ -613,6 +613,71 @@ QDF_STATUS ucfg_mlme_get_oce_sap_enabled_info(struct wlan_objmgr_psoc *psoc,
return wlan_mlme_get_oce_sap_enabled_info(psoc, value);
}
/**
* ucfg_mlme_get_rts_threshold() - Get the rts threshold config
* @psoc: pointer to psoc object
* @value: pointer to the value which will be filled for the caller
*
* Inline UCFG API to be used by HDD/OSIF callers
*
* Return: QDF Status
*/
static inline
QDF_STATUS ucfg_mlme_get_rts_threshold(struct wlan_objmgr_psoc *psoc,
uint32_t *value)
{
return wlan_mlme_get_rts_threshold(psoc, value);
}
/**
* ucfg_mlme_set_rts_threshold() - Set the rts threshold config
* @psoc: pointer to psoc object
* @value: pointer to the value which will be filled for the caller
*
* Inline UCFG API to be used by HDD/OSIF callers
*
* Return: QDF Status
*/
static inline
QDF_STATUS ucfg_mlme_set_rts_threshold(struct wlan_objmgr_psoc *psoc,
uint32_t value)
{
return wlan_mlme_set_rts_threshold(psoc, value);
}
/**
* ucfg_mlme_get_frag_threshold() - Get the fragmentation threshold
* config
* @psoc: pointer to psoc object
* @value: Value that needs to be set from the caller
*
* Inline UCFG API to be used by HDD/OSIF callers
*
* Return: QDF Status
*/
static inline
QDF_STATUS ucfg_mlme_get_frag_threshold(struct wlan_objmgr_psoc *psoc,
uint32_t *value)
{
return wlan_mlme_get_frag_threshold(psoc, value);
}
/**
* ucfg_mlme_set_frag_threshold() - set the frag threshold config
* @psoc: pointer to psoc object
* @value: pointer to the value which will be filled for the caller
*
* Inline UCFG API to be used by HDD/OSIF callers
*
* Return: QDF Status
*/
static inline
QDF_STATUS ucfg_mlme_set_frag_threshold(struct wlan_objmgr_psoc *psoc,
uint32_t value)
{
return wlan_mlme_set_frag_threshold(psoc, value);
}
/**
* ucfg_mlme_get_fils_enabled_info() - Get fils enable/disable info
*

View File

@@ -24,6 +24,8 @@
#include "wlan_mlme_ucfg_api.h"
#include "wma_types.h"
#include "wmi_unified.h"
#include "wma.h"
#include "wma_internal.h"
QDF_STATUS wlan_mlme_get_cfg_str(uint8_t *dst, struct mlme_cfg_str *cfg_str,
qdf_size_t *len)
@@ -506,6 +508,90 @@ QDF_STATUS wlan_mlme_get_oce_sap_enabled_info(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_mlme_get_rts_threshold(struct wlan_objmgr_psoc *psoc,
uint32_t *value)
{
struct wlan_mlme_psoc_obj *mlme_obj;
mlme_obj = mlme_get_psoc_obj(psoc);
if (!mlme_obj) {
mlme_err("Failed to get MLME Obj");
return QDF_STATUS_E_FAILURE;
}
*value = mlme_obj->cfg.threshold.rts_threshold;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_mlme_set_rts_threshold(struct wlan_objmgr_psoc *psoc,
uint32_t value)
{
struct wlan_mlme_psoc_obj *mlme_obj;
tp_wma_handle wma_handle;
wma_handle = cds_get_context(QDF_MODULE_ID_WMA);
if (NULL == wma_handle) {
WMA_LOGE("%s: wma_handle is NULL", __func__);
return QDF_STATUS_E_INVAL;
}
mlme_obj = mlme_get_psoc_obj(psoc);
if (!mlme_obj) {
mlme_err("Failed to get MLME Obj");
return QDF_STATUS_E_FAILURE;
}
mlme_obj->cfg.threshold.rts_threshold = value;
wma_update_rts_params(wma_handle, value);
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_mlme_get_frag_threshold(struct wlan_objmgr_psoc *psoc,
uint32_t *value)
{
struct wlan_mlme_psoc_obj *mlme_obj;
mlme_obj = mlme_get_psoc_obj(psoc);
if (!mlme_obj) {
mlme_err("Failed to get MLME Obj");
return QDF_STATUS_E_FAILURE;
}
*value = mlme_obj->cfg.threshold.frag_threshold;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_mlme_set_frag_threshold(struct wlan_objmgr_psoc *psoc,
uint32_t value)
{
struct wlan_mlme_psoc_obj *mlme_obj;
tp_wma_handle wma_handle;
wma_handle = cds_get_context(QDF_MODULE_ID_WMA);
if (NULL == wma_handle) {
WMA_LOGE("%s: wma_handle is NULL", __func__);
return QDF_STATUS_E_INVAL;
}
mlme_obj = mlme_get_psoc_obj(psoc);
if (!mlme_obj) {
mlme_err("Failed to get MLME Obj");
return QDF_STATUS_E_FAILURE;
}
mlme_obj->cfg.threshold.frag_threshold = value;
wma_update_frag_params(wma_handle,
value);
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_mlme_get_fils_enabled_info(struct wlan_objmgr_psoc *psoc,
bool *value)
{