Jelajahi Sumber

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

Add MLME CFG items of rates

Change-Id: I9f52f2ef0eef4698ddc13c55dd56d938a6e4c677
Karthik Kantamneni 7 tahun lalu
induk
melakukan
f2f10e8e9b

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

@@ -148,6 +148,20 @@ static void mlme_update_ht_cap_in_cfg(struct wlan_objmgr_psoc *psoc,
 	*ht_cap_info = u.default_ht_cap_info;
 }
 
+static void mlme_update_rates_in_cfg(struct wlan_objmgr_psoc *psoc,
+				     struct wlan_mlme_rates *rates)
+{
+	rates->cfp_period = cfg_default(CFG_CFP_PERIOD);
+	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->disable_abg_rate_txdata = cfg_get(psoc,
+					CFG_INI_DISABLE_ABG_RATE_FOR_TX_DATA);
+	rates->sap_max_mcs_txdata = cfg_get(psoc,
+					CFG_INI_SAP_MAX_MCS_FOR_TX_DATA);
+	rates->disable_high_ht_mcs_2x2 = cfg_get(psoc,
+					 CFG_INI_DISABLE_HIGH_HT_RX_MCS_2x2);
+}
+
 QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
 {
 	struct wlan_mlme_psoc_obj *mlme_obj;
@@ -162,6 +176,7 @@ QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
 
 	mlme_cfg = &mlme_obj->cfg;
 	mlme_update_ht_cap_in_cfg(psoc, &mlme_cfg->ht_caps.ht_cap_info);
+	mlme_update_rates_in_cfg(psoc, &mlme_cfg->rates);
 
 	return status;
 }

+ 3 - 1
mlme/dispatcher/inc/cfg_mlme.h

@@ -25,10 +25,12 @@
 
 #include "cfg_mlme_ht_caps.h"
 #include "cfg_mlme_vht_caps.h"
+#include "cfg_mlme_rates.h"
 
 #define CFG_MLME_ALL \
 	CFG_HT_CAPS_ALL \
-	CFG_VHT_CAPS_ALL
+	CFG_VHT_CAPS_ALL \
+	CFG_RATES_ALL
 
 #endif /* __CFG_MLME_H */
 

+ 146 - 0
mlme/dispatcher/inc/cfg_mlme_rates.h

@@ -0,0 +1,146 @@
+/*
+ * 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 centralized definitions of converged configuration.
+ */
+
+#ifndef __CFG_MLME_RATES_H
+#define __CFG_MLME_RATES_H
+
+/*
+ * <ini>
+ * gMaxHTMCSForTxData - max HT mcs for TX
+ * @Min: 0
+ * @Max: 383
+ * @Default: 0
+ *
+ * This ini is used to configure the max HT mcs
+ * for tx data.
+ *
+ * Usage: External
+ *
+ * bits 0-15:  max HT mcs
+ * bits 16-31: zero to disable, otherwise enable.
+ *
+ * </ini>
+ */
+#define CFG_INI_MAX_HT_MCS_FOR_TX_DATA CFG_INI_UINT( \
+		"gMaxHTMCSForTxData", \
+		0, \
+		0x17f, \
+		0, \
+		CFG_VALUE_OR_DEFAULT, \
+		"Max HT Mcs for Tx Data")
+
+/*
+ * <ini>
+ * gDisableABGRateForTxData - disable abg rate for tx data
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * This ini is used to disable abg rate for tx data.
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_INI_DISABLE_ABG_RATE_FOR_TX_DATA CFG_INI_BOOL( \
+		"gDisableABGRateForTxData", \
+		0, \
+		"Disable ABG RATE for TX Data")
+
+/*
+ * gSapMaxMCSForTxData - sap 11n max mcs
+ * @Min: 0
+ * @Max: 383
+ * @Default: 0
+ *
+ * This ini configure SAP 11n max mcs
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_INI_SAP_MAX_MCS_FOR_TX_DATA CFG_INI_UINT( \
+		"gSapMaxMCSForTxData", \
+		0, \
+		383, \
+		0, \
+		CFG_VALUE_OR_DEFAULT, \
+		"SAP Max MCS for TX Data")
+
+/*
+ * <ini>
+ * disable_high_ht_mcs_2x2 - disable high mcs index for 2nd stream in 2.4G
+ * @Min: 0
+ * @Max: 8
+ * @Default: 0
+ *
+ * This ini is used to disable high HT MCS index for 2.4G STA connection.
+ * It has been introduced to resolve IOT issue with one of the vendor.
+ *
+ * Note: This INI is not useful with 1x1 setting. If some platform supports
+ * only 1x1 then this INI is not useful.
+ *
+ * 0 - It won't disable any HT MCS index (just like normal HT MCS)
+ * 1 - It will disable 15th bit from HT RX MCS set (from 8-15 bits slot)
+ * 2 - It will disable 14th & 15th bits from HT RX MCS set
+ * 3 - It will disable 13th, 14th, & 15th bits from HT RX MCS set
+ * and so on.
+ *
+ * Related: STA
+ *
+ * Supported Feature: 11n
+ *
+ * Usage: External
+ */
+#define CFG_INI_DISABLE_HIGH_HT_RX_MCS_2x2 CFG_INI_UINT( \
+		"disable_high_ht_mcs_2x2", \
+		0, \
+		8, \
+		0, \
+		CFG_VALUE_OR_DEFAULT, \
+		"Disable high MCS index for 2x2")
+
+#define CFG_CFP_PERIOD CFG_UINT( \
+		"cfpPeriod", \
+		0, \
+		255, \
+		1, \
+		CFG_VALUE_OR_DEFAULT, \
+		"CFP Period")
+
+#define CFG_CFP_MAX_DURATION CFG_UINT( \
+		"cfpMaxDuration", \
+		0, \
+		65535, \
+		30000, \
+		CFG_VALUE_OR_DEFAULT, \
+		"CFP Max Duration")
+
+#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_CFP_PERIOD) \
+	CFG(CFG_CFP_MAX_DURATION)
+
+#endif /* __CFG_MLME_RATES_H */

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

@@ -90,14 +90,34 @@ struct wlan_mlme_vht_caps {
 	/* VHT related configs */
 };
 
+/**
+ * struct wlan_mlme_rates - RATES related config items
+ * @cfpPeriod: cfp period info
+ * @cfpMaxDuration: cfp Max duration info
+ * @max_htmcs_txdata: max HT mcs info for Tx
+ * @disable_abg_rate_txdata: disable abg rate info for tx data
+ * @sap_max_mcs_txdata: sap max mcs info
+ * @disable_high_ht_mcs_2x2: disable high mcs for 2x2 info
+ */
+struct wlan_mlme_rates {
+	uint8_t cfp_period;
+	uint16_t cfp_max_duration;
+	uint16_t max_htmcs_txdata;
+	bool disable_abg_rate_txdata;
+	uint16_t sap_max_mcs_txdata;
+	uint8_t disable_high_ht_mcs_2x2;
+};
+
 /**
  * struct wlan_mlme_cfg - MLME config items
  * @ht_cfg: HT related CFG Items
  * @vht_cfg: VHT related CFG Items
+ * @rates: Rates related cfg items
  */
 struct wlan_mlme_cfg {
 	struct wlan_mlme_ht_caps ht_caps;
 	struct wlan_mlme_vht_caps vht_caps;
+	struct wlan_mlme_rates rates;
 };
 
 #endif