[qca-nss-drv] Adding connection inquiry for NSS debug.
Give 5 tuples to NSS FW to find if a matching connection exists;
nss_ipv#_conn_inquiry() is the API to pass 5 tuple for inquiry,
and its callback parameter (cb) is for checking return result/status.
Change-Id: Ib968b9b3b7d1a4125425a8926489e74cb90af30f
Signed-off-by: Guojun Jin <gjin@codeaurora.org>
diff --git a/nss_ipv6.c b/nss_ipv6.c
index 430d260..c5a6590 100644
--- a/nss_ipv6.c
+++ b/nss_ipv6.c
@@ -54,6 +54,37 @@
EXPORT_SYMBOL(nss_ipv6_max_conn_count);
/*
+ * nss_ipv6_conn_inquiry()
+ * Inquiry if a connection has been established in NSS FW
+ */
+nss_tx_status_t nss_ipv6_conn_inquiry(struct nss_ipv6_5tuple *ipv6_5t_p,
+ nss_ipv6_msg_callback_t cb)
+{
+ nss_tx_status_t nss_tx_status;
+ struct nss_ipv6_msg nim;
+ struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[0];
+
+ /*
+ * Initialize inquiry message structure.
+ * This is async message and the result will be returned
+ * to the caller by the msg_callback passed in.
+ */
+ memset(&nim, 0, sizeof(nim));
+ nss_ipv6_msg_init(&nim, NSS_IPV6_RX_INTERFACE,
+ NSS_IPV6_TX_CONN_CFG_INQUIRY_MSG,
+ sizeof(struct nss_ipv6_inquiry_msg),
+ cb, NULL);
+ nim.msg.inquiry.rr.tuple = *ipv6_5t_p;
+ nss_tx_status = nss_ipv6_tx(nss_ctx, &nim);
+ if (nss_tx_status != NSS_TX_SUCCESS) {
+ nss_warning("%p: Send inquiry message failed\n", ipv6_5t_p);
+ }
+
+ return nss_tx_status;
+}
+EXPORT_SYMBOL(nss_ipv6_conn_inquiry);
+
+/*
* nss_ipv6_driver_conn_sync_update()
* Update driver specific information from the messsage.
*/