Browse Source

qcacld-3.0: Defines five WNI cfg and one INI cfg

Based on new cfg framework, defines below five WNI cfg items and one
INI cfg:
 - WNI_CFG_APSD_ENABLED
 - WNI_CFG_OBSS_DETECTION_OFFLOAD
 - WNI_CFG_OBSS_COLOR_COLLISION_OFFLOAD
 - WNI_CFG_CURRENT_TX_POWER_LEVEL
 - WNI_CFG_LOCAL_POWER_CONSTRAINT
 - gTxPowerCap

Change-Id: I5546ea7a4efd142b546ad10a40712d40d2d3ea0d
CRs-Fixed: 2375857
Wu Gao 6 years ago
parent
commit
2255ea2817

+ 11 - 1
components/mlme/core/src/wlan_mlme_main.c

@@ -1187,6 +1187,10 @@ static void mlme_init_obss_ht40_cfg(struct wlan_objmgr_psoc *psoc,
 		cfg_default(CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD);
 	obss_ht40->is_override_ht20_40_24g =
 		cfg_get(psoc, CFG_OBSS_HT40_OVERRIDE_HT40_20_24GHZ);
+	obss_ht40->obss_detection_offload_enabled =
+		(bool)cfg_default(CFG_OBSS_DETECTION_OFFLOAD);
+	obss_ht40->obss_color_collision_offload_enabled =
+		(bool)cfg_default(CFG_OBSS_COLOR_COLLISION_OFFLOAD);
 }
 
 static void mlme_init_threshold_cfg(struct wlan_objmgr_psoc *psoc,
@@ -1567,7 +1571,13 @@ static void mlme_init_power_cfg(struct wlan_objmgr_psoc *psoc,
 	power->power_usage.len = CFG_POWER_USAGE_MAX_LEN;
 	qdf_mem_copy(power->power_usage.data, cfg_get(psoc, CFG_POWER_USAGE),
 		     power->power_usage.len);
+	power->max_tx_power = cfg_get(psoc, CFG_MAX_TX_POWER);
+	power->current_tx_power_level =
+			(uint8_t)cfg_default(CFG_CURRENT_TX_POWER_LEVEL);
+	power->local_power_constraint =
+			(uint8_t)cfg_default(CFG_LOCAL_POWER_CONSTRAINT);
 }
+
 static void mlme_init_scoring_cfg(struct wlan_objmgr_psoc *psoc,
 				  struct wlan_mlme_scoring_cfg *scoring_cfg)
 {
@@ -1696,10 +1706,10 @@ static void mlme_init_scoring_cfg(struct wlan_objmgr_psoc *psoc,
 	scoring_cfg->oce_wan_scoring.score_pcnt15_to_12 =
 		mlme_limit_max_per_index_score(
 			cfg_get(psoc, CFG_SCORING_OCE_WAN_SCORE_IDX_15_TO_12));
-
 	scoring_cfg->roam_trigger_bitmap =
 				cfg_get(psoc, CFG_ROAM_TRIGGER_BITMAP);
 	scoring_cfg->roam_score_delta = cfg_get(psoc, CFG_ROAM_SCORE_DELTA);
+	scoring_cfg->apsd_enabled = (bool)cfg_default(CFG_APSD_ENABLED);
 }
 
 static void mlme_init_oce_cfg(struct wlan_objmgr_psoc *psoc,

+ 28 - 2
components/mlme/dispatcher/inc/cfg_mlme_obss_ht40.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2019 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
@@ -219,6 +219,30 @@
 		0, \
 		"Use channel bonding in 24 GHz")
 
+/*
+ * <cfg>
+ * obss_detection_offload - Enable OBSS detection offload
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ */
+#define CFG_OBSS_DETECTION_OFFLOAD CFG_BOOL( \
+		"obss_detection_offload", \
+		0, \
+		"Enable OBSS detection offload")
+
+/*
+ * <cfg>
+ * obss_color_collision_offload - Enable obss color collision offload
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ */
+#define CFG_OBSS_COLOR_COLLISION_OFFLOAD CFG_BOOL( \
+		"obss_color_collision_offload", \
+		0, \
+		"Enable obss color collision offload")
+
 #define CFG_OBSS_HT40_ALL \
 	CFG(CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME) \
 	CFG(CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME) \
@@ -227,6 +251,8 @@
 	CFG(CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL) \
 	CFG(CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD) \
 	CFG(CFG_OBSS_HT40_WIDTH_CH_TRANSITION_DELAY) \
-	CFG(CFG_OBSS_HT40_OVERRIDE_HT40_20_24GHZ)
+	CFG(CFG_OBSS_HT40_OVERRIDE_HT40_20_24GHZ) \
+	CFG(CFG_OBSS_DETECTION_OFFLOAD) \
+	CFG(CFG_OBSS_COLOR_COLLISION_OFFLOAD)
 
 #endif /* CFG_MLME_OBSS_HT40_H__ */

+ 60 - 2
components/mlme/dispatcher/inc/cfg_mlme_power.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2019 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
@@ -110,11 +110,69 @@
 			CFG_VALUE_OR_DEFAULT, \
 			"power limit 5g")
 
+/*
+ * <ini>
+ * gTxPowerCap - WLAN max tx power
+ * @Min: 0
+ * @Max: 128
+ * @Default: 128
+ *
+ * This ini is used to configure the device max tx power.
+ *
+ * Related: None.
+ *
+ * Supported Feature: Concurrency
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_MAX_TX_POWER CFG_INI_UINT( \
+			"gTxPowerCap", \
+			0, \
+			128, \
+			128, \
+			CFG_VALUE_OR_DEFAULT, \
+			"WLAN max tx power")
+
+/*
+ * <cfg>
+ * current_tx_power_level - current tx power level
+ * @Min: 0
+ * @Max: 128
+ * @Default: 27
+ */
+#define CFG_CURRENT_TX_POWER_LEVEL CFG_UINT( \
+		"current_tx_power_level", \
+		0, \
+		128, \
+		27, \
+		CFG_VALUE_OR_DEFAULT, \
+		"current tx power level")
+
+/*
+ * <cfg>
+ * local_power_constraint - local power constraint
+ * @Min: 0
+ * @Max: 255
+ * @Default: 0
+ */
+#define CFG_LOCAL_POWER_CONSTRAINT CFG_UINT( \
+		"local_power_constraint", \
+		0, \
+		255, \
+		0, \
+		CFG_VALUE_OR_DEFAULT, \
+		"local power constraint")
+
 #define CFG_MLME_POWER_ALL \
 	CFG(CFG_MAX_TX_POWER_2_4) \
 	CFG(CFG_MAX_TX_POWER_5) \
 	CFG(CFG_POWER_USAGE) \
 	CFG(CFG_SET_TXPOWER_LIMIT2G) \
-	CFG(CFG_SET_TXPOWER_LIMIT5G)
+	CFG(CFG_SET_TXPOWER_LIMIT5G) \
+	CFG(CFG_MAX_TX_POWER) \
+	CFG(CFG_CURRENT_TX_POWER_LEVEL) \
+	CFG(CFG_LOCAL_POWER_CONSTRAINT)
 
 #endif /* __CFG_MLME_POWER_H */

+ 15 - 2
components/mlme/dispatcher/inc/cfg_mlme_scoring.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2019 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
@@ -1057,6 +1057,18 @@
 		1, \
 		"Enable Scoring for Roam")
 
+/*
+ * <cfg>
+ * apsd_enabled - Enable automatic power save delivery
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ */
+#define CFG_APSD_ENABLED CFG_BOOL( \
+		"apsd_enabled", \
+		0, \
+		"Enable APSD")
+
 #define CFG_SCORING_ALL \
 	CFG(CFG_SCORING_RSSI_WEIGHTAGE) \
 	CFG(CFG_SCORING_HT_CAPS_WEIGHTAGE) \
@@ -1092,6 +1104,7 @@
 	CFG(CFG_SCORING_OCE_WAN_SCORE_IDX_15_TO_12) \
 	CFG(CFG_ROAM_TRIGGER_BITMAP) \
 	CFG(CFG_ROAM_SCORE_DELTA) \
-	CFG(CFG_ENABLE_SCORING_FOR_ROAM)
+	CFG(CFG_ENABLE_SCORING_FOR_ROAM) \
+	CFG(CFG_APSD_ENABLED)
 
 #endif /* __CFG_MLME_SCORING_H */

+ 12 - 0
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -1069,6 +1069,8 @@ struct wlan_mlme_cfg_twt {
  * @width_trans_delay:       obss width transition delay
  * @scan_activity_threshold: obss scan activity threshold
  * @is_override_ht20_40_24g: use channel bonding in 2.4 GHz
+ * @obss_detection_offload_enabled:       Enable OBSS detection offload
+ * @obss_color_collision_offload_enabled: Enable obss color collision
  */
 struct wlan_mlme_obss_ht40 {
 	uint32_t active_dwelltime;
@@ -1079,6 +1081,8 @@ struct wlan_mlme_obss_ht40 {
 	uint32_t width_trans_delay;
 	uint32_t scan_activity_threshold;
 	bool is_override_ht20_40_24g;
+	bool obss_detection_offload_enabled;
+	bool obss_color_collision_offload_enabled;
 };
 
 /**
@@ -1628,6 +1632,7 @@ struct wlan_mlme_per_slot_scoring {
  * @band_weight_per_index: Band weight per index for scoring logic
  * @roam_trigger_bitmap: bitmap for various roam triggers
  * @roam_score_delta: percentage delta in roam score
+ * @apsd_enabled: Enable automatic power save delivery
  */
 struct wlan_mlme_scoring_cfg {
 	bool enable_scoring_for_roam;
@@ -1640,6 +1645,7 @@ struct wlan_mlme_scoring_cfg {
 	uint32_t band_weight_per_index;
 	uint32_t roam_trigger_bitmap;
 	uint32_t roam_score_delta;
+	bool apsd_enabled;
 };
 
 /* struct wlan_mlme_threshold - Threshold related config items
@@ -1691,6 +1697,9 @@ struct mlme_power_usage {
  * @power_usage: power usage mode, min, max, mod
  * @tx_power_2g: limit tx power in 2.4 ghz
  * @tx_power_5g: limit tx power in 5 ghz
+ * @max_tx_power: WLAN max tx power
+ * @current_tx_power_level: current tx power level
+ * @local_power_constraint: local power constraint
  */
 struct wlan_mlme_power {
 	struct mlme_max_tx_power_24 max_tx_power_24;
@@ -1698,6 +1707,9 @@ struct wlan_mlme_power {
 	struct mlme_power_usage power_usage;
 	uint8_t tx_power_2g;
 	uint8_t tx_power_5g;
+	uint8_t max_tx_power;
+	uint8_t current_tx_power_level;
+	uint8_t local_power_constraint;
 };
 
 /*

+ 52 - 7
components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h

@@ -3440,8 +3440,8 @@ ucfg_mlme_get_mws_coex_5g_nr_pwr_limit(struct wlan_objmgr_psoc *psoc,
 /**
  * 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
+ * @psoc:   pointer to psoc object
+ * @value:  pointer to the value which will be filled for the caller
  *
  * Return: QDF Status
  */
@@ -3451,8 +3451,8 @@ ucfg_mlme_get_etsi13_srd_chan_in_master_mode(struct wlan_objmgr_psoc *psoc,
 
 /**
  * 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
+ * @psoc:   pointer to psoc object
+ * @value:  pointer to the value which will be filled for the caller
  *
  * Return: QDF Status
  */
@@ -3462,8 +3462,8 @@ ucfg_mlme_get_restart_beaconing_on_ch_avoid(struct wlan_objmgr_psoc *psoc,
 
 /**
  * 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
+ * @psoc:   pointer to psoc object
+ * @value:  pointer to the value which will be filled for the caller
  *
  * Return: QDF Status
  */
@@ -3474,7 +3474,7 @@ ucfg_mlme_get_indoor_channel_support(struct wlan_objmgr_psoc *psoc,
 /**
  * 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
+ * @value:  Pointer to the value which will be filled for the caller
  *
  * Return: QDF Status
  */
@@ -3504,4 +3504,49 @@ ucfg_mlme_is_subnet_detection_enabled(struct wlan_objmgr_psoc *psoc, bool *val)
 	return QDF_STATUS_SUCCESS;
 }
 #endif /* FEATURE_LFR_SUBNET_DETECTION */
+
+/**
+ * ucfg_mlme_set_current_tx_power_level() - set current tx power level
+ * @psoc:   pointer to psoc object
+ * @value:  data to be set
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_set_current_tx_power_level(struct wlan_objmgr_psoc *psoc,
+				     uint8_t value);
+
+/**
+ * ucfg_mlme_get_current_tx_power_level() - get current tx power level
+ * @psoc:   pointer to psoc object
+ * @value:  pointer to the value which will be filled for the caller
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_get_current_tx_power_level(struct wlan_objmgr_psoc *psoc,
+				     uint8_t *value);
+
+/**
+ * ucfg_mlme_set_obss_detection_offload_enabled() - Enable obss offload
+ * @psoc:   pointer to psoc object
+ * @value:  enable or disable
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_set_obss_detection_offload_enabled(struct wlan_objmgr_psoc *psoc,
+					     uint8_t value);
+
+/**
+ * ucfg_mlme_set_obss_color_collision_offload_enabled() - Enable obss color
+ * collision offload
+ * @psoc:   pointer to psoc object
+ * @value:  enable or disable
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_set_obss_color_collision_offload_enabled(
+		struct wlan_objmgr_psoc *psoc, uint8_t value);
 #endif /* _WLAN_MLME_UCFG_API_H_ */

+ 62 - 0
components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c

@@ -1472,3 +1472,65 @@ ucfg_mlme_is_subnet_detection_enabled(struct wlan_objmgr_psoc *psoc, bool *val)
 	return QDF_STATUS_SUCCESS;
 }
 #endif
+
+QDF_STATUS
+ucfg_mlme_set_current_tx_power_level(struct wlan_objmgr_psoc *psoc,
+				     uint8_t value)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj)
+		return QDF_STATUS_E_INVAL;
+
+	mlme_obj->cfg.power.current_tx_power_level = value;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+ucfg_mlme_get_current_tx_power_level(struct wlan_objmgr_psoc *psoc,
+				     uint8_t *value)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj) {
+		*value = cfg_default(CFG_CURRENT_TX_POWER_LEVEL);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	*value = mlme_obj->cfg.power.current_tx_power_level;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+ucfg_mlme_set_obss_detection_offload_enabled(struct wlan_objmgr_psoc *psoc,
+					     uint8_t value)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj)
+		return QDF_STATUS_E_INVAL;
+
+	mlme_obj->cfg.obss_ht40.obss_detection_offload_enabled = value;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+ucfg_mlme_set_obss_color_collision_offload_enabled(
+		struct wlan_objmgr_psoc *psoc, uint8_t value)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj)
+		return QDF_STATUS_E_INVAL;
+
+	mlme_obj->cfg.obss_ht40.obss_color_collision_offload_enabled = value;
+
+	return QDF_STATUS_SUCCESS;
+}