|
@@ -6174,6 +6174,7 @@ struct hdd_adapter *hdd_open_adapter(struct hdd_context *hdd_ctx, uint8_t sessio
|
|
|
qdf_list_create(&adapter->blocked_scan_request_q, WLAN_MAX_SCAN_COUNT);
|
|
|
qdf_mutex_create(&adapter->blocked_scan_request_q_lock);
|
|
|
qdf_event_create(&adapter->acs_complete_event);
|
|
|
+ qdf_event_create(&adapter->peer_cleanup_done);
|
|
|
hdd_sta_info_init(&adapter->sta_info_list);
|
|
|
hdd_sta_info_init(&adapter->cache_sta_info_list);
|
|
|
|
|
@@ -6234,6 +6235,7 @@ static void __hdd_close_adapter(struct hdd_context *hdd_ctx,
|
|
|
qdf_mutex_destroy(&adapter->blocked_scan_request_q_lock);
|
|
|
policy_mgr_clear_concurrency_mode(hdd_ctx->psoc, adapter->device_mode);
|
|
|
qdf_event_destroy(&adapter->acs_complete_event);
|
|
|
+ qdf_event_destroy(&adapter->peer_cleanup_done);
|
|
|
hdd_cleanup_adapter(hdd_ctx, adapter, rtnl_held);
|
|
|
|
|
|
if (hdd_ctx->current_intf_count != 0)
|
|
@@ -6347,6 +6349,28 @@ void hdd_ipa_ap_disconnect_evt(struct hdd_context *hdd_ctx,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+static void
|
|
|
+hdd_peer_cleanup(struct hdd_context *hdd_ctx, struct hdd_adapter *adapter)
|
|
|
+{
|
|
|
+ QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;
|
|
|
+
|
|
|
+ /* Check if there is any peer present on the adapter */
|
|
|
+ if (!hdd_any_valid_peer_present(adapter))
|
|
|
+ return;
|
|
|
+
|
|
|
+ if (adapter->device_mode == QDF_NDI_MODE)
|
|
|
+ qdf_status = ucfg_nan_disable_ndi(hdd_ctx->psoc,
|
|
|
+ adapter->vdev_id);
|
|
|
+
|
|
|
+ if (QDF_IS_STATUS_ERROR(qdf_status))
|
|
|
+ return;
|
|
|
+
|
|
|
+ qdf_status = qdf_wait_for_event_completion(&adapter->peer_cleanup_done,
|
|
|
+ WLAN_WAIT_PEER_CLEANUP);
|
|
|
+ if (QDF_IS_STATUS_ERROR(qdf_status))
|
|
|
+ hdd_debug("peer_cleanup_done wait fail");
|
|
|
+}
|
|
|
+
|
|
|
QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx,
|
|
|
struct hdd_adapter *adapter)
|
|
|
{
|
|
@@ -6401,13 +6425,14 @@ QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx,
|
|
|
reason = eSIR_MAC_DEVICE_RECOVERY;
|
|
|
|
|
|
/* For NDI do not use roam_profile */
|
|
|
- if (adapter->device_mode == QDF_NDI_MODE)
|
|
|
+ if (adapter->device_mode == QDF_NDI_MODE) {
|
|
|
+ hdd_peer_cleanup(hdd_ctx, adapter);
|
|
|
status = sme_roam_disconnect(
|
|
|
mac_handle,
|
|
|
adapter->vdev_id,
|
|
|
eCSR_DISCONNECT_REASON_NDI_DELETE,
|
|
|
reason);
|
|
|
- else if (roam_profile->BSSType ==
|
|
|
+ } else if (roam_profile->BSSType ==
|
|
|
eCSR_BSS_TYPE_START_IBSS)
|
|
|
status = sme_roam_disconnect(
|
|
|
mac_handle,
|