pcidirect.h File Reference

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

#include <stdint.h>
#include <gpxe/io.h>

Go to the source code of this file.

Defines

#define PCIAPI_PREFIX_direct   __direct_
#define PCIDIRECT_CONFIG_ADDRESS   0xcf8
#define PCIDIRECT_CONFIG_DATA   0xcfc

Functions

 FILE_LICENCE (GPL2_OR_LATER)
void pcidirect_prepare (struct pci_device *pci, int where)
 Prepare for Type 1 PCI configuration space access.
static __always_inline int PCIAPI_INLINE (direct, pci_max_bus)(void)
 Determine maximum PCI bus number within system.
static __always_inline int PCIAPI_INLINE (direct, pci_read_config_byte)(struct pci_device *pci
 Read byte from PCI configuration space via Type 1 access.

Variables

static __always_inline int
unsigned int 
where


Detailed Description

PCI configuration space access via Type 1 accesses.

Definition in file pcidirect.h.


Define Documentation

#define PCIAPI_PREFIX_direct   __direct_

Definition at line 12 of file pcidirect.h.

#define PCIDIRECT_CONFIG_ADDRESS   0xcf8

Definition at line 21 of file pcidirect.h.

Referenced by pcidirect_prepare().

#define PCIDIRECT_CONFIG_DATA   0xcfc

Definition at line 22 of file pcidirect.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

void pcidirect_prepare ( struct pci_device pci,
int  where 
)

Prepare for Type 1 PCI configuration space access.

Parameters:
pci PCI device
where Location within PCI configuration space

Definition at line 36 of file pcidirect.c.

References pci_device::bus, pci_device::devfn, outl, and PCIDIRECT_CONFIG_ADDRESS.

00036                                                              {
00037         outl ( ( 0x80000000 | ( pci->bus << 16 ) | ( pci->devfn << 8 ) |
00038                  ( where & ~3 ) ), PCIDIRECT_CONFIG_ADDRESS );
00039 }

static __always_inline int PCIAPI_INLINE ( direct  ,
pci_max_bus   
) [inline, static]

Determine maximum PCI bus number within system.

Return values:
max_bus Maximum bus number

Definition at line 34 of file pcidirect.h.

00034                                                {
00035         /* No way to work this out via Type 1 accesses */
00036         return 0xff;
00037 }

static __always_inline int PCIAPI_INLINE ( direct  ,
pci_read_config_byte   
) [inline, static]

Read byte from PCI configuration space via Type 1 access.

Parameters:
pci PCI device
where Location within PCI configuration space
value Value read
Return values:
rc Return status code


Variable Documentation

__always_inline int unsigned int where

Definition at line 49 of file pcidirect.h.


Generated on Tue Apr 6 20:01:13 2010 for gPXE by  doxygen 1.5.7.1