linux/drivers/net/ethernet/intel/i40evf/i40e_osdep.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0 */
   2/* Copyright(c) 2013 - 2018 Intel Corporation. */
   3
   4#ifndef _I40E_OSDEP_H_
   5#define _I40E_OSDEP_H_
   6
   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
  13/* get readq/writeq support for 32 bit kernels, use the low-first version */
  14#include <asm-generic/io-64-nonatomic-lo-hi.h>
  15
  16/* File to be the magic between shared code and
  17 * actual OS primitives
  18 */
  19
  20#define hw_dbg(hw, S, A...)     do {} while (0)
  21
  22#define wr32(a, reg, value)     writel((value), ((a)->hw_addr + (reg)))
  23#define rd32(a, reg)            readl((a)->hw_addr + (reg))
  24
  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)
  28
  29/* memory allocation tracking */
  30struct i40e_dma_mem {
  31        void *va;
  32        dma_addr_t pa;
  33        u32 size;
  34};
  35
  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)
  39
  40struct i40e_virt_mem {
  41        void *va;
  42        u32 size;
  43};
  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)
  46
  47#define i40e_debug(h, m, s, ...)  i40evf_debug_d(h, m, s, ##__VA_ARGS__)
  48extern void i40evf_debug_d(void *hw, u32 mask, char *fmt_str, ...)
  49        __attribute__ ((format(gnu_printf, 3, 4)));
  50
  51typedef enum i40e_status_code i40e_status;
  52#endif /* _I40E_OSDEP_H_ */
  53