From 564aa84417a8f819f8220ab1e523dc4018949555 Mon Sep 17 00:00:00 2001 From: Tiger Yu Date: Fri, 15 Nov 2019 18:08:45 +0800 Subject: [PATCH] qcacld-3.0: Update the IPA interface context if device_mode is different For wlan_ipa_setup_iface, if found the net_dev is already there, but the device_mode is different, will remove this obsolete record and update it with new interface context for current IPA WLAN event. Change-Id: Ib9ecd7f7b3b9603c37dc1d69cd0f3a2868c978ec CRs-Fixed: 2567222 --- components/ipa/core/src/wlan_ipa_core.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/components/ipa/core/src/wlan_ipa_core.c b/components/ipa/core/src/wlan_ipa_core.c index 5a93342256d2..85d104a0f546 100644 --- a/components/ipa/core/src/wlan_ipa_core.c +++ b/components/ipa/core/src/wlan_ipa_core.c @@ -1540,9 +1540,17 @@ static QDF_STATUS wlan_ipa_setup_iface(struct wlan_ipa_priv *ipa_ctx, for (i = 0; i < WLAN_IPA_MAX_IFACE; i++) { iface_context = &(ipa_ctx->iface_context[i]); if (iface_context->dev == net_dev) { - ipa_debug("found iface %u device_mode %u", - i, device_mode); - return QDF_STATUS_SUCCESS; + if (iface_context->device_mode == + device_mode) { + ipa_debug("found iface %u device_mode %u", + i, device_mode); + return QDF_STATUS_SUCCESS; + } + + ipa_err("Obsolete iface %u found, device_mode %u, will remove it.", + i, + iface_context->device_mode); + wlan_ipa_cleanup_iface(iface_context); } } }