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_num_bus)(void)
 Determine number of PCI buses within system. More...
 
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...
 
static __always_inline void * PCIAPI_INLINE (linux, pci_ioremap)(struct pci_device *pci __unused
 Map PCI bus address as an I/O address. 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 ) )
 
static __always_inline void unsigned long bus_addr
 
static __always_inline void unsigned long size_t len
 

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/8]

static __always_inline int PCIAPI_INLINE ( linux  ,
pci_num_bus   
)
inlinestatic

Determine number of PCI buses within system.

Return values
num_busNumber of buses

Definition at line 31 of file linux_pci.h.

31  {
32  /* Assume all buses may exist */
33  return 0x100;
34 }

◆ PCIAPI_INLINE() [2/8]

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() [3/8]

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() [4/8]

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() [5/8]

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() [6/8]

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() [7/8]

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

◆ PCIAPI_INLINE() [8/8]

static __always_inline void* PCIAPI_INLINE ( linux  ,
pci_ioremap   
)
inlinestatic

Map PCI bus address as an I/O address.

Parameters
bus_addrPCI bus address
lenLength of region
Return values
io_addrI/O address, or NULL on error

Variable Documentation

◆ where

__always_inline int unsigned int where

Definition at line 46 of file linux_pci.h.

◆ value

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

Definition at line 47 of file linux_pci.h.

◆ tmp

unsigned long tmp

Definition at line 49 of file linux_pci.h.

◆ rc

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

Definition at line 51 of file linux_pci.h.

◆ bus_addr

__always_inline void unsigned long bus_addr

Definition at line 150 of file linux_pci.h.

Referenced by bus_to_virt(), efipci_ioremap(), IOAPI_INLINE(), and ioremap_pages().

◆ len

__always_inline void unsigned long size_t len
Initial value:
{
return ioremap ( bus_addr, len )
static __always_inline void unsigned long size_t len
Definition: linux_pci.h:150
static __always_inline void unsigned long bus_addr
Definition: linux_pci.h:150
void * ioremap(unsigned long bus_addr, size_t len)
Map bus address as an I/O address.

Definition at line 150 of file linux_pci.h.