Pārlūkot izejas kodu

qcacld-3.0: Deinitialize the scan pdev OS private

Deinitialize the scan pdev os private member
as part of the hdd deinit sequence.

Change-Id: I451000ac5d883418e380b72f281663c57b276f2d
CRs-Fixed: 2033622
Sandeep Puligilla 8 gadi atpakaļ
vecāks
revīzija
8de3c1c765

+ 1 - 3
core/hdd/src/wlan_hdd_main.c

@@ -5410,9 +5410,7 @@ static void hdd_wlan_exit(hdd_context_t *hdd_ctx)
 		 * the expectation is that by the time Request Full Power has
 		 * completed, all scans will be cancelled
 		 */
-#ifndef NAPIER_SCAN
-		hdd_cleanup_scan_queue(hdd_ctx);
-#endif
+		wlan_cfg80211_cleanup_scan_queue(hdd_ctx->hdd_pdev);
 		hdd_abort_mac_scan_all_adapters(hdd_ctx);
 		hdd_abort_sched_scan_all_adapters(hdd_ctx);
 		hdd_stop_all_adapters(hdd_ctx);

+ 7 - 6
core/hdd/src/wlan_hdd_object_manager.c

@@ -33,18 +33,18 @@
 #include <wlan_hdd_object_manager.h>
 #include <wlan_osif_priv.h>
 
-#ifdef NAPIER_SCAN
-#define hdd_init_scan_priv(x) wlan_cfg80211_scan_priv_init(x)
-#else
-#define hdd_init_scan_priv(x)
-#endif
 
 static void hdd_init_pdev_os_priv(hdd_context_t *hdd_ctx,
 	struct pdev_osif_priv *os_priv)
 {
 	/* Initialize the OS private structure*/
 	os_priv->wiphy = hdd_ctx->wiphy;
-	hdd_init_scan_priv(hdd_ctx->hdd_pdev);
+	wlan_cfg80211_scan_priv_init(hdd_ctx->hdd_pdev);
+}
+
+static void hdd_deinit_pdev_os_priv(hdd_context_t *hdd_ctx)
+{
+	wlan_cfg80211_scan_priv_deinit(hdd_ctx->hdd_pdev);
 }
 
 static void hdd_init_vdev_os_priv(hdd_adapter_t *adapter,
@@ -125,6 +125,7 @@ int hdd_objmgr_release_and_destroy_pdev(hdd_context_t *hdd_ctx)
 	struct wlan_objmgr_pdev *pdev = hdd_ctx->hdd_pdev;
 	struct pdev_osif_priv *osif_priv;
 
+	hdd_deinit_pdev_os_priv(hdd_ctx);
 	hdd_ctx->hdd_pdev = NULL;
 	if (!pdev)
 		return -EINVAL;

+ 1 - 5
core/hdd/src/wlan_hdd_power.c

@@ -1272,11 +1272,7 @@ QDF_STATUS hdd_wlan_shutdown(void)
 
 	hdd_debug("Invoking packetdump deregistration API");
 	wlan_deregister_txrx_packetdump();
-#ifndef NAPIER_SCAN
-	hdd_cleanup_scan_queue(pHddCtx);
-#else
-	wlan_cfg80211_abort_scan(pHddCtx->hdd_pdev);
-#endif
+	wlan_cfg80211_cleanup_scan_queue(pHddCtx->hdd_pdev);
 	hdd_ipa_uc_ssr_deinit();
 	hdd_reset_all_adapters(pHddCtx);
 

+ 0 - 53
core/hdd/src/wlan_hdd_scan.c

@@ -2735,59 +2735,6 @@ void wlan_hdd_cfg80211_abort_scan(struct wiphy *wiphy,
 	cds_ssr_unprotect(__func__);
 }
 #endif
-#ifndef NAPIER_SCAN
-/**
- * hdd_cleanup_scan_queue() - remove entries in scan queue
- *
- * Removes entries in scan queue and sends scan complete event to NL
- * Return: None
- */
-void hdd_cleanup_scan_queue(hdd_context_t *hdd_ctx)
-{
-	struct hdd_scan_req *hdd_scan_req;
-	qdf_list_node_t *node = NULL;
-	struct cfg80211_scan_request *req;
-	hdd_adapter_t *adapter;
-	uint8_t source;
-	bool aborted = true;
-
-	if (NULL == hdd_ctx) {
-		hdd_err("HDD context is Null");
-		return;
-	}
-
-	qdf_spin_lock(&hdd_ctx->hdd_scan_req_q_lock);
-	while (!qdf_list_empty(&hdd_ctx->hdd_scan_req_q)) {
-		if (QDF_STATUS_SUCCESS !=
-			qdf_list_remove_front(&hdd_ctx->hdd_scan_req_q,
-						&node)) {
-			qdf_spin_unlock(&hdd_ctx->hdd_scan_req_q_lock);
-			hdd_err("Failed to remove scan request");
-			return;
-		}
-		qdf_spin_unlock(&hdd_ctx->hdd_scan_req_q_lock);
-		hdd_scan_req = container_of(node, struct hdd_scan_req, node);
-		req = hdd_scan_req->scan_request;
-		source = hdd_scan_req->source;
-		adapter = hdd_scan_req->adapter;
-		if (WLAN_HDD_ADAPTER_MAGIC != adapter->magic) {
-			hdd_err("HDD adapter magic is invalid");
-		} else {
-			if (NL_SCAN == source)
-				hdd_cfg80211_scan_done(adapter, req, aborted);
-			else
-				hdd_vendor_scan_callback(adapter, req, aborted);
-			hdd_debug("removed Scan id: %d, req = %p",
-					hdd_scan_req->scan_id, req);
-		}
-		qdf_mem_free(hdd_scan_req);
-		qdf_spin_lock(&hdd_ctx->hdd_scan_req_q_lock);
-	}
-	qdf_spin_unlock(&hdd_ctx->hdd_scan_req_q_lock);
-
-	return;
-}
-#endif
 
 /**
  * hdd_scan_context_destroy() - Destroy scan context

+ 0 - 2
core/hdd/src/wlan_hdd_scan.h

@@ -104,8 +104,6 @@ int wlan_hdd_vendor_abort_scan(
 	struct wiphy *wiphy, struct wireless_dev *wdev,
 	const void *data, int data_len);
 
-void hdd_cleanup_scan_queue(hdd_context_t *hdd_ctx);
-
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)) || \
 	defined(CFG80211_ABORT_SCAN)
 void wlan_hdd_cfg80211_abort_scan(struct wiphy *wiphy,