Ver código fonte

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
Tiger Yu 5 anos atrás
pai
commit
564aa84417
1 arquivos alterados com 11 adições e 3 exclusões
  1. 11 3
      components/ipa/core/src/wlan_ipa_core.c

+ 11 - 3
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);
 			}
 		}
 	}