Quellcode durchsuchen

qcacld-3.0: Do client cleanup in SSR case for P2P GO

Reset adapter done for P2P GO as part of shutdown does
not invoke hdd_sap_indicate_disconnect_for_sta where in
cleanup is done and ap_active flag is reset to false.
After re init, if sta connection happens and driver
unload is triggered, bus_bw timer is not stopped as
part of station stop_adapter since ap_active flag is not
reset to false.

Fix is to invoke hdd_sap_indicate_disconnect_for_sta in
case of P2P GO cleanup during shutdown.

Change-Id: Ia832ccf4311bfdf202fcf01d3ab46023c0f3451f
CRs-Fixed: 2562839
Yeshwanth Sriram Guntuka vor 5 Jahren
Ursprung
Commit
e6e60f89fd
2 geänderte Dateien mit 14 neuen und 33 gelöschten Zeilen
  1. 6 2
      core/hdd/src/wlan_hdd_hostapd.c
  2. 8 31
      core/hdd/src/wlan_hdd_main.c

+ 6 - 2
core/hdd/src/wlan_hdd_hostapd.c

@@ -6595,6 +6595,7 @@ void hdd_sap_indicate_disconnect_for_sta(struct hdd_adapter *adapter)
 	uint8_t index = 0;
 	struct sap_context *sap_ctx;
 	struct hdd_station_info *sta_info;
+	struct hdd_sta_info_entry *tmp;
 
 	hdd_enter();
 
@@ -6604,12 +6605,15 @@ void hdd_sap_indicate_disconnect_for_sta(struct hdd_adapter *adapter)
 		return;
 	}
 
-	hdd_for_each_station(adapter->sta_info_list, sta_info, index) {
+	hdd_for_each_station_safe(adapter->sta_info_list, sta_info, index,
+				  tmp) {
 		hdd_debug("sta_mac: " QDF_MAC_ADDR_STR,
 			  QDF_MAC_ADDR_ARRAY(sta_info->sta_mac.bytes));
 
-		if (qdf_is_macaddr_broadcast(&sta_info->sta_mac))
+		if (qdf_is_macaddr_broadcast(&sta_info->sta_mac)) {
+			hdd_softap_deregister_sta(adapter, sta_info);
 			continue;
+		}
 
 		sap_event.sapHddEventCode = eSAP_STA_DISASSOC_EVENT;
 

+ 8 - 31
core/hdd/src/wlan_hdd_main.c

@@ -6157,9 +6157,6 @@ QDF_STATUS hdd_reset_all_adapters(struct hdd_context *hdd_ctx)
 	struct qdf_mac_addr peer_macaddr;
 	bool value;
 	struct wlan_objmgr_vdev *vdev;
-	uint8_t index = 0;
-	struct hdd_station_info *sta_info;
-	struct hdd_sta_info_entry *tmp;
 
 	hdd_enter();
 
@@ -6197,19 +6194,19 @@ QDF_STATUS hdd_reset_all_adapters(struct hdd_context *hdd_ctx)
 						&adapter->acs_pending_work);
 				clear_bit(ACS_PENDING, &adapter->event_flags);
 			}
-
-			if (test_bit(SOFTAP_BSS_STARTED,
-						&adapter->event_flags)) {
-				hdd_sap_indicate_disconnect_for_sta(adapter);
-				clear_bit(SOFTAP_BSS_STARTED,
-					  &adapter->event_flags);
-			}
-
 		} else {
 			wlan_hdd_netif_queue_control(adapter,
 					   WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER,
 					   WLAN_CONTROL_PATH);
 		}
+
+		if ((adapter->device_mode == QDF_P2P_GO_MODE ||
+		     adapter->device_mode == QDF_SAP_MODE) &&
+		    test_bit(SOFTAP_BSS_STARTED, &adapter->event_flags)) {
+			hdd_sap_indicate_disconnect_for_sta(adapter);
+			clear_bit(SOFTAP_BSS_STARTED, &adapter->event_flags);
+		}
+
 		/*
 		 * Clear fc flag if it was set before SSR to avoid TX queues
 		 * permanently stopped after SSR.
@@ -6260,26 +6257,6 @@ QDF_STATUS hdd_reset_all_adapters(struct hdd_context *hdd_ctx)
 			qdf_copy_macaddr(&peer_macaddr,
 					 &sta_ctx->conn_info.bssid);
 
-		} else if (adapter->device_mode == QDF_P2P_GO_MODE ||
-			   adapter->device_mode == QDF_SAP_MODE) {
-
-			/*
-			 * Clear SOFTAP_BSS_STARTED bit only in case of P2P GO
-			 * as SAP is restarted after SSR.
-			 */
-			if (adapter->device_mode == QDF_P2P_GO_MODE)
-				clear_bit(SOFTAP_BSS_STARTED,
-					  &adapter->event_flags);
-
-			/* Loop over and deregister every registered peer */
-			hdd_for_each_station_safe(adapter->sta_info_list,
-						  sta_info, index, tmp) {
-				hdd_debug("[SSR] deregister STA MAC:"
-					  QDF_MAC_ADDR_STR, QDF_MAC_ADDR_ARRAY(
-					  sta_info->sta_mac.bytes));
-
-				hdd_softap_deregister_sta(adapter, sta_info);
-			}
 		}
 
 		hdd_nud_ignore_tracking(adapter, true);