1 /* 2 * Copyright (c) 2015-2018 The Linux Foundation. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for 5 * any purpose with or without fee is hereby granted, provided that the 6 * above copyright notice and this permission notice appear in all 7 * copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16 * PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 #ifndef __HIF_IRQ_AFFINITY_H__ 20 #define __HIF_IRQ_AFFINITY_H__ 21 22 #ifdef HIF_IRQ_AFFINITY 23 #ifndef FEATURE_NAPI 24 #error /*HIF_IRQ_AFFINITY currently relies on FEATURE_NAPI*/ 25 #endif 26 #endif 27 28 /* CLD headers */ 29 #include <hif.h> /* struct hif_opaque_softc; */ 30 #include <hif_napi.h> 31 struct hif_opaque_softc; 32 enum qca_blacklist_op; 33 34 int hif_exec_cpu_migrate(struct qca_napi_data *napid, int cpu, int action); 35 36 int hif_exec_cpu_blacklist(struct qca_napi_data *napid, 37 enum qca_blacklist_op op); 38 39 #ifdef HIF_IRQ_AFFINITY 40 int hif_exec_event(struct hif_opaque_softc *hif, 41 enum qca_napi_event event, 42 void *data); 43 44 45 /* hif_irq_affinity_remove() - remove affinity before freeing the irq 46 * @os_irq: irq number to remove affinity from 47 */ 48 static inline void hif_irq_affinity_remove(int os_irq) 49 { 50 irq_set_affinity_hint(os_irq, NULL); 51 } 52 #else 53 static inline void hif_irq_affinity_remove(int os_irq) 54 { 55 } 56 57 static inline int hif_exec_event(struct hif_opaque_softc *hif, 58 enum qca_napi_event event, 59 void *data) 60 { 61 return 0; 62 } 63 #endif 64 #endif 65