diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index a8d43f2a6b17..faaeed49efa5 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -2895,13 +2895,7 @@ static int hdd_softap_unpack_ie(mac_handle_t mac_handle, return QDF_STATUS_SUCCESS; } -/** - * hdd_is_any_sta_connecting() - check if any sta is connecting - * @hdd_ctx: hdd context - * - * Return: true if any sta is connecting - */ -static bool hdd_is_any_sta_connecting(struct hdd_context *hdd_ctx) +bool hdd_is_any_sta_connecting(struct hdd_context *hdd_ctx) { struct hdd_adapter *adapter = NULL, *next_adapter = NULL; struct hdd_station_ctx *sta_ctx; diff --git a/core/hdd/src/wlan_hdd_hostapd.h b/core/hdd/src/wlan_hdd_hostapd.h index 6f5314f21b9d..a583aac09832 100644 --- a/core/hdd/src/wlan_hdd_hostapd.h +++ b/core/hdd/src/wlan_hdd_hostapd.h @@ -327,4 +327,11 @@ enum qca_wlan_802_11_mode hdd_convert_dot11mode_from_phymode(int phymode); */ void hdd_stop_sap_due_to_invalid_channel(struct work_struct *work); +/** + * hdd_is_any_sta_connecting() - check if any sta is connecting + * @hdd_ctx: hdd context + * + * Return: true if any sta is connecting + */ +bool hdd_is_any_sta_connecting(struct hdd_context *hdd_ctx); #endif /* end #if !defined(WLAN_HDD_HOSTAPD_H) */ diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 707cf3f4e58c..3280d882429c 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -5499,7 +5499,8 @@ int hdd_vdev_destroy(struct hdd_adapter *adapter) policy_mgr_mode_specific_connection_count(hdd_ctx->psoc, policy_mgr_convert_device_mode_to_qdf_type( adapter->device_mode), NULL) == 1) || - !policy_mgr_get_connection_count(hdd_ctx->psoc)) + (!policy_mgr_get_connection_count(hdd_ctx->psoc) && + !hdd_is_any_sta_connecting(hdd_ctx))) policy_mgr_check_and_stop_opportunistic_timer(hdd_ctx->psoc, adapter->vdev_id); /* Check and wait for hw mode response */