Browse Source

qcacld-3.0: Iterate all links in hdd_is_any_interface_open()

Check the sme opened status of all links in adapter
to identify any open interface.

Change-Id: Ic49f375ff4eefae2a0da460aacd57bc8782ba06c
CRs-Fixed: 3524033
Vinod Kumar Pirla 2 years ago
parent
commit
d04b17ae71
1 changed files with 12 additions and 2 deletions
  1. 12 2
      core/hdd/src/wlan_hdd_main.c

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

@@ -9408,6 +9408,17 @@ QDF_STATUS hdd_reset_all_adapters(struct hdd_context *hdd_ctx)
 	return QDF_STATUS_SUCCESS;
 }
 
+static bool hdd_is_any_link_opened(struct hdd_adapter *adapter)
+{
+	struct wlan_hdd_link_info *link_info;
+
+	hdd_adapter_for_each_active_link_info(adapter, link_info) {
+		if (test_bit(SME_SESSION_OPENED, &link_info->link_flags))
+			return true;
+	}
+	return false;
+}
+
 bool hdd_is_any_interface_open(struct hdd_context *hdd_ctx)
 {
 	struct hdd_adapter *adapter, *next_adapter = NULL;
@@ -9421,8 +9432,7 @@ bool hdd_is_any_interface_open(struct hdd_context *hdd_ctx)
 	hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter, next_adapter,
 					   dbgid) {
 		if (test_bit(DEVICE_IFACE_OPENED, &adapter->event_flags) ||
-		    test_bit(SME_SESSION_OPENED,
-			     &adapter->deflink->link_flags)) {
+		    hdd_is_any_link_opened(adapter)) {
 			hdd_adapter_dev_put_debug(adapter, dbgid);
 			if (next_adapter)
 				hdd_adapter_dev_put_debug(next_adapter, dbgid);