net/cnxk: support device infos query
[dpdk.git] / drivers / raw / cnxk_bphy / cnxk_bphy_irq.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2021 Marvell.
3  */
4
5 #ifndef _CNXK_BPHY_IRQ_
6 #define _CNXK_BPHY_IRQ_
7
8 #include <rte_bus_pci.h>
9 #include <rte_dev.h>
10
11 #include <roc_api.h>
12
13 typedef void (*cnxk_bphy_intr_handler_t)(int irq_num, void *isr_data);
14
15 struct bphy_mem {
16         struct rte_mem_resource res0;
17         struct rte_mem_resource res2;
18 };
19
20 struct bphy_irq_queue {
21         /* queue holds up to one response */
22         void *rsp;
23 };
24
25 struct bphy_device {
26         struct roc_bphy_irq_chip *irq_chip;
27         struct bphy_mem mem;
28         /* bphy irq interface supports single queue only */
29         struct bphy_irq_queue queues[1];
30 };
31
32 int cnxk_bphy_intr_init(uint16_t dev_id);
33 void cnxk_bphy_intr_fini(uint16_t dev_id);
34 struct bphy_mem *cnxk_bphy_mem_get(uint16_t dev_id);
35 int cnxk_bphy_intr_register(uint16_t dev_id, int irq_num,
36                             cnxk_bphy_intr_handler_t handler,
37                             void *isr_data, int cpu);
38 void cnxk_bphy_intr_unregister(uint16_t dev_id, int irq_num);
39 uint64_t cnxk_bphy_irq_max_get(uint16_t dev_id);
40
41 #endif /* _CNXK_BPHY_IRQ_ */