FreeBSD kernel IXGBE device code
ixgbe_osdep.h File Reference
#include <sys/types.h>
#include <sys/param.h>
#include <sys/endian.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/protosw.h>
#include <sys/socket.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/bus.h>
#include <machine/bus.h>
#include <sys/rman.h>
#include <machine/resource.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <machine/clock.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
Include dependency graph for ixgbe_osdep.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ixgbe_osdep
 

Macros

#define ASSERT(x)   if(!(x)) panic("IXGBE: x")
 
#define EWARN(H, W)   printf(W)
 
#define usec_delay(x)   DELAY(x)
 
#define msec_delay(x)   DELAY(1000*(x))
 
#define DBG   0
 
#define MSGOUT(S, A, B)   printf(S "\n", A, B)
 
#define DEBUGFUNC(F)   DEBUGOUT(F);
 
#define DEBUGOUT(S)
 
#define DEBUGOUT1(S, A)
 
#define DEBUGOUT2(S, A, B)
 
#define DEBUGOUT3(S, A, B, C)
 
#define DEBUGOUT4(S, A, B, C, D)
 
#define DEBUGOUT5(S, A, B, C, D, E)
 
#define DEBUGOUT6(S, A, B, C, D, E, F)
 
#define DEBUGOUT7(S, A, B, C, D, E, F, G)
 
#define ERROR_REPORT1(S, A)
 
#define ERROR_REPORT2(S, A, B)
 
#define ERROR_REPORT3(S, A, B, C)
 
#define CMD_MEM_WRT_INVALIDATE   0x0010 /* BIT_4 */
 
#define PCI_COMMAND_REGISTER   PCIR_COMMAND
 
#define IXGBE_INTEL_VENDOR_ID   0x8086
 
#define UNREFERENCED_PARAMETER(_p)
 
#define UNREFERENCED_1PARAMETER(_p)
 
#define UNREFERENCED_2PARAMETER(_p, _q)
 
#define UNREFERENCED_3PARAMETER(_p, _q, _r)
 
#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s)
 
#define IXGBE_NTOHL(_i)   ntohl(_i)
 
#define IXGBE_NTOHS(_i)   ntohs(_i)
 
#define IXGBE_CPU_TO_LE16   htole16
 
#define IXGBE_CPU_TO_LE32   htole32
 
#define IXGBE_LE32_TO_CPU   le32toh
 
#define IXGBE_LE32_TO_CPUS(x)
 
#define IXGBE_CPU_TO_BE16   htobe16
 
#define IXGBE_CPU_TO_BE32   htobe32
 
#define IXGBE_BE32_TO_CPU   be32toh
 
#define __le16   u16
 
#define __le32   u32
 
#define __le64   u64
 
#define __be16   u16
 
#define __be32   u32
 
#define __be64   u64
 
#define le16_to_cpu
 
#define mb()
 
#define rmb()
 
#define wmb()
 
#define prefetch(x)
 
#define IXGBE_READ_PCIE_WORD   ixgbe_read_pci_cfg
 
#define IXGBE_WRITE_PCIE_WORD   ixgbe_write_pci_cfg
 
#define IXGBE_WRITE_FLUSH(a)   IXGBE_READ_REG(a, IXGBE_STATUS)
 
#define IXGBE_READ_REG(a, reg)   ixgbe_read_reg(a, reg)
 
#define IXGBE_WRITE_REG(a, reg, val)   ixgbe_write_reg(a, reg, val)
 
#define IXGBE_READ_REG_ARRAY(a, reg, offset)    ixgbe_read_reg_array(a, reg, offset)
 
#define IXGBE_WRITE_REG_ARRAY(a, reg, offset, val)    ixgbe_write_reg_array(a, reg, offset, val)
 

Typedefs

typedef uint8_t u8
 
typedef int8_t s8
 
typedef uint16_t u16
 
typedef int16_t s16
 
typedef uint32_t u32
 
typedef int32_t s32
 
typedef uint64_t u64
 
typedef boolean_t bool
 

Enumerations

enum  {
  IXGBE_ERROR_SOFTWARE , IXGBE_ERROR_POLLING , IXGBE_ERROR_INVALID_STATE , IXGBE_ERROR_UNSUPPORTED ,
  IXGBE_ERROR_ARGUMENT , IXGBE_ERROR_CAUTION
}
 

Functions

static __inline int ixgbe_bcopy (void *restrict _src, void *restrict _dst, int l)
 
u16 ixgbe_read_pci_cfg (struct ixgbe_hw *, u32)
 
void ixgbe_write_pci_cfg (struct ixgbe_hw *, u32, u16)
 
u32 ixgbe_read_reg (struct ixgbe_hw *, u32)
 
void ixgbe_write_reg (struct ixgbe_hw *, u32, u32)
 
u32 ixgbe_read_reg_array (struct ixgbe_hw *, u32, u32)
 
void ixgbe_write_reg_array (struct ixgbe_hw *, u32, u32, u32)
 

Macro Definition Documentation

◆ __be16

#define __be16   u16

Definition at line 158 of file ixgbe_osdep.h.

◆ __be32

#define __be32   u32

Definition at line 159 of file ixgbe_osdep.h.

◆ __be64

#define __be64   u64

Definition at line 160 of file ixgbe_osdep.h.

◆ __le16

#define __le16   u16

Definition at line 155 of file ixgbe_osdep.h.

◆ __le32

#define __le32   u32

Definition at line 156 of file ixgbe_osdep.h.

◆ __le64

#define __le64   u64

Definition at line 157 of file ixgbe_osdep.h.

◆ ASSERT

#define ASSERT (   x)    if(!(x)) panic("IXGBE: x")

Definition at line 58 of file ixgbe_osdep.h.

◆ CMD_MEM_WRT_INVALIDATE

#define CMD_MEM_WRT_INVALIDATE   0x0010 /* BIT_4 */

Definition at line 118 of file ixgbe_osdep.h.

◆ DBG

#define DBG   0

Definition at line 74 of file ixgbe_osdep.h.

◆ DEBUGFUNC

#define DEBUGFUNC (   F)    DEBUGOUT(F);

Definition at line 76 of file ixgbe_osdep.h.

◆ DEBUGOUT

#define DEBUGOUT (   S)

Definition at line 104 of file ixgbe_osdep.h.

◆ DEBUGOUT1

#define DEBUGOUT1 (   S,
 
)

Definition at line 105 of file ixgbe_osdep.h.

◆ DEBUGOUT2

#define DEBUGOUT2 (   S,
  A,
 
)

Definition at line 106 of file ixgbe_osdep.h.

◆ DEBUGOUT3

#define DEBUGOUT3 (   S,
  A,
  B,
 
)

Definition at line 107 of file ixgbe_osdep.h.

◆ DEBUGOUT4

#define DEBUGOUT4 (   S,
  A,
  B,
  C,
 
)

Definition at line 108 of file ixgbe_osdep.h.

◆ DEBUGOUT5

#define DEBUGOUT5 (   S,
  A,
  B,
  C,
  D,
 
)

Definition at line 109 of file ixgbe_osdep.h.

◆ DEBUGOUT6

#define DEBUGOUT6 (   S,
  A,
  B,
  C,
  D,
  E,
 
)

Definition at line 110 of file ixgbe_osdep.h.

◆ DEBUGOUT7

#define DEBUGOUT7 (   S,
  A,
  B,
  C,
  D,
  E,
  F,
 
)

Definition at line 111 of file ixgbe_osdep.h.

◆ ERROR_REPORT1

#define ERROR_REPORT1 (   S,
 
)

Definition at line 113 of file ixgbe_osdep.h.

◆ ERROR_REPORT2

#define ERROR_REPORT2 (   S,
  A,
 
)

Definition at line 114 of file ixgbe_osdep.h.

◆ ERROR_REPORT3

#define ERROR_REPORT3 (   S,
  A,
  B,
 
)

Definition at line 115 of file ixgbe_osdep.h.

◆ EWARN

#define EWARN (   H,
 
)    printf(W)

Definition at line 59 of file ixgbe_osdep.h.

◆ IXGBE_BE32_TO_CPU

#define IXGBE_BE32_TO_CPU   be32toh

Definition at line 141 of file ixgbe_osdep.h.

◆ IXGBE_CPU_TO_BE16

#define IXGBE_CPU_TO_BE16   htobe16

Definition at line 139 of file ixgbe_osdep.h.

◆ IXGBE_CPU_TO_BE32

#define IXGBE_CPU_TO_BE32   htobe32

Definition at line 140 of file ixgbe_osdep.h.

◆ IXGBE_CPU_TO_LE16

#define IXGBE_CPU_TO_LE16   htole16

Definition at line 135 of file ixgbe_osdep.h.

◆ IXGBE_CPU_TO_LE32

#define IXGBE_CPU_TO_LE32   htole32

Definition at line 136 of file ixgbe_osdep.h.

◆ IXGBE_INTEL_VENDOR_ID

#define IXGBE_INTEL_VENDOR_ID   0x8086

Definition at line 122 of file ixgbe_osdep.h.

◆ IXGBE_LE32_TO_CPU

#define IXGBE_LE32_TO_CPU   le32toh

Definition at line 137 of file ixgbe_osdep.h.

◆ IXGBE_LE32_TO_CPUS

#define IXGBE_LE32_TO_CPUS (   x)

Definition at line 138 of file ixgbe_osdep.h.

◆ IXGBE_NTOHL

#define IXGBE_NTOHL (   _i)    ntohl(_i)

Definition at line 131 of file ixgbe_osdep.h.

◆ IXGBE_NTOHS

#define IXGBE_NTOHS (   _i)    ntohs(_i)

Definition at line 132 of file ixgbe_osdep.h.

◆ IXGBE_READ_PCIE_WORD

#define IXGBE_READ_PCIE_WORD   ixgbe_read_pci_cfg

Definition at line 216 of file ixgbe_osdep.h.

◆ IXGBE_READ_REG

#define IXGBE_READ_REG (   a,
  reg 
)    ixgbe_read_reg(a, reg)

Definition at line 224 of file ixgbe_osdep.h.

◆ IXGBE_READ_REG_ARRAY

#define IXGBE_READ_REG_ARRAY (   a,
  reg,
  offset 
)     ixgbe_read_reg_array(a, reg, offset)

Definition at line 230 of file ixgbe_osdep.h.

◆ IXGBE_WRITE_FLUSH

#define IXGBE_WRITE_FLUSH (   a)    IXGBE_READ_REG(a, IXGBE_STATUS)

Definition at line 221 of file ixgbe_osdep.h.

◆ IXGBE_WRITE_PCIE_WORD

#define IXGBE_WRITE_PCIE_WORD   ixgbe_write_pci_cfg

Definition at line 219 of file ixgbe_osdep.h.

◆ IXGBE_WRITE_REG

#define IXGBE_WRITE_REG (   a,
  reg,
  val 
)    ixgbe_write_reg(a, reg, val)

Definition at line 227 of file ixgbe_osdep.h.

◆ IXGBE_WRITE_REG_ARRAY

#define IXGBE_WRITE_REG_ARRAY (   a,
  reg,
  offset,
  val 
)     ixgbe_write_reg_array(a, reg, offset, val)

Definition at line 234 of file ixgbe_osdep.h.

◆ le16_to_cpu

#define le16_to_cpu

Definition at line 162 of file ixgbe_osdep.h.

◆ mb

#define mb ( )

Definition at line 170 of file ixgbe_osdep.h.

◆ msec_delay

#define msec_delay (   x)    DELAY(1000*(x))

Definition at line 72 of file ixgbe_osdep.h.

◆ MSGOUT

#define MSGOUT (   S,
  A,
 
)    printf(S "\n", A, B)

Definition at line 75 of file ixgbe_osdep.h.

◆ PCI_COMMAND_REGISTER

#define PCI_COMMAND_REGISTER   PCIR_COMMAND

Definition at line 119 of file ixgbe_osdep.h.

◆ prefetch

#define prefetch (   x)

Definition at line 183 of file ixgbe_osdep.h.

◆ rmb

#define rmb ( )

Definition at line 171 of file ixgbe_osdep.h.

◆ UNREFERENCED_1PARAMETER

#define UNREFERENCED_1PARAMETER (   _p)

Definition at line 126 of file ixgbe_osdep.h.

◆ UNREFERENCED_2PARAMETER

#define UNREFERENCED_2PARAMETER (   _p,
  _q 
)

Definition at line 127 of file ixgbe_osdep.h.

◆ UNREFERENCED_3PARAMETER

#define UNREFERENCED_3PARAMETER (   _p,
  _q,
  _r 
)

Definition at line 128 of file ixgbe_osdep.h.

◆ UNREFERENCED_4PARAMETER

#define UNREFERENCED_4PARAMETER (   _p,
  _q,
  _r,
  _s 
)

Definition at line 129 of file ixgbe_osdep.h.

◆ UNREFERENCED_PARAMETER

#define UNREFERENCED_PARAMETER (   _p)

Definition at line 125 of file ixgbe_osdep.h.

◆ usec_delay

#define usec_delay (   x)    DELAY(x)

Definition at line 71 of file ixgbe_osdep.h.

◆ wmb

#define wmb ( )

Definition at line 172 of file ixgbe_osdep.h.

Typedef Documentation

◆ bool

typedef boolean_t bool

Definition at line 151 of file ixgbe_osdep.h.

◆ s16

typedef int16_t s16

Definition at line 146 of file ixgbe_osdep.h.

◆ s32

typedef int32_t s32

Definition at line 148 of file ixgbe_osdep.h.

◆ s8

typedef int8_t s8

Definition at line 144 of file ixgbe_osdep.h.

◆ u16

typedef uint16_t u16

Definition at line 145 of file ixgbe_osdep.h.

◆ u32

typedef uint32_t u32

Definition at line 147 of file ixgbe_osdep.h.

◆ u64

typedef uint64_t u64

Definition at line 149 of file ixgbe_osdep.h.

◆ u8

typedef uint8_t u8

Definition at line 143 of file ixgbe_osdep.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
IXGBE_ERROR_SOFTWARE 
IXGBE_ERROR_POLLING 
IXGBE_ERROR_INVALID_STATE 
IXGBE_ERROR_UNSUPPORTED 
IXGBE_ERROR_ARGUMENT 
IXGBE_ERROR_CAUTION 

Definition at line 61 of file ixgbe_osdep.h.

Function Documentation

◆ ixgbe_bcopy()

static __inline int ixgbe_bcopy ( void *restrict  _src,
void *restrict  _dst,
int  l 
)
static

Definition at line 191 of file ixgbe_osdep.h.

◆ ixgbe_read_pci_cfg()

u16 ixgbe_read_pci_cfg ( struct ixgbe_hw hw,
u32  reg 
)
inline

Definition at line 38 of file ixgbe_osdep.c.

References ixgbe_hw::back.

◆ ixgbe_read_reg()

u32 ixgbe_read_reg ( struct ixgbe_hw hw,
u32  reg 
)
inline

Definition at line 50 of file ixgbe_osdep.c.

References ixgbe_hw::back.

◆ ixgbe_read_reg_array()

u32 ixgbe_read_reg_array ( struct ixgbe_hw hw,
u32  reg,
u32  offset 
)
inline

Definition at line 65 of file ixgbe_osdep.c.

References ixgbe_hw::back.

◆ ixgbe_write_pci_cfg()

void ixgbe_write_pci_cfg ( struct ixgbe_hw hw,
u32  reg,
u16  value 
)
inline

Definition at line 44 of file ixgbe_osdep.c.

References ixgbe_hw::back.

◆ ixgbe_write_reg()

void ixgbe_write_reg ( struct ixgbe_hw hw,
u32  reg,
u32  val 
)
inline

Definition at line 57 of file ixgbe_osdep.c.

References ixgbe_hw::back.

◆ ixgbe_write_reg_array()

void ixgbe_write_reg_array ( struct ixgbe_hw hw,
u32  reg,
u32  offset,
u32  val 
)
inline

Definition at line 73 of file ixgbe_osdep.c.

References ixgbe_hw::back.