Prechádzať zdrojové kódy

qcacld-3.0: ini param support for disconnect threshold

This is qcacld-2.0 to qcacld-3.0 propagation.

This patch adds ini support for WMI_VDEV_PARAM_DISCONNECT_TH
which represents number of dropped packets before FW sends out
kickout event for that peer to host.

Change-Id: I4c82bd1b5d1bc5d8265e3b0e5e58c82cdcab7f50
CRs-Fixed: 862686
Naveen Rawat 8 rokov pred
rodič
commit
2b6e3c9d51

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

@@ -1559,6 +1559,29 @@ enum hdd_dot11_mode {
 #define CFG_ROAM_RESCAN_RSSI_DIFF_MAX                   (100)
 #define CFG_ROAM_RESCAN_RSSI_DIFF_DEFAULT               (5)
 
+/*
+ * <ini>
+ * gDroppedPktDisconnectTh - Sets dropped packet threshold in firmware
+ * @Min: 0
+ * @Max: 512
+ * @Default: 512
+ *
+ * This INI is the packet drop threshold will trigger disconnect from remote
+ * peer.
+ *
+ * Related: None
+ *
+ * Supported Feature: connection
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_DROPPED_PKT_DISCONNECT_TH_NAME      "gDroppedPktDisconnectTh"
+#define CFG_DROPPED_PKT_DISCONNECT_TH_MIN       (0)
+#define CFG_DROPPED_PKT_DISCONNECT_TH_MAX       (512)
+#define CFG_DROPPED_PKT_DISCONNECT_TH_DEFAULT   (512)
+
 /*
  * <ini>
  * gEnableFastRoamInConcurrency - Enable LFR roaming on STA during concurrency
@@ -10757,6 +10780,8 @@ struct hdd_config {
 	uint8_t fils_max_chan_guard_time;
 	enum hdd_external_acs_policy external_acs_policy;
 	enum hdd_external_acs_freq_band external_acs_freq_band;
+	/* threshold of packet drops at which FW initiates disconnect */
+	uint16_t pkt_err_disconn_th;
 };
 
 #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var))

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

@@ -4318,12 +4318,14 @@ struct reg_table_entry g_registry_table[] = {
 		     CFG_ENABLE_REG_OFFLOAD_DEFAULT,
 		     CFG_ENABLE_REG_OFFLOAD_MIN,
 		     CFG_ENABLE_REG_OFFLOAD_MAX),
+
 	REG_VARIABLE(CFG_FILS_MAX_CHAN_GUARD_TIME_NAME, WLAN_PARAM_Integer,
 		struct hdd_config, fils_max_chan_guard_time,
 		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
 		CFG_FILS_MAX_CHAN_GUARD_TIME_DEFAULT,
 		CFG_FILS_MAX_CHAN_GUARD_TIME_MIN,
 		CFG_FILS_MAX_CHAN_GUARD_TIME_MAX),
+
 	REG_VARIABLE(CFG_EXTERNAL_ACS_POLICY, WLAN_PARAM_Integer,
 		     struct hdd_config, external_acs_policy,
 		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -4337,6 +4339,13 @@ struct reg_table_entry g_registry_table[] = {
 		     CFG_EXTERNAL_ACS_FREQ_BAND_DEFAULT,
 		     CFG_EXTERNAL_ACS_FREQ_BAND_MIN,
 		     CFG_EXTERNAL_ACS_FREQ_BAND_MAX),
+
+	REG_VARIABLE(CFG_DROPPED_PKT_DISCONNECT_TH_NAME, WLAN_PARAM_Integer,
+		struct hdd_config, pkt_err_disconn_th,
+		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		CFG_DROPPED_PKT_DISCONNECT_TH_DEFAULT,
+		CFG_DROPPED_PKT_DISCONNECT_TH_MIN,
+		CFG_DROPPED_PKT_DISCONNECT_TH_MAX),
 };
 
 
@@ -5847,6 +5856,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx)
 	hdd_info("Name = [%s] Value = [%d]",
 		 CFG_EXTERNAL_ACS_FREQ_BAND,
 		 pHddCtx->config->external_acs_freq_band);
+	hdd_info("Name = [%s] value = [%u]",
+		 CFG_DROPPED_PKT_DISCONNECT_TH_NAME,
+		 pHddCtx->config->pkt_err_disconn_th);
 }
 
 
@@ -7431,6 +7443,8 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx)
 
 	hdd_he_set_sme_config(smeConfig, pConfig);
 
+	smeConfig->csrConfig.pkt_err_disconn_th =
+			pHddCtx->config->pkt_err_disconn_th;
 	status = sme_update_config(pHddCtx->hHal, smeConfig);
 	if (!QDF_IS_STATUS_SUCCESS(status))
 		hdd_err("sme_update_config() failure: %d", status);

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

@@ -1313,6 +1313,7 @@ typedef struct tagCsrConfigParam {
 #endif
 	bool qcn_ie_support;
 	uint8_t fils_max_chan_guard_time;
+	uint16_t pkt_err_disconn_th;
 } tCsrConfigParam;
 
 /* Tush */

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

@@ -624,6 +624,7 @@ typedef struct tagCsrConfig {
 #endif
 	bool qcn_ie_support;
 	uint8_t fils_max_chan_guard_time;
+	uint16_t pkt_err_disconn_th;
 } tCsrConfig;
 
 typedef struct tagCsrChannelPowerInfo {

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

@@ -2352,6 +2352,8 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac,
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
 	if (pParam) {
+		pMac->roam.configParam.pkt_err_disconn_th =
+			pParam->pkt_err_disconn_th;
 		pMac->roam.configParam.WMMSupportMode = pParam->WMMSupportMode;
 		cfg_set_int(pMac, WNI_CFG_WME_ENABLED,
 			(pParam->WMMSupportMode == eCsrRoamWmmNoQos) ? 0 : 1);
@@ -2818,6 +2820,7 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam)
 	if (!pParam)
 		return QDF_STATUS_E_INVAL;
 
+	pParam->pkt_err_disconn_th = cfg_params->pkt_err_disconn_th;
 	pParam->WMMSupportMode = cfg_params->WMMSupportMode;
 	pParam->Is11eSupportEnabled = cfg_params->Is11eSupportEnabled;
 	pParam->FragmentationThreshold = cfg_params->FragmentationThreshold;
@@ -15513,7 +15516,8 @@ QDF_STATUS csr_issue_add_sta_for_session_req(tpAniSirGlobal pMac,
 			pMac->roam.configParam.enable_bcast_probe_rsp;
 	add_sta_self_req->fils_max_chan_guard_time =
 			pMac->roam.configParam.fils_max_chan_guard_time;
-
+	add_sta_self_req->pkt_err_disconn_th =
+			pMac->roam.configParam.pkt_err_disconn_th;
 	msg.type = WMA_ADD_STA_SELF_REQ;
 	msg.reserved = 0;
 	msg.bodyptr = add_sta_self_req;

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

@@ -1171,6 +1171,7 @@ typedef struct sMaxTxPowerPerBandParams {
  * @rx_aggregation_size: Rx aggregation size
  * @enable_bcast_probe_rsp: enable broadcast probe response
  * @fils_max_chan_guard_time: FILS max channel guard time
+ * @pkt_err_disconn_th: packet drop threshold
  */
 struct add_sta_self_params {
 	tSirMacAddr self_mac_addr;
@@ -1185,6 +1186,7 @@ struct add_sta_self_params {
 	uint32_t rx_aggregation_size;
 	bool enable_bcast_probe_rsp;
 	uint8_t fils_max_chan_guard_time;
+	uint16_t pkt_err_disconn_th;
 };
 
 /**

+ 9 - 0
core/wma/src/wma_dev_if.c

@@ -1762,6 +1762,15 @@ struct cdp_vdev *wma_vdev_attach(tp_wma_handle wma_handle,
 		}
 	}
 
+	WMA_LOGD("Setting WMI_VDEV_PARAM_DISCONNECT_TH: %d",
+		self_sta_req->pkt_err_disconn_th);
+	ret = wma_vdev_set_param(wma_handle->wmi_handle,
+				self_sta_req->session_id,
+				WMI_VDEV_PARAM_DISCONNECT_TH,
+				self_sta_req->pkt_err_disconn_th);
+	if (ret)
+		WMA_LOGE("Failed to set WMI_VDEV_PARAM_DISCONNECT_TH");
+
 	wma_handle->interfaces[vdev_id].is_vdev_valid = true;
 	ret = wma_vdev_set_param(wma_handle->wmi_handle,
 				self_sta_req->session_id,