Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause
2 : : * Copyright(c) 2018 Intel Corporation
3 : : */
4 : :
5 : : #ifndef _IFCVF_OSDEP_H_
6 : : #define _IFCVF_OSDEP_H_
7 : :
8 : : #include <stdint.h>
9 : :
10 : : #include <rte_cycles.h>
11 : : #include <rte_pci.h>
12 : : #include <bus_pci_driver.h>
13 : : #include <rte_log.h>
14 : : #include <rte_io.h>
15 : :
16 : : #define WARNINGOUT(S, args...) RTE_LOG(WARNING, PMD, S, ##args)
17 : : #define DEBUGOUT(S, args...) RTE_LOG(DEBUG, PMD, S, ##args)
18 : : #define STATIC static
19 : :
20 : : #define msec_delay(x) rte_delay_us_sleep(1000 * (x))
21 : :
22 : : #define IFCVF_READ_REG8(reg) rte_read8(reg)
23 : : #define IFCVF_WRITE_REG8(val, reg) rte_write8((val), (reg))
24 : : #define IFCVF_READ_REG16(reg) rte_read16(reg)
25 : : #define IFCVF_WRITE_REG16(val, reg) rte_write16((val), (reg))
26 : : #define IFCVF_READ_REG32(reg) rte_read32(reg)
27 : : #define IFCVF_WRITE_REG32(val, reg) rte_write32((val), (reg))
28 : :
29 : : typedef struct rte_pci_device PCI_DEV;
30 : :
31 : : #define PCI_READ_CONFIG_BYTE(dev, val, where) \
32 : : rte_pci_read_config(dev, val, 1, where)
33 : :
34 : : #define PCI_READ_CONFIG_DWORD(dev, val, where) \
35 : : rte_pci_read_config(dev, val, 4, where)
36 : :
37 : : #define PCI_CAPABILITY_LIST RTE_PCI_CAPABILITY_LIST
38 : : #define PCI_CAP_ID_VNDR RTE_PCI_CAP_ID_VNDR
39 : :
40 : : typedef uint8_t u8;
41 : : typedef int8_t s8;
42 : : typedef uint16_t u16;
43 : : typedef int16_t s16;
44 : : typedef uint32_t u32;
45 : : typedef int32_t s32;
46 : : typedef int64_t s64;
47 : : typedef uint64_t u64;
48 : :
49 : : static inline int
50 : : PCI_READ_CONFIG_RANGE(PCI_DEV *dev, uint32_t *val, int size, int where)
51 : : {
52 : 0 : return rte_pci_read_config(dev, val, size, where);
53 : : }
54 : :
55 : : #endif /* _IFCVF_OSDEP_H_ */
|