e94c61b1a75d33a94b03cc69fd2ef590d03792a5
[dpdk.git] / drivers / event / octeontx2 / otx2_tim_evdev.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2019 Marvell International Ltd.
3  */
4
5 #ifndef __OTX2_TIM_EVDEV_H__
6 #define __OTX2_TIM_EVDEV_H__
7
8 #include <rte_event_timer_adapter.h>
9
10 #include "otx2_dev.h"
11
12 #define OTX2_TIM_EVDEV_NAME otx2_tim_eventdev
13
14 struct otx2_tim_evdev {
15         struct rte_pci_device *pci_dev;
16         struct rte_eventdev *event_dev;
17         struct otx2_mbox *mbox;
18         uint16_t nb_rings;
19         uintptr_t bar2;
20 };
21
22 static inline struct otx2_tim_evdev *
23 tim_priv_get(void)
24 {
25         const struct rte_memzone *mz;
26
27         mz = rte_memzone_lookup(RTE_STR(OTX2_TIM_EVDEV_NAME));
28         if (mz == NULL)
29                 return NULL;
30
31         return mz->addr;
32 }
33
34 int otx2_tim_caps_get(const struct rte_eventdev *dev, uint64_t flags,
35                       uint32_t *caps,
36                       const struct rte_event_timer_adapter_ops **ops);
37
38 void otx2_tim_init(struct rte_pci_device *pci_dev, struct otx2_dev *cmn_dev);
39 void otx2_tim_fini(void);
40
41 #endif /* __OTX2_TIM_EVDEV_H__ */