qcacmn: Add changes for per NAPI or per Rx CE LRO manager

Make changes for per per Rx context LRO manager, this addresses
all parallel Rx concurrency issues. There by removes all the contention.

Change-Id: I90604ffdf7b7fd930eee636426a4c7fc9b92c7d7
CRs-Fixed: 1079320
diff --git a/hif/src/hif_main.c b/hif/src/hif_main.c
index 766f910..f4707d6 100644
--- a/hif/src/hif_main.c
+++ b/hif/src/hif_main.c
@@ -49,6 +49,7 @@
 #ifdef QCA_WIFI_QCA8074
 #include "hal_api.h"
 #endif
+#include "hif_napi.h"
 
 void hif_dump(struct hif_opaque_softc *hif_ctx, uint8_t cmd_id, bool start)
 {
@@ -812,20 +813,70 @@
  * Return: void
  */
 void hif_lro_flush_cb_register(struct hif_opaque_softc *scn,
-			       void (handler)(void *), void *data)
+			       void (lro_flush_handler)(void *),
+			       void *(lro_init_handler)(void))
 {
-	ce_lro_flush_cb_register(scn, handler, data);
+	if (hif_napi_enabled(scn, -1))
+		hif_napi_lro_flush_cb_register(scn, lro_flush_handler,
+					       lro_init_handler);
+	else
+		ce_lro_flush_cb_register(scn, lro_flush_handler,
+					lro_init_handler);
+}
+
+/**
+ * hif_get_lro_info - Returns LRO instance for instance ID
+ * @ctx_id: LRO instance ID
+ * @hif_hdl: HIF Context
+ *
+ * Return: Pointer to LRO instance.
+ */
+void *hif_get_lro_info(int ctx_id, struct hif_opaque_softc *hif_hdl)
+{
+	void *data;
+
+	if (hif_napi_enabled(hif_hdl, -1))
+		data = hif_napi_get_lro_info(hif_hdl, ctx_id);
+	else
+		data = hif_ce_get_lro_ctx(hif_hdl, ctx_id);
+
+	return data;
+}
+
+/**
+ * hif_get_rx_ctx_id - Returns LRO instance ID based on underlying LRO instance
+ * @ctx_id: LRO context ID
+ * @hif_hdl: HIF Context
+ *
+ * Return: LRO instance ID
+ */
+int hif_get_rx_ctx_id(int ctx_id, struct hif_opaque_softc *hif_hdl)
+{
+	if (hif_napi_enabled(hif_hdl, -1))
+		return NAPI_PIPE2ID(ctx_id);
+	else
+		return ctx_id;
 }
 
 /**
  * hif_lro_flush_cb_deregister - API to deregister for LRO Flush Callbacks
- * @scn: HIF Context
+ * @hif_hdl: HIF Context
+ * @lro_deinit_cb: LRO deinit callback
  *
  * Return: void
  */
-void hif_lro_flush_cb_deregister(struct hif_opaque_softc *scn)
+void hif_lro_flush_cb_deregister(struct hif_opaque_softc *hif_hdl,
+				 void (lro_deinit_cb)(void *))
 {
-	ce_lro_flush_cb_deregister(scn);
+	if (hif_napi_enabled(hif_hdl, -1))
+		hif_napi_lro_flush_cb_deregister(hif_hdl, lro_deinit_cb);
+	else
+		ce_lro_flush_cb_deregister(hif_hdl, lro_deinit_cb);
+}
+#else /* !defined(FEATURE_LRO) */
+int hif_get_rx_ctx_id(int ctx_id, struct hif_opaque_softc *hif_hdl)
+{
+	return 0;
 }
 #endif