iPXE
|
PCI I/O API. More...
#include <stdint.h>
#include <ipxe/api.h>
#include <ipxe/iomap.h>
#include <config/ioapi.h>
#include <ipxe/null_pci.h>
#include <ipxe/ecam_io.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.
Data Structures | |
struct | pci_range |
A PCI bus:dev.fn address range. More... | |
struct | pci_api |
A runtime selectable PCI I/O API. More... | |
Macros | |
#define | PCI_BUSDEVFN(segment, bus, slot, func) |
#define | PCIAPI_INLINE(_subsys, _api_func) SINGLE_API_INLINE ( PCIAPI_PREFIX_ ## _subsys, _api_func ) |
Calculate static inline PCI I/O API function name. More... | |
#define | PROVIDE_PCIAPI(_subsys, _api_func, _func) PROVIDE_SINGLE_API ( PCIAPI_PREFIX_ ## _subsys, _api_func, _func ) |
Provide a PCI I/O API implementation. More... | |
#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. More... | |
#define | PCIAPI_RUNTIME(_subsys) |
Provide a runtime selectable PCI I/O API. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
int | pci_can_probe (void) |
Check if PCI bus probing is allowed. More... | |
void | pci_discover (uint32_t busdevfn, struct pci_range *range) |
Find next PCI bus:dev.fn address range in system. More... | |
int | pci_read_config_byte (struct pci_device *pci, unsigned int where, uint8_t *value) |
Read byte from PCI configuration space. More... | |
int | pci_read_config_word (struct pci_device *pci, unsigned int where, uint16_t *value) |
Read 16-bit word from PCI configuration space. More... | |
int | pci_read_config_dword (struct pci_device *pci, unsigned int where, uint32_t *value) |
Read 32-bit dword from PCI configuration space. More... | |
int | pci_write_config_byte (struct pci_device *pci, unsigned int where, uint8_t value) |
Write byte to PCI configuration space. More... | |
int | pci_write_config_word (struct pci_device *pci, unsigned int where, uint16_t value) |
Write 16-bit word to PCI configuration space. More... | |
int | pci_write_config_dword (struct pci_device *pci, unsigned int where, uint32_t value) |
Write 32-bit dword to PCI configuration space. More... | |
void * | pci_ioremap (struct pci_device *pci, unsigned long bus_addr, size_t len) |
Map PCI bus address as an I/O address. More... | |
PCI I/O API.
Definition in file pci_io.h.
#define PCIAPI_INLINE | ( | _subsys, | |
_api_func | |||
) | SINGLE_API_INLINE ( PCIAPI_PREFIX_ ## _subsys, _api_func ) |
#define PROVIDE_PCIAPI | ( | _subsys, | |
_api_func, | |||
_func | |||
) | PROVIDE_SINGLE_API ( PCIAPI_PREFIX_ ## _subsys, _api_func, _func ) |
#define PROVIDE_PCIAPI_INLINE | ( | _subsys, | |
_api_func | |||
) | PROVIDE_SINGLE_API_INLINE ( PCIAPI_PREFIX_ ## _subsys, _api_func ) |
#define PCIAPI_RUNTIME | ( | _subsys | ) |
Provide a runtime selectable PCI I/O API.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
int pci_can_probe | ( | void | ) |
Check if PCI bus probing is allowed.
ok | Bus probing is allowed |
Referenced by pcibus_probe().
Find next PCI bus:dev.fn address range in system.
busdevfn | Starting PCI bus:dev.fn address |
range | PCI bus:dev.fn address range to fill in |
Referenced by pci_find_next().
int pci_read_config_byte | ( | struct pci_device * | pci, |
unsigned int | where, | ||
uint8_t * | value | ||
) |
Read byte from PCI configuration space.
pci | PCI device |
where | Location within PCI configuration space |
value | Value read |
rc | Return status code |
Referenced by adjust_pci_device(), ath5k_probe(), ath_pci_extn_synch_enable(), ath_pci_probe(), ath_pci_read_cachesize(), atl1e_sw_init(), ehci_legacy_claim(), ehci_legacy_init(), falcon_probe_nic_variant(), gve_probe(), igbvf_sw_init(), jme_probe(), mlx_pci_config_byte(), myri10ge_nvs_write(), pci_find_capability(), pci_find_capability_common(), pci_find_next(), pci_find_next_capability(), pci_read_config(), pci_settings_fetch(), pciea_offset(), rhine_probe(), sis190_get_mac_addr(), sis190_get_mac_addr_from_apc(), sis630e_get_mac_addr(), sis900_probe(), sundance_probe(), tg3_get_invariants(), tulip_probe(), virtio_pci_find_capability(), virtio_pci_map_capability(), vpm_ioread8(), and vxge_probe().
int pci_read_config_word | ( | struct pci_device * | pci, |
unsigned int | where, | ||
uint16_t * | value | ||
) |
Read 16-bit word from PCI configuration space.
pci | PCI device |
where | Location within PCI configuration space |
value | Value read |
rc | Return status code |
Referenced by __vxge_hw_device_pci_e_init(), adjust_pci_device(), arbel_reset(), ath_pci_probe(), atl1e_reset_hw(), atl1e_setup_pcicmd(), bnx2_init_chip(), bnx2_set_power_state_0(), hermon_reset(), igbvf_sw_init(), mlx_pci_config_word(), myri10ge_net_irq(), pci_bar_size(), pci_find_capability(), pci_msix_disable(), pci_msix_enable(), pci_reset(), pci_vpd_read_dword(), pci_vpd_write_dword(), pcibridge_probe(), pcnet32_setup_if_duplex(), skge_reset(), tg3_chip_reset(), tg3_get_eeprom_hw_cfg(), tg3_get_invariants(), tg3_init_one(), tg3_reset_hw(), tg3_restore_pci_state(), tg3_save_pci_state(), tg3_set_power_state_0(), tg3_setup_copper_phy(), undinet_irq_is_broken(), vpm_ioread16(), and xhci_remove().
int pci_read_config_dword | ( | struct pci_device * | pci, |
unsigned int | where, | ||
uint32_t * | value | ||
) |
Read 32-bit dword from PCI configuration space.
pci | PCI device |
where | Location within PCI configuration space |
value | Value read |
rc | Return status code |
Referenced by ath_pci_probe(), dmfe_probe(), efx_probe(), ehci_extended_capability(), ehci_legacy_claim(), ehci_legacy_release(), forcedeth_map_regs(), mac_address_from_string_specs(), mlx_pci_config_dword(), myri10ge_nvs_read(), pci_backup(), pci_bar(), pci_bar_size(), pci_msix_ioremap(), pci_read_config(), pci_vpd_read_dword(), pcibridge_probe(), pciea_bar_value(), pciea_offset(), phantom_probe(), prism2_find_plx(), skge_reset(), ssb_pci_setup(), tg3_chip_reset(), tg3_get_invariants(), tg3_read_indirect_mbox(), tg3_read_indirect_reg32(), tg3_read_mem(), virtio_pci_map_capability(), vpm_find_vqs(), vpm_ioread32(), and xhci_pch_fix().
int pci_write_config_byte | ( | struct pci_device * | pci, |
unsigned int | where, | ||
uint8_t | value | ||
) |
Write byte to PCI configuration space.
pci | PCI device |
where | Location within PCI configuration space |
value | Value to be written |
rc | Return 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 | ||
) |
Write 16-bit word to PCI configuration space.
pci | PCI device |
where | Location within PCI configuration space |
value | Value to be written |
rc | Return status code |
Referenced by __vxge_hw_device_pci_e_init(), adjust_pci_device(), atl1e_reset_hw(), atl1e_setup_pcicmd(), bnx2_init_chip(), bnx2_set_power_state_0(), mlx_pci_config_word(), myri10ge_net_irq(), pci_bar_size(), pci_msix_disable(), pci_msix_enable(), pci_reset(), pci_vpd_read_dword(), pci_vpd_write_dword(), skge_reset(), tg3_chip_reset(), tg3_get_eeprom_hw_cfg(), tg3_get_invariants(), tg3_reset_hw(), tg3_restore_pci_state(), tg3_set_power_state_0(), tg3_setup_copper_phy(), uhci_probe(), and vpm_iowrite16().
int pci_write_config_dword | ( | struct pci_device * | pci, |
unsigned int | where, | ||
uint32_t | value | ||
) |
Write 32-bit dword to PCI configuration space.
pci | PCI device |
where | Location within PCI configuration space |
value | Value to be written |
rc | Return status code |
Referenced by ath_pci_probe(), atl1e_setup_pcicmd(), bnx2_init_board(), davicom_probe(), ehci_legacy_claim(), ena_membase(), mac_address_from_string_specs(), mlx_pci_config_dword(), myri10ge_nvs_write(), pci_bar_size(), pci_restore(), pci_vpd_write_dword(), phantom_probe(), prep_pci_cfg_cap(), sis900_probe(), skge_reset(), ssb_pci_setup(), tg3_chip_reset(), tg3_do_test_dma(), tg3_get_eeprom_hw_cfg(), tg3_get_invariants(), tg3_read_indirect_mbox(), tg3_read_indirect_reg32(), tg3_read_mem(), tg3_restore_pci_state(), tg3_set_power_state_0(), tg3_write_indirect_mbox(), tg3_write_indirect_reg32(), tg3_write_mem(), tulip_probe(), vpm_iowrite32(), xhci_pch_fix(), and xhci_pch_undo().
void* pci_ioremap | ( | struct pci_device * | pci, |
unsigned long | bus_addr, | ||
size_t | len | ||
) |
Map PCI bus address as an I/O address.
bus_addr | PCI bus address |
len | Length of region |
io_addr | I/O address, or NULL on error |
Referenced by amd8111e_probe(), arbel_probe(), arbel_start_firmware(), ath5k_probe(), ath_pci_probe(), atl_probe(), b44_probe(), bnx2_init_board(), bnxt_pci_base(), efab_probe(), efx_probe(), ehci_probe(), ena_probe(), exanic_probe(), flexboot_nodnic_alloc_uar(), forcedeth_map_regs(), golan_alloc_uar(), golan_pci_init(), gve_probe(), hermon_bofm_probe(), hermon_probe(), hvm_ioremap(), hvm_map_xenstore(), ice_probe(), icplus_probe(), igbvf_probe(), intel_probe(), intelx_probe(), intelxl_probe(), intelxlvf_probe(), intelxvf_probe(), jme_probe(), linda_probe(), mlx_pci_init_priv(), myson_probe(), natsemi_probe(), pci_msix_ioremap(), phantom_map_crb(), prism2_pci_probe(), qib7322_probe(), rdc_probe(), realtek_probe(), rhine_probe(), sis190_init_board(), skeleton_probe(), skge_probe(), sky2_probe(), tg3_init_one(), txnic_alloc(), txnic_bgx_probe(), txnic_pf_probe(), velocity_probe(), virtio_pci_map_capability(), vmxnet3_probe(), vxge_probe(), and xhci_probe().