Prechádzať zdrojové kódy

qcacld-3.0: Refine mlme reg configurations

Refine mlme reg configurations based on converged cfg component.
Remove related legacy codes.

Change-Id: I524b29d2d03e60111fa1759d11e32236bb3aa3fa
CRs-Fixed: 2357961
lifeng 6 rokov pred
rodič
commit
b9e91962b8

+ 13 - 0
mlme/core/src/wlan_mlme_main.c

@@ -1942,6 +1942,18 @@ static void mlme_init_mwc_cfg(struct wlan_objmgr_psoc *psoc,
 }
 }
 #endif
 #endif
 
 
+static void mlme_init_reg_cfg(struct wlan_objmgr_psoc *psoc,
+			      struct wlan_mlme_reg *reg)
+{
+	reg->self_gen_frm_pwr = cfg_get(psoc, CFG_SELF_GEN_FRM_PWR);
+	reg->etsi13_srd_chan_in_master_mode =
+			cfg_get(psoc, CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE);
+	reg->restart_beaconing_on_ch_avoid =
+			cfg_get(psoc, CFG_RESTART_BEACONING_ON_CH_AVOID);
+	reg->indoor_channel_support = cfg_get(psoc, CFG_INDOOR_CHANNEL_SUPPORT);
+	reg->scan_11d_interval = cfg_get(psoc, CFG_SCAN_11D_INTERVAL);
+}
+
 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;
@@ -1989,6 +2001,7 @@ QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
 	mlme_init_fe_wlm_in_cfg(psoc, &mlme_cfg->wlm_config);
 	mlme_init_fe_wlm_in_cfg(psoc, &mlme_cfg->wlm_config);
 	mlme_init_fe_rrm_in_cfg(psoc, &mlme_cfg->rrm_config);
 	mlme_init_fe_rrm_in_cfg(psoc, &mlme_cfg->rrm_config);
 	mlme_init_mwc_cfg(psoc, &mlme_cfg->mwc);
 	mlme_init_mwc_cfg(psoc, &mlme_cfg->mwc);
+	mlme_init_reg_cfg(psoc, &mlme_cfg->reg);
 
 
 	return status;
 	return status;
 }
 }

+ 2 - 0
mlme/dispatcher/inc/cfg_mlme.h

@@ -56,6 +56,7 @@
 #include "cfg_mlme_fe_wlm.h"
 #include "cfg_mlme_fe_wlm.h"
 #include "cfg_mlme_fe_rrm.h"
 #include "cfg_mlme_fe_rrm.h"
 #include "cfg_mlme_mwc.h"
 #include "cfg_mlme_mwc.h"
+#include "cfg_mlme_reg.h"
 
 
 /* Please Maintain Alphabetic Order here */
 /* Please Maintain Alphabetic Order here */
 #define CFG_MLME_ALL \
 #define CFG_MLME_ALL \
@@ -81,6 +82,7 @@
 	CFG_POWERSAVE_ALL \
 	CFG_POWERSAVE_ALL \
 	CFG_QOS_ALL \
 	CFG_QOS_ALL \
 	CFG_RATES_ALL \
 	CFG_RATES_ALL \
+	CFG_REG_ALL \
 	CFG_SAP_ALL \
 	CFG_SAP_ALL \
 	CFG_SAP_PROTECTION_ALL \
 	CFG_SAP_PROTECTION_ALL \
 	CFG_SCORING_ALL \
 	CFG_SCORING_ALL \

+ 166 - 0
mlme/dispatcher/inc/cfg_mlme_reg.h

@@ -0,0 +1,166 @@
+/*
+ * 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 configuration definitions for MLME REG.
+ */
+
+#ifndef CFG_MLME_REG_H__
+#define CFG_MLME_REG_H__
+
+/*
+ * <ini>
+ * gSelfGenFrmPwr - self-generated frame power in tx chain mask
+ * for CCK rates
+ * @Min: 0
+ * @Max: 0xffff
+ * @Default: 0
+ *
+ * gSelfGenFrmPwr is to set self-generated frame power in tx chain mask
+ * for CCK rates
+ *
+ * Related: None
+ *
+ * Supported Feature: STA
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_SELF_GEN_FRM_PWR CFG_INI_UINT( \
+	"gSelfGenFrmPwr", \
+	0, \
+	0xffff, \
+	0, \
+	CFG_VALUE_OR_DEFAULT, \
+	"set the self gen power value")
+
+/*
+ * <ini>
+ * etsi13_srd_chan_in_master_mode - Enable/disable ETSI SRD channels in
+ * master mode PCL and ACS functionality
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * etsi13_srd_chan_in_master_mode is to enable/disable ETSI SRD channels in
+ * master mode PCL and ACS functionality
+ *
+ * Related: None
+ *
+ * Supported Feature: SAP/P2P-GO
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE CFG_INI_BOOL( \
+	"etsi13_srd_chan_in_master_mode", \
+	0, \
+	"enable/disable ETSI SRD channels in master mode")
+
+/*
+ * <ini>
+ * restart_beaconing_on_chan_avoid_event - control the beaconing entity to move
+ * away from active LTE channels
+ * @Min: 0
+ * @Max: 2
+ * @Default: 1
+ *
+ * This ini is used to control the beaconing entity (SAP/GO) to move away from
+ * active LTE channels when channel avoidance event is received
+ * restart_beaconing_on_chan_avoid_event=0: Don't allow beaconing entity move
+ * from active LTE channels
+ * restart_beaconing_on_chan_avoid_event=1: Allow beaconing entity move from
+ * active LTE channels
+ * restart_beaconing_on_chan_avoid_event=2: Allow beaconing entity move from
+ * 2.4G active LTE channels only
+ *
+ * Related: None
+ *
+ * Supported Feature: channel avoidance
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_RESTART_BEACONING_ON_CH_AVOID CFG_INI_UINT( \
+	"restart_beaconing_on_chan_avoid_event", \
+	0, \
+	2, \
+	1, \
+	CFG_VALUE_OR_DEFAULT, \
+	"control the beaconing entity to move away from active LTE channels")
+
+/*
+ * <ini>
+ * gindoor_channel_support - support to start sap in indoor channel
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * This ini is to support to start sap in indoor channel.
+ * Customer can config this item to enable/disable sap in indoor channel
+ *
+ * Related: None
+ *
+ * Supported Feature: SAP
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_INDOOR_CHANNEL_SUPPORT CFG_INI_BOOL( \
+	"gindoor_channel_support", \
+	0, \
+	"enable/disable sap in indoor channel")
+
+/*
+ * <ini>
+ * scan_11d_interval - 11d scan interval in ms
+ * @Min: 1 sec
+ * @Max: 10 hr
+ * @Default: 1 hr
+ *
+ * This ini sets the 11d scan interval in FW
+ *
+ * Related: None
+ *
+ * Supported Feature: STA
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+
+#define CFG_SCAN_11D_INTERVAL CFG_INI_UINT( \
+	"scan_11d_interval", \
+	1000, \
+	36000000, \
+	3600000, \
+	CFG_VALUE_OR_DEFAULT, \
+	"set the 11d scan interval in FW")
+
+#define CFG_REG_ALL \
+	CFG(CFG_SELF_GEN_FRM_PWR) \
+	CFG(CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE) \
+	CFG(CFG_RESTART_BEACONING_ON_CH_AVOID) \
+	CFG(CFG_INDOOR_CHANNEL_SUPPORT) \
+	CFG(CFG_SCAN_11D_INTERVAL)
+
+#endif /* CFG_MLME_REG_H__ */

+ 11 - 0
mlme/dispatcher/inc/wlan_mlme_api.h

@@ -2061,4 +2061,15 @@ QDF_STATUS wlan_mlme_is_imps_enabled(struct wlan_objmgr_psoc *psoc,
 void
 void
 wlan_mlme_get_wps_uuid(struct wlan_mlme_wps_params *wps_params, uint8_t *data);
 wlan_mlme_get_wps_uuid(struct wlan_mlme_wps_params *wps_params, uint8_t *data);
 
 
+/*
+ * wlan_mlme_get_self_gen_frm_pwr() - get self gen frm pwr
+ * @psoc: pointer to psoc object
+ * @val:  Pointer to the value which will be filled for the caller
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+wlan_mlme_get_self_gen_frm_pwr(struct wlan_objmgr_psoc *psoc,
+			       uint32_t *value);
+
 #endif /* _WLAN_MLME_API_H_ */
 #endif /* _WLAN_MLME_API_H_ */

+ 20 - 0
mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -1767,6 +1767,24 @@ struct wlan_mlme_mwc {
 };
 };
 #endif
 #endif
 
 
+/**
+ * struct wlan_mlme_reg - REG related configs
+ * @self_gen_frm_pwr: self-generated frame power in tx chain mask
+ * for CCK rates
+ * @etsi13_srd_chan_in_master_mode: etsi13 srd chan in master mode
+ * @restart_beaconing_on_ch_avoid: restart beaconing on ch avoid
+ * @indoor_channel_support: indoor channel support
+ * @scan_11d_interval: scan 11d interval
+ */
+struct wlan_mlme_reg {
+	uint32_t self_gen_frm_pwr;
+	bool etsi13_srd_chan_in_master_mode;
+	enum restart_beaconing_on_ch_avoid_rule
+		restart_beaconing_on_ch_avoid;
+	bool indoor_channel_support;
+	uint32_t scan_11d_interval;
+};
+
 /**
 /**
  * struct wlan_mlme_cfg - MLME config items
  * struct wlan_mlme_cfg - MLME config items
  * @chainmask_cfg: VHT chainmask related cfg items
  * @chainmask_cfg: VHT chainmask related cfg items
@@ -1803,6 +1821,7 @@ struct wlan_mlme_mwc {
  * @wlm_config: WLM related CFG items
  * @wlm_config: WLM related CFG items
  * @rrm_config: RRM related CFG items
  * @rrm_config: RRM related CFG items
  * @mwc: MWC related CFG items
  * @mwc: MWC related CFG items
+ * @reg: REG related CFG itmes
  */
  */
 struct wlan_mlme_cfg {
 struct wlan_mlme_cfg {
 	struct wlan_mlme_chainmask chainmask_cfg;
 	struct wlan_mlme_chainmask chainmask_cfg;
@@ -1841,6 +1860,7 @@ struct wlan_mlme_cfg {
 	struct wlan_mlme_fe_wlm wlm_config;
 	struct wlan_mlme_fe_wlm wlm_config;
 	struct wlan_mlme_fe_rrm rrm_config;
 	struct wlan_mlme_fe_rrm rrm_config;
 	struct wlan_mlme_mwc mwc;
 	struct wlan_mlme_mwc mwc;
+	struct wlan_mlme_reg reg;
 };
 };
 
 
 #endif
 #endif

+ 45 - 0
mlme/dispatcher/inc/wlan_mlme_ucfg_api.h

@@ -3357,4 +3357,49 @@ ucfg_mlme_get_mws_coex_5g_nr_pwr_limit(struct wlan_objmgr_psoc *psoc,
 				       uint32_t *val);
 				       uint32_t *val);
 #endif
 #endif
 
 
+/**
+ * ucfg_mlme_get_etsi13_srd_chan_in_master_mode  - get etsi13 srd chan
+ * in master mode
+ * @psoc: pointer to psoc object
+ * @val:  Pointer to the value which will be filled for the caller
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_get_etsi13_srd_chan_in_master_mode(struct wlan_objmgr_psoc *psoc,
+					     bool *value);
+
+/**
+ * ucfg_mlme_restart_beaconing_on_ch_avoid() - get restart beaconing on ch avoid
+ * @psoc: pointer to psoc object
+ * @val:  Pointer to the value which will be filled for the caller
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_get_restart_beaconing_on_ch_avoid(struct wlan_objmgr_psoc *psoc,
+					    uint32_t *value);
+
+/**
+ * ucfg_mlme_get_indoor_channel_support() - get indoor channel support
+ * @psoc: pointer to psoc object
+ * @val:  Pointer to the value which will be filled for the caller
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_get_indoor_channel_support(struct wlan_objmgr_psoc *psoc,
+				     bool *value);
+
+/**
+ * ucfg_mlme_get_scan_11d_interval() - get scan 11d interval
+ * @psoc: pointer to psoc object
+ * @val:  Pointer to the value which will be filled for the caller
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_get_scan_11d_interval(struct wlan_objmgr_psoc *psoc,
+				uint32_t *value);
+
 #endif /* _WLAN_MLME_UCFG_API_H_ */
 #endif /* _WLAN_MLME_UCFG_API_H_ */

+ 18 - 0
mlme/dispatcher/src/wlan_mlme_api.c

@@ -3020,3 +3020,21 @@ void wlan_mlme_get_wps_uuid(struct wlan_mlme_wps_params *wps_params,
 
 
 	wlan_mlme_get_cfg_str(data, &wps_params->wps_uuid, &len);
 	wlan_mlme_get_cfg_str(data, &wps_params->wps_uuid, &len);
 }
 }
+
+QDF_STATUS
+wlan_mlme_get_self_gen_frm_pwr(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) {
+		*value = cfg_default(CFG_SELF_GEN_FRM_PWR);
+		mlme_err("Failed to get MLME Obj");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	*value = mlme_obj->cfg.reg.self_gen_frm_pwr;
+
+	return QDF_STATUS_SUCCESS;
+}

+ 72 - 0
mlme/dispatcher/src/wlan_mlme_ucfg_api.c

@@ -1248,3 +1248,75 @@ ucfg_mlme_get_mws_coex_5g_nr_pwr_limit(struct wlan_objmgr_psoc *psoc,
 	return QDF_STATUS_SUCCESS;
 	return QDF_STATUS_SUCCESS;
 }
 }
 #endif
 #endif
+
+QDF_STATUS
+ucfg_mlme_get_etsi13_srd_chan_in_master_mode(struct wlan_objmgr_psoc *psoc,
+					     bool *value)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj) {
+		*value = cfg_default(CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE);
+		mlme_err("Failed to get MLME Obj");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	*value = mlme_obj->cfg.reg.etsi13_srd_chan_in_master_mode;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+ucfg_mlme_get_restart_beaconing_on_ch_avoid(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) {
+		*value = cfg_default(CFG_RESTART_BEACONING_ON_CH_AVOID);
+		mlme_err("Failed to get MLME Obj");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	*value = mlme_obj->cfg.reg.restart_beaconing_on_ch_avoid;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+ucfg_mlme_get_indoor_channel_support(struct wlan_objmgr_psoc *psoc,
+				     bool *value)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj) {
+		*value = cfg_default(CFG_INDOOR_CHANNEL_SUPPORT);
+		mlme_err("Failed to get MLME Obj");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	*value = mlme_obj->cfg.reg.indoor_channel_support;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+ucfg_mlme_get_scan_11d_interval(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) {
+		*value = cfg_default(CFG_SCAN_11D_INTERVAL);
+		mlme_err("Failed to get MLME Obj");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	*value = mlme_obj->cfg.reg.scan_11d_interval;
+
+	return QDF_STATUS_SUCCESS;
+}