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 void PCIAPI_INLINE (linux, pci_discover)(uint32_t busdevfn __unused
 Find next PCI bus:dev.fn address range in 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 void struct pci_rangerange
 
range count = PCI_BUSDEVFN ( 1, 0, 0, 0 )
 
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 void PCIAPI_INLINE ( linux  ,
pci_discover   
)
inlinestatic

Find next PCI bus:dev.fn address range in system.

Parameters
busdevfnStarting PCI bus:dev.fn address
rangePCI bus:dev.fn address range to fill in

◆ 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

◆ range

__always_inline void struct pci_range* range
Initial value:
{
range->start = PCI_BUSDEVFN ( 0, 0, 0, 0 )
uint32_t start
Starting bus:dev.fn address.
Definition: pci_io.h:23
static __always_inline void struct pci_range * range
Definition: linux_pci.h:33
#define PCI_BUSDEVFN(segment, bus, slot, func)
Definition: pci_io.h:28

Definition at line 33 of file linux_pci.h.

◆ count

range count = PCI_BUSDEVFN ( 1, 0, 0, 0 )

Definition at line 37 of file linux_pci.h.

◆ where

__always_inline int unsigned int where

Definition at line 50 of file linux_pci.h.

◆ value

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

Definition at line 51 of file linux_pci.h.

◆ tmp

unsigned long tmp

Definition at line 53 of file linux_pci.h.

Referenced by __attribute__(), a3c90x_hw_start(), aes_setkey(), aoedev_close(), ar5008_hw_spur_mitigate(), ar9002_hw_spur_mitigate(), atadev_close(), ath5k_combine_pwr_to_pdadc_curves(), ath5k_get_linear_pcdac_min(), ath9k_hw_gpio_cfg_output_mux(), base64_encode(), bigint_mod_exp_raw(), bigint_mod_exp_sample(), bigint_mod_multiply_raw(), bigint_mod_multiply_sample(), bios_ansi_seq(), cachedhcp_record(), cert_exec(), cms_free(), des_rounds(), destroy_menu(), dhe_key(), downloader_vredirect(), ecam_find(), efi_block_describe(), efi_connect_controller_wrapper(), efi_local_open_path(), efi_open_attributes_name(), efi_path_prev(), efi_pecoff_debug_name(), efi_pxe_udp_close(), efi_snp_flush(), efi_snp_hii_store(), efivars_find(), ehci_companion(), eisabus_remove(), eoib_flush_peers(), eoib_remove(), epic100_open(), expand_settings(), fc_peer_login(), fc_peer_logout(), fc_port_close(), fc_port_login(), fc_port_logout(), fc_ulp_login(), fc_ulp_logout(), fcpdev_close(), fdt_path(), fetch_numeric_setting(), fetch_setting(), fiber_autoneg(), free_memblock(), free_parameters(), free_tls(), gcm_process(), gcm_tag(), generic_settings_clear(), get_entropy_input(), get_entropy_input_tmp(), ib_destroy_mi(), imgmulti_exec(), imux_rx_log(), inline_list_contains(), intf_shutdown(), intfs_vrestart(), intfs_vshutdown(), iob_concatenate(), ipoib_flush_remac(), ipoib_remove(), ipv4_create_routes(), ipv6_create_all_routes(), ipv6_sock_aton(), ipv6_table_del(), isabus_remove(), isapnpbus_remove(), iscsi_vredirect(), list_check_contents(), list_test_exec(), mac_address_from_string_specs(), mcabus_remove(), mlx_pci_config(), mschapv2_auth(), neighbour_flush(), net80211_free_wlanlist(), net80211_process_ie(), netfront_discard(), netvsc_recv_data(), nii_pci_close(), ntlm_append_string(), ntlm_authenticate(), parse_setting_tag(), parse_uri(), pci_read_config(), pcibus_remove(), peerdisc_discovered(), peerdisc_free(), peermux_block_stat(), posix_file_free(), process_script(), pxenv_udp_close(), remove_devices(), reprioritise_settings(), rsa_alloc(), rtl8225_rf_set_tx_power(), rtl8225z2_rf_set_tx_power(), scsidev_close(), settings_name(), srpdev_close(), t509bus_remove(), tcp_close(), tcp_process_tx_queue(), tftp_uri(), tg3_nvram_read_using_eeprom(), tg3_reset_hw(), TLan_MiiReadReg(), TLan_SetMulticastList(), tls_new_record(), tls_newdata_process_header(), tls_p_hash_va(), tls_prf(), tls_send_plaintext(), tulip_probe(), unregister_usb(), uri_format_okx(), usb_flush(), usb_remove_all(), usbkbd_consume(), utf8_accumulate(), velocity_reset(), velocity_set_link(), vmbus_probe_channels(), vmbus_remove_channels(), vmbus_xfer_page_iobufs(), wpa_stop(), x25519_key(), x25519_ladder(), x25519_multiply(), x25519_reduce_by(), x25519_reverse(), x509_truncate(), xcm_list(), xenbus_remove(), xenstore_request(), xfer_vredirect(), and xsigo_ib_remove().

◆ rc

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

Definition at line 55 of file linux_pci.h.

◆ bus_addr

__always_inline void unsigned long bus_addr

Definition at line 154 of file linux_pci.h.

◆ 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:154
static __always_inline void unsigned long bus_addr
Definition: linux_pci.h:154
void * ioremap(unsigned long bus_addr, size_t len)
Map bus address as an I/O address.

Definition at line 154 of file linux_pci.h.