pintos/src/devices/pci.h File Reference

#include <stdint.h>
#include <stddef.h>

Go to the source code of this file.

Defines

#define PCI_MAJOR_EARLY   0
#define PCI_MINOR_VGA   1
#define PCI_MAJOR_MASS_STORAGE   1
#define PCI_MINOR_SCSI   0
#define PCI_MINOR_IDE   1
#define PCI_MINOR_FLOPPY   2
#define PCI_MINOR_IPI   3
#define PCI_MINOR_RAID   4
#define PCI_MINOR_MS_OTHER   0x80
#define PCI_MAJOR_NETWORK   2
#define PCI_MINOR_ETHERNET   0
#define PCI_MINOR_TOKENRING   1
#define PCI_MINOR_FDDI   2
#define PCI_MINOR_ATM   3
#define PCI_MINOR_ISDN   4
#define PCI_MINOR_NET_OTHER   0x80
#define PCI_MAJOR_DISPLAY   3
#define PCI_MAJOR_MULTIMEDIA   4
#define PCI_MAJOR_MEMORY   5
#define PCI_MAJOR_BRIDGE   6
#define PCI_MINOR_HOST   0
#define PCI_MINOR_ISA   1
#define PCI_MINOR_EISA   2
#define PCI_MINOR_MCA   3
#define PCI_MINOR_PCI   4
#define PCI_MINOR_PCMCIA   5
#define PCI_MINOR_NUBUS   6
#define PCI_MINOR_CARDBUS   7
#define PCI_MINOR_RACEWAY   8
#define PCI_MAJOR_SIMPLE_COMM   7
#define PCI_MAJOR_BASE_PERIPHERAL   8
#define PCI_MINOR_PIC   0
#define PCI_MINOR_DMA   1
#define PCI_MINOR_TIMER   2
#define PCI_MINOR_RTC   3
#define PCI_MINOR_HOTPLUG   4
#define PCI_MAJOR_INPUT   9
#define PCI_MAJOR_DOCK   10
#define PCI_MAJOR_PROCESSOR   11
#define PCI_MINOR_386   0
#define PCI_MINOR_486   1
#define PCI_MINOR_PENTIUM   2
#define PCI_MINOR_ALPHA   0x10
#define PCI_MINOR_PPC   0x20
#define PCI_MINOR_MIPS   0x30
#define PCI_MINOR_COPROC   0x40
#define PCI_MAJOR_SERIALBUS   12
#define PCI_MINOR_FIREWIRE   0
#define PCI_MINOR_ACCESS   1
#define PCI_MINOR_SSA   2
#define PCI_MINOR_USB   3
#define PCI_USB_IFACE_UHCI   0
#define PCI_USB_IFACE_OHCI   0x10
#define PCI_USB_IFACE_EHCI   0x20
#define PCI_MINOR_FIBRE   4
#define PCI_MAJOR_UNDEF   0xff

Typedefs

typedef void pci_handler_func (void *AUX)

Functions

void pci_init (void)
struct pci_devpci_get_device (int vendor, int device, int func, int n)
struct pci_devpci_get_dev_by_class (int major, int minor, int iface, int n)
struct pci_iopci_io_enum (struct pci_dev *, struct pci_io *last)
void pci_register_irq (struct pci_dev *, pci_handler_func *, void *AUX)
void pci_unregister_irq (struct pci_dev *)
size_t pci_io_size (struct pci_io *)
void pci_write_config8 (struct pci_dev *, int reg, uint8_t)
void pci_write_config16 (struct pci_dev *, int reg, uint16_t)
void pci_write_config32 (struct pci_dev *, int reg, uint32_t)
uint8_t pci_read_config8 (struct pci_dev *, int reg)
uint16_t pci_read_config16 (struct pci_dev *, int reg)
uint32_t pci_read_config32 (struct pci_dev *, int reg)
void pci_reg_write32 (struct pci_io *, int reg, uint32_t)
void pci_reg_write16 (struct pci_io *, int reg, uint16_t)
void pci_reg_write8 (struct pci_io *, int reg, uint8_t)
uint32_t pci_reg_read32 (struct pci_io *, int reg)
uint16_t pci_reg_read16 (struct pci_io *, int reg)
uint8_t pci_reg_read8 (struct pci_io *, int reg)
void pci_read_in (struct pci_io *, int off, size_t sz, void *buf)
void pci_write_out (struct pci_io *, int off, size_t sz, const void *buf)
void pci_print_stats (void)
void pci_mask_irq (struct pci_dev *)
void pci_unmask_irq (struct pci_dev *)


Define Documentation

#define PCI_MAJOR_BASE_PERIPHERAL   8

Definition at line 47 of file pci.h.

#define PCI_MAJOR_BRIDGE   6

Definition at line 34 of file pci.h.

Referenced by pci_probe().

#define PCI_MAJOR_DISPLAY   3

Definition at line 30 of file pci.h.

#define PCI_MAJOR_DOCK   10

Definition at line 56 of file pci.h.

#define PCI_MAJOR_EARLY   0

Definition at line 11 of file pci.h.

#define PCI_MAJOR_INPUT   9

Definition at line 55 of file pci.h.

#define PCI_MAJOR_MASS_STORAGE   1

Definition at line 14 of file pci.h.

#define PCI_MAJOR_MEMORY   5

Definition at line 32 of file pci.h.

#define PCI_MAJOR_MULTIMEDIA   4

Definition at line 31 of file pci.h.

#define PCI_MAJOR_NETWORK   2

Definition at line 22 of file pci.h.

#define PCI_MAJOR_PROCESSOR   11

Definition at line 57 of file pci.h.

#define PCI_MAJOR_SERIALBUS   12

Definition at line 66 of file pci.h.

Referenced by ehci_init(), and uhci_init().

#define PCI_MAJOR_SIMPLE_COMM   7

Definition at line 45 of file pci.h.

#define PCI_MAJOR_UNDEF   0xff

Definition at line 75 of file pci.h.

#define PCI_MINOR_386   0

Definition at line 58 of file pci.h.

#define PCI_MINOR_486   1

Definition at line 59 of file pci.h.

#define PCI_MINOR_ACCESS   1

Definition at line 68 of file pci.h.

#define PCI_MINOR_ALPHA   0x10

Definition at line 61 of file pci.h.

#define PCI_MINOR_ATM   3

Definition at line 26 of file pci.h.

#define PCI_MINOR_CARDBUS   7

Definition at line 42 of file pci.h.

#define PCI_MINOR_COPROC   0x40

Definition at line 64 of file pci.h.

#define PCI_MINOR_DMA   1

Definition at line 49 of file pci.h.

#define PCI_MINOR_EISA   2

Definition at line 37 of file pci.h.

#define PCI_MINOR_ETHERNET   0

Definition at line 23 of file pci.h.

#define PCI_MINOR_FDDI   2

Definition at line 25 of file pci.h.

#define PCI_MINOR_FIBRE   4

Definition at line 74 of file pci.h.

#define PCI_MINOR_FIREWIRE   0

Definition at line 67 of file pci.h.

#define PCI_MINOR_FLOPPY   2

Definition at line 17 of file pci.h.

#define PCI_MINOR_HOST   0

Definition at line 35 of file pci.h.

#define PCI_MINOR_HOTPLUG   4

Definition at line 52 of file pci.h.

#define PCI_MINOR_IDE   1

Definition at line 16 of file pci.h.

#define PCI_MINOR_IPI   3

Definition at line 18 of file pci.h.

#define PCI_MINOR_ISA   1

Definition at line 36 of file pci.h.

#define PCI_MINOR_ISDN   4

Definition at line 27 of file pci.h.

#define PCI_MINOR_MCA   3

Definition at line 38 of file pci.h.

#define PCI_MINOR_MIPS   0x30

Definition at line 63 of file pci.h.

#define PCI_MINOR_MS_OTHER   0x80

Definition at line 20 of file pci.h.

#define PCI_MINOR_NET_OTHER   0x80

Definition at line 28 of file pci.h.

#define PCI_MINOR_NUBUS   6

Definition at line 41 of file pci.h.

#define PCI_MINOR_PCI   4

Definition at line 39 of file pci.h.

Referenced by pci_probe().

#define PCI_MINOR_PCMCIA   5

Definition at line 40 of file pci.h.

#define PCI_MINOR_PENTIUM   2

Definition at line 60 of file pci.h.

#define PCI_MINOR_PIC   0

Definition at line 48 of file pci.h.

#define PCI_MINOR_PPC   0x20

Definition at line 62 of file pci.h.

#define PCI_MINOR_RACEWAY   8

Definition at line 43 of file pci.h.

#define PCI_MINOR_RAID   4

Definition at line 19 of file pci.h.

#define PCI_MINOR_RTC   3

Definition at line 51 of file pci.h.

#define PCI_MINOR_SCSI   0

Definition at line 15 of file pci.h.

#define PCI_MINOR_SSA   2

Definition at line 69 of file pci.h.

#define PCI_MINOR_TIMER   2

Definition at line 50 of file pci.h.

#define PCI_MINOR_TOKENRING   1

Definition at line 24 of file pci.h.

#define PCI_MINOR_USB   3

Definition at line 70 of file pci.h.

Referenced by ehci_init(), and uhci_init().

#define PCI_MINOR_VGA   1

Definition at line 12 of file pci.h.

#define PCI_USB_IFACE_EHCI   0x20

Definition at line 73 of file pci.h.

Referenced by ehci_init().

#define PCI_USB_IFACE_OHCI   0x10

Definition at line 72 of file pci.h.

#define PCI_USB_IFACE_UHCI   0

Definition at line 71 of file pci.h.

Referenced by uhci_init().


Typedef Documentation

typedef void pci_handler_func(void *AUX)

Definition at line 77 of file pci.h.


Function Documentation

struct pci_dev* pci_get_dev_by_class ( int  major,
int  minor,
int  iface,
int  n 
) [read]

struct pci_dev* pci_get_device ( int  vendor,
int  device,
int  func,
int  n 
) [read]

void pci_init ( void   ) 

Definition at line 167 of file pci.c.

References devices, int_devices, list_init(), num_pci_pages, pci_print_stats(), and pci_scan_bus().

Referenced by main().

struct pci_io* pci_io_enum ( struct pci_dev ,
struct pci_io last 
) [read]

Definition at line 234 of file pci.c.

References pci_dev::io_ranges, list_begin(), list_end(), list_entry, list_next(), NULL, and pci_io::peer.

Referenced by ehci_init(), and uhci_init().

size_t pci_io_size ( struct pci_io  ) 

Definition at line 281 of file pci.c.

References ASSERT, NULL, and pci_io::size.

Referenced by uhci_init().

void pci_mask_irq ( struct pci_dev  ) 

Definition at line 731 of file pci.c.

References intr_irq_mask(), pci_dev::pch, and pci_config_header::pci_int_line.

void pci_print_stats ( void   ) 

Definition at line 701 of file pci.c.

References devices, list_begin(), list_end(), list_entry, list_next(), pci_print_dev_info(), and pci_dev::peer.

Referenced by pci_init().

uint16_t pci_read_config16 ( struct pci_dev ,
int  reg 
)

Definition at line 767 of file pci.c.

References pci_dev::bus, pci_dev::dev, pci_dev::func, and pci_read_config().

uint32_t pci_read_config32 ( struct pci_dev ,
int  reg 
)

Definition at line 773 of file pci.c.

References pci_dev::bus, pci_dev::dev, pci_dev::func, and pci_read_config().

uint8_t pci_read_config8 ( struct pci_dev ,
int  reg 
)

Definition at line 761 of file pci.c.

References pci_dev::bus, pci_dev::dev, pci_dev::func, and pci_read_config().

void pci_read_in ( struct pci_io ,
int  off,
size_t  sz,
void *  buf 
)

uint16_t pci_reg_read16 ( struct pci_io ,
int  reg 
)

uint32_t pci_reg_read32 ( struct pci_io ,
int  reg 
)

Definition at line 343 of file pci.c.

References pci_io::addr, ASSERT, inl(), NULL, PANIC, PCI_IO_MEM, PCI_IO_PORT, pci_io::port, pci_io::ptr, and pci_io::type.

Referenced by dump_regs().

uint8_t pci_reg_read8 ( struct pci_io ,
int  reg 
)

Definition at line 389 of file pci.c.

References pci_io::addr, ASSERT, inb(), NULL, PANIC, PCI_IO_MEM, PCI_IO_PORT, pci_io::port, pci_io::ptr, and pci_io::type.

Referenced by ehci_init().

void pci_reg_write16 ( struct pci_io ,
int  reg,
uint16_t   
)

void pci_reg_write32 ( struct pci_io ,
int  reg,
uint32_t   
)

Definition at line 289 of file pci.c.

References pci_io::addr, ASSERT, NULL, outl(), PANIC, PCI_IO_MEM, PCI_IO_PORT, pci_io::port, pci_io::ptr, and pci_io::type.

Referenced by ehci_init(), and uhci_init().

void pci_reg_write8 ( struct pci_io ,
int  reg,
uint8_t   
)

Definition at line 325 of file pci.c.

References pci_io::addr, ASSERT, NULL, outb(), PANIC, PCI_IO_MEM, PCI_IO_PORT, pci_io::port, pci_io::ptr, and pci_io::type.

Referenced by uhci_init().

void pci_register_irq ( struct pci_dev ,
pci_handler_func ,
void *  AUX 
)

void pci_unmask_irq ( struct pci_dev  ) 

Definition at line 737 of file pci.c.

References intr_irq_unmask(), pci_dev::pch, and pci_config_header::pci_int_line.

void pci_unregister_irq ( struct pci_dev  ) 

void pci_write_config16 ( struct pci_dev ,
int  reg,
uint16_t   
)

Definition at line 743 of file pci.c.

References pci_dev::bus, pci_dev::dev, pci_dev::func, and pci_write_config().

Referenced by uhci_init().

void pci_write_config32 ( struct pci_dev ,
int  reg,
uint32_t   
)

Definition at line 749 of file pci.c.

References pci_dev::bus, pci_dev::dev, pci_dev::func, and pci_write_config().

void pci_write_config8 ( struct pci_dev ,
int  reg,
uint8_t   
)

Definition at line 755 of file pci.c.

References pci_dev::bus, pci_dev::dev, pci_dev::func, and pci_write_config().

void pci_write_out ( struct pci_io ,
int  off,
size_t  sz,
const void *  buf 
)


Generated on Mon Jan 10 16:43:58 2011 for Pintos by  doxygen 1.5.6