pci.c File Reference

PCI related functions needed by the EHCI driver. More...

#include <errno.h>
#include <str_error.h>
#include <assert.h>
#include <as.h>
#include <devman.h>
#include <ddi.h>
#include <libarch/ddi.h>
#include <device/hw_res.h>
#include <usb/debug.h>
#include <pci_dev_iface.h>
#include "pci.h"

Go to the source code of this file.

Defines

#define CFG_OFFSET   0x40
#define CMD_OFFSET   0x0
#define DEFAULT_WAIT   1000
#define HCC_PARAMS_EECP_MASK   0xff
#define HCC_PARAMS_EECP_OFFSET   8
#define HCC_PARAMS_OFFSET   0x8
#define INT_OFFSET   0x8
#define PAGE_SIZE_MASK   0xfffff000
#define PCI_READ(size)
#define PCI_WRITE(size)
#define STS_OFFSET   0x4
#define USBCMD_RUN   1
#define USBLEGCTLSTS_OFFSET   4
#define USBLEGSUP_BIOS_CONTROL   (1 << 16)
#define USBLEGSUP_OFFSET   0
#define USBLEGSUP_OS_CONTROL   (1 << 24)
#define USBSTS_HALTED   (1 << 12)
#define WAIT_STEP   10

Functions

int pci_disable_legacy (const ddf_dev_t *device, uintptr_t reg_base, size_t reg_size, int irq)
 Implements BIOS handoff routine as decribed in EHCI spec.
int pci_enable_interrupts (const ddf_dev_t *device)
 Calls the PCI driver with a request to enable interrupts.
int pci_get_my_registers (const ddf_dev_t *dev, uintptr_t *mem_reg_address, size_t *mem_reg_size, int *irq_no)
 Get address of registers and IRQ for given device.
static int pci_read16 (const ddf_dev_t *dev, int address, uint16_t *value)
static int pci_read32 (const ddf_dev_t *dev, int address, uint32_t *value)
static int pci_read8 (const ddf_dev_t *dev, int address, uint8_t *value)
static int pci_write16 (const ddf_dev_t *dev, int address, uint16_t value)
static int pci_write32 (const ddf_dev_t *dev, int address, uint32_t value)
static int pci_write8 (const ddf_dev_t *dev, int address, uint8_t value)


Detailed Description

PCI related functions needed by the EHCI driver.

Definition in file pci.c.


Generated on Thu Jun 2 07:45:51 2011 for HelenOS/USB by  doxygen 1.4.7