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 wr64(a, reg, value) writeq((value), ((a)->hw_addr + (reg)))
30 #define rd64(a, reg) readq((a)->hw_addr + (reg))
31 #define i40e_flush(a) readl((a)->hw_addr + I40E_GLGEN_STAT)
33 /* memory allocation tracking */
40 #define i40e_allocate_dma_mem(h, m, unused, s, a) \
41 i40e_allocate_dma_mem_d(h, m, s, a)
42 #define i40e_free_dma_mem(h, m) i40e_free_dma_mem_d(h, m)
44 struct i40e_virt_mem {
49 #define i40e_allocate_virt_mem(h, m, s) i40e_allocate_virt_mem_d(h, m, s)
50 #define i40e_free_virt_mem(h, m) i40e_free_virt_mem_d(h, m)
52 #define i40e_debug(h, m, s, ...) \
54 if (((m) & (h)->debug_mask)) \
55 pr_info("i40e %02x:%02x.%x " s, \
56 (h)->bus.bus_id, (h)->bus.device, \
57 (h)->bus.func, ##__VA_ARGS__); \
60 typedef enum i40e_status_code i40e_status;
61 #endif /* _I40E_OSDEP_H_ */