Linux 4.19.133
[linux/fpc-iii.git] / drivers / net / ethernet / intel / i40evf / i40e_osdep.h
blob3ddddb46455b2fbdeac7c14426fa74de61b1dec1
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright(c) 2013 - 2018 Intel Corporation. */
4 #ifndef _I40E_OSDEP_H_
5 #define _I40E_OSDEP_H_
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>
13 /* get readq/writeq support for 32 bit kernels, use the low-first version */
14 #include <linux/io-64-nonatomic-lo-hi.h>
16 /* File to be the magic between shared code and
17 * actual OS primitives
20 #define hw_dbg(hw, S, A...) do {} while (0)
22 #define wr32(a, reg, value) writel((value), ((a)->hw_addr + (reg)))
23 #define rd32(a, reg) readl((a)->hw_addr + (reg))
25 #define wr64(a, reg, value) writeq((value), ((a)->hw_addr + (reg)))
26 #define rd64(a, reg) readq((a)->hw_addr + (reg))
27 #define i40e_flush(a) readl((a)->hw_addr + I40E_VFGEN_RSTAT)
29 /* memory allocation tracking */
30 struct i40e_dma_mem {
31 void *va;
32 dma_addr_t pa;
33 u32 size;
36 #define i40e_allocate_dma_mem(h, m, unused, s, a) \
37 i40evf_allocate_dma_mem_d(h, m, s, a)
38 #define i40e_free_dma_mem(h, m) i40evf_free_dma_mem_d(h, m)
40 struct i40e_virt_mem {
41 void *va;
42 u32 size;
44 #define i40e_allocate_virt_mem(h, m, s) i40evf_allocate_virt_mem_d(h, m, s)
45 #define i40e_free_virt_mem(h, m) i40evf_free_virt_mem_d(h, m)
47 #define i40e_debug(h, m, s, ...) i40evf_debug_d(h, m, s, ##__VA_ARGS__)
48 extern void i40evf_debug_d(void *hw, u32 mask, char *fmt_str, ...)
49 __attribute__ ((format(gnu_printf, 3, 4)));
51 typedef enum i40e_status_code i40e_status;
52 #endif /* _I40E_OSDEP_H_ */