Просмотр исходного кода

qcacld-3.0: Green ap CFG convergence

Adds CFG convergence support for green ap related items

Change-Id: I2cfee273ffbcefcd3294cc1a18fb58549166c55b
CRs-Fixed: 2322024
gaurank kathpalia 6 лет назад
Родитель
Сommit
4a205fc269

+ 0 - 2
core/hdd/inc/wlan_hdd_cfg.h

@@ -38,7 +38,6 @@
 #include <wmi_unified.h>
 #include "wlan_pmo_hw_filter_public_struct.h"
 #include "wlan_action_oui_public_struct.h"
-#include "wlan_hdd_green_ap_cfg.h"
 #include "hdd_config.h"
 
 struct hdd_context;
@@ -7942,7 +7941,6 @@ struct hdd_config {
 	bool enable_bt_chain_separation;
 	uint8_t enable_tx_sch_delay;
 	uint32_t enable_secondary_rate;
-	HDD_GREEN_AP_CFG_FIELDS
 	bool is_unit_test_framework_enabled;
 	bool enable_ftopen;
 	bool enable_rtt_mac_randomization;

+ 0 - 3
core/hdd/src/wlan_hdd_cfg.c

@@ -40,7 +40,6 @@
 #include <wlan_policy_mgr_api.h>
 #include "wifi_pos_api.h"
 #include "wlan_hdd_green_ap.h"
-#include "wlan_hdd_green_ap_cfg.h"
 #include "wlan_hdd_twt.h"
 #include "wlan_mlme_ucfg_api.h"
 #include "wlan_mlme_public_struct.h"
@@ -2858,8 +2857,6 @@ struct reg_table_entry g_registry_table[] = {
 		     CFG_TX_SCH_DELAY_MIN,
 		     CFG_TX_SCH_DELAY_MAX),
 
-	HDD_GREEN_AP_REG_VARIABLES
-
 	REG_VARIABLE(CFG_ENABLE_UNIT_TEST_FRAMEWORK_NAME,
 		     WLAN_PARAM_Integer,
 		     struct hdd_config, is_unit_test_framework_enabled,

+ 11 - 24
core/hdd/src/wlan_hdd_green_ap.c

@@ -89,27 +89,6 @@ int hdd_green_ap_enable_egap(struct hdd_context *hdd_ctx)
 	return 0;
 }
 
-int hdd_green_ap_update_config(struct hdd_context *hdd_ctx)
-{
-	struct green_ap_user_cfg green_ap_cfg;
-	struct hdd_config *cfg = hdd_ctx->config;
-	QDF_STATUS status;
-
-	green_ap_cfg.host_enable_egap = cfg->enable_egap;
-	green_ap_cfg.egap_inactivity_time = cfg->egap_inact_time;
-	green_ap_cfg.egap_wait_time = cfg->egap_wait_time;
-	green_ap_cfg.egap_feature_flags = cfg->egap_feature_flag;
-
-	status = ucfg_green_ap_update_user_config(hdd_ctx->pdev,
-						  &green_ap_cfg);
-	if (status != QDF_STATUS_SUCCESS) {
-		hdd_err("failed to update green ap user configuration");
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
 int hdd_green_ap_start_state_mc(struct hdd_context *hdd_ctx,
 				enum QDF_OPMODE mode, bool is_session_start)
 {
@@ -118,6 +97,7 @@ int hdd_green_ap_start_state_mc(struct hdd_context *hdd_ctx,
 	uint8_t num_sap_sessions = 0, num_p2p_go_sessions = 0, ret = 0;
 	QDF_STATUS status;
 	bool bval = false;
+	uint8_t ps_enable;
 
 	cfg = hdd_ctx->config;
 	if (!cfg) {
@@ -131,9 +111,16 @@ int hdd_green_ap_start_state_mc(struct hdd_context *hdd_ctx,
 		return -EINVAL;
 	}
 
-	if (!bval || !cfg->enable_green_ap) {
-		hdd_debug("Green AP not enabled: enable2x2:%d, enable_green_ap:%d",
-			  bval, cfg->enable_green_ap);
+	if (!bval) {
+		hdd_debug(" 2x2 not enabled");
+	}
+
+	if (QDF_IS_STATUS_ERROR(ucfg_green_ap_get_ps_config(hdd_ctx->pdev,
+							     &ps_enable)))
+		return 0;
+
+	if (!ps_enable) {
+		hdd_debug("Green AP not enabled");
 		return 0;
 	}
 

+ 0 - 11
core/hdd/src/wlan_hdd_green_ap.h

@@ -56,17 +56,6 @@ void hdd_green_ap_del_sta(struct hdd_context *hdd_ctx);
  */
 int hdd_green_ap_enable_egap(struct hdd_context *hdd_ctx);
 
-/**
- * hdd_green_ap_update_config() - Update Green AP component configuration
- * @hdd_ctx: Global HDD context
- *
- * This function will take the static Green AP configuration and apply it
- * to the Green AP component.
- *
- * Return: 0 on success, negative errno on any failure
- */
-int hdd_green_ap_update_config(struct hdd_context *hdd_ctx);
-
 /**
  * hdd_green_ap_start_state_mc() - to start green AP state mc based on
  *        present concurrency and state of green AP state machine.

+ 0 - 108
core/hdd/src/wlan_hdd_green_ap_cfg.h

@@ -1,108 +0,0 @@
-/*
- * 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.
- */
-
-#ifdef WLAN_SUPPORT_GREEN_AP
-
-#define CFG_ENABLE_GREEN_AP_FEATURE         "gEnableGreenAp"
-#define CFG_ENABLE_GREEN_AP_FEATURE_MIN     (0)
-#define CFG_ENABLE_GREEN_AP_FEATURE_MAX     (1)
-#define CFG_ENABLE_GREEN_AP_FEATURE_DEFAULT (1)
-#define CFG_ENABLE_GREEN_AP_FEATURE_FIELD   bool enable_green_ap;
-#define CFG_ENABLE_GREEN_AP_FEATURE_REG_VARIABLE \
-	REG_VARIABLE(CFG_ENABLE_GREEN_AP_FEATURE, WLAN_PARAM_Integer,\
-		     struct hdd_config, enable_green_ap,\
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,\
-		     CFG_ENABLE_GREEN_AP_FEATURE_DEFAULT,\
-		     CFG_ENABLE_GREEN_AP_FEATURE_MIN,\
-		     CFG_ENABLE_GREEN_AP_FEATURE_MAX),
-
-/* Enhanced Green AP (EGAP) flags/params */
-#define CFG_ENABLE_EGAP_ENABLE_FEATURE             "gEnableEGAP"
-#define CFG_ENABLE_EGAP_ENABLE_FEATURE_MIN         (0)
-#define CFG_ENABLE_EGAP_ENABLE_FEATURE_MAX         (1)
-#define CFG_ENABLE_EGAP_ENABLE_FEATURE_DEFAULT     (1)
-#define CFG_ENABLE_EGAP_ENABLE_FEATURE_FIELD       bool enable_egap;
-#define CFG_ENABLE_EGAP_ENABLE_FEATURE_REG_VARIABLE \
-	REG_VARIABLE(CFG_ENABLE_EGAP_ENABLE_FEATURE, WLAN_PARAM_Integer,\
-		     struct hdd_config, enable_egap,\
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,\
-		     CFG_ENABLE_EGAP_ENABLE_FEATURE_DEFAULT,\
-		     CFG_ENABLE_EGAP_ENABLE_FEATURE_MIN,\
-		     CFG_ENABLE_EGAP_ENABLE_FEATURE_MAX),
-
-#define CFG_ENABLE_EGAP_INACT_TIME_FEATURE         "gEGAPInactTime"
-#define CFG_ENABLE_EGAP_INACT_TIME_FEATURE_MIN     (0)
-#define CFG_ENABLE_EGAP_INACT_TIME_FEATURE_MAX     (300000)
-#define CFG_ENABLE_EGAP_INACT_TIME_FEATURE_DEFAULT (2000)
-#define CFG_ENABLE_EGAP_INACT_TIME_FEATURE_FIELD   uint32_t egap_inact_time;
-#define CFG_ENABLE_EGAP_INACT_TIME_FEATURE_REG_VARIABLE \
-	REG_VARIABLE(CFG_ENABLE_EGAP_INACT_TIME_FEATURE, WLAN_PARAM_Integer,\
-		     struct hdd_config, egap_inact_time,\
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,\
-		     CFG_ENABLE_EGAP_INACT_TIME_FEATURE_DEFAULT,\
-		     CFG_ENABLE_EGAP_INACT_TIME_FEATURE_MIN,\
-		     CFG_ENABLE_EGAP_INACT_TIME_FEATURE_MAX),\
-
-#define CFG_ENABLE_EGAP_WAIT_TIME_FEATURE          "gEGAPWaitTime"
-#define CFG_ENABLE_EGAP_WAIT_TIME_FEATURE_MIN      (0)
-#define CFG_ENABLE_EGAP_WAIT_TIME_FEATURE_MAX      (300000)
-#define CFG_ENABLE_EGAP_WAIT_TIME_FEATURE_DEFAULT  (150)
-#define CFG_ENABLE_EGAP_WAIT_TIME_FEATURE_FIELD    uint32_t egap_wait_time;
-#define CFG_ENABLE_EGAP_WAIT_TIME_FEATURE_REG_VARIABLE \
-	REG_VARIABLE(CFG_ENABLE_EGAP_WAIT_TIME_FEATURE, WLAN_PARAM_Integer,\
-		     struct hdd_config, egap_wait_time,\
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,\
-		     CFG_ENABLE_EGAP_WAIT_TIME_FEATURE_DEFAULT,\
-		     CFG_ENABLE_EGAP_WAIT_TIME_FEATURE_MIN,\
-		     CFG_ENABLE_EGAP_WAIT_TIME_FEATURE_MAX),\
-
-#define CFG_ENABLE_EGAP_FLAGS_FEATURE              "gEGAPFeatures"
-#define CFG_ENABLE_EGAP_FLAGS_FEATURE_MIN          (0)
-#define CFG_ENABLE_EGAP_FLAGS_FEATURE_MAX          (15)
-#define CFG_ENABLE_EGAP_FLAGS_FEATURE_DEFAULT      (3)
-#define CFG_ENABLE_EGAP_FLAGS_FEATURE_FIELD        uint32_t egap_feature_flag;
-#define CFG_ENABLE_EGAP_FLAGS_FEATURE_REG_VARIABLE \
-	REG_VARIABLE(CFG_ENABLE_EGAP_FLAGS_FEATURE, WLAN_PARAM_Integer,\
-		     struct hdd_config, egap_feature_flag,\
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,\
-		     CFG_ENABLE_EGAP_FLAGS_FEATURE_DEFAULT,\
-		     CFG_ENABLE_EGAP_FLAGS_FEATURE_MIN,\
-		     CFG_ENABLE_EGAP_FLAGS_FEATURE_MAX),
-
-/* end Enhanced Green AP flags/params */
-
-#define HDD_GREEN_AP_REG_VARIABLES \
-	CFG_ENABLE_GREEN_AP_FEATURE_REG_VARIABLE \
-	CFG_ENABLE_EGAP_ENABLE_FEATURE_REG_VARIABLE \
-	CFG_ENABLE_EGAP_INACT_TIME_FEATURE_REG_VARIABLE \
-	CFG_ENABLE_EGAP_WAIT_TIME_FEATURE_REG_VARIABLE \
-	CFG_ENABLE_EGAP_FLAGS_FEATURE_REG_VARIABLE
-
-#define HDD_GREEN_AP_CFG_FIELDS \
-	CFG_ENABLE_GREEN_AP_FEATURE_FIELD \
-	CFG_ENABLE_EGAP_ENABLE_FEATURE_FIELD \
-	CFG_ENABLE_EGAP_INACT_TIME_FEATURE_FIELD \
-	CFG_ENABLE_EGAP_WAIT_TIME_FEATURE_FIELD \
-	CFG_ENABLE_EGAP_FLAGS_FEATURE_FIELD
-
-#else /* WLAN_SUPPORT_GREEN_AP */
-
-#define HDD_GREEN_AP_REG_VARIABLES
-#define HDD_GREEN_AP_CFG_FIELDS
-
-#endif /* WLAN_SUPPORT_GREEN_AP */

+ 1 - 2
core/hdd/src/wlan_hdd_main.c

@@ -152,6 +152,7 @@
 #include "wlan_reg_ucfg_api.h"
 #include "wlan_ocb_ucfg_api.h"
 #include <wlan_hdd_spectralscan.h>
+#include "wlan_green_ap_ucfg_api.h"
 #ifdef MODULE
 #define WLAN_MODULE_NAME  module_name(THIS_MODULE)
 #else
@@ -1737,8 +1738,6 @@ void hdd_update_tgt_cfg(hdd_handle_t hdd_handle, struct wma_tgt_cfg *cfg)
 
 	hdd_objmgr_update_tgt_max_vdev_psoc(hdd_ctx, cfg->max_intf_count);
 
-	ret = hdd_green_ap_update_config(hdd_ctx);
-
 	ucfg_ipa_set_dp_handle(hdd_ctx->psoc,
 			       cds_get_context(QDF_MODULE_ID_SOC));
 	ucfg_ipa_set_txrx_handle(hdd_ctx->psoc,