1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright(c) 2013 - 2018 Intel Corporation. */
7 #include <linux/types.h>
8 #include <linux/if_ether.h>
9 #include <linux/if_vlan.h>
10 #include <linux/tcp.h>
11 #include <linux/pci.h>
12 #include <linux/highuid.h>
14 /* get readq/writeq support for 32 bit kernels, use the low-first version */
15 #include <linux/io-64-nonatomic-lo-hi.h>
17 /* File to be the magic between shared code and
18 * actual OS primitives
21 #define hw_dbg(hw, S, A...) \
23 dev_dbg(&((struct i40e_pf *)hw->back)->pdev->dev, S, ##A); \
26 #define wr32(a, reg, value) writel((value), ((a)->hw_addr + (reg)))
27 #define rd32(a, reg) readl((a)->hw_addr + (reg))
29 #define rd64(a, reg) readq((a)->hw_addr + (reg))
30 #define i40e_flush(a) readl((a)->hw_addr + I40E_GLGEN_STAT)
32 /* memory allocation tracking */
39 #define i40e_allocate_dma_mem(h, m, unused, s, a) \
40 i40e_allocate_dma_mem_d(h, m, s, a)
41 #define i40e_free_dma_mem(h, m) i40e_free_dma_mem_d(h, m)
43 struct i40e_virt_mem {
48 #define i40e_allocate_virt_mem(h, m, s) i40e_allocate_virt_mem_d(h, m, s)
49 #define i40e_free_virt_mem(h, m) i40e_free_virt_mem_d(h, m)
51 #define i40e_debug(h, m, s, ...) \
53 if (((m) & (h)->debug_mask)) \
54 pr_info("i40e %02x:%02x.%x " s, \
55 (h)->bus.bus_id, (h)->bus.device, \
56 (h)->bus.func, ##__VA_ARGS__); \
59 typedef enum i40e_status_code i40e_status;
60 #endif /* _I40E_OSDEP_H_ */