qcacmn: Fix multi queue NAPI build errors
Fix build errors on the platform where multi queue NAPI is
not supported.
Change-Id: Id9916cff11f9337f279f9aed6dfe35e7a6beb1ed
CRs-Fixed: 1066020
diff --git a/hif/inc/hif.h b/hif/inc/hif.h
index 7bf96b1..61a23e2 100644
--- a/hif/inc/hif.h
+++ b/hif/inc/hif.h
@@ -189,11 +189,9 @@
not used by clients (clients use an
id returned by create) */
struct qca_napi_info napis[CE_COUNT_MAX];
-#ifdef HELIUMPLUS
struct qca_napi_cpu napi_cpu[NR_CPUS];
int lilcl_head, bigcl_head;
enum qca_napi_tput_state napi_mode;
-#endif
};
/**
diff --git a/hif/inc/hif_napi.h b/hif/inc/hif_napi.h
index 2087807..243301f 100644
--- a/hif/inc/hif_napi.h
+++ b/hif/inc/hif_napi.h
@@ -123,42 +123,10 @@
#define NAPI_DEBUG(fmt, ...) /* NO-OP */
#endif /* FEATURE NAPI_DEBUG */
-/**
- * Local interface to HIF implemented functions of NAPI CPU affinity management.
- * Note:
- * 1- The symbols in this file are NOT supposed to be used by any
- * entity other than hif_napi.c
- * 2- The symbols are valid only if HELIUMPLUS is defined. They are otherwise
- * mere wrappers.
- *
- */
-#ifndef HELIUMPLUS
-/**
- * stub functions
- */
-/* fw-declare to make compiler happy */
-struct qca_napi_data;
-static inline int hif_napi_cpu_init(void *) { return 0; }
-static inline int hif_napi_cpu_deinit(void *) { return 0; }
-static int hif_napi_cpu_migrate(struct qca_napi_data *, int, int) { return 0; }
-static int hif_napi_cpu_(bool) { return 0; }
-
-#else /* HELIUMPLUS - NAPI CPU symbols are valid */
-
-/*
- * prototype signatures
- */
-int hif_napi_cpu_init(void *);
-int hif_napi_cpu_deinit(void *);
-
#define HNC_ANY_CPU (-1)
#define HNC_ACT_RELOCATE (0)
#define HNC_ACT_COLLAPSE (1)
#define HNC_ACT_DISPERSE (-1)
-int hif_napi_cpu_migrate(struct qca_napi_data *napid, int cpu, int action);
-int hif_napi_cpu_blacklist(bool is_on);
-
-#endif /* HELIUMPLUS */
/**
* Local interface to HIF implemented functions of NAPI CPU affinity management.
@@ -175,11 +143,8 @@
*/
/* fw-declare to make compiler happy */
struct qca_napi_data;
-static inline int hif_napi_cpu_init(void *) { return 0; }
-static inline int hif_napi_cpu_deinit(void *) { return 0; }
-static int hif_napi_cpu_migrate(struct qca_napi_data *, int, int) { return 0; }
-static int hif_napi_cpu_(bool) { return 0; }
-
+static inline int hif_napi_cpu_init(void *ctx) { return 0; }
+static inline int hif_napi_cpu_deinit(void *ctx) { return 0; }
#else /* HELIUMPLUS - NAPI CPU symbols are valid */
/*
@@ -188,16 +153,11 @@
int hif_napi_cpu_init(void *);
int hif_napi_cpu_deinit(void *);
-#define HNC_ANY_CPU (-1)
-#define HNC_ACT_RELOCATE (0)
-#define HNC_ACT_COLLAPSE (1)
-#define HNC_ACT_DISPERSE (-1)
int hif_napi_cpu_migrate(struct qca_napi_data *napid, int cpu, int action);
int hif_napi_cpu_blacklist(bool is_on);
#endif /* HELIUMPLUS */
-
#else /* ! defined(FEATURE_NAPI) */
/**
diff --git a/hif/src/hif_napi.c b/hif/src/hif_napi.c
index 28b9f7c..50a68c5 100644
--- a/hif/src/hif_napi.c
+++ b/hif/src/hif_napi.c
@@ -39,9 +39,11 @@
#include <linux/cpu.h>
#include <linux/topology.h>
#include <linux/interrupt.h>
+#ifdef HELIUMPLUS
#include <soc/qcom/irq-helper.h>
-#include <linux/pm.h>
#include <soc/qcom/icnss.h> /* replace with pld when available */
+#endif
+#include <linux/pm.h>
/* Driver headers */
#include <cds_api.h>
@@ -58,6 +60,25 @@
};
#define ENABLE_NAPI_MASK (HIF_NAPI_INITED | HIF_NAPI_CONF_UP)
+#ifdef HELIUMPLUS
+static inline int hif_get_irq_for_ce(int ce_id)
+{
+ return icnss_get_irq(ce_id);
+}
+#else /* HELIUMPLUS */
+static inline int hif_get_irq_for_ce(int ce_id)
+{
+ return -EINVAL;
+}
+static int hif_napi_cpu_migrate(struct qca_napi_data *napid, int cpu,
+ int action)
+{
+ return 0;
+}
+
+int hif_napi_cpu_blacklist(bool is_on) { return 0; }
+#endif /* HELIUMPLUS */
+
/**
* hif_napi_create() - creates the NAPI structures for a given CE
* @hif : pointer to hif context
@@ -129,7 +150,7 @@
napii->scale = scale;
napii->id = NAPI_PIPE2ID(i);
napii->hif_ctx = hif_ctx;
- napii->irq = icnss_get_irq(i);
+ napii->irq = hif_get_irq_for_ce(i);
if (napii->irq < 0)
HIF_WARN("%s: bad IRQ value for CE %d: %d",
__func__, i, napii->irq);