Selaa lähdekoodia

Merge "qcacld-3.0: Add .ini configuration for max number of AMSDU"

Linux Build Service Account 7 vuotta sitten
vanhempi
sitoutus
111c5563e8

+ 21 - 6
core/hdd/inc/wlan_hdd_cfg.h

@@ -6614,11 +6614,6 @@ enum hdd_link_speed_rpt_type {
 #define CFG_ENABLE_SNR_MONITORING_MAX               (1)
 #define CFG_ENABLE_SNR_MONITORING_DEFAULT           (0)
 
-#define CFG_AMSDU_SUPPORT_IN_AMPDU_NAME                "gAmsduSupportInAMPDU"
-#define CFG_AMSDU_SUPPORT_IN_AMPDU_MIN                 (0)
-#define CFG_AMSDU_SUPPORT_IN_AMPDU_MAX                 (1)
-#define CFG_AMSDU_SUPPORT_IN_AMPDU_DEFAULT             (0)      /* disabled */
-
 /*
  * <ini>
  * gEnableIpTcpUdpChecksumOffload - It enables IP, TCP and UDP checksum
@@ -7182,6 +7177,26 @@ enum hdd_link_speed_rpt_type {
 #define CFG_AUTO_DETECT_POWER_FAIL_MODE_DEFAULT         (0)
 #define CFG_AUTO_DETECT_POWER_FAIL_MODE_MIN             (0)
 #define CFG_AUTO_DETECT_POWER_FAIL_MODE_MAX             (1)
+/*
+ * <ini>
+ * gMaxAmsduNum - Max number of MSDU's in aggregate
+ * @Min: 0
+ * @Max: 3
+ * @Default: 1
+ * gMaxAmsduNum is the number of MSDU's transmitted in the 11n aggregate
+ * frame. Setting it to a value larger than 1 enables transmit aggregation.
+ * It is a PHY parameter that applies to all vdev's in firmware.
+ *
+ * Supported Feature: 11n aggregation
+ *
+ * Usage: Internal
+ *
+ * </ini>
+ */
+#define CFG_MAX_AMSDU_NUM_NAME                "gMaxAmsduNum"
+#define CFG_MAX_AMSDU_NUM_MIN                 (0)
+#define CFG_MAX_AMSDU_NUM_MAX                 (3)
+#define CFG_MAX_AMSDU_NUM_DEFAULT             (1)
 
 /*
  * <ini>
@@ -10817,7 +10832,7 @@ struct hdd_config {
 	uint32_t configPNOScanTimerRepeatValue;
 	uint32_t pno_slow_scan_multiplier;
 #endif
-	uint8_t isAmsduSupportInAMPDU;
+	uint8_t max_amsdu_num;
 	uint8_t nSelect5GHzMargin;
 	uint8_t isCoalesingInIBSSAllowed;
 

+ 8 - 9
core/hdd/src/wlan_hdd_cfg.c

@@ -2567,12 +2567,12 @@ struct reg_table_entry g_registry_table[] = {
 		     CFG_PNO_SLOW_SCAN_MULTIPLIER_MIN,
 		     CFG_PNO_SLOW_SCAN_MULTIPLIER_MAX),
 #endif
-	REG_VARIABLE(CFG_AMSDU_SUPPORT_IN_AMPDU_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, isAmsduSupportInAMPDU,
+	REG_VARIABLE(CFG_MAX_AMSDU_NUM_NAME , WLAN_PARAM_Integer,
+		     struct hdd_config, max_amsdu_num,
 		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_AMSDU_SUPPORT_IN_AMPDU_DEFAULT,
-		     CFG_AMSDU_SUPPORT_IN_AMPDU_MIN,
-		     CFG_AMSDU_SUPPORT_IN_AMPDU_MAX),
+		     CFG_MAX_AMSDU_NUM_DEFAULT,
+		     CFG_MAX_AMSDU_NUM_MIN,
+		     CFG_MAX_AMSDU_NUM_MAX),
 
 	REG_VARIABLE(CFG_STRICT_5GHZ_PREF_BY_MARGIN, WLAN_PARAM_Integer,
 		     struct hdd_config, nSelect5GHzMargin,
@@ -5583,8 +5583,8 @@ void hdd_cfg_print(hdd_context_t *pHddCtx)
 		  pHddCtx->config->goKeepAlivePeriod);
 	hdd_info("Name = [gApKeepAlivePeriod]Value = [%u]",
 		  pHddCtx->config->apKeepAlivePeriod);
-	hdd_info("Name = [gAmsduSupportInAMPDU] Value = [%u] ",
-		  pHddCtx->config->isAmsduSupportInAMPDU);
+	hdd_debug("Name = [max_amsdu_num] Value = [%u] ",
+		 pHddCtx->config->max_amsdu_num);
 	hdd_info("Name = [nSelect5GHzMargin] Value = [%u] ",
 		  pHddCtx->config->nSelect5GHzMargin);
 	hdd_info("Name = [gCoalesingInIBSS] Value = [%u] ",
@@ -7464,8 +7464,7 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx)
 	smeConfig->csrConfig.cc_switch_mode = pConfig->WlanMccToSccSwitchMode;
 #endif
 
-	smeConfig->csrConfig.isAmsduSupportInAMPDU =
-		pConfig->isAmsduSupportInAMPDU;
+	smeConfig->csrConfig.max_amsdu_num = pConfig->max_amsdu_num;
 	smeConfig->csrConfig.nSelect5GHzMargin = pConfig->nSelect5GHzMargin;
 
 	smeConfig->csrConfig.isCoalesingInIBSSAllowed =

+ 11 - 0
core/hdd/src/wlan_hdd_main.c

@@ -3638,6 +3638,17 @@ int hdd_set_fw_params(hdd_adapter_t *adapter)
 		goto error;
 	}
 
+	hdd_debug("SET AMSDU num %d", hdd_ctx->config->max_amsdu_num);
+
+	ret = wma_cli_set_command(adapter->sessionId,
+				  GEN_VDEV_PARAM_AMSDU,
+				  hdd_ctx->config->max_amsdu_num,
+				  GEN_CMD);
+	if (ret != 0) {
+		hdd_err("GEN_VDEV_PARAM_AMSDU set failed %d", ret);
+		goto error;
+	}
+
 	hdd_set_fw_log_params(hdd_ctx, adapter);
 	EXIT();
 

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

@@ -8298,6 +8298,9 @@ static int __iw_setint_getnone(struct net_device *dev,
 		ret = wma_cli_set_command(pAdapter->sessionId,
 					  GEN_VDEV_PARAM_AMSDU,
 					  set_value, GEN_CMD);
+		/* Update the stored ini value */
+		if (!ret)
+			hdd_ctx->config->max_amsdu_num = set_value;
 		break;
 	}
 

+ 1 - 1
core/mac/inc/sir_api.h

@@ -1189,7 +1189,7 @@ typedef struct sSirSmeJoinReq {
 	uint8_t htSmps;
 	bool send_smps_action;
 
-	uint8_t isAmsduSupportInAMPDU;
+	uint8_t max_amsdu_num;
 	tAniBool isWMEenabled;
 	tAniBool isQosEnabled;
 	tAniBool isOSENConnection;

+ 1 - 0
core/mac/inc/sir_mac_prot_def.h

@@ -1697,6 +1697,7 @@ typedef enum eHTCapability {
 	eHT_PSMP,
 	eHT_DSSS_CCK_MODE_40MHZ,
 	eHT_MAX_AMSDU_LENGTH,
+	eHT_MAX_AMSDU_NUM,
 	eHT_RX_STBC,
 	eHT_TX_STBC,
 	eHT_SHORT_GI_40MHZ,

+ 1 - 1
core/mac/src/pe/include/lim_session.h

@@ -374,7 +374,7 @@ typedef struct sPESession       /* Added to Support BT-AMP */
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM
 	int8_t rssi;
 #endif
-	uint8_t isAmsduSupportInAMPDU;
+	uint8_t max_amsdu_num;
 	uint8_t isCoalesingInIBSSAllowed;
 
 	tSirHTConfig htConfig;

+ 3 - 0
core/mac/src/pe/lim/lim_assoc_utils.c

@@ -2767,6 +2767,9 @@ lim_add_sta_self(tpAniSirGlobal pMac, uint16_t staIdx, uint8_t updateSta,
 			pAddStaParams->maxAmsduSize =
 				lim_get_ht_capability(pMac, eHT_MAX_AMSDU_LENGTH,
 						      psessionEntry);
+			pAddStaParams->max_amsdu_num =
+				lim_get_ht_capability(pMac, eHT_MAX_AMSDU_NUM,
+						      psessionEntry);
 			pAddStaParams->fDsssCckMode40Mhz =
 				lim_get_ht_capability(pMac, eHT_DSSS_CCK_MODE_40MHZ,
 						      psessionEntry);

+ 3 - 0
core/mac/src/pe/lim/lim_process_mlm_host_roam.c

@@ -512,6 +512,9 @@ void lim_process_sta_mlm_add_bss_rsp_ft(tpAniSirGlobal pMac,
 		pAddStaParams->maxAmsduSize =
 			lim_get_ht_capability(pMac, eHT_MAX_AMSDU_LENGTH,
 					      psessionEntry);
+		pAddStaParams->max_amsdu_num =
+			lim_get_ht_capability(pMac, eHT_MAX_AMSDU_NUM,
+					      psessionEntry);
 		pAddStaParams->fDsssCckMode40Mhz =
 			lim_get_ht_capability(pMac, eHT_DSSS_CCK_MODE_40MHZ,
 					      psessionEntry);

+ 3 - 0
core/mac/src/pe/lim/lim_process_mlm_req_messages.c

@@ -409,6 +409,9 @@ static void mlm_add_sta(tpAniSirGlobal mac_ctx, tpAddStaParams sta_param,
 		sta_param->maxAmsduSize =
 			lim_get_ht_capability(mac_ctx, eHT_MAX_AMSDU_LENGTH,
 					      session_entry);
+		sta_param->max_amsdu_num =
+			lim_get_ht_capability(mac_ctx, eHT_MAX_AMSDU_NUM,
+					      session_entry);
 		sta_param->fDsssCckMode40Mhz =
 			lim_get_ht_capability(mac_ctx, eHT_DSSS_CCK_MODE_40MHZ,
 					      session_entry);

+ 1 - 2
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -1596,8 +1596,7 @@ __lim_process_sme_join_req(tpAniSirGlobal mac_ctx, uint32_t *msg_buf)
 				pe_debug("SessionId:%d New session created",
 					session_id);
 		}
-		session->isAmsduSupportInAMPDU =
-			sme_join_req->isAmsduSupportInAMPDU;
+		session->max_amsdu_num = sme_join_req->max_amsdu_num;
 
 		/*
 		 * Store Session related parameters

+ 4 - 0
core/mac/src/pe/lim/lim_utils.c

@@ -2856,6 +2856,10 @@ uint8_t lim_get_ht_capability(tpAniSirGlobal pMac,
 		retVal = (uint8_t) macHTCapabilityInfo.maximalAMSDUsize;
 		break;
 
+	case eHT_MAX_AMSDU_NUM:
+		retVal = (uint8_t) psessionEntry->max_amsdu_num;
+		break;
+
 	case eHT_RX_STBC:
 		retVal = (uint8_t) psessionEntry->htConfig.ht_rx_stbc;
 		break;

+ 1 - 1
core/sme/inc/csr_api.h

@@ -1246,7 +1246,7 @@ typedef struct tagCsrConfigParam {
 	uint8_t scanCfgAgingTime;
 	uint8_t enable_tx_ldpc;
 	uint8_t enable_rx_ldpc;
-	uint8_t isAmsduSupportInAMPDU;
+	uint8_t max_amsdu_num;
 	uint8_t nSelect5GHzMargin;
 	uint8_t isCoalesingInIBSSAllowed;
 #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH

+ 1 - 1
core/sme/inc/csr_internal.h

@@ -568,7 +568,7 @@ typedef struct tagCsrConfig {
 	 * Enable/Disable heartbeat offload
 	 */
 	bool enableHeartBeatOffload;
-	uint8_t isAmsduSupportInAMPDU;
+	uint8_t max_amsdu_num;
 	uint8_t nSelect5GHzMargin;
 	uint8_t isCoalesingInIBSSAllowed;
 #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH

+ 5 - 5
core/sme/src/csr/csr_api_roam.c

@@ -2678,8 +2678,8 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac,
 		pMac->roam.configParam.rx_ldpc_enable = pParam->enable_rx_ldpc;
 		pMac->roam.configParam.ignore_peer_erp_info =
 			pParam->ignore_peer_erp_info;
-		pMac->roam.configParam.isAmsduSupportInAMPDU =
-			pParam->isAmsduSupportInAMPDU;
+		pMac->roam.configParam.max_amsdu_num =
+			pParam->max_amsdu_num;
 		pMac->roam.configParam.nSelect5GHzMargin =
 			pParam->nSelect5GHzMargin;
 		pMac->roam.configParam.isCoalesingInIBSSAllowed =
@@ -2932,7 +2932,7 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam)
 #endif
 	pParam->enable_tx_ldpc = cfg_params->tx_ldpc_enable;
 	pParam->enable_rx_ldpc = cfg_params->rx_ldpc_enable;
-	pParam->isAmsduSupportInAMPDU = cfg_params->isAmsduSupportInAMPDU;
+	pParam->max_amsdu_num = cfg_params->max_amsdu_num;
 	pParam->nSelect5GHzMargin = cfg_params->nSelect5GHzMargin;
 	pParam->isCoalesingInIBSSAllowed = cfg_params->isCoalesingInIBSSAllowed;
 	pParam->allowDFSChannelRoam = cfg_params->allowDFSChannelRoam;
@@ -14661,8 +14661,8 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId,
 		csr_join_req->send_smps_action =
 			pMac->roam.configParam.send_smps_action;
 
-		csr_join_req->isAmsduSupportInAMPDU =
-			(uint8_t) pMac->roam.configParam.isAmsduSupportInAMPDU;
+		csr_join_req->max_amsdu_num =
+			(uint8_t) pMac->roam.configParam.max_amsdu_num;
 
 		if (pMac->roam.roamSession[sessionId].fWMMConnection)
 			csr_join_req->isWMEenabled = true;

+ 2 - 0
core/wma/inc/wma_if.h

@@ -229,6 +229,7 @@ typedef struct sAniProbeRspStruct {
  * @atimIePresent: Peer Atim Info
  * @peerAtimWindowLength: peer ATIM Window length
  * @nss: Return the number of spatial streams supported
+ * @max_amsdu_num: Maximum number of MSDUs in a tx aggregate frame
  *
  * This structure contains parameter required for
  * add sta request of upper layer.
@@ -332,6 +333,7 @@ typedef struct {
 	tDot11fIEvendor_he_cap he_config;
 	tDot11fIEvendor_he_op he_op;
 #endif
+	uint8_t max_amsdu_num;
 } tAddStaParams, *tpAddStaParams;
 
 /**

+ 14 - 13
core/wma/src/wma_main.c

@@ -992,19 +992,20 @@ static void wma_process_cli_set_cmd(tp_wma_handle wma,
 			}
 			break;
 		case GEN_VDEV_PARAM_AMSDU:
-			if (soc) {
-				ret = cdp_aggr_cfg(soc, vdev, 0,
-							privcmd->param_value);
-				if (ret)
-					WMA_LOGE("cdp_aggr_cfg set amsdu failed ret %d",
-						ret);
-				else
-					intr[privcmd->param_vdev_id].config.
-					amsdu = privcmd->param_value;
-			} else {
-				WMA_LOGE("%s:SOC context is NULL", __func__);
-				return;
-			}
+			/*
+			 * Firmware currently does not support set operation
+			 * for AMSDU. It may cause crash if the configuration
+			 * is sent to firmware.
+			 * Firmware enhancement will advertise a service bit
+			 * to enable AMSDU configuration through WMI. Then
+			 * add the WMI command to configure AMSDU parameter.
+			 * For the older chipset that does not advertise the
+			 * service bit, enable the following legacy code:
+			 *    ol_txrx_aggr_cfg(vdev, 0, privcmd->param_value);
+			 *    intr[privcmd->param_vdev_id].config.amsdu =
+			 *            privcmd->param_value;
+			 */
+			WMA_LOGE("SET GEN_VDEV_PARAM_AMSDU command is currently not supported");
 			break;
 		case GEN_PARAM_CRASH_INJECT:
 			if (QDF_GLOBAL_FTM_MODE  == cds_get_conparam())