Browse Source

qcacld-3.0: Move vendor ACS event flag to per link

The VENDOR_ACS_RESPONSE_PENDING event flag is used
for tracking ACS request for SAP/P2P-GO modes, hence
move this flag to per link.
The references of this event flag are moved to deflink.

Change-Id: I54a3e9f592563cfe40ff68d5527d974eb84fe692
CRs-Fixed: 3452545
Vinod Kumar Pirla 2 years ago
parent
commit
989a5cded6

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

@@ -259,14 +259,12 @@ 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
- * @VENDOR_ACS_RESPONSE_PENDING: Waiting for event for vendor acs
  * @WDEV_ONLY_REGISTERED: Only WDEV is registered
  */
 enum hdd_adapter_flags {
 	NET_DEVICE_REGISTERED,
 	WMM_INIT_DONE,
 	DEVICE_IFACE_OPENED,
-	VENDOR_ACS_RESPONSE_PENDING,
 	WDEV_ONLY_REGISTERED,
 };
 
@@ -275,11 +273,13 @@ enum hdd_adapter_flags {
  * @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
+ * @VENDOR_ACS_RESPONSE_PENDING: Waiting for event for vendor acs
  */
 enum hdd_link_flags {
 	SME_SESSION_OPENED,
 	SOFTAP_BSS_STARTED,
 	SOFTAP_INIT_DONE,
+	VENDOR_ACS_RESPONSE_PENDING,
 };
 
 /**

+ 6 - 4
core/hdd/src/wlan_hdd_cfg80211.c

@@ -3056,7 +3056,7 @@ static int hdd_create_acs_timer(struct hdd_adapter *adapter)
 
 	timer_context->adapter = adapter;
 
-	set_bit(VENDOR_ACS_RESPONSE_PENDING, &adapter->event_flags);
+	set_bit(VENDOR_ACS_RESPONSE_PENDING, &adapter->deflink->link_flags);
 	status = qdf_mc_timer_init(
 		  &adapter->deflink->session.ap.vendor_acs_timer,
 		  QDF_TIMER_TYPE_SW,
@@ -16357,9 +16357,11 @@ static int __wlan_hdd_cfg80211_update_vendor_channel(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (test_bit(VENDOR_ACS_RESPONSE_PENDING, &adapter->event_flags))
-		clear_bit(VENDOR_ACS_RESPONSE_PENDING, &adapter->event_flags);
-	else {
+	if (test_bit(VENDOR_ACS_RESPONSE_PENDING,
+		     &adapter->deflink->link_flags)) {
+		clear_bit(VENDOR_ACS_RESPONSE_PENDING,
+			  &adapter->deflink->link_flags);
+	} else {
 		hdd_err("already timeout happened for acs");
 		return -EINVAL;
 	}

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

@@ -6994,7 +6994,7 @@ int hdd_destroy_acs_timer(struct hdd_adapter *adapter)
 
 	ap_ctx->vendor_acs_timer_initialized = false;
 
-	clear_bit(VENDOR_ACS_RESPONSE_PENDING, &adapter->event_flags);
+	clear_bit(VENDOR_ACS_RESPONSE_PENDING, &adapter->deflink->link_flags);
 	if (QDF_TIMER_STATE_RUNNING == ap_ctx->vendor_acs_timer.state) {
 		qdf_status = qdf_mc_timer_stop(&ap_ctx->vendor_acs_timer);
 		if (!QDF_IS_STATUS_SUCCESS(qdf_status))

+ 6 - 5
core/hdd/src/wlan_hdd_main.c

@@ -12118,7 +12118,7 @@ int hdd_update_acs_timer_reason(struct hdd_adapter *adapter, uint8_t reason)
 	QDF_STATUS qdf_status;
 	qdf_mc_timer_t *vendor_acs_timer;
 
-	set_bit(VENDOR_ACS_RESPONSE_PENDING, &adapter->event_flags);
+	set_bit(VENDOR_ACS_RESPONSE_PENDING, &adapter->deflink->link_flags);
 
 	vendor_acs_timer = &adapter->deflink->session.ap.vendor_acs_timer;
 	if (QDF_TIMER_STATE_RUNNING ==
@@ -12703,13 +12703,14 @@ void hdd_acs_response_timeout_handler(void *context)
 	if (wlan_hdd_validate_context(hdd_ctx))
 		return;
 
-	if (test_bit(VENDOR_ACS_RESPONSE_PENDING, &adapter->event_flags))
-		clear_bit(VENDOR_ACS_RESPONSE_PENDING, &adapter->event_flags);
-	else
+	if (!test_bit(VENDOR_ACS_RESPONSE_PENDING,
+		      &adapter->deflink->link_flags))
 		return;
 
+	clear_bit(VENDOR_ACS_RESPONSE_PENDING, &adapter->deflink->link_flags);
+
 	hdd_err("ACS timeout happened for %s reason %d",
-				adapter->dev->name, reason);
+		adapter->dev->name, reason);
 
 	sap_context = WLAN_HDD_GET_SAP_CTX_PTR(adapter->deflink);
 	switch (reason) {

+ 8 - 5
core/hdd/src/wlan_hdd_scan.c

@@ -823,12 +823,15 @@ static void hdd_process_vendor_acs_response(struct hdd_adapter *adapter)
 {
 	qdf_mc_timer_t *vendor_acs_timer;
 
+	if (!test_bit(VENDOR_ACS_RESPONSE_PENDING,
+		      &adapter->deflink->link_flags)) {
+		return;
+	}
+
 	vendor_acs_timer = &adapter->deflink->session.ap.vendor_acs_timer;
-	if (test_bit(VENDOR_ACS_RESPONSE_PENDING, &adapter->event_flags)) {
-		if (QDF_TIMER_STATE_RUNNING ==
-		    qdf_mc_timer_get_current_state(vendor_acs_timer)) {
-			qdf_mc_timer_stop(vendor_acs_timer);
-		}
+	if (QDF_TIMER_STATE_RUNNING ==
+	    qdf_mc_timer_get_current_state(vendor_acs_timer)) {
+		qdf_mc_timer_stop(vendor_acs_timer);
 	}
 }