From d04b17ae71d38713cd103ff0ee6c8671e27bedbf Mon Sep 17 00:00:00 2001 From: Vinod Kumar Pirla Date: Wed, 1 Mar 2023 20:35:14 -0800 Subject: [PATCH] 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 --- core/hdd/src/wlan_hdd_main.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 0680e4fa21..7873d55296 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/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);