diff options
| author | Agrawal Ashish <ashishka@qti.qualcomm.com> | 2016-06-09 17:42:05 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-07-13 14:53:13 +0530 |
| commit | eb2d58e7e33daf64387af5faa68fa2a102408fd6 (patch) | |
| tree | 5ac3ea4f9eaf9c9904410dc98e591d633575e0a5 | |
| parent | 4772a0af0d5e15874c559e4b8f320b70d00a0381 (diff) | |
qcacld-2.0: Pass sta_inactivity_timeout to FW
If a station does not send anything in sta_inactivity_timeout, an
empty data frame is sent to it in order to verify whether it is
still in range. If this frame is not ACKed, the station will be
disassociated and then deauthenticated.
Change-Id: Ib86c9aacdb52141890b224262d55abbe58b1604d
CRs-Fixed: 1020078
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg.h | 16 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg.c | 14 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 5 | ||||
| -rw-r--r-- | CORE/MAC/inc/sirApi.h | 11 | ||||
| -rw-r--r-- | CORE/MAC/src/include/sirParams.h | 2 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 59 | ||||
| -rw-r--r-- | CORE/SME/inc/sme_Api.h | 2 | ||||
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 54 | ||||
| -rw-r--r-- | CORE/WDA/inc/wlan_qct_wda.h | 2 |
9 files changed, 161 insertions, 4 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index e0ea1955ec4b..bab5442a5877 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -3944,6 +3944,21 @@ enum dot11p_mode { #define CFG_BUG_ON_REINIT_FAILURE_MAX (1) #define CFG_BUG_ON_REINIT_FAILURE_DEFAULT (1) +/* + * This parameter will avoid updating ap_sta_inactivity from hostapd.conf + * file. If a station does not send anything in ap_max_inactivity seconds, an + * empty data frame is sent to it in order to verify whether it is + * still in range. If this frame is not ACKed, the station will be + * disassociated and then deauthenticated. This feature is used to + * clear station table of old entries when the STAs move out of the + * range. + * Default : Disable + */ +#define CFG_SAP_MAX_INACTIVITY_OVERRIDE_NAME "gSapMaxInactivityOverride" +#define CFG_SAP_MAX_INACTIVITY_OVERRIDE_DEFAULT (0) +#define CFG_SAP_MAX_INACTIVITY_OVERRIDE_MIN (0) +#define CFG_SAP_MAX_INACTIVITY_OVERRIDE_MAX (1) + /*--------------------------------------------------------------------------- Type declarations -------------------------------------------------------------------------*/ @@ -4723,6 +4738,7 @@ struct hdd_config { bool bug_on_reinit_failure; /* parameter to force sap into 11n */ bool sap_force_11n_for_11ac; + uint8_t sap_max_inactivity_override; }; typedef struct hdd_config hdd_config_t; diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index 5c248fd0556d..6c7627b72b87 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -4659,7 +4659,15 @@ REG_TABLE_ENTRY g_registry_table[] = VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, CFG_SAP_FORCE_11N_FOR_11AC_DEFAULT, CFG_SAP_FORCE_11N_FOR_11AC_MIN, - CFG_SAP_FORCE_11N_FOR_11AC_MAX) + CFG_SAP_FORCE_11N_FOR_11AC_MAX), + + REG_VARIABLE(CFG_SAP_MAX_INACTIVITY_OVERRIDE_NAME, WLAN_PARAM_Integer, + hdd_config_t, sap_max_inactivity_override, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_SAP_MAX_INACTIVITY_OVERRIDE_DEFAULT, + CFG_SAP_MAX_INACTIVITY_OVERRIDE_MIN, + CFG_SAP_MAX_INACTIVITY_OVERRIDE_MAX) + }; @@ -5500,6 +5508,10 @@ void print_hdd_cfg(hdd_context_t *pHddCtx) hddLog(LOG2, "Name = [%s] Value = [%u]", CFG_SAP_FORCE_11N_FOR_11AC_NAME, pHddCtx->cfg_ini->sap_force_11n_for_11ac); + hddLog(LOG2, "Name = [%s] Value = [%u]", + CFG_SAP_MAX_INACTIVITY_OVERRIDE_NAME, + pHddCtx->cfg_ini->sap_max_inactivity_override); + hdd_ndp_print_ini_config(pHddCtx); } diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 4fa84555dbab..9456b7faeb74 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -12126,7 +12126,7 @@ int wlan_hdd_cfg80211_init(struct device *dev, #ifdef CHANNEL_SWITCH_SUPPORTED wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH; #endif - + wiphy->features |= NL80211_FEATURE_INACTIVITY_TIMER; EXIT(); return 0; } @@ -14759,6 +14759,9 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, } } hdd_change_ch_avoidance_status(pHddCtx, false); + if (pHddCtx->cfg_ini->sap_max_inactivity_override) + sme_update_sta_inactivity_timeout(WLAN_HDD_GET_HAL_CTX(pAdapter), + pAdapter->sessionId, params->inactivity_timeout); } EXIT(); diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index c58d55cbb397..34e60945775f 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -7518,4 +7518,15 @@ struct sme_long_retry_limit { uint8_t session_id; uint32_t long_retry_limit; }; + +/** + * struct sme_sta_inactivity_timeout - set sta_inactivity_timeout + * @session_id: session Id. + * @sta_inactivity_timeout: Timeout to disconnect STA after there + * is no activity. + */ +struct sme_sta_inactivity_timeout { + uint8_t session_id; + uint32_t sta_inactivity_timeout; +}; #endif /* __SIR_API_H */ diff --git a/CORE/MAC/src/include/sirParams.h b/CORE/MAC/src/include/sirParams.h index d2ba7f0d65ff..63ff542921cf 100644 --- a/CORE/MAC/src/include/sirParams.h +++ b/CORE/MAC/src/include/sirParams.h @@ -779,7 +779,7 @@ typedef struct sSirMbMsgP2p #define SIR_HAL_UPDATE_TX_FAIL_CNT_TH (SIR_HAL_ITC_MSG_TYPES_BEGIN + 362) #define SIR_HAL_SHORT_RETRY_LIMIT_CNT (SIR_HAL_ITC_MSG_TYPES_BEGIN + 363) #define SIR_HAL_LONG_RETRY_LIMIT_CNT (SIR_HAL_ITC_MSG_TYPES_BEGIN + 364) - +#define SIR_HAL_STA_INACTIVITY_TIMEOUT (SIR_HAL_ITC_MSG_TYPES_BEGIN + 365) #define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF) diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 171c09483a93..6b35c515f052 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -30315,6 +30315,59 @@ static VOS_STATUS wma_update_long_retry_limit(tp_wma_handle wma, } /* + * wma_update_sta_inactivity_timeout() - Set sta_inactivity_timeout to fw + * @wma_handle: WMA handle + * @sta_inactivity_timer: sme_sta_inactivity_timeout + * + * This function is used to set sta_inactivity_timeout. + * If a station does not send anything in sta_inactivity_timeout seconds, an + * empty data frame is sent to it in order to verify whether it is + * still in range. If this frame is not ACKed, the station will be + * disassociated and then deauthenticated. + * + * Return: None + */ +static void wma_update_sta_inactivity_timeout(tp_wma_handle wma, + struct sme_sta_inactivity_timeout *sta_inactivity_timer) +{ + u_int8_t vdev_id; + u_int32_t max_unresponsive_time; + u_int32_t min_inactive_time, max_inactive_time; + + if (!wma || !wma->wmi_handle) { + WMA_LOGE(FL("WMA is closed, can not issue sta_inactivity_timeout")); + return; + } + vdev_id = sta_inactivity_timer->session_id; + max_unresponsive_time = sta_inactivity_timer->sta_inactivity_timeout; + max_inactive_time = max_unresponsive_time* 2/3; + min_inactive_time = max_unresponsive_time - max_inactive_time ; + + if (wmi_unified_vdev_set_param_send(wma->wmi_handle, + vdev_id, + WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS, + min_inactive_time)) + WMA_LOGE("Failed to Set AP MIN IDLE INACTIVE TIME"); + + if (wmi_unified_vdev_set_param_send(wma->wmi_handle, + vdev_id, + WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS, + max_inactive_time)) + WMA_LOGE("Failed to Set AP MAX IDLE INACTIVE TIME"); + + + if (wmi_unified_vdev_set_param_send(wma->wmi_handle, + vdev_id, + WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS, + max_unresponsive_time)) + WMA_LOGE("%s:vdev_id:%d min_inactive_time: %u max_inactive_time: %u" + " max_unresponsive_time: %u", __func__, vdev_id, + min_inactive_time, max_inactive_time, max_unresponsive_time); + + return; +} + +/* * function : wma_mc_process_msg * Description : * Args : @@ -31205,7 +31258,11 @@ VOS_STATUS wma_mc_process_msg(v_VOID_t *vos_context, vos_msg_t *msg) wma_update_short_retry_limit(wma_handle, msg->bodyptr); vos_mem_free(msg->bodyptr); break; - + case WDA_UPDATE_STA_INACTIVITY_TIMEOUT: + wma_update_sta_inactivity_timeout(wma_handle, + msg->bodyptr); + vos_mem_free(msg->bodyptr); + break; default: WMA_LOGD("unknow msg type %x", msg->type); /* Do Nothing? MSG Body should be freed at here */ diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h index b22a9e30040c..fceeeac7ddd5 100644 --- a/CORE/SME/inc/sme_Api.h +++ b/CORE/SME/inc/sme_Api.h @@ -4596,4 +4596,6 @@ eHalStatus sme_update_short_retry_limit_threshold(tHalHandle hal_handle, uint8_t session_id, uint32_t short_limit_count_th); eHalStatus sme_update_long_retry_limit_threshold(tHalHandle hal_handle, uint8_t session_id, uint32_t long_limit_count_th); +eHalStatus sme_update_sta_inactivity_timeout(tHalHandle hal_handle, + uint8_t session_id, uint32_t sta_inactivity_timeout); #endif //#if !defined( __SME_API_H ) diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index bd038e560750..e1b212d7c0ce 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -19398,3 +19398,57 @@ eHalStatus sme_update_long_retry_limit_threshold(tHalHandle hal_handle, } return status; } + +/** + * sme_update_sta_inactivity_timeout(): Update sta_inactivity_timeout to FW + * @hal: Handle returned by mac_open + * @session_id: Session ID on which sta_inactivity_timeout needs + * to be updated to FW + * @sta_inactivity_timeout: sta inactivity timeout. + * + * If a station does not send anything in sta_inactivity_timeout seconds, an + * empty data frame is sent to it in order to verify whether it is + * still in range. If this frame is not ACKed, the station will be + * disassociated and then deauthenticated. + * + * Return: eHAL_STATUS_SUCCESS or non-zero on failure. + */ +eHalStatus sme_update_sta_inactivity_timeout(tHalHandle hal_handle, + uint8_t session_id, uint32_t sta_inactivity_timeout) +{ + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_handle); + eHalStatus status = eHAL_STATUS_SUCCESS; + struct sme_sta_inactivity_timeout *inactivity_time; + vos_msg_t msg; + + inactivity_time = vos_mem_malloc(sizeof(*inactivity_time)); + if (NULL == inactivity_time) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: fail to alloc inactivity_time", __func__); + return eHAL_STATUS_FAILURE; + } + smsLog(mac_ctx, LOG1, FL("sta_inactivity_timeout: %d"), + sta_inactivity_timeout); + inactivity_time->session_id = session_id; + inactivity_time->sta_inactivity_timeout = sta_inactivity_timeout; + + if (eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock(&mac_ctx->sme)) { + vos_mem_zero(&msg, sizeof(vos_msg_t)); + msg.type = WDA_UPDATE_STA_INACTIVITY_TIMEOUT; + msg.reserved = 0; + msg.bodyptr = inactivity_time; + status = vos_mq_post_message(VOS_MQ_ID_WDA, &msg); + + if(status != eHAL_STATUS_SUCCESS) { + status = eHAL_STATUS_FAILURE; + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: sta_inactivity_timeout ", + __func__); + vos_mem_free(inactivity_time); + } + sme_ReleaseGlobalLock(&mac_ctx->sme); + return status; + } + + return eHAL_STATUS_FAILURE; +} diff --git a/CORE/WDA/inc/wlan_qct_wda.h b/CORE/WDA/inc/wlan_qct_wda.h index 1edea935379a..180f6dafc61d 100644 --- a/CORE/WDA/inc/wlan_qct_wda.h +++ b/CORE/WDA/inc/wlan_qct_wda.h @@ -1099,6 +1099,8 @@ tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb); #define WDA_UPDATE_LONG_RETRY_LIMIT_CNT SIR_HAL_LONG_RETRY_LIMIT_CNT +#define WDA_UPDATE_STA_INACTIVITY_TIMEOUT SIR_HAL_STA_INACTIVITY_TIMEOUT + tSirRetStatus wdaPostCtrlMsg(tpAniSirGlobal pMac, tSirMsgQ *pMsg); #define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40 // Bit 6 will be used to control BD rate for Management frames |
