Эх сурвалжийг харах

qcacmn: Fix peer authentication for wds client

Fix the peer authentication for wds client, in SDX_WKK
wds client needs to get authenticate when packets receive
from exception path as wds client is not directly associated,
authentication is done by verifying from ast table

Change-Id: I93051d67fc3d5be0af9242e6579f44883b3f757d
CRs-Fixed: 3534370
Amrit Sahai 2 жил өмнө
parent
commit
5aac5cb621

+ 23 - 1
dp/wifi3.0/dp_main.c

@@ -760,6 +760,28 @@ dp_peer_send_wds_disconnect(struct dp_soc *soc, struct dp_peer *peer)
 }
 #endif
 
+/**
+ * dp_peer_check_ast_offload() - check ast offload support is enable or not
+ * @soc: soc handle
+ *
+ * Return: false in case of IPA and true/false in IPQ case
+ *
+ */
+#if defined(IPA_OFFLOAD) && defined(QCA_WIFI_QCN9224)
+static inline bool dp_peer_check_ast_offload(struct dp_soc *soc)
+{
+	return false;
+}
+#else
+static inline bool dp_peer_check_ast_offload(struct dp_soc *soc)
+{
+	if (soc->ast_offload_support)
+		return true;
+
+	return false;
+}
+#endif
+
 /**
  * dp_peer_get_ast_info_by_soc_wifi3() - search the soc AST hash table
  *                                       and return ast entry information
@@ -781,7 +803,7 @@ static bool dp_peer_get_ast_info_by_soc_wifi3
 	struct dp_soc *soc = (struct dp_soc *)soc_hdl;
 	struct dp_peer *peer = NULL;
 
-	if (soc->ast_offload_support)
+	if (dp_peer_check_ast_offload(soc))
 		return false;
 
 	qdf_spin_lock_bh(&soc->ast_lock);

+ 42 - 5
ipa/core/src/wlan_ipa_core.c

@@ -1398,6 +1398,47 @@ wlan_ipa_get_sap_client_auth(struct wlan_ipa_priv *ipa_ctx, uint8_t *peer_mac)
 	return false;
 }
 
+/**
+ * wlan_ipa_check_peer_auth() - Check whether peer is authenticated or not
+ * @dp_soc: soc handle
+ * @peer_mac: peer mac address
+ * @iface: wlan ipa iface context
+ *
+ * Return: true if peer is authenticated
+ */
+#ifdef QCA_WIFI_QCN9224
+static inline bool
+wlan_ipa_check_peer_auth(ol_txrx_soc_handle dp_soc,
+			 uint8_t *peer_mac,
+			 struct wlan_ipa_iface_context *iface)
+{
+	uint8_t is_authenticated = false;
+	struct cdp_ast_entry_info ast_info = {0};
+
+	cdp_peer_get_ast_info_by_soc(dp_soc, peer_mac,
+				     &ast_info);
+	peer_mac = &ast_info.peer_mac_addr[0];
+	is_authenticated = wlan_ipa_get_peer_state(dp_soc,
+						   iface->session_id,
+						   peer_mac);
+
+	return is_authenticated;
+}
+#else
+static inline bool
+wlan_ipa_check_peer_auth(ol_txrx_soc_handle dp_soc,
+			 uint8_t *peer_mac,
+			 struct wlan_ipa_iface_context *iface)
+{
+	uint8_t is_authenticated = false;
+
+	is_authenticated = wlan_ipa_get_peer_state(dp_soc, iface->session_id,
+						   peer_mac);
+
+	return is_authenticated;
+}
+#endif
+
 #ifdef IPA_WDS_EASYMESH_FEATURE
 static inline uint8_t
 wlan_ipa_get_peer_auth_state(ol_txrx_soc_handle dp_soc, uint8_t *peer_mac,
@@ -1426,12 +1467,8 @@ static inline uint8_t
 wlan_ipa_get_peer_auth_state(ol_txrx_soc_handle dp_soc, uint8_t *peer_mac,
 			     struct wlan_ipa_iface_context *iface)
 {
-	uint8_t is_authenticated = false;
 
-	is_authenticated = wlan_ipa_get_peer_state(dp_soc, iface->session_id,
-						   peer_mac);
-
-	return is_authenticated;
+	return wlan_ipa_check_peer_auth(dp_soc, peer_mac, iface);
 }
 #endif