iPXE PCI I/O API for EFI
More...
Go to the source code of this file.
|
| | FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) |
| |
| int | efipci_read (struct pci_device *pci, unsigned long location, void *value) |
| | Read from PCI configuration space. More...
|
| |
| int | efipci_write (struct pci_device *pci, unsigned long location, unsigned long value) |
| | Write to PCI configuration space. More...
|
| |
| static __always_inline int | PCIAPI_INLINE (efi, pci_can_probe)(struct pci_device *pci __unused) |
| | Check if PCI bus probing is allowed. More...
|
| |
| static __always_inline int | PCIAPI_INLINE (efi, pci_read_config_byte)(struct pci_device *pci |
| | Read byte from PCI configuration space via EFI. More...
|
| |
| return | efipci_read (pci, EFIPCI_LOCATION(where, EFIPCI_WIDTH_BYTE), value) |
| |
| static __always_inline int | PCIAPI_INLINE (efi, pci_read_config_word)(struct pci_device *pci |
| | Read word from PCI configuration space via EFI. More...
|
| |
| return | efipci_read (pci, EFIPCI_LOCATION(where, EFIPCI_WIDTH_WORD), value) |
| |
| static __always_inline int | PCIAPI_INLINE (efi, pci_read_config_dword)(struct pci_device *pci |
| | Read dword from PCI configuration space via EFI. More...
|
| |
| return | efipci_read (pci, EFIPCI_LOCATION(where, EFIPCI_WIDTH_DWORD), value) |
| |
| static __always_inline int | PCIAPI_INLINE (efi, pci_write_config_byte)(struct pci_device *pci |
| | Write byte to PCI configuration space via EFI. More...
|
| |
| static __always_inline int | PCIAPI_INLINE (efi, pci_write_config_word)(struct pci_device *pci |
| | Write word to PCI configuration space via EFI. More...
|
| |
| static __always_inline int | PCIAPI_INLINE (efi, pci_write_config_dword)(struct pci_device *pci |
| | Write dword to PCI configuration space via EFI. More...
|
| |
iPXE PCI I/O API for EFI
Definition in file efi_pci_api.h.
◆ PCIAPI_PREFIX_efi
| #define PCIAPI_PREFIX_efi __efi_ |
◆ EFIPCI_WIDTH_BYTE
| #define EFIPCI_WIDTH_BYTE 0 |
◆ EFIPCI_WIDTH_WORD
| #define EFIPCI_WIDTH_WORD 1 |
◆ EFIPCI_WIDTH_DWORD
| #define EFIPCI_WIDTH_DWORD 2 |
◆ EFIPCI_LOCATION
| #define EFIPCI_LOCATION |
( |
|
_offset, |
|
|
|
_width |
|
) |
| ( (_offset) | ( (_width) << 16 ) ) |
◆ EFIPCI_OFFSET
| #define EFIPCI_OFFSET |
( |
|
_location | ) |
( (_location) & 0xffff ) |
◆ EFIPCI_WIDTH
| #define EFIPCI_WIDTH |
( |
|
_location | ) |
( (_location) >> 16 ) |
◆ FILE_LICENCE()
| FILE_LICENCE |
( |
GPL2_OR_LATER_OR_UBDL |
| ) |
|
◆ efipci_read() [1/4]
| int efipci_read |
( |
struct pci_device * |
pci, |
|
|
unsigned long |
location, |
|
|
void * |
value |
|
) |
| |
Read from PCI configuration space.
- Parameters
-
| pci | PCI device |
| location | Encoded offset and width |
- Return values
-
| value | Value |
| rc | Return status code |
Definition at line 300 of file efi_pci.c.
316 DBGC ( pci,
"EFIPCI " PCI_FMT " config read from offset %02lx " struct arbelprm_rc_send_wqe rc
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
struct stp_switch root
Root switch.
static int efipci_root_open(struct pci_device *pci, EFI_HANDLE *handle, EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **root)
Open EFI PCI root bridge I/O protocol for ephemeral use.
#define EFIPCI_OFFSET(_location)
pseudo_bit_t value[0x00020]
char * strerror(int errno)
Retrieve string representation of error number.
#define PCI_FMT
PCI device debug message format.
Provides the basic Memory, I/O, PCI configuration, and DMA interfaces that are used to abstract acces...
#define EFIPCI_WIDTH(_location)
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
#define PCI_ARGS(pci)
PCI device debug message arguments.
static unsigned long efipci_address(struct pci_device *pci, unsigned long location)
Calculate EFI PCI configuration space address.
References DBGC, EEFI, efipci_address(), EFIPCI_OFFSET, efipci_root_open(), EFIPCI_WIDTH, handle, PCI_ARGS, PCI_FMT, rc, root, strerror(), and value.
◆ efipci_write()
| int efipci_write |
( |
struct pci_device * |
pci, |
|
|
unsigned long |
location, |
|
|
unsigned long |
value |
|
) |
| |
Write to PCI configuration space.
- Parameters
-
| pci | PCI device |
| location | Encoded offset and width |
| value | Value |
- Return values
-
Definition at line 333 of file efi_pci.c.
349 DBGC ( pci,
"EFIPCI " PCI_FMT " config write to offset %02lx " struct arbelprm_rc_send_wqe rc
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
struct stp_switch root
Root switch.
static int efipci_root_open(struct pci_device *pci, EFI_HANDLE *handle, EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **root)
Open EFI PCI root bridge I/O protocol for ephemeral use.
#define EFIPCI_OFFSET(_location)
pseudo_bit_t value[0x00020]
char * strerror(int errno)
Retrieve string representation of error number.
#define PCI_FMT
PCI device debug message format.
Provides the basic Memory, I/O, PCI configuration, and DMA interfaces that are used to abstract acces...
#define EFIPCI_WIDTH(_location)
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
#define PCI_ARGS(pci)
PCI device debug message arguments.
static unsigned long efipci_address(struct pci_device *pci, unsigned long location)
Calculate EFI PCI configuration space address.
References DBGC, EEFI, efipci_address(), EFIPCI_OFFSET, efipci_root_open(), EFIPCI_WIDTH, handle, PCI_ARGS, PCI_FMT, rc, root, strerror(), and value.
◆ PCIAPI_INLINE() [1/7]
Check if PCI bus probing is allowed.
- Parameters
-
- Return values
-
Definition at line 42 of file efi_pci_api.h.
◆ PCIAPI_INLINE() [2/7]
Read byte from PCI configuration space via EFI.
- Parameters
-
| pci | PCI device |
| where | Location within PCI configuration space |
| value | Value read |
- Return values
-
◆ efipci_read() [2/4]
◆ PCIAPI_INLINE() [3/7]
Read word from PCI configuration space via EFI.
- Parameters
-
| pci | PCI device |
| where | Location within PCI configuration space |
| value | Value read |
- Return values
-
◆ efipci_read() [3/4]
◆ PCIAPI_INLINE() [4/7]
Read dword from PCI configuration space via EFI.
- Parameters
-
| pci | PCI device |
| where | Location within PCI configuration space |
| value | Value read |
- Return values
-
◆ efipci_read() [4/4]
◆ PCIAPI_INLINE() [5/7]
Write byte to PCI configuration space via EFI.
- Parameters
-
| pci | PCI device |
| where | Location within PCI configuration space |
| value | Value to be written |
- Return values
-
◆ PCIAPI_INLINE() [6/7]
Write word to PCI configuration space via EFI.
- Parameters
-
| pci | PCI device |
| where | Location within PCI configuration space |
| value | Value to be written |
- Return values
-
◆ PCIAPI_INLINE() [7/7]
Write dword to PCI configuration space via EFI.
- Parameters
-
| pci | PCI device |
| where | Location within PCI configuration space |
| value | Value to be written |
- Return values
-
◆ where
◆ value
Initial value:{
static __always_inline int unsigned int uint8_t * value
Definition at line 57 of file efi_pci_api.h.