iPXE
Macros | Functions | Variables
linux_pci.h File Reference

iPXE PCI API for Linux More...

Go to the source code of this file.

Macros

#define PCIAPI_PREFIX_linux   __linux_
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
int linux_pci_read (struct pci_device *pci, unsigned long where, unsigned long *value, size_t len)
 
int linux_pci_write (struct pci_device *pci, unsigned long where, unsigned long value, size_t len)
 
static __always_inline int PCIAPI_INLINE (linux, pci_read_config_byte)(struct pci_device *pci
 Read byte from PCI configuration space. More...
 
static __always_inline int PCIAPI_INLINE (linux, pci_read_config_word)(struct pci_device *pci
 Read word from PCI configuration space. More...
 
static __always_inline int PCIAPI_INLINE (linux, pci_read_config_dword)(struct pci_device *pci
 Read dword from PCI configuration space. More...
 
static __always_inline int PCIAPI_INLINE (linux, pci_write_config_byte)(struct pci_device *pci
 Write byte to PCI configuration space. More...
 
static __always_inline int PCIAPI_INLINE (linux, pci_write_config_word)(struct pci_device *pci
 Write word to PCI configuration space. More...
 
static __always_inline int PCIAPI_INLINE (linux, pci_write_config_dword)(struct pci_device *pci
 Write dword to PCI configuration space. More...
 

Variables

static __always_inline int unsigned int where
 
static __always_inline int unsigned int uint8_tvalue
 
unsigned long tmp
 
 rc = linux_pci_read ( pci, where, &tmp, sizeof ( *value ) )
 

Detailed Description

iPXE PCI API for Linux

Definition in file linux_pci.h.

Macro Definition Documentation

◆ PCIAPI_PREFIX_linux

#define PCIAPI_PREFIX_linux   __linux_

Definition at line 15 of file linux_pci.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ linux_pci_read()

int linux_pci_read ( struct pci_device pci,
unsigned long  where,
unsigned long *  value,
size_t  len 
)

◆ linux_pci_write()

int linux_pci_write ( struct pci_device pci,
unsigned long  where,
unsigned long  value,
size_t  len 
)

◆ PCIAPI_INLINE() [1/6]

static __always_inline int PCIAPI_INLINE ( linux  ,
pci_read_config_byte   
)
inlinestatic

Read byte from PCI configuration space.

Parameters
pciPCI device
whereLocation within PCI configuration space
valueValue read
Return values
rcReturn status code

◆ PCIAPI_INLINE() [2/6]

static __always_inline int PCIAPI_INLINE ( linux  ,
pci_read_config_word   
)
inlinestatic

Read word from PCI configuration space.

Parameters
pciPCI device
whereLocation within PCI configuration space
valueValue read
Return values
rcReturn status code

◆ PCIAPI_INLINE() [3/6]

static __always_inline int PCIAPI_INLINE ( linux  ,
pci_read_config_dword   
)
inlinestatic

Read dword from PCI configuration space.

Parameters
pciPCI device
whereLocation within PCI configuration space
valueValue read
Return values
rcReturn status code

◆ PCIAPI_INLINE() [4/6]

static __always_inline int PCIAPI_INLINE ( linux  ,
pci_write_config_byte   
)
inlinestatic

Write byte to PCI configuration space.

Parameters
pciPCI device
whereLocation within PCI configuration space
valueValue to be written
Return values
rcReturn status code

◆ PCIAPI_INLINE() [5/6]

static __always_inline int PCIAPI_INLINE ( linux  ,
pci_write_config_word   
)
inlinestatic

Write word to PCI configuration space.

Parameters
pciPCI device
whereLocation within PCI configuration space
valueValue to be written
Return values
rcReturn status code

◆ PCIAPI_INLINE() [6/6]

static __always_inline int PCIAPI_INLINE ( linux  ,
pci_write_config_dword   
)
inlinestatic

Write dword to PCI configuration space.

Parameters
pciPCI device
whereLocation within PCI configuration space
valueValue to be written
Return values
rcReturn status code

Variable Documentation

◆ where

__always_inline int unsigned int where

Definition at line 35 of file linux_pci.h.

◆ value

__always_inline int unsigned int uint32_t value
Initial value:
{
int rc
rc
Definition: linux_pci.h:40

Definition at line 36 of file linux_pci.h.

◆ tmp

unsigned long tmp

Definition at line 38 of file linux_pci.h.

◆ rc

return rc = linux_pci_read ( pci, where, &tmp, sizeof ( *value ) )

Definition at line 40 of file linux_pci.h.