gpio: rcar: Fix runtime PM imbalance on error
[linux/fpc-iii.git] / drivers / net / ethernet / intel / iavf / iavf_osdep.h
bloba452ce90679a9dc625942bf8033664e9829f67cd
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright(c) 2013 - 2018 Intel Corporation. */
4 #ifndef _IAVF_OSDEP_H_
5 #define _IAVF_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 iavf_flush(a) readl((a)->hw_addr + IAVF_VFGEN_RSTAT)
29 /* memory allocation tracking */
30 struct iavf_dma_mem {
31 void *va;
32 dma_addr_t pa;
33 u32 size;
36 #define iavf_allocate_dma_mem(h, m, unused, s, a) \
37 iavf_allocate_dma_mem_d(h, m, s, a)
38 #define iavf_free_dma_mem(h, m) iavf_free_dma_mem_d(h, m)
40 struct iavf_virt_mem {
41 void *va;
42 u32 size;
44 #define iavf_allocate_virt_mem(h, m, s) iavf_allocate_virt_mem_d(h, m, s)
45 #define iavf_free_virt_mem(h, m) iavf_free_virt_mem_d(h, m)
47 #define iavf_debug(h, m, s, ...) \
48 do { \
49 if (((m) & (h)->debug_mask)) \
50 pr_info("iavf %02x:%02x.%x " s, \
51 (h)->bus.bus_id, (h)->bus.device, \
52 (h)->bus.func, ##__VA_ARGS__); \
53 } while (0)
55 #endif /* _IAVF_OSDEP_H_ */