diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 56522889e4c4..90f64e819f54 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -1538,22 +1538,35 @@ typedef enum { #define CFG_TDLS_TX_STATS_PERIOD "gTDLSTxStatsPeriod" #define CFG_TDLS_TX_STATS_PERIOD_MIN (10) #define CFG_TDLS_TX_STATS_PERIOD_MAX (4294967295UL) -#define CFG_TDLS_TX_STATS_PERIOD_DEFAULT (5000) +#define CFG_TDLS_TX_STATS_PERIOD_DEFAULT (500) #define CFG_TDLS_TX_PACKET_THRESHOLD "gTDLSTxPacketThreshold" #define CFG_TDLS_TX_PACKET_THRESHOLD_MIN (0) #define CFG_TDLS_TX_PACKET_THRESHOLD_MAX (4294967295UL) -#define CFG_TDLS_TX_PACKET_THRESHOLD_DEFAULT (100) +#define CFG_TDLS_TX_PACKET_THRESHOLD_DEFAULT (10) #define CFG_TDLS_MAX_DISCOVERY_ATTEMPT "gTDLSMaxDiscoveryAttempt" #define CFG_TDLS_MAX_DISCOVERY_ATTEMPT_MIN (1) #define CFG_TDLS_MAX_DISCOVERY_ATTEMPT_MAX (100) #define CFG_TDLS_MAX_DISCOVERY_ATTEMPT_DEFAULT (5) +/* teardown notification interval (gTDLSIdleTimeout) should be multiple of + * setup notification (gTDLSTxStatsPeriod) interval. + * e.g. + * if setup notification (gTDLSTxStatsPeriod) interval = 500, then + * teardown notification (gTDLSIdleTimeout) interval should be 1000, + * 1500, 2000, 2500... + */ +#define CFG_TDLS_IDLE_TIMEOUT "gTDLSIdleTimeout" +#define CFG_TDLS_IDLE_TIMEOUT_MIN (500) +#define CFG_TDLS_IDLE_TIMEOUT_MAX (40000) +#define CFG_TDLS_IDLE_TIMEOUT_DEFAULT (2000) + + #define CFG_TDLS_IDLE_PACKET_THRESHOLD "gTDLSIdlePacketThreshold" #define CFG_TDLS_IDLE_PACKET_THRESHOLD_MIN (0) #define CFG_TDLS_IDLE_PACKET_THRESHOLD_MAX (40000) -#define CFG_TDLS_IDLE_PACKET_THRESHOLD_DEFAULT (5) +#define CFG_TDLS_IDLE_PACKET_THRESHOLD_DEFAULT (1) #define CFG_TDLS_RSSI_TRIGGER_THRESHOLD "gTDLSRSSITriggerThreshold" #define CFG_TDLS_RSSI_TRIGGER_THRESHOLD_MIN (-120) @@ -3087,6 +3100,7 @@ struct hdd_config { uint32_t fTDLSTxStatsPeriod; uint32_t fTDLSTxPacketThreshold; uint32_t fTDLSMaxDiscoveryAttempt; + uint32_t tdls_idle_timeout; uint32_t fTDLSIdlePacketThreshold; int32_t fTDLSRSSITriggerThreshold; int32_t fTDLSRSSITeardownThreshold; diff --git a/core/hdd/inc/wlan_hdd_tdls.h b/core/hdd/inc/wlan_hdd_tdls.h index 33557fc20901..c1f06cec7460 100644 --- a/core/hdd/inc/wlan_hdd_tdls.h +++ b/core/hdd/inc/wlan_hdd_tdls.h @@ -394,6 +394,7 @@ typedef struct { * @puapsd_mask: puapsd mask * @puapsd_inactivity_time: puapsd inactivity time * @puapsd_rx_frame_threshold: puapsd rx frame threshold + * @teardown_notification_ms: tdls teardown notification interval */ typedef struct { uint32_t vdev_id; @@ -409,6 +410,7 @@ typedef struct { uint32_t puapsd_mask; uint32_t puapsd_inactivity_time; uint32_t puapsd_rx_frame_threshold; + uint32_t teardown_notification_ms; } tdlsInfo_t; int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter); diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index b0d7e88e7ae3..9b495dd7c7fb 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -2232,6 +2232,13 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_TDLS_MAX_DISCOVERY_ATTEMPT_MIN, CFG_TDLS_MAX_DISCOVERY_ATTEMPT_MAX), + REG_VARIABLE(CFG_TDLS_IDLE_TIMEOUT, WLAN_PARAM_Integer, + struct hdd_config, tdls_idle_timeout, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TDLS_IDLE_TIMEOUT_DEFAULT, + CFG_TDLS_IDLE_TIMEOUT_MIN, + CFG_TDLS_IDLE_TIMEOUT_MAX), + REG_VARIABLE(CFG_TDLS_IDLE_PACKET_THRESHOLD, WLAN_PARAM_Integer, struct hdd_config, fTDLSIdlePacketThreshold, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index aa0e442bdd5d..58f4660a5807 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -438,7 +438,7 @@ static void dump_tdls_state_param_setting(tdlsInfo_t *info) hddLog(LOG1, FL( - "Setting tdls state and param in fw: vdev_id: %d, tdls_state: %d, notification_interval_ms: %d, tx_discovery_threshold: %d, tx_teardown_threshold: %d, rssi_teardown_threshold: %d, rssi_delta: %d, tdls_options: 0x%x, peer_traffic_ind_window: %d, peer_traffic_response_timeout: %d, puapsd_mask: 0x%x, puapsd_inactivity_time: %d, puapsd_rx_frame_threshold: %d" + "Setting tdls state and param in fw: vdev_id: %d, tdls_state: %d, notification_interval_ms: %d, tx_discovery_threshold: %d, tx_teardown_threshold: %d, rssi_teardown_threshold: %d, rssi_delta: %d, tdls_options: 0x%x, peer_traffic_ind_window: %d, peer_traffic_response_timeout: %d, puapsd_mask: 0x%x, puapsd_inactivity_time: %d, puapsd_rx_frame_threshold: %d, teardown_notification_ms: %d" ), info->vdev_id, info->tdls_state, @@ -452,7 +452,8 @@ static void dump_tdls_state_param_setting(tdlsInfo_t *info) info->peer_traffic_response_timeout, info->puapsd_mask, info->puapsd_inactivity_time, - info->puapsd_rx_frame_threshold); + info->puapsd_rx_frame_threshold, + info->teardown_notification_ms); } @@ -700,6 +701,8 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter) pHddCtx->config->fTDLSPuapsdInactivityTimer; tInfo->puapsd_rx_frame_threshold = pHddCtx->config->fTDLSRxFrameThreshold; + tInfo->teardown_notification_ms = + pHddCtx->config->tdls_idle_timeout; dump_tdls_state_param_setting(tInfo); @@ -799,6 +802,8 @@ void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter) pHddCtx->config->fTDLSPuapsdInactivityTimer; tInfo->puapsd_rx_frame_threshold = pHddCtx->config->fTDLSRxFrameThreshold; + tInfo->teardown_notification_ms = + pHddCtx->config->tdls_idle_timeout; dump_tdls_state_param_setting(tInfo); @@ -1634,36 +1639,10 @@ int wlan_hdd_tdls_set_params(struct net_device *dev, pHddCtx->config->fTDLSPuapsdInactivityTimer; tdlsParams->puapsd_rx_frame_threshold = pHddCtx->config->fTDLSRxFrameThreshold; + tdlsParams->teardown_notification_ms = + pHddCtx->config->tdls_idle_timeout; - hddLog(LOG1, - "%s: Setting tdls state and param in fw: " - "vdev_id: %d, " - "tdls_state: %d, " - "notification_interval_ms: %d, " - "tx_discovery_threshold: %d, " - "tx_teardown_threshold: %d, " - "rssi_teardown_threshold: %d, " - "rssi_delta: %d, " - "tdls_options: 0x%x, " - "peer_traffic_ind_window: %d, " - "peer_traffic_response_timeout: %d, " - "puapsd_mask: 0x%x, " - "puapsd_inactivity_time: %d, " - "puapsd_rx_frame_threshold: %d ", - __func__, - tdlsParams->vdev_id, - tdlsParams->tdls_state, - tdlsParams->notification_interval_ms, - tdlsParams->tx_discovery_threshold, - tdlsParams->tx_teardown_threshold, - tdlsParams->rssi_teardown_threshold, - tdlsParams->rssi_delta, - tdlsParams->tdls_options, - tdlsParams->peer_traffic_ind_window, - tdlsParams->peer_traffic_response_timeout, - tdlsParams->puapsd_mask, - tdlsParams->puapsd_inactivity_time, - tdlsParams->puapsd_rx_frame_threshold); + dump_tdls_state_param_setting(tdlsParams); cdf_ret_status = sme_update_fw_tdls_state(pHddCtx->hHal, tdlsParams, true); if (CDF_STATUS_SUCCESS != cdf_ret_status) { @@ -1768,35 +1747,10 @@ void wlan_hdd_update_tdls_info(hdd_adapter_t *adapter, bool tdls_prohibited, hdd_ctx->config->fTDLSPuapsdInactivityTimer; tdls_param->puapsd_rx_frame_threshold = hdd_ctx->config->fTDLSRxFrameThreshold; + tdls_param->teardown_notification_ms = + hdd_ctx->config->tdls_idle_timeout; - hddLog(CDF_TRACE_LEVEL_DEBUG, - FL("Setting tdls state and param in fw: " - "vdev_id: %d, " - "tdls_state: %d, " - "notification_interval_ms: %d, " - "tx_discovery_threshold: %d, " - "tx_teardown_threshold: %d, " - "rssi_teardown_threshold: %d, " - "rssi_delta: %d, " - "tdls_options: 0x%x, " - "peer_traffic_ind_window: %d, " - "peer_traffic_response_timeout: %d, " - "puapsd_mask: 0x%x, " - "puapsd_inactivity_time: %d, " - "puapsd_rx_frame_threshold: %d "), - tdls_param->vdev_id, - tdls_param->tdls_state, - tdls_param->notification_interval_ms, - tdls_param->tx_discovery_threshold, - tdls_param->tx_teardown_threshold, - tdls_param->rssi_teardown_threshold, - tdls_param->rssi_delta, - tdls_param->tdls_options, - tdls_param->peer_traffic_ind_window, - tdls_param->peer_traffic_response_timeout, - tdls_param->puapsd_mask, - tdls_param->puapsd_inactivity_time, - tdls_param->puapsd_rx_frame_threshold); + dump_tdls_state_param_setting(tdls_param); cdf_ret_status = sme_update_fw_tdls_state(hdd_ctx->hHal, tdls_param, diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index 3028688cb682..afffb5e05dad 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -1784,6 +1784,7 @@ typedef enum { * @puapsd_mask: uapsd mask * @puapsd_inactivity_time: uapsd inactivity time * @puapsd_rx_frame_threshold: uapsd rx frame threshold + * @teardown_notification_ms: tdls teardown notification interval */ typedef struct wma_tdls_params { uint32_t vdev_id; @@ -1799,6 +1800,7 @@ typedef struct wma_tdls_params { uint32_t puapsd_mask; uint32_t puapsd_inactivity_time; uint32_t puapsd_rx_frame_threshold; + uint32_t teardown_notification_ms; } t_wma_tdls_params; /** diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 32b3bc4f356e..7ed21d9d8a54 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -6509,6 +6509,8 @@ int wma_update_fw_tdls_state(WMA_HANDLE handle, void *pwmaTdlsparams) cmd->tdls_puapsd_inactivity_time_ms = wma_tdls->puapsd_inactivity_time; cmd->tdls_puapsd_rx_frame_threshold = wma_tdls->puapsd_rx_frame_threshold; + cmd->teardown_notification_ms = + wma_tdls->teardown_notification_ms; WMA_LOGD("%s: tdls_mode: %d, state: %d, " "notification_interval_ms: %d, " @@ -6521,7 +6523,8 @@ int wma_update_fw_tdls_state(WMA_HANDLE handle, void *pwmaTdlsparams) "tdls_peer_traffic_response_timeout: %d, " "tdls_puapsd_mask: 0x%x, " "tdls_puapsd_inactivity_time: %d, " - "tdls_puapsd_rx_frame_threshold: %d ", + "tdls_puapsd_rx_frame_threshold: %d, " + "teardown_notification_ms: %d", __func__, tdls_mode, cmd->state, cmd->notification_interval_ms, cmd->tx_discovery_threshold, @@ -6533,7 +6536,8 @@ int wma_update_fw_tdls_state(WMA_HANDLE handle, void *pwmaTdlsparams) cmd->tdls_peer_traffic_response_timeout_ms, cmd->tdls_puapsd_mask, cmd->tdls_puapsd_inactivity_time_ms, - cmd->tdls_puapsd_rx_frame_threshold); + cmd->tdls_puapsd_rx_frame_threshold, + cmd->teardown_notification_ms); if (wmi_unified_cmd_send(wma_handle->wmi_handle, wmi_buf, len, WMI_TDLS_SET_STATE_CMDID)) {