iPXE
Defines | Functions
pci_io.h File Reference

PCI I/O API. More...

#include <stdint.h>
#include <ipxe/api.h>
#include <config/ioapi.h>
#include <ipxe/efi/efi_pci_api.h>
#include <ipxe/linux/linux_pci.h>
#include <bits/pci_io.h>

Go to the source code of this file.

Defines

#define PCIAPI_INLINE(_subsys, _api_func)   SINGLE_API_INLINE ( PCIAPI_PREFIX_ ## _subsys, _api_func )
 Calculate static inline PCI I/O API function name.
#define PROVIDE_PCIAPI(_subsys, _api_func, _func)   PROVIDE_SINGLE_API ( PCIAPI_PREFIX_ ## _subsys, _api_func, _func )
 Provide a PCI I/O API implementation.
#define PROVIDE_PCIAPI_INLINE(_subsys, _api_func)   PROVIDE_SINGLE_API_INLINE ( PCIAPI_PREFIX_ ## _subsys, _api_func )
 Provide a static inline PCI I/O API implementation.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
int pci_num_bus (void)
 Determine number of PCI buses within system.
int pci_read_config_byte (struct pci_device *pci, unsigned int where, uint8_t *value)
 Read byte from PCI configuration space.
int pci_read_config_word (struct pci_device *pci, unsigned int where, uint16_t *value)
 Read 16-bit word from PCI configuration space.
int pci_read_config_dword (struct pci_device *pci, unsigned int where, uint32_t *value)
 Read 32-bit dword from PCI configuration space.
int pci_write_config_byte (struct pci_device *pci, unsigned int where, uint8_t value)
 Write byte to PCI configuration space.
int pci_write_config_word (struct pci_device *pci, unsigned int where, uint16_t value)
 Write 16-bit word to PCI configuration space.
int pci_write_config_dword (struct pci_device *pci, unsigned int where, uint32_t value)
 Write 32-bit dword to PCI configuration space.

Detailed Description

PCI I/O API.

Definition in file pci_io.h.


Define Documentation

#define PCIAPI_INLINE (   _subsys,
  _api_func 
)    SINGLE_API_INLINE ( PCIAPI_PREFIX_ ## _subsys, _api_func )

Calculate static inline PCI I/O API function name.

Parameters:
_prefixSubsystem prefix
_api_funcAPI function
Return values:
_subsys_funcSubsystem API function

Definition at line 23 of file pci_io.h.

#define PROVIDE_PCIAPI (   _subsys,
  _api_func,
  _func 
)    PROVIDE_SINGLE_API ( PCIAPI_PREFIX_ ## _subsys, _api_func, _func )

Provide a PCI I/O API implementation.

Parameters:
_prefixSubsystem prefix
_api_funcAPI function
_funcImplementing function

Definition at line 33 of file pci_io.h.

#define PROVIDE_PCIAPI_INLINE (   _subsys,
  _api_func 
)    PROVIDE_SINGLE_API_INLINE ( PCIAPI_PREFIX_ ## _subsys, _api_func )

Provide a static inline PCI I/O API implementation.

Parameters:
_prefixSubsystem prefix
_api_funcAPI function

Definition at line 42 of file pci_io.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
int pci_num_bus ( void  )

Determine number of PCI buses within system.

Return values:
num_busNumber of buses

Referenced by pci_find_next().

int pci_read_config_byte ( struct pci_device pci,
unsigned int  where,
uint8_t value 
)
int pci_read_config_word ( struct pci_device pci,
unsigned int  where,
uint16_t value 
)
int pci_read_config_dword ( struct pci_device pci,
unsigned int  where,
uint32_t value 
)
int pci_write_config_byte ( struct pci_device pci,
unsigned int  where,
uint8_t  value 
)

Write byte to PCI configuration space.

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

Referenced by adjust_pci_device(), ath5k_probe(), ath_pci_extn_synch_enable(), ath_pci_probe(), ehci_legacy_claim(), ehci_legacy_release(), mac_address_from_string_specs(), mlx_pci_config_byte(), myri10ge_nvs_read(), myri10ge_nvs_write(), prep_pci_cfg_cap(), sis190_get_mac_addr_from_apc(), sis630e_get_mac_addr(), tg3_get_invariants(), tg3_restore_pci_state(), and vpm_iowrite8().

int pci_write_config_word ( struct pci_device pci,
unsigned int  where,
uint16_t  value 
)
int pci_write_config_dword ( struct pci_device pci,
unsigned int  where,
uint32_t  value 
)