1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2021 Marvell.
5 #ifndef _ROC_DEV_PRIV_H
6 #define _ROC_DEV_PRIV_H
8 #define RVU_PFVF_PF_SHIFT 10
9 #define RVU_PFVF_PF_MASK 0x3F
10 #define RVU_PFVF_FUNC_SHIFT 0
11 #define RVU_PFVF_FUNC_MASK 0x3FF
12 #define RVU_MAX_INT_RETRY 3
15 dev_get_vf(uint16_t pf_func)
17 return (((pf_func >> RVU_PFVF_FUNC_SHIFT) & RVU_PFVF_FUNC_MASK) - 1);
21 dev_get_pf(uint16_t pf_func)
23 return (pf_func >> RVU_PFVF_PF_SHIFT) & RVU_PFVF_PF_MASK;
27 dev_pf_func(int pf, int vf)
29 return (pf << RVU_PFVF_PF_SHIFT) | ((vf << RVU_PFVF_FUNC_SHIFT) + 1);
40 struct mbox mbox_local;
44 bool disable_shared_lmt; /* false(default): shared lmt mode enabled */
45 } __plt_cache_aligned;
47 extern uint16_t dev_rclk_freq;
48 extern uint16_t dev_sclk_freq;
50 int dev_init(struct dev *dev, struct plt_pci_device *pci_dev);
51 int dev_fini(struct dev *dev, struct plt_pci_device *pci_dev);
53 int dev_irq_register(struct plt_intr_handle *intr_handle,
54 plt_intr_callback_fn cb, void *data, unsigned int vec);
55 void dev_irq_unregister(struct plt_intr_handle *intr_handle,
56 plt_intr_callback_fn cb, void *data, unsigned int vec);
57 int dev_irqs_disable(struct plt_intr_handle *intr_handle);
59 #endif /* _ROC_DEV_PRIV_H */