/* * Copyright (c) 2015-2021 The Linux Foundation. All rights reserved. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all * copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ #ifndef __HIF_IRQ_AFFINITY_H__ #define __HIF_IRQ_AFFINITY_H__ #ifdef HIF_IRQ_AFFINITY #ifndef FEATURE_NAPI #error /*HIF_IRQ_AFFINITY currently relies on FEATURE_NAPI*/ #endif #endif /* CLD headers */ #include /* struct hif_opaque_softc; */ #include struct hif_opaque_softc; enum qca_denylist_op; int hif_exec_cpu_migrate(struct qca_napi_data *napid, int cpu, int action); int hif_exec_cpu_denylist(struct qca_napi_data *napid, enum qca_denylist_op op); #ifdef HIF_IRQ_AFFINITY int hif_exec_event(struct hif_opaque_softc *hif, enum qca_napi_event event, void *data); /* hif_irq_affinity_remove() - remove affinity before freeing the irq * @os_irq: irq number to remove affinity from */ static inline void hif_irq_affinity_remove(int os_irq) { qdf_dev_set_irq_affinity(os_irq, NULL); } #else static inline void hif_irq_affinity_remove(int os_irq) { } static inline int hif_exec_event(struct hif_opaque_softc *hif, enum qca_napi_event event, void *data) { return 0; } #endif /** * hif_napi_core_ctl_set_boost() - This API is used to move * tasks to CPUs with higher capacity * @boost: If set move tasks to higher capacity CPUs * * This function moves tasks to higher capacity CPUs than those * where the tasks would have normally ended up * * Return: None */ static inline int hif_napi_core_ctl_set_boost(bool boost) { return qdf_core_ctl_set_boost(boost); } #ifdef HIF_CPU_PERF_AFFINE_MASK static inline int hif_core_ctl_set_boost(bool boost) { return hif_napi_core_ctl_set_boost(boost); } #else static inline int hif_core_ctl_set_boost(bool boost) { return 0; } #endif #endif