# pci.c File Reference

`#include <pci/pci.h>`
`#include <sys/io.h>`
`#include <ubixos/types.h>`
`#include <lib/kprintf.h>`

Include dependency graph for pci.c:

Go to the source code of this file.

## Functions

int | pci_init ()
bool | pciProbe (int bus, int dev, int func, struct pciConfig *cfg)
uInt32 | pciRead (int bus, int dev, int func, int reg, int bytes)
void | pciWrite (int bus, int dev, int func, int reg, uInt32 v, int bytes)

## Variables

struct {
uInt8 baseClass
uInt8 interface
const char * name
uInt8 subClass
} | pciClasses []

## Function Documentation

int pci_init | ( |  | ) |

Definition at line 292 of file pci.c.

References pciConfig::baseClass, confadd::bus, countof, confadd::dev, confadd::func, pciConfig::interface, pciConfig::irq, kprintf(), name, pciClasses, pciProbe(), pciConfig::subClass, and TRUE.

Here is the call graph for this function:

bool pciProbe | ( | int | bus,
|  | int | dev,
|  | int | func,
|  | struct pciConfig * | cfg |
| ) |  |  |

Definition at line 236 of file pci.c.

References pciConfig::base, pciConfig::baseClass, pciConfig::bist, pciConfig::bus, pciConfig::cacheLineSize, pciConfig::command, pciConfig::dev, pciConfig::deviceId, FALSE, pciConfig::func, pciConfig::headerType, pciConfig::interface, pciConfig::irq, kprintf(), pciConfig::latencyTimer, pciRead(), pciWrite(), pciConfig::size, pciConfig::status, pciConfig::subClass, pciConfig::subsys, pciConfig::subsysVendor, TRUE, pciConfig::vendorId, and x10.

Referenced by pci_init().

Here is the call graph for this function:

uInt32 pciRead | ( | int | bus,
|  | int | dev,
|  | int | func,
|  | int | reg,
|  | int | bytes |
| ) |  |  |

Definition at line 182 of file pci.c.

References inportByte(), inportDWord(), inportWord(), and outportDWord().

Referenced by pciProbe().

Here is the call graph for this function:

void pciWrite | ( | int | bus,
|  | int | dev,
|  | int | func,
|  | int | reg,
|  | uInt32 | v,
|  | int | bytes |
| ) |  |  |

Definition at line 210 of file pci.c.

References outportByte(), outportDWord(), and outportWord().

Referenced by pciProbe().

Here is the call graph for this function:

## Variable Documentation

uInt8 baseClass

Definition at line 36 of file pci.c.

uInt8 interface

Definition at line 38 of file pci.c.

const char* name

Definition at line 39 of file pci.c.

Referenced by def_ctls(), initHardDisk(), lookup(), and pci_init().

struct { ... } pciClasses[]

Referenced by pci_init().

uInt8 subClass

Definition at line 37 of file pci.c.