Prechádzať zdrojové kódy

qcacld-3.0: Move SOFTAP_INIT_DONE event flag to per link

This event flag is used in SAP/P2P-GO modes which
will be per link.
The references of this event flag are moved to deflink.

Change-Id: Ia3dd0970ca82e6d4988b0f19dfcef9e100c064a2
CRs-Fixed: 3452540
Vinod Kumar Pirla 2 rokov pred
rodič
commit
dd706b688f

+ 2 - 2
core/hdd/inc/wlan_hdd_main.h

@@ -259,7 +259,6 @@ static inline bool in_compat_syscall(void) { return is_compat_task(); }
  * @NET_DEVICE_REGISTERED: Adapter is registered with the kernel
  * @WMM_INIT_DONE: Adapter is initialized
  * @DEVICE_IFACE_OPENED: Adapter has been "opened" via the kernel
- * @SOFTAP_INIT_DONE: Software Access Point (SAP) is initialized
  * @VENDOR_ACS_RESPONSE_PENDING: Waiting for event for vendor acs
  * @WDEV_ONLY_REGISTERED: Only WDEV is registered
  */
@@ -267,7 +266,6 @@ enum hdd_adapter_flags {
 	NET_DEVICE_REGISTERED,
 	WMM_INIT_DONE,
 	DEVICE_IFACE_OPENED,
-	SOFTAP_INIT_DONE,
 	VENDOR_ACS_RESPONSE_PENDING,
 	WDEV_ONLY_REGISTERED,
 };
@@ -276,10 +274,12 @@ enum hdd_adapter_flags {
  * enum hdd_link_flags - Event bitmap flags specific to per link
  * @SME_SESSION_OPENED: Firmware vdev has been created
  * @SOFTAP_BSS_STARTED: Software Access Point (SAP) is running
+ * @SOFTAP_INIT_DONE: Software Access Point (SAP) is initialized
  */
 enum hdd_link_flags {
 	SME_SESSION_OPENED,
 	SOFTAP_BSS_STARTED,
+	SOFTAP_INIT_DONE,
 };
 
 /**

+ 4 - 4
core/hdd/src/wlan_hdd_hostapd.c

@@ -6872,7 +6872,7 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 	sap_event_callback = hdd_hostapd_sap_event_cb;
 
 	ap_ctx->dfs_cac_block_tx = true;
-	set_bit(SOFTAP_INIT_DONE, &adapter->event_flags);
+	set_bit(SOFTAP_INIT_DONE, &adapter->deflink->link_flags);
 
 	ucfg_dp_set_dfs_cac_tx(vdev, true);
 
@@ -6956,7 +6956,7 @@ error:
 		hdd_update_indoor_channel(hdd_ctx, false);
 		sme_update_channel_list(mac_handle);
 	}
-	clear_bit(SOFTAP_INIT_DONE, &adapter->event_flags);
+	clear_bit(SOFTAP_INIT_DONE, &adapter->deflink->link_flags);
 	qdf_atomic_set(&ap_ctx->acs_in_progress, 0);
 	wlansap_reset_sap_config_add_ie(config, eUPDATE_IE_ALL);
 
@@ -7071,7 +7071,7 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
 	 * This update is moved to start of this function to resolve stop_ap
 	 * call during SSR case. Adapter gets cleaned up as part of SSR.
 	 */
-	clear_bit(SOFTAP_INIT_DONE, &adapter->event_flags);
+	clear_bit(SOFTAP_INIT_DONE, &adapter->deflink->link_flags);
 	hdd_debug("Event flags 0x%lx(%s) Device_mode %s(%d)",
 		  adapter->event_flags, (adapter->dev)->name,
 		  qdf_opmode_str(adapter->device_mode), adapter->device_mode);
@@ -7736,7 +7736,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 
 	hdd_enter();
 
-	clear_bit(SOFTAP_INIT_DONE, &adapter->event_flags);
+	clear_bit(SOFTAP_INIT_DONE, &adapter->deflink->link_flags);
 	if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
 		hdd_err("Command not allowed in FTM mode");
 		return -EINVAL;

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

@@ -8799,7 +8799,8 @@ QDF_STATUS hdd_stop_adapter_ext(struct hdd_context *hdd_ctx,
 		 * and is not cleared/freed on purpose in case of SAP SSR
 		 */
 		if (!cds_is_driver_recovering()) {
-			clear_bit(SOFTAP_INIT_DONE, &adapter->event_flags);
+			clear_bit(SOFTAP_INIT_DONE,
+				  &adapter->deflink->link_flags);
 			qdf_mem_free(ap_ctx->beacon);
 			ap_ctx->beacon = NULL;
 		}

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

@@ -933,7 +933,7 @@ int __wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev)
 	 * Clear SOFTAP_INIT_DONE flag to mark SAP unload, so that we do
 	 * not restart SAP after SSR as SAP is already stopped from user space.
 	 */
-	clear_bit(SOFTAP_INIT_DONE, &adapter->event_flags);
+	clear_bit(SOFTAP_INIT_DONE, &adapter->deflink->link_flags);
 
 	qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
 		   TRACE_CODE_HDD_DEL_VIRTUAL_INTF,

+ 11 - 9
core/hdd/src/wlan_hdd_power.c

@@ -1928,16 +1928,18 @@ static void hdd_ssr_restart_sap(struct hdd_context *hdd_ctx)
 
 	hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter, next_adapter,
 					   NET_DEV_HOLD_SSR_RESTART_SAP) {
-		if (adapter->device_mode == QDF_SAP_MODE) {
-			if (test_bit(SOFTAP_INIT_DONE, &adapter->event_flags)) {
-				hdd_debug(
-				"Restart prev SAP session, event_flags 0x%lx(%s)",
-				adapter->event_flags, (adapter->dev)->name);
-				wlan_hdd_set_twt_responder(hdd_ctx,
-							   adapter);
-				wlan_hdd_start_sap(adapter, true);
-			}
+		if (adapter->device_mode != QDF_SAP_MODE)
+			goto next_adapter;
+
+		if (test_bit(SOFTAP_INIT_DONE, &adapter->deflink->link_flags)) {
+			hdd_debug("Restart prev SAP session, event_flags 0x%lx, link_flags 0x%lx(%s)",
+				  adapter->event_flags,
+				  adapter->deflink->link_flags,
+				  adapter->dev->name);
+			wlan_hdd_set_twt_responder(hdd_ctx, adapter);
+			wlan_hdd_start_sap(adapter, true);
 		}
+next_adapter:
 		hdd_adapter_dev_put_debug(adapter,
 					  NET_DEV_HOLD_SSR_RESTART_SAP);
 	}

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

@@ -1806,7 +1806,7 @@ static void hdd_country_change_update_sap(struct hdd_context *hdd_ctx)
 			break;
 		case QDF_SAP_MODE:
 			if (!test_bit(SOFTAP_INIT_DONE,
-				      &adapter->event_flags)) {
+				      &adapter->deflink->link_flags)) {
 				hdd_info("AP is not started yet");
 				break;
 			}