Explorar o código

qcacld-3.0: Add MLME CFG items of rates [PART 2]

Add MLME CFG items of rates based on converged cfg component

Change-Id: If823a2b19e4b828a3f079d2b032067dd5b5ca196
CRs-Fixed: 2322410
Karthik Kantamneni %!s(int64=6) %!d(string=hai) anos
pai
achega
79943c7e78

+ 34 - 4
mlme/core/src/wlan_mlme_main.c

@@ -559,13 +559,43 @@ static void mlme_init_rates_in_cfg(struct wlan_objmgr_psoc *psoc,
 {
 {
 	rates->cfp_period = cfg_default(CFG_CFP_PERIOD);
 	rates->cfp_period = cfg_default(CFG_CFP_PERIOD);
 	rates->cfp_max_duration = cfg_default(CFG_CFP_MAX_DURATION);
 	rates->cfp_max_duration = cfg_default(CFG_CFP_MAX_DURATION);
-	rates->max_htmcs_txdata = cfg_get(psoc, CFG_INI_MAX_HT_MCS_FOR_TX_DATA);
+	rates->max_htmcs_txdata = cfg_get(psoc, CFG_MAX_HT_MCS_FOR_TX_DATA);
 	rates->disable_abg_rate_txdata = cfg_get(psoc,
 	rates->disable_abg_rate_txdata = cfg_get(psoc,
-					CFG_INI_DISABLE_ABG_RATE_FOR_TX_DATA);
+					CFG_DISABLE_ABG_RATE_FOR_TX_DATA);
 	rates->sap_max_mcs_txdata = cfg_get(psoc,
 	rates->sap_max_mcs_txdata = cfg_get(psoc,
-					CFG_INI_SAP_MAX_MCS_FOR_TX_DATA);
+					CFG_SAP_MAX_MCS_FOR_TX_DATA);
 	rates->disable_high_ht_mcs_2x2 = cfg_get(psoc,
 	rates->disable_high_ht_mcs_2x2 = cfg_get(psoc,
-					 CFG_INI_DISABLE_HIGH_HT_RX_MCS_2x2);
+					 CFG_DISABLE_HIGH_HT_RX_MCS_2x2);
+
+	rates->supported_11b.max_len = CFG_SUPPORTED_RATES_11B_LEN;
+	qdf_uint8_array_parse(cfg_default(CFG_SUPPORTED_RATES_11B),
+			      rates->supported_11b.data,
+			      sizeof(rates->supported_11b.data),
+			      &rates->supported_11b.len);
+	rates->supported_11a.max_len = CFG_SUPPORTED_RATES_11A_LEN;
+	qdf_uint8_array_parse(cfg_default(CFG_SUPPORTED_RATES_11A),
+			      rates->supported_11a.data,
+			      sizeof(rates->supported_11a.data),
+			      &rates->supported_11a.len);
+	rates->opr_rate_set.max_len = CFG_OPERATIONAL_RATE_SET_LEN;
+	rates->opr_rate_set.len = 0;
+	rates->ext_opr_rate_set.max_len = CFG_EXTENDED_OPERATIONAL_RATE_SET_LEN;
+	rates->ext_opr_rate_set.len = 0;
+	rates->supported_mcs_set.max_len = CFG_SUPPORTED_MCS_SET_LEN;
+	qdf_uint8_array_parse(cfg_default(CFG_SUPPORTED_MCS_SET),
+			      rates->supported_mcs_set.data,
+			      sizeof(rates->supported_mcs_set.data),
+			      &rates->supported_mcs_set.len);
+	rates->basic_mcs_set.max_len = CFG_BASIC_MCS_SET_LEN;
+	qdf_uint8_array_parse(cfg_default(CFG_BASIC_MCS_SET),
+			      rates->basic_mcs_set.data,
+			      sizeof(rates->basic_mcs_set.data),
+			      &rates->basic_mcs_set.len);
+	rates->current_mcs_set.max_len = CFG_CURRENT_MCS_SET_LEN;
+	qdf_uint8_array_parse(cfg_default(CFG_CURRENT_MCS_SET),
+			      rates->current_mcs_set.data,
+			      sizeof(rates->current_mcs_set.data),
+			      &rates->current_mcs_set.len);
 }
 }
 
 
 static void mlme_init_dfs_cfg(struct wlan_objmgr_psoc *psoc,
 static void mlme_init_dfs_cfg(struct wlan_objmgr_psoc *psoc,

+ 99 - 9
mlme/dispatcher/inc/cfg_mlme_rates.h

@@ -23,6 +23,14 @@
 #ifndef __CFG_MLME_RATES_H
 #ifndef __CFG_MLME_RATES_H
 #define __CFG_MLME_RATES_H
 #define __CFG_MLME_RATES_H
 
 
+#define CFG_SUPPORTED_RATES_11B_LEN    4
+#define CFG_SUPPORTED_RATES_11A_LEN    8
+#define CFG_OPERATIONAL_RATE_SET_LEN    12
+#define CFG_EXTENDED_OPERATIONAL_RATE_SET_LEN    8
+#define CFG_SUPPORTED_MCS_SET_LEN    16
+#define CFG_BASIC_MCS_SET_LEN    16
+#define CFG_CURRENT_MCS_SET_LEN    16
+
 /*
 /*
  * <ini>
  * <ini>
  * gMaxHTMCSForTxData - max HT mcs for TX
  * gMaxHTMCSForTxData - max HT mcs for TX
@@ -40,7 +48,7 @@
  *
  *
  * </ini>
  * </ini>
  */
  */
-#define CFG_INI_MAX_HT_MCS_FOR_TX_DATA CFG_INI_UINT( \
+#define CFG_MAX_HT_MCS_FOR_TX_DATA CFG_INI_UINT( \
 		"gMaxHTMCSForTxData", \
 		"gMaxHTMCSForTxData", \
 		0, \
 		0, \
 		0x17f, \
 		0x17f, \
@@ -61,7 +69,7 @@
  *
  *
  * </ini>
  * </ini>
  */
  */
-#define CFG_INI_DISABLE_ABG_RATE_FOR_TX_DATA CFG_INI_BOOL( \
+#define CFG_DISABLE_ABG_RATE_FOR_TX_DATA CFG_INI_BOOL( \
 		"gDisableABGRateForTxData", \
 		"gDisableABGRateForTxData", \
 		0, \
 		0, \
 		"Disable ABG RATE for TX Data")
 		"Disable ABG RATE for TX Data")
@@ -78,7 +86,7 @@
  *
  *
  * </ini>
  * </ini>
  */
  */
-#define CFG_INI_SAP_MAX_MCS_FOR_TX_DATA CFG_INI_UINT( \
+#define CFG_SAP_MAX_MCS_FOR_TX_DATA CFG_INI_UINT( \
 		"gSapMaxMCSForTxData", \
 		"gSapMaxMCSForTxData", \
 		0, \
 		0, \
 		383, \
 		383, \
@@ -111,7 +119,7 @@
  *
  *
  * Usage: External
  * Usage: External
  */
  */
-#define CFG_INI_DISABLE_HIGH_HT_RX_MCS_2x2 CFG_INI_UINT( \
+#define CFG_DISABLE_HIGH_HT_RX_MCS_2x2 CFG_INI_UINT( \
 		"disable_high_ht_mcs_2x2", \
 		"disable_high_ht_mcs_2x2", \
 		0, \
 		0, \
 		8, \
 		8, \
@@ -134,13 +142,95 @@
 		30000, \
 		30000, \
 		CFG_VALUE_OR_DEFAULT, \
 		CFG_VALUE_OR_DEFAULT, \
 		"CFP Max Duration")
 		"CFP Max Duration")
+/*
+ * <cfg>
+ * supported_rates_11b - supported rates for 11b
+ * @Min: 0 minimum length of supported rates
+ * @Max: default data length of supported rates in string format
+ * @Default: 2, 4, 11, 22
+ */
+#define CFG_SUPPORTED_RATES_11B_DATA "2, 4, 11, 22"
+#define CFG_SUPPORTED_RATES_11B CFG_STRING( \
+		"supported_rates_11b", \
+		0, \
+		sizeof(CFG_SUPPORTED_RATES_11B_DATA) - 1, \
+		CFG_SUPPORTED_RATES_11B_DATA, \
+		"Supported rates for 11B")
+
+/*
+ * <cfg>
+ * supported_rates_11a - supported rates for 11a
+ * @Min: 0 minimum length of supported rates
+ * @Max: default data length of supported rates in string format
+ * @Default: 12, 18, 24, 36, 48, 72, 96, 108
+ */
+#define CFG_SUPPORTED_RATES_11A_DATA "12, 18, 24, 36, 48, 72, 96, 108"
+#define CFG_SUPPORTED_RATES_11A CFG_STRING( \
+		"supported_rates_11a", \
+		0, \
+		sizeof(CFG_SUPPORTED_RATES_11A_DATA) - 1, \
+		CFG_SUPPORTED_RATES_11A_DATA, \
+		"Supported rates for 11A")
+
+/*
+ * <cfg>
+ * supported_mcs_set - supported MCS set data
+ * @Min: 0 minimum length of supported MCS set
+ * @Max: default data length of supported mcs set in string format
+ * @Default: 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ * 0x0, 0x0, 0x0
+ */
+#define CFG_SUPPORTED_MCS_SET_DATA "0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0"
+#define CFG_SUPPORTED_MCS_SET CFG_STRING( \
+		"supported_mcs_set", \
+		0, \
+		sizeof(CFG_SUPPORTED_MCS_SET_DATA) - 1, \
+		CFG_SUPPORTED_MCS_SET_DATA, \
+		"supported MCS set")
+
+/*
+ * <cfg>
+ * basic_mcs_set - basic MCS set data
+ * @Min: 0 minimum length of basic MCS set
+ * @Max: default data length of basic mcs set in string format
+ * @Default: 0x00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ * 0x0, 0x0, 0x0
+ */
+#define CFG_BASIC_MCS_SET_DATA "0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0"
+#define CFG_BASIC_MCS_SET CFG_STRING( \
+		"basic_mcs_set", \
+		0, \
+		sizeof(CFG_BASIC_MCS_SET_DATA) - 1, \
+		CFG_BASIC_MCS_SET_DATA, \
+		"basic MCS set")
+
+/*
+ * <cfg>
+ * current_mcs_set - current MCS set data
+ * @Min: 0 minimum length of current MCS set
+ * @Max: default data length of current mcs set in string format
+ * @Default: 0x00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ * 0x0, 0x0, 0x0
+ */
+#define CFG_CURRENT_MCS_SET_DATA "0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0"
+#define CFG_CURRENT_MCS_SET CFG_STRING( \
+		"current_mcs_set", \
+		0, \
+		sizeof(CFG_CURRENT_MCS_SET_DATA) - 1, \
+		CFG_CURRENT_MCS_SET_DATA, \
+		"current MCS set")
 
 
 #define CFG_RATES_ALL \
 #define CFG_RATES_ALL \
-	CFG(CFG_INI_MAX_HT_MCS_FOR_TX_DATA) \
-	CFG(CFG_INI_DISABLE_ABG_RATE_FOR_TX_DATA) \
-	CFG(CFG_INI_SAP_MAX_MCS_FOR_TX_DATA) \
-	CFG(CFG_INI_DISABLE_HIGH_HT_RX_MCS_2x2) \
+	CFG(CFG_MAX_HT_MCS_FOR_TX_DATA) \
+	CFG(CFG_DISABLE_ABG_RATE_FOR_TX_DATA) \
+	CFG(CFG_SAP_MAX_MCS_FOR_TX_DATA) \
+	CFG(CFG_DISABLE_HIGH_HT_RX_MCS_2x2) \
 	CFG(CFG_CFP_PERIOD) \
 	CFG(CFG_CFP_PERIOD) \
-	CFG(CFG_CFP_MAX_DURATION)
+	CFG(CFG_CFP_MAX_DURATION) \
+	CFG(CFG_SUPPORTED_RATES_11B) \
+	CFG(CFG_SUPPORTED_RATES_11A) \
+	CFG(CFG_SUPPORTED_MCS_SET) \
+	CFG(CFG_BASIC_MCS_SET) \
+	CFG(CFG_CURRENT_MCS_SET)
 
 
 #endif /* __CFG_MLME_RATES_H */
 #endif /* __CFG_MLME_RATES_H */

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

@@ -531,6 +531,13 @@ struct wlan_mlme_he_caps {
  * @disable_abg_rate_txdata: disable abg rate info for tx data
  * @disable_abg_rate_txdata: disable abg rate info for tx data
  * @sap_max_mcs_txdata: sap max mcs info
  * @sap_max_mcs_txdata: sap max mcs info
  * @disable_high_ht_mcs_2x2: disable high mcs for 2x2 info
  * @disable_high_ht_mcs_2x2: disable high mcs for 2x2 info
+ * @supported_11b: supported 11B rates
+ * @supported_11a: supported 11A rates
+ * @opr_rate_set: operational rates set
+ * @ext_opr_rate_set: extended operational rates set
+ * @supported_mcs_set: supported MCS set
+ * @basic_mcs_set: basic MCS set
+ * @current_mcs_set: current MCS set
  */
  */
 struct wlan_mlme_rates {
 struct wlan_mlme_rates {
 	uint8_t cfp_period;
 	uint8_t cfp_period;
@@ -539,6 +546,13 @@ struct wlan_mlme_rates {
 	bool disable_abg_rate_txdata;
 	bool disable_abg_rate_txdata;
 	uint16_t sap_max_mcs_txdata;
 	uint16_t sap_max_mcs_txdata;
 	uint8_t disable_high_ht_mcs_2x2;
 	uint8_t disable_high_ht_mcs_2x2;
+	struct mlme_cfg_str supported_11b;
+	struct mlme_cfg_str supported_11a;
+	struct mlme_cfg_str opr_rate_set;
+	struct mlme_cfg_str ext_opr_rate_set;
+	struct mlme_cfg_str supported_mcs_set;
+	struct mlme_cfg_str basic_mcs_set;
+	struct mlme_cfg_str current_mcs_set;
 };
 };
 
 
 
 

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

@@ -1590,4 +1590,58 @@ ucfg_mlme_update_nss_vht_cap(struct wlan_objmgr_psoc *psoc)
 	return mlme_update_nss_vht_cap(psoc);
 	return mlme_update_nss_vht_cap(psoc);
 }
 }
 
 
+/**
+ * ucfg_mlme_get_opr_rate_set() - Get operational rate set
+ * @psoc: pointer to psoc object
+ * @buf: buffer to get rates set
+ * @len: length of the buffer
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_get_opr_rate_set(struct wlan_objmgr_psoc *psoc, uint8_t *buf,
+			   qdf_size_t *len);
+
+/**
+ * ucfg_mlme_get_ext_opr_rate_set() - Get operational rate set
+ * @psoc: pointer to psoc object
+ * @buf: buffer to get rates set
+ * @len: length of the buffer
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_get_ext_opr_rate_set(struct wlan_objmgr_psoc *psoc, uint8_t *buf,
+			       qdf_size_t *len);
+
+/**
+ * ucfg_mlme_get_supported_mcs_set() - Get Supported MCS set
+ * @psoc: pointer to psoc object
+ * @buf:  caller buffer to copy mcs set info
+ * @len: length of the buffer
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_get_supported_mcs_set(struct wlan_objmgr_psoc *psoc, uint8_t *buf,
+				qdf_size_t *len);
+
+/**
+ * ucfg_mlme_set_supported_mcs_set() - Get Supported MCS set
+ * @psoc: pointer to psoc object
+ * @buf: caller buffer having mcs set info
+ * @len: length of the buffer
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_set_supported_mcs_set(struct wlan_objmgr_psoc *psoc, uint8_t *buf,
+				qdf_size_t len);
+
+/**
+ * ucfg_mlme_get_current_mcs_set() - Get current MCS set
+ * @psoc: pointer to psoc object
+ * @buf:  caller buffer to copy mcs set info
+ * @len: length of the buffer
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_get_current_mcs_set(struct wlan_objmgr_psoc *psoc, uint8_t *buf,
+			      qdf_size_t *len);
 #endif /* _WLAN_MLME_UCFG_API_H_ */
 #endif /* _WLAN_MLME_UCFG_API_H_ */

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

@@ -316,3 +316,86 @@ ucfg_mlme_get_first_scan_bucket_threshold(struct wlan_objmgr_psoc *psoc,
 
 
 	return QDF_STATUS_SUCCESS;
 	return QDF_STATUS_SUCCESS;
 }
 }
+
+QDF_STATUS
+ucfg_mlme_get_opr_rate_set(struct wlan_objmgr_psoc *psoc,
+			   uint8_t *buf, qdf_size_t *len)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj) {
+		mlme_err("mlme obj null");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	return wlan_mlme_get_cfg_str(buf, &mlme_obj->cfg.rates.opr_rate_set,
+				     len);
+}
+
+QDF_STATUS
+ucfg_mlme_get_ext_opr_rate_set(struct wlan_objmgr_psoc *psoc,
+			       uint8_t *buf, qdf_size_t *len)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj) {
+		mlme_err("mlme obj null");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	return wlan_mlme_get_cfg_str(buf, &mlme_obj->cfg.rates.ext_opr_rate_set,
+				     len);
+}
+
+QDF_STATUS
+ucfg_mlme_get_supported_mcs_set(struct wlan_objmgr_psoc *psoc,
+				uint8_t *buf, qdf_size_t *len)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj) {
+		mlme_err("mlme obj null");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	return wlan_mlme_get_cfg_str(buf,
+				     &mlme_obj->cfg.rates.supported_mcs_set,
+				     len);
+}
+
+QDF_STATUS
+ucfg_mlme_set_supported_mcs_set(struct wlan_objmgr_psoc *psoc,
+				uint8_t *buf, qdf_size_t len)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj) {
+		mlme_err("mlme obj null");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	return wlan_mlme_set_cfg_str(buf,
+				     &mlme_obj->cfg.rates.supported_mcs_set,
+				     len);
+}
+
+QDF_STATUS
+ucfg_mlme_get_current_mcs_set(struct wlan_objmgr_psoc *psoc,
+			      uint8_t *buf, qdf_size_t *len)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj) {
+		mlme_err("mlme obj null");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	return wlan_mlme_get_cfg_str(buf,
+				     &mlme_obj->cfg.rates.current_mcs_set,
+				     len);
+}