12.07.2015 Views

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

PCI (9) <strong>NetBSD</strong> <strong>Kernel</strong> Developer’s <strong>Manual</strong> PCI (9)FUNCTIONSpci_activate(pc , tag , sc , fun)Attempt to bring the device to state D0. If the device is not in the D0 state call fun to restore itsstate. If fun is NULL then restoring from state D3 is going to fail.pci_conf_read(pc , tag , reg)Read from register reg in PCI configuration space. The argument tag is the PCI tag for thecurrent device attached to PCI chipset pc.pci_conf_write(pc , tag , reg , val)Write to register reg in PCI configuration space. The argument tag is the PCI tag for the currentdevice attached to PCI chipset pc.pci_conf_print(pc , tag , func)Print out most of the registers in the PCI configuration for the device. The argument tag is thePCI tag for the current device attached to PCI chipset pc. The argument func is a functioncalled by pci_conf_print() to print the device-dependent registers. This function is onlyuseful for driver development and is usually wrapped in pre-processor declarations.pci_conf_capture(pc , tag , pcs)Capture PCI configuration space into structure pcs. The argument tag is the PCI tag for thecurrent device attached to the PCI chipset pc.pci_conf_restore(pc , tag , pcs)Restores PCI configuration space from structure pcs. The argument tag is the PCI tag for thecurrent device attached to the PCI chipset pc.pci_find_device(pa , func)Find a device using a match function on all probed busses. The argument func is called bypci_find_device() to match a device. The argument pa is filled in if the device is matched.pci_find_device() returns 1 if the device is matched, and zero otherwise. This function isspecifically for use by LKMs (see lkm(4)) and its use otherwise is strongly discouraged.pci_get_capability(pc , tag , capid , offsetp , valuep)Parse the device capability list in configuration space looking for capability capid. Ifoffsetp is not NULL, the register offset in configuration space is returned in offsetp. Ifvaluep is not NULL, the value of the capability is returned in valuep. The argument tag isthe PCI tag for the current device attached to PCI chipset pc. This function returns 1 if the capabilitywas found. If the capability was not found, it returns zero, and offsetp and valuepremain unchanged.pci_mapreg_type(pc , tag , reg)Interrogates the Base Address Register (BAR) in configuration space specified by reg andreturns the default (or current) mapping type. Valid returns values are:PCI_MAPREG_TYPE_IOThe mapping is to I/O address space.PCI_MAPREG_TYPE_MEMThe mapping is to memory address space.PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BITThe mapping is to 64-bit memory address space.PCI_MAPREG_TYPE_ROMThe mapping is to ROM. Note that in the current implementation,PCI_MAPREG_TYPE_ROM has the same numeric value asPCI_MAPREG_TYPE_MEM.<strong>NetBSD</strong> 3.0 June 17, 2006 4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!