diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 7a3491e1f743..c99e212304e1 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -5438,6 +5438,7 @@ wlan_hdd_wifi_config_policy[QCA_WLAN_VENDOR_ATTR_CONFIG_MAX + 1] = { [QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_CHAIN] = {.type = NLA_U32 }, [QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_SELFTEST] = {.type = NLA_U32 }, [QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_SELFTEST_INTVL] = {.type = NLA_U32 }, + [QCA_WLAN_VENDOR_ATTR_CONFIG_TOTAL_BEACON_MISS_COUNT] = {.type = NLA_U8}, }; /** @@ -5765,6 +5766,7 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, uint32_t ant_div_usrcfg; uint32_t antdiv_enable, antdiv_chain; uint32_t antdiv_selftest, antdiv_selftest_intvl; + uint8_t bmiss_bcnt; ENTER_DEV(dev); @@ -6231,6 +6233,38 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, } } + if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_TOTAL_BEACON_MISS_COUNT]) { + bmiss_bcnt = nla_get_u8( + tb[QCA_WLAN_VENDOR_ATTR_CONFIG_TOTAL_BEACON_MISS_COUNT]); + if (hdd_ctx->config->nRoamBmissFirstBcnt < bmiss_bcnt) { + hdd_ctx->config->nRoamBmissFinalBcnt = bmiss_bcnt + - hdd_ctx->config->nRoamBmissFirstBcnt; + hdd_debug("Bmiss first cnt(%d), Bmiss final cnt(%d)", + hdd_ctx->config->nRoamBmissFirstBcnt, + hdd_ctx->config->nRoamBmissFinalBcnt); + ret_val = sme_set_roam_bmiss_final_bcnt(hdd_ctx->hHal, + 0, hdd_ctx->config->nRoamBmissFinalBcnt); + + if (ret_val) { + hdd_err("Failed to set bmiss final Bcnt"); + return ret_val; + } + + ret_val = sme_set_bmiss_bcnt(adapter->sessionId, + hdd_ctx->config->nRoamBmissFirstBcnt, + hdd_ctx->config->nRoamBmissFinalBcnt); + if (ret_val) { + hdd_err("Failed to set bmiss Bcnt"); + return ret_val; + } + } else { + hdd_err("Bcnt(%d) needs to exceed BmissFirstBcnt(%d)", + bmiss_bcnt, + hdd_ctx->config->nRoamBmissFirstBcnt); + return -EINVAL; + } + } + return ret_val; } diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 6be2c45d01c2..18477da001cb 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1745,4 +1745,16 @@ void sme_display_disconnect_stats(tHalHandle hal, uint8_t session_id); */ QDF_STATUS sme_process_msg_callback(tHalHandle hal, struct scheduler_msg *msg); + +/** + * sme_set_bmiss_bcnt() - set bmiss config parameters + * @vdev_id: virtual device for the command + * @first_cnt: bmiss first value + * @final_cnt: bmiss final value + * + * Return: QDF_STATUS_SUCCESS or non-zero on failure + */ +QDF_STATUS sme_set_bmiss_bcnt(uint32_t vdev_id, uint32_t first_cnt, + uint32_t final_cnt); + #endif /* #if !defined( __SME_API_H ) */ diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 175d350d712e..6b0eb3277431 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -16055,3 +16055,17 @@ void sme_display_disconnect_stats(tHalHandle hal, uint8_t session_id) sme_debug("No. of Disconnections due to Peer Kickout: %d", session->disconnect_stats.peer_kickout); } + +/** + * sme_set_bmiss_bcnt() - set bmiss config parameters + * @vdev_id: virtual device for the command + * @first_cnt: bmiss first value + * @final_cnt: bmiss final value + * + * Return: QDF_STATUS_SUCCESS or non-zero on failure + */ +QDF_STATUS sme_set_bmiss_bcnt(uint32_t vdev_id, uint32_t first_cnt, + uint32_t final_cnt) +{ + return wma_config_bmiss_bcnt_params(vdev_id, first_cnt, final_cnt); +} diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index a65f374d880a..13f8c5443df8 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -2636,4 +2636,15 @@ int wma_chip_power_save_failure_detected_handler(void *handle, QDF_STATUS wma_get_chain_rssi(tp_wma_handle wma_handle, struct get_chain_rssi_req_params *req_params); +/** + * wma_config_bmiss_bcnt_params() - set bmiss config parameters + * @vdev_id: virtual device for the command + * @first_cnt: bmiss first value + * @final_cnt: bmiss final value + * + * Return: QDF_STATUS_SUCCESS or non-zero on failure + */ +QDF_STATUS wma_config_bmiss_bcnt_params(uint32_t vdev_id, uint32_t first_cnt, + uint32_t final_cnt); + #endif diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 431179ea02a6..cc17fce51736 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -8156,3 +8156,32 @@ void wma_ipa_uc_stat_request(wma_cli_set_cmd_t *privcmd) if (wma_set_priv_cfg(wma, privcmd)) WMA_LOGE("Failed to set wma priv congiuration"); } + +/** + * wma_config_bmiss_bcnt_params() - set bmiss config parameters + * @vdev_id: virtual device for the command + * @first_cnt: bmiss first value + * @final_cnt: bmiss final value + * + * Return: QDF_STATUS_SUCCESS or non-zero on failure + */ +QDF_STATUS wma_config_bmiss_bcnt_params(uint32_t vdev_id, uint32_t first_cnt, + uint32_t final_cnt) +{ + tp_wma_handle wma_handle = cds_get_context(QDF_MODULE_ID_WMA); + int status = QDF_STATUS_E_INVAL; + + if (!wma_handle) { + WMA_LOGE("%s: Failed to get wma", __func__); + return status; + } + + status = wma_roam_scan_bmiss_cnt(wma_handle, first_cnt, final_cnt, + vdev_id); + + if (status) + WMA_LOGE("Failed to set Bmiss Param"); + + return status; +} +