iPXE
Functions
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_num_bus)
 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)

Detailed Description

PCI configuration space access via Type 1 accesses.

Definition in file pcidirect.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
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.

References pci_device::busdevfn, outl(), and PCIDIRECT_CONFIG_ADDRESS.

                                                             {
        uint16_t busdevfn = ( pci->busdevfn & 0xffff );

        outl ( ( 0x80000000 | ( busdevfn << 8 ) | ( where & ~3 ) ),
               PCIDIRECT_CONFIG_ADDRESS );
}
PROVIDE_PCIAPI_INLINE ( direct  ,
pci_num_bus   
)