qcacmn: stub core_ctl_set_boost if not defined

In hif_napi.c, we are calling this kernel API core_ctl_set_boost. This
API is only present in the kernel if the feature CONFIG_SCHED_CORE_CTL
is present. In case the feature is not present in the kernel, it will
result in a compilation error.
Create a new internal API hif_napi_core_ctl_set_boost as a wrapper
around the kernel API. The new API is stubbed in case the kernel feature
is not present.

Change-Id: Ia52f1110304816670efe3480da3aa78d7b2ecb9e
CRs-Fixed: 2018089
This commit is contained in:
Mohit Khanna
2017-03-10 11:48:12 -08:00
committed by Sandeep Puligilla
parent 012bfe3098
commit 4a76dde9ad

View File

@@ -41,8 +41,9 @@
#include <linux/interrupt.h>
#include <linux/irq.h>
#ifdef HELIUMPLUS
#include <soc/qcom/irq-helper.h>
#ifdef CONFIG_SCHED_CORE_CTL
#include <linux/sched/core_ctl.h>
#endif
#include <pld_snoc.h>
#endif
#include <linux/pm.h>
@@ -1527,6 +1528,18 @@ static inline void hif_napi_bl_irq(struct qca_napi_data *napid, bool bl_flag)
}
}
#ifdef CONFIG_SCHED_CORE_CTL
/* Enable this API only if kernel feature - CONFIG_SCHED_CORE_CTL is defined */
static inline int hif_napi_core_ctl_set_boost(bool boost)
{
return core_ctl_set_boost(boost);
}
#else
static inline int hif_napi_core_ctl_set_boost(bool boost)
{
return 0;
}
#endif
/**
* hif_napi_cpu_blacklist() - en(dis)ables blacklisting for NAPI RX interrupts.
* @napid: pointer to qca_napi_data structure
@@ -1566,7 +1579,7 @@ int hif_napi_cpu_blacklist(struct qca_napi_data *napid, enum qca_blacklist_op op
ref_count++;
rc = 0;
if (ref_count == 1) {
rc = core_ctl_set_boost(true);
rc = hif_napi_core_ctl_set_boost(true);
NAPI_DEBUG("boost_on() returns %d - refcnt=%d",
rc, ref_count);
hif_napi_bl_irq(napid, true);
@@ -1577,7 +1590,7 @@ int hif_napi_cpu_blacklist(struct qca_napi_data *napid, enum qca_blacklist_op op
ref_count--;
rc = 0;
if (ref_count == 0) {
rc = core_ctl_set_boost(false);
rc = hif_napi_core_ctl_set_boost(false);
NAPI_DEBUG("boost_off() returns %d - refcnt=%d",
rc, ref_count);
hif_napi_bl_irq(napid, false);