common/cnxk: check BPHY IRQ availability
[dpdk.git] / drivers / common / cnxk / roc_bphy_irq.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2021 Marvell.
3  */
4
5 #ifndef _ROC_BPHY_IRQ_
6 #define _ROC_BPHY_IRQ_
7
8 struct roc_bphy_irq_vec {
9         int fd;
10         int handler_cpu;
11         void (*handler)(int irq_num, void *isr_data);
12         void *isr_data;
13 };
14
15 struct roc_bphy_irq_chip {
16         struct roc_bphy_irq_vec *irq_vecs;
17         uint64_t max_irq;
18         uint64_t avail_irq_bmask;
19         int intfd;
20         int n_handlers;
21         char *mz_name;
22 };
23
24 __roc_api struct roc_bphy_irq_chip *roc_bphy_intr_init(void);
25 __roc_api void roc_bphy_intr_fini(struct roc_bphy_irq_chip *irq_chip);
26 __roc_api bool roc_bphy_intr_available(struct roc_bphy_irq_chip *irq_chip,
27                                        int irq_num);
28
29 #endif /* _ROC_BPHY_IRQ_ */