Browse Source

qcacld-3.0: cleanup scan queue in case of SSR

When the SSR and interface down happen in parallel,
the driver rejects the interface down since the
recovery is in progress. Kernel ignores the -EAGAIN
request from the driver and as part of NET_DOWN notification
in cfg80211_netdown_notifer the kernel invokes the
___cfg80211_scan_done to free the request but dosen't not send
scan_result indication, since it expects the scan_done work to
get scheduled and then broadcast the request to upperlayer.

Change-Id: Id698044ebe30cf555300e909a916d74be1f8b94f
CRs-Fixed: 2115392
Arunk Khandavalli 7 năm trước cách đây
mục cha
commit
f0c0d76d72

+ 5 - 0
core/hdd/src/wlan_hdd_driver_ops.c

@@ -1466,6 +1466,7 @@ static void wlan_hdd_set_the_pld_uevent(struct pld_uevent_data *uevent)
 static void wlan_hdd_handle_the_pld_uevent(struct pld_uevent_data *uevent)
 static void wlan_hdd_handle_the_pld_uevent(struct pld_uevent_data *uevent)
 {
 {
 	enum cds_driver_state driver_state;
 	enum cds_driver_state driver_state;
+	struct hdd_context *hdd_ctx;
 
 
 	driver_state = cds_get_driver_state();
 	driver_state = cds_get_driver_state();
 
 
@@ -1482,6 +1483,10 @@ static void wlan_hdd_handle_the_pld_uevent(struct pld_uevent_data *uevent)
 	case PLD_FW_DOWN:
 	case PLD_FW_DOWN:
 		qdf_complete_wait_events();
 		qdf_complete_wait_events();
 		cds_set_target_ready(false);
 		cds_set_target_ready(false);
+		hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
+		if (hdd_ctx != NULL)
+			wlan_cfg80211_cleanup_scan_queue(
+					hdd_ctx->hdd_pdev);
 		break;
 		break;
 	case PLD_FW_READY:
 	case PLD_FW_READY:
 	default:
 	default:

+ 7 - 0
core/hdd/src/wlan_hdd_main.c

@@ -552,6 +552,13 @@ static int __hdd_netdev_notifier_call(struct notifier_block *nb,
 			cds_flush_work(&adapter->scan_block_work);
 			cds_flush_work(&adapter->scan_block_work);
 			hdd_debug("Scan is not Pending from user");
 			hdd_debug("Scan is not Pending from user");
 		}
 		}
+		/*
+		 * After NETDEV_GOING_DOWN, kernel calls hdd_stop.Irrespective
+		 * of return status of hdd_stop call, kernel resets the IFF_UP
+		 * flag after which driver does not send the cfg80211_scan_done.
+		 * Ensure to cleanup the scan queue in NETDEV_GOING_DOWN
+		 */
+		wlan_cfg80211_cleanup_scan_queue(hdd_ctx->hdd_pdev);
 		break;
 		break;
 
 
 	default:
 	default:

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

@@ -82,6 +82,7 @@
 #include "scheduler_api.h"
 #include "scheduler_api.h"
 #include "cds_utils.h"
 #include "cds_utils.h"
 #include "wlan_hdd_packet_filter_api.h"
 #include "wlan_hdd_packet_filter_api.h"
+#include "wlan_cfg80211_scan.h"
 
 
 /* Preprocessor definitions and constants */
 /* Preprocessor definitions and constants */
 #ifdef QCA_WIFI_NAPIER_EMULATION
 #ifdef QCA_WIFI_NAPIER_EMULATION
@@ -1272,7 +1273,6 @@ QDF_STATUS hdd_wlan_shutdown(void)
 
 
 	hdd_debug("Invoking packetdump deregistration API");
 	hdd_debug("Invoking packetdump deregistration API");
 	wlan_deregister_txrx_packetdump();
 	wlan_deregister_txrx_packetdump();
-	wlan_cfg80211_cleanup_scan_queue(hdd_ctx->hdd_pdev);
 	hdd_reset_all_adapters(hdd_ctx);
 	hdd_reset_all_adapters(hdd_ctx);
 
 
 	/* Flush cached rx frame queue */
 	/* Flush cached rx frame queue */