浏览代码

qcacmn: Extend IPA max intf number to 4

To support 4 SAP concurrency on sdxlemur, it is required to extend IPA
max interface number to 4.

wlan_ipa_iface_2_client is for legacy chip which support MCC, it is not
useful for nowaday chip, just extend it to 4 interface with same
content as other interface to pass ipa setup.

And Fix a static analyze error about session_id.

Change-Id: I5f2a4a0e3ff943e15ab9907e206b64423002eccb
CRs-Fixed: 3092428
Will Huang 3 年之前
父节点
当前提交
f920f723a9
共有 2 个文件被更改,包括 16 次插入7 次删除
  1. 1 1
      ipa/core/inc/wlan_ipa_priv.h
  2. 15 6
      ipa/core/src/wlan_ipa_core.c

+ 1 - 1
ipa/core/inc/wlan_ipa_priv.h

@@ -58,7 +58,7 @@
 
 #define WLAN_IPA_WLAN_HDR_DES_MAC_OFFSET    0
 #define WLAN_IPA_MAX_IFACE                  MAX_IPA_IFACE
-#define WLAN_IPA_CLIENT_MAX_IFACE           3
+#define WLAN_IPA_CLIENT_MAX_IFACE           MAX_IPA_IFACE
 #define WLAN_IPA_MAX_SYSBAM_PIPE            4
 #define WLAN_IPA_MAX_SESSION                5
 #ifdef WLAN_MAX_CLIENTS_ALLOWED

+ 15 - 6
ipa/core/src/wlan_ipa_core.c

@@ -54,11 +54,20 @@ static struct wlan_ipa_iface_2_client {
 } wlan_ipa_iface_2_client[WLAN_IPA_CLIENT_MAX_IFACE] = {
 	{
 		QDF_IPA_CLIENT_WLAN2_CONS, QDF_IPA_CLIENT_WLAN1_PROD
-	}, {
+	},
+	{
 		QDF_IPA_CLIENT_MCC2_CONS,  QDF_IPA_CLIENT_WLAN1_PROD
-	}, {
+	},
+#if WLAN_IPA_CLIENT_MAX_IFACE >= 3
+	{
 		QDF_IPA_CLIENT_WLAN4_CONS, QDF_IPA_CLIENT_WLAN1_PROD
-	}
+	},
+#if WLAN_IPA_CLIENT_MAX_IFACE == 4
+	{
+		QDF_IPA_CLIENT_WLAN4_CONS, QDF_IPA_CLIENT_WLAN1_PROD
+	},
+#endif
+#endif
 };
 
 /* Local Function Prototypes */
@@ -1113,7 +1122,7 @@ static void __wlan_ipa_w2i_cb(void *priv, qdf_ipa_dp_evt_type_t evt,
 		}
 
 		iface_context = &ipa_ctx->iface_context[iface_id];
-		if (iface_context->session_id == WLAN_IPA_MAX_SESSION) {
+		if (iface_context->session_id >= WLAN_IPA_MAX_SESSION) {
 			ipa_err_rl("session_id of iface_id %u is invalid:%d",
 				   iface_id, iface_context->session_id);
 			ipa_ctx->ipa_rx_internal_drop_count++;
@@ -1165,7 +1174,7 @@ static void __wlan_ipa_w2i_cb(void *priv, qdf_ipa_dp_evt_type_t evt,
 		/* Disable to forward Intra-BSS Rx packets when
 		 * ap_isolate=1 in hostapd.conf
 		 */
-		if (!ipa_ctx->disable_intrabss_fwd[session_id] &&
+		if (!ipa_ctx->disable_intrabss_fwd[iface_context->session_id] &&
 		    iface_context->device_mode == QDF_SAP_MODE) {
 			/*
 			 * When INTRA_BSS_FWD_OFFLOAD is enabled, FW will send
@@ -1183,7 +1192,7 @@ static void __wlan_ipa_w2i_cb(void *priv, qdf_ipa_dp_evt_type_t evt,
 				break;
 		} else {
 			ipa_debug_rl("Intra-BSS fwd disabled for session_id %u",
-				     session_id);
+				     iface_context->session_id);
 		}
 
 		wlan_ipa_send_skb_to_network(skb, iface_context);