1 #ifndef _IPXE_ECAM_IO_H 2 #define _IPXE_ECAM_IO_H 15 #define PCIAPI_PREFIX_ecam 17 #define PCIAPI_PREFIX_ecam __ecam_ 23 #define ECAM_LOC( where, len ) ( ( (len) << 16 ) | where ) 26 #define ECAM_WHERE( location ) ( (location) & 0xffff ) 29 #define ECAM_LEN( location ) ( (location) >> 16 ) 34 unsigned long value );
int pci_write_config_word(struct pci_device *pci, unsigned int where, uint16_t value)
Write 16-bit word to PCI configuration space.
static struct ecam_mapping ecam
Cached mapped ECAM allocation.
int pci_read_config_word(struct pci_device *pci, unsigned int where, uint16_t *value)
Read 16-bit word from PCI configuration space.
static __always_inline int unsigned int where
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
int pci_read_config_dword(struct pci_device *pci, unsigned int where, uint32_t *value)
Read 32-bit dword from PCI configuration space.
#define __unused
Declare a variable or data structure as unused.
int ecam_write(struct pci_device *pci, unsigned int location, unsigned long value)
Write to PCI configuration space.
int pci_write_config_byte(struct pci_device *pci, unsigned int where, uint8_t value)
Write byte to PCI configuration space.
#define __always_inline
Declare a function to be always inline.
static __always_inline int PCIAPI_INLINE(ecam, pci_read_config_byte)(struct pci_device *pci
Read byte from PCI configuration space via ECAM.
static __always_inline void unsigned long size_t len
static __always_inline int unsigned int uint8_t * value
int pci_write_config_dword(struct pci_device *pci, unsigned int where, uint32_t value)
Write 32-bit dword to PCI configuration space.
void * ioremap(unsigned long bus_addr, size_t len)
Map bus address as an I/O address.
void * pci_ioremap(struct pci_device *pci, unsigned long bus_addr, size_t len)
Map PCI bus address as an I/O address.
#define ECAM_LOC(where, len)
Construct ECAM location.
static __always_inline void unsigned long bus_addr
int ecam_read(struct pci_device *pci, unsigned int location, void *value)
Read from PCI configuration space.
int pci_read_config_byte(struct pci_device *pci, unsigned int where, uint8_t *value)
Read byte from PCI configuration space.