qcacld-3.0: Add MLME CFG items of sap/sta erp protection

Add the following SAP/STA protection ini and cfg parameters to MLME cfg:
CFG_PROTECTION_ENABLED       - CFG
CFG_FORCE_POLICY_PROTECTION  - CFG
CFG_IGNORE_PEER_HT_MODE_NAME - INI

Change-Id: I3763d62c6aa4ae79a5a31dfac248e8367b6369ad
CRs-Fixed: 2310378
This commit is contained in:
Pragaspathi Thilagaraj
2018-07-31 00:39:05 +05:30
committed by nshrivas
parent 7b8b76c56b
commit f4cc58b320
11 changed files with 160 additions and 42 deletions

View File

@@ -117,6 +117,18 @@ static void mlme_update_rates_in_cfg(struct wlan_objmgr_psoc *psoc,
CFG_INI_DISABLE_HIGH_HT_RX_MCS_2x2);
}
static void mlme_update_sap_protection_cfg(struct wlan_objmgr_psoc *psoc,
struct wlan_mlme_sap_protection
*sap_protection_params)
{
sap_protection_params->protection_enabled =
cfg_default(CFG_PROTECTION_ENABLED);
sap_protection_params->protection_force_policy =
cfg_default(CFG_FORCE_POLICY_PROTECTION);
sap_protection_params->ignore_peer_ht_mode =
cfg_get(psoc, CFG_IGNORE_PEER_HT_MODE);
}
QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
{
struct wlan_mlme_psoc_obj *mlme_obj;
@@ -132,6 +144,7 @@ QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
mlme_cfg = &mlme_obj->cfg;
mlme_update_ht_cap_in_cfg(psoc, &mlme_cfg->ht_caps.ht_cap_info);
mlme_update_rates_in_cfg(psoc, &mlme_cfg->rates);
mlme_update_sap_protection_cfg(psoc, &mlme_cfg->sap_protection_cfg);
return status;
}

View File

@@ -26,11 +26,13 @@
#include "cfg_mlme_ht_caps.h"
#include "cfg_mlme_vht_caps.h"
#include "cfg_mlme_rates.h"
#include "cfg_sap_protection.h"
#define CFG_MLME_ALL \
CFG_HT_CAPS_ALL \
CFG_VHT_CAPS_ALL \
CFG_RATES_ALL
CFG_RATES_ALL \
CFG_SAP_PROTECTION_ALL
#endif /* __CFG_MLME_H */

View File

@@ -0,0 +1,69 @@
/*
* 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 sap erp protection related
* converged configurations.
*/
#ifndef __CFG_MLME_SAP_PROTECTION_H
#define __CFG_MLME_SAP_PROTECTION_H
#define CFG_PROTECTION_ENABLED CFG_UINT( \
"protection_enabled", \
0, \
65535, \
65535, \
CFG_VALUE_OR_DEFAULT, \
"sap protection enabled")
#define CFG_FORCE_POLICY_PROTECTION CFG_UINT( \
"protection_force_policy", \
0, \
5, \
5, \
CFG_VALUE_OR_DEFAULT, \
"force policy protection")
/*
* <ini>
* gignore_peer_ht_opmode
*
* @min 0
* @max 1
* @default 1
*
* Enabling gignore_peer_ht_opmode will enable 11g
* protection only when there is a 11g AP in vicinity.
*
* Related: None
*
* Supported Feature: SAP Protection
* </ini>
*/
#define CFG_IGNORE_PEER_HT_MODE CFG_INI_BOOL( \
"gignore_peer_ht_opmode", \
0, \
"ignore the peer ht mode")
#define CFG_SAP_PROTECTION_ALL \
CFG(CFG_PROTECTION_ENABLED) \
CFG(CFG_FORCE_POLICY_PROTECTION) \
CFG(CFG_IGNORE_PEER_HT_MODE)
#endif /* __CFG_MLME_SAP_PROTECTION_H */

View File

@@ -47,4 +47,14 @@ QDF_STATUS wlan_mlme_get_ht_cap_info(struct wlan_objmgr_psoc *psoc,
QDF_STATUS wlan_mlme_set_ht_cap_info(struct wlan_objmgr_psoc *psoc,
struct mlme_ht_capabilities_info
ht_cap_info);
/**
* wlan_mlme_get_ignore_peer_ht_mode() - Get the ignore peer ht opmode flag
* @psoc: pointer to psoc object
* @value: Value that needs to be set from the caller
*
* Return: QDF Status
*/
QDF_STATUS wlan_mlme_get_ignore_peer_ht_mode(struct wlan_objmgr_psoc *psoc,
bool *value);
#endif /* _WLAN_MLME_API_H_ */

View File

@@ -108,16 +108,33 @@ struct wlan_mlme_rates {
uint8_t disable_high_ht_mcs_2x2;
};
/*
* struct wlan_mlme_sap_protection_cfg - SAP erp protection config items
*
* @protection_enabled - Force enable protection. static via cfg
* @protection_always_11g - Force protection enable for 11g. Static via cfg
* @protection_force_policy - Protection force policy. Static via cfg
* @ignore_peer_ht_mode - ignore the ht opmode of the peer. Dynamic via INI.
*
*/
struct wlan_mlme_sap_protection {
uint32_t protection_enabled;
uint8_t protection_force_policy;
bool ignore_peer_ht_mode;
};
/**
* struct wlan_mlme_cfg - MLME config items
* @ht_cfg: HT related CFG Items
* @vht_cfg: VHT related CFG Items
* @rates: Rates related cfg items
* @sap_protection_cfg: SAP erp protection related CFG items
*/
struct wlan_mlme_cfg {
struct wlan_mlme_ht_caps ht_caps;
struct wlan_mlme_vht_caps vht_caps;
struct wlan_mlme_rates rates;
struct wlan_mlme_sap_protection sap_protection_cfg;
};
#endif

View File

@@ -99,4 +99,22 @@ QDF_STATUS ucfg_mlme_set_ht_cap_info(struct wlan_objmgr_psoc *psoc,
{
return wlan_mlme_set_ht_cap_info(psoc, ht_cap_info);
}
/**
* ucfg_mlme_get_ignore_peer_ht_mode() - Get the ignore peer ht mode flag
*
* @psoc: pointer to psoc object
* @value: Value that needs to be set
*
* Inline UCFG API to be used by HDD/OSIF callers to get the
* ignore_peer_ht_opmode flag value
*
* Return: QDF_STATUS_SUCCESS or QDF_STATUS_FAILURE
*/
static inline
QDF_STATUS ucfg_mlme_get_ignore_peer_ht_mode(struct wlan_objmgr_psoc *psoc,
bool *value)
{
return wlan_mlme_get_ignore_peer_ht_mode(psoc, value);
}
#endif /* _WLAN_MLME_UCFG_API_H_ */

View File

@@ -56,3 +56,17 @@ QDF_STATUS wlan_mlme_set_ht_cap_info(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_mlme_get_ignore_peer_ht_mode(struct wlan_objmgr_psoc *psoc,
bool *value)
{
struct wlan_mlme_psoc_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.sap_protection_cfg.ignore_peer_ht_mode;
return QDF_STATUS_SUCCESS;
}

View File

@@ -8555,15 +8555,6 @@ enum dot11p_mode {
#define CFG_USER_ACS_DFS_LTE_ENABLE (1)
#define CFG_USER_ACS_DFS_LTE_DEFAULT (0)
/*
* Enabling gignore_peer_ht_opmode will enable 11g
* protection only when there is a 11g AP in vicinity.
*/
#define CFG_IGNORE_PEER_HT_MODE_NAME "gignore_peer_ht_opmode"
#define CFG_IGNORE_PEER_HT_MODE_MIN (0)
#define CFG_IGNORE_PEER_HT_MODE_MAX (1)
#define CFG_IGNORE_PEER_HT_MODE_DEFAULT (0)
/*
* Enable/Disable to initiate BUG report in case of fatal event
* Default: Enable
@@ -14525,7 +14516,6 @@ struct hdd_config {
#endif
uint32_t roam_dense_traffic_thresh;
uint32_t roam_dense_rssi_thresh_offset;
bool ignore_peer_ht_opmode;
uint32_t roam_dense_min_aps;
int8_t roam_bg_scan_bad_rssi_thresh;
uint8_t roam_bad_rssi_thresh_offset_2g;

View File

@@ -3556,14 +3556,6 @@ struct reg_table_entry g_registry_table[] = {
CFG_ROAM_DENSE_RSSI_THRE_OFFSET_MIN,
CFG_ROAM_DENSE_RSSI_THRE_OFFSET_MAX),
REG_VARIABLE(CFG_IGNORE_PEER_HT_MODE_NAME, WLAN_PARAM_Integer,
struct hdd_config, ignore_peer_ht_opmode,
VAR_FLAGS_OPTIONAL |
VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
CFG_IGNORE_PEER_HT_MODE_DEFAULT,
CFG_IGNORE_PEER_HT_MODE_MIN,
CFG_IGNORE_PEER_HT_MODE_MAX),
REG_VARIABLE(CFG_ROAM_DENSE_MIN_APS, WLAN_PARAM_Integer,
struct hdd_config, roam_dense_min_aps,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -7183,6 +7175,7 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx)
QDF_STATUS status = QDF_STATUS_SUCCESS;
tSmeConfigParams *smeConfig;
uint8_t rrm_capab_len, val;
bool ignore_peer_ht_mode;
mac_handle_t mac_handle = hdd_ctx->mac_handle;
struct hdd_config *pConfig = hdd_ctx->config;
@@ -7504,8 +7497,15 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx)
hdd_ctx->config->obss_active_dwelltime;
smeConfig->csrConfig.obss_passive_dwelltime =
hdd_ctx->config->obss_passive_dwelltime;
smeConfig->csrConfig.ignore_peer_ht_opmode =
pConfig->ignore_peer_ht_opmode;
status = ucfg_mlme_get_ignore_peer_ht_mode(hdd_ctx->hdd_psoc,
&ignore_peer_ht_mode);
if (!QDF_IS_STATUS_SUCCESS(status)) {
hdd_err("Get ignore_peer_ht_mode failed");
goto error;
}
smeConfig->csrConfig.ignore_peer_ht_opmode = ignore_peer_ht_mode;
smeConfig->csrConfig.enable_fatal_event =
pConfig->enable_fatal_event;
smeConfig->csrConfig.scan_adaptive_dwell_mode =
@@ -7655,7 +7655,7 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx)
status = sme_update_config(mac_handle, smeConfig);
if (!QDF_IS_STATUS_SUCCESS(status))
hdd_err("sme_update_config() failure: %d", status);
error:
qdf_mem_free(smeConfig);
return status;
}

View File

@@ -48,6 +48,7 @@ static void lim_update_config(tpAniSirGlobal pMac, tpPESession psessionEntry);
void lim_set_cfg_protection(tpAniSirGlobal pMac, tpPESession pesessionEntry)
{
uint32_t val = 0;
struct wlan_mlme_cfg *mlme_cfg = pMac->mlme_cfg;
if (pesessionEntry != NULL && LIM_IS_AP_ROLE(pesessionEntry)) {
if (pesessionEntry->gLimProtectionControl ==
@@ -68,24 +69,17 @@ void lim_set_cfg_protection(tpAniSirGlobal pMac, tpPESession pesessionEntry)
pesessionEntry->cfgProtection.obss);
}
} else {
if (wlan_cfg_get_int(pMac, WNI_CFG_FORCE_POLICY_PROTECTION, &val)
!= QDF_STATUS_SUCCESS) {
pe_err("reading WNI_CFG_FORCE_POLICY_PROTECTION cfg failed");
return;
} else
pMac->lim.gLimProtectionControl = (uint8_t) val;
pMac->lim.gLimProtectionControl =
mlme_cfg->sap_protection_cfg.protection_force_policy;
if (wlan_cfg_get_int(pMac, WNI_CFG_PROTECTION_ENABLED, &val) !=
QDF_STATUS_SUCCESS) {
pe_err("reading protection cfg failed");
return;
}
if (pMac->lim.gLimProtectionControl ==
WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE)
qdf_mem_set((void *)&pMac->lim.cfgProtection,
sizeof(tCfgProtection), 0);
else {
val = mlme_cfg->sap_protection_cfg.protection_enabled;
pMac->lim.cfgProtection.fromlla =
(val >> WNI_CFG_PROTECTION_ENABLED_FROM_llA) & 1;
pMac->lim.cfgProtection.fromllb =

View File

@@ -487,7 +487,6 @@ QDF_STATUS
populate_dot11f_erp_info(tpAniSirGlobal pMac,
tDot11fIEERPInfo *pDot11f, tpPESession psessionEntry)
{
QDF_STATUS nSirStatus;
uint32_t val;
enum band_info rfBand = BAND_UNKNOWN;
@@ -518,14 +517,6 @@ populate_dot11f_erp_info(tpAniSirGlobal pMac,
pDot11f->barker_preamble = 1;
}
/* if protection always flag is set, advertise protection enabled */
/* regardless of legacy stations presence */
CFG_GET_INT(nSirStatus, pMac, WNI_CFG_11G_PROTECTION_ALWAYS,
val);
if (val) {
pDot11f->use_prot = 1;
}
}
return QDF_STATUS_SUCCESS;