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:

committed by
nshrivas

parent
f1a6d08ebc
commit
8c8947ecad
@@ -117,6 +117,18 @@ static void mlme_update_rates_in_cfg(struct wlan_objmgr_psoc *psoc,
|
|||||||
CFG_INI_DISABLE_HIGH_HT_RX_MCS_2x2);
|
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)
|
QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
|
||||||
{
|
{
|
||||||
struct wlan_mlme_psoc_obj *mlme_obj;
|
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_cfg = &mlme_obj->cfg;
|
||||||
mlme_update_ht_cap_in_cfg(psoc, &mlme_cfg->ht_caps.ht_cap_info);
|
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_rates_in_cfg(psoc, &mlme_cfg->rates);
|
||||||
|
mlme_update_sap_protection_cfg(psoc, &mlme_cfg->sap_protection_cfg);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
@@ -26,11 +26,13 @@
|
|||||||
#include "cfg_mlme_ht_caps.h"
|
#include "cfg_mlme_ht_caps.h"
|
||||||
#include "cfg_mlme_vht_caps.h"
|
#include "cfg_mlme_vht_caps.h"
|
||||||
#include "cfg_mlme_rates.h"
|
#include "cfg_mlme_rates.h"
|
||||||
|
#include "cfg_sap_protection.h"
|
||||||
|
|
||||||
#define CFG_MLME_ALL \
|
#define CFG_MLME_ALL \
|
||||||
CFG_HT_CAPS_ALL \
|
CFG_HT_CAPS_ALL \
|
||||||
CFG_VHT_CAPS_ALL \
|
CFG_VHT_CAPS_ALL \
|
||||||
CFG_RATES_ALL
|
CFG_RATES_ALL \
|
||||||
|
CFG_SAP_PROTECTION_ALL
|
||||||
|
|
||||||
#endif /* __CFG_MLME_H */
|
#endif /* __CFG_MLME_H */
|
||||||
|
|
||||||
|
69
mlme/dispatcher/inc/cfg_sap_protection.h
Normal file
69
mlme/dispatcher/inc/cfg_sap_protection.h
Normal 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 */
|
@@ -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,
|
QDF_STATUS wlan_mlme_set_ht_cap_info(struct wlan_objmgr_psoc *psoc,
|
||||||
struct mlme_ht_capabilities_info
|
struct mlme_ht_capabilities_info
|
||||||
ht_cap_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_ */
|
#endif /* _WLAN_MLME_API_H_ */
|
||||||
|
@@ -108,16 +108,33 @@ struct wlan_mlme_rates {
|
|||||||
uint8_t disable_high_ht_mcs_2x2;
|
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
|
* struct wlan_mlme_cfg - MLME config items
|
||||||
* @ht_cfg: HT related CFG Items
|
* @ht_cfg: HT related CFG Items
|
||||||
* @vht_cfg: VHT related CFG Items
|
* @vht_cfg: VHT related CFG Items
|
||||||
* @rates: Rates related cfg items
|
* @rates: Rates related cfg items
|
||||||
|
* @sap_protection_cfg: SAP erp protection related CFG items
|
||||||
*/
|
*/
|
||||||
struct wlan_mlme_cfg {
|
struct wlan_mlme_cfg {
|
||||||
struct wlan_mlme_ht_caps ht_caps;
|
struct wlan_mlme_ht_caps ht_caps;
|
||||||
struct wlan_mlme_vht_caps vht_caps;
|
struct wlan_mlme_vht_caps vht_caps;
|
||||||
struct wlan_mlme_rates rates;
|
struct wlan_mlme_rates rates;
|
||||||
|
struct wlan_mlme_sap_protection sap_protection_cfg;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -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);
|
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_ */
|
#endif /* _WLAN_MLME_UCFG_API_H_ */
|
||||||
|
@@ -56,3 +56,17 @@ QDF_STATUS wlan_mlme_set_ht_cap_info(struct wlan_objmgr_psoc *psoc,
|
|||||||
|
|
||||||
return QDF_STATUS_SUCCESS;
|
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;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user