Browse Source

qcacld-3.0: Add INI for dbs mode selection

Add dbs_selection_policy to select preferred
2x2 DBS band.
Add vdev_priority_list to set the vdev 2x2
priority list.

Change-Id: I79bba3dbeecba85a04a4ddc1b57ca798998fc7d7
CRs-Fixed: 2304298
Liangwei Dong 6 years ago
parent
commit
2f29b37809
2 changed files with 83 additions and 0 deletions
  1. 67 0
      core/hdd/inc/wlan_hdd_cfg.h
  2. 16 0
      core/hdd/src/wlan_hdd_cfg.c

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

@@ -7688,6 +7688,71 @@ enum hdd_link_speed_rpt_type {
 #define CFG_CONC_SYSTEM_PREF_MAX           (2)
 #define CFG_CONC_SYSTEM_PREF_DEFAULT       (0)
 
+/*
+ * <ini>
+ * dbs_selection_policy - Configure dbs selection policy.
+ * @Min: 0
+ * @Max: 3
+ * @Default: 0
+ *
+ *  set band preference or Vdev preference.
+ *      bit[0] = 0: 5G 2x2 preferred to select 2x2 5G + 1x1 2G DBS mode.
+ *      bit[0] = 1: 2G 2x2 preferred to select 2x2 2G + 1x1 5G DBS mode.
+ *      bit[1] = 1: vdev priority enabled. The INI "vdev_priority_list" will
+ * specify the vdev priority.
+ *      bit[1] = 0: vdev priority disabled.
+ * This INI only take effect for Genoa dual DBS hw.
+ *
+ * Supported Feature: DBS
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_DBS_SELECTION_POLICY               "dbs_selection_policy"
+#define CFG_DBS_SELECTION_POLICY_MIN           (0)
+#define CFG_DBS_SELECTION_POLICY_MAX           (0x3)
+#define CFG_DBS_SELECTION_POLICY_DEFAULT       (0)
+
+/*
+ * <ini>
+ * vdev_priority_list - Configure vdev priority list.
+ * @Min: 0
+ * @Max: 0x4444
+ * @Default: 0x4321
+ *
+ * @vdev_priority_list: vdev priority list
+ *      bit[0-3]: pri_id (policy_mgr_pri_id) of highest priority
+ *      bit[4-7]: pri_id (policy_mgr_pri_id) of second priority
+ *      bit[8-11]: pri_id (policy_mgr_pri_id) of third priority
+ *      bit[12-15]: pri_id (policy_mgr_pri_id) of fourth priority
+ *      example: 0x4321 - CLI < GO < SAP < STA
+ *      vdev priority id mapping:
+ *        PM_STA_PRI_ID = 1,
+ *        PM_SAP_PRI_ID = 2,
+ *        PM_P2P_GO_PRI_ID = 3,
+ *        PM_P2P_CLI_PRI_ID = 4,
+ * When the previous INI "dbs_selection_policy" bit[1]=1, which means
+ * the vdev 2x2 prioritization enabled. Then this INI will be used to
+ * specify the vdev type priority list. For example :
+ * dbs_selection_policy=0x2
+ * vdev_priority_list=0x4312
+ * means: default preference 2x2 band is 5G, vdev 2x2 prioritization enabled.
+ * And the priority list is CLI < GO < STA < SAP
+ *
+ * This INI only take effect for Genoa dual DBS hw.
+ *
+ * Supported Feature: DBS
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_VDEV_PRIORITY_LIST               "vdev_priority_list"
+#define CFG_VDEV_PRIORITY_LIST_MIN           (0)
+#define CFG_VDEV_PRIORITY_LIST_MAX           (0x4444)
+#define CFG_VDEV_PRIORITY_LIST_DEFAULT       (0x4321)
+
 /*
  * <ini>
  * TSOEnable - Control to enable tso feature
@@ -14390,6 +14455,8 @@ struct hdd_config {
 	bool ignore_peer_erp_info;
 	uint8_t multicast_host_fw_msgs;
 	uint8_t conc_system_pref;
+	uint32_t dbs_selection_policy;
+	uint32_t vdev_priority_list;
 	bool send_deauth_before_con;
 	bool tso_enable;
 	bool lro_enable;

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

@@ -3175,6 +3175,20 @@ struct reg_table_entry g_registry_table[] = {
 		   CFG_CONC_SYSTEM_PREF_MIN,
 		   CFG_CONC_SYSTEM_PREF_MAX),
 
+	REG_VARIABLE(CFG_DBS_SELECTION_POLICY, WLAN_PARAM_Integer,
+		     struct hdd_config, dbs_selection_policy,
+		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		     CFG_DBS_SELECTION_POLICY_DEFAULT,
+		     CFG_DBS_SELECTION_POLICY_MIN,
+		     CFG_DBS_SELECTION_POLICY_MAX),
+
+	REG_VARIABLE(CFG_VDEV_PRIORITY_LIST, WLAN_PARAM_Integer,
+		     struct hdd_config, vdev_priority_list,
+		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		     CFG_VDEV_PRIORITY_LIST_DEFAULT,
+		     CFG_VDEV_PRIORITY_LIST_MIN,
+		     CFG_VDEV_PRIORITY_LIST_MAX),
+
 	REG_VARIABLE(CFG_TSO_ENABLED_NAME, WLAN_PARAM_Integer,
 		     struct hdd_config, tso_enable,
 		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -6986,6 +7000,8 @@ QDF_STATUS hdd_set_policy_mgr_user_cfg(struct hdd_context *hdd_ctx)
 		hdd_ctx->config->channel_select_logic_conc;
 	user_cfg->sta_sap_scc_on_lte_coex_chan =
 		hdd_ctx->config->sta_sap_scc_on_lte_coex_chan;
+	user_cfg->dbs_selection_policy = hdd_ctx->config->dbs_selection_policy;
+	user_cfg->vdev_priority_list = hdd_ctx->config->vdev_priority_list;
 	status = policy_mgr_set_user_cfg(hdd_ctx->hdd_psoc, user_cfg);
 	qdf_mem_free(user_cfg);