iPXE
pcidirect.c File Reference

PCI configuration space access via Type 1 accesses. More...

#include <ipxe/io.h>
#include <ipxe/pci.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
void pcidirect_prepare (struct pci_device *pci, int where)
 Prepare for Type 1 PCI configuration space access.
 PROVIDE_PCIAPI_INLINE (direct, pci_can_probe)
 PROVIDE_PCIAPI_INLINE (direct, pci_discover)
 PROVIDE_PCIAPI_INLINE (direct, pci_read_config_byte)
 PROVIDE_PCIAPI_INLINE (direct, pci_read_config_word)
 PROVIDE_PCIAPI_INLINE (direct, pci_read_config_dword)
 PROVIDE_PCIAPI_INLINE (direct, pci_write_config_byte)
 PROVIDE_PCIAPI_INLINE (direct, pci_write_config_word)
 PROVIDE_PCIAPI_INLINE (direct, pci_write_config_dword)
 PROVIDE_PCIAPI_INLINE (direct, pci_ioremap)
 PROVIDE_PCIAPI_RUNTIME (direct, PCIAPI_PRIORITY_DIRECT)

Detailed Description

PCI configuration space access via Type 1 accesses.

Definition in file pcidirect.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ pcidirect_prepare()

void pcidirect_prepare ( struct pci_device * pci,
int where )

Prepare for Type 1 PCI configuration space access.

Parameters
pciPCI device
whereLocation within PCI configuration space

Definition at line 41 of file pcidirect.c.

41 {
42 uint16_t busdevfn = ( pci->busdevfn & 0xffff );
43
44 outl ( ( 0x80000000 | ( busdevfn << 8 ) | ( where & ~3 ) ),
46}
unsigned short uint16_t
Definition stdint.h:11
uint16_t busdevfn
PCI bus:dev.fn address.
Definition ena.h:17
#define outl(data, io_addr)
Definition io.h:330
static __always_inline int unsigned int where
Definition pcibios.h:57
#define PCIDIRECT_CONFIG_ADDRESS
Definition pcidirect.h:22
uint32_t busdevfn
Segment, bus, device, and function (bus:dev.fn) number.
Definition pci.h:238

References busdevfn, pci_device::busdevfn, outl, PCIDIRECT_CONFIG_ADDRESS, and where.

Referenced by PCIAPI_INLINE(), PCIAPI_INLINE(), PCIAPI_INLINE(), PCIAPI_INLINE(), and PCIAPI_INLINE().

◆ PROVIDE_PCIAPI_INLINE() [1/9]

PROVIDE_PCIAPI_INLINE ( direct ,
pci_can_probe  )

References pci_can_probe().

◆ PROVIDE_PCIAPI_INLINE() [2/9]

PROVIDE_PCIAPI_INLINE ( direct ,
pci_discover  )

References pci_discover().

◆ PROVIDE_PCIAPI_INLINE() [3/9]

PROVIDE_PCIAPI_INLINE ( direct ,
pci_read_config_byte  )

◆ PROVIDE_PCIAPI_INLINE() [4/9]

PROVIDE_PCIAPI_INLINE ( direct ,
pci_read_config_word  )

◆ PROVIDE_PCIAPI_INLINE() [5/9]

PROVIDE_PCIAPI_INLINE ( direct ,
pci_read_config_dword  )

◆ PROVIDE_PCIAPI_INLINE() [6/9]

PROVIDE_PCIAPI_INLINE ( direct ,
pci_write_config_byte  )

◆ PROVIDE_PCIAPI_INLINE() [7/9]

PROVIDE_PCIAPI_INLINE ( direct ,
pci_write_config_word  )

◆ PROVIDE_PCIAPI_INLINE() [8/9]

PROVIDE_PCIAPI_INLINE ( direct ,
pci_write_config_dword  )

◆ PROVIDE_PCIAPI_INLINE() [9/9]

PROVIDE_PCIAPI_INLINE ( direct ,
pci_ioremap  )

References pci_ioremap().

◆ PROVIDE_PCIAPI_RUNTIME()

PROVIDE_PCIAPI_RUNTIME ( direct ,
PCIAPI_PRIORITY_DIRECT  )