pci pci_read_config pci_write_config pci_enable_busmaster pci_disable_busmaster pci_enable_io pci_disable_io pci_set_powerstate pci_get_powerstate pci_find_bsf pci_find_dbsf pci_find_device - PCI bus interface
The
pci_read_config ();
function is used to read data from the PCI configuration
space of the device
Fa dev ,
at offset
Fa reg ,
with
Fa width
specifying the size of the access.
The
pci_write_config ();
function is used to write the value
Fa val
to the PCI configuration
space of the device
Fa dev ,
at offset
Fa reg ,
with
Fa width
specifying the size of the access.
The
pci_enable_busmaster ();
function enables PCI bus mastering for the device
Fa dev ,
by setting the
PCIM_CMD_BUSMASTEREN
bit in the
PCIR_COMMAND
register.
The
pci_disable_busmaster ();
function clears this bit.
The
pci_enable_io ();
function enables memory or I/O port address decoding for the device
Fa dev ,
by setting the
PCIM_CMD_MEMEN
or
PCIM_CMD_PORTEN
bit in the
PCIR_COMMAND
register appropriately.
The
pci_disable_io ();
function clears the appropriate bit.
The
Fa space
argument specifies which resource is affected; this can be either
SYS_RES_MEMORY
or
SYS_RES_IOPORT
as appropriate.
NOTE These functions should be used in preference to manually manipulating the configuration space.
The
pci_get_powerstate ();
function returns the current ACPI power state of the device
Fa dev .
If the device does not support power management capabilities, then the default
state of
PCI_POWERSTATE_D0
is returned.
The following power states are defined by ACPI:
The
pci_set_powerstate ();
function is used to transition the device
Fa dev
to the ACPI power state
Fa state .
It checks to see if the device is PCI 2.2 compliant.
If so, it checks the
capabilities pointer to determine which power states the device supports.
If the device does not have power management capabilities, the default state
of
PCI_POWERSTATE_D0
is set.
The
pci_find_bsf ();
function looks up the
Vt device_t
of a PCI device, given its
Fa bus ,
Fa slot ,
and
Fa func .
The
Fa slot
number actually refers to the number of the device on the bus,
which does not necessarily indicate its geographic location
in terms of a physical slot.
Note that in case the system has multiple PCI domains,
the
pci_find_bsf ();
function only searches the first one.
Actually, it is equivalent to:
pci_find_dbsf(0, bus, slot, func);
The
pci_find_dbsf ();
function looks up the
Vt device_t
of a PCI device, given its
Fa domain ,
Fa bus ,
Fa slot ,
and
Fa func .
The
Fa slot
number actually refers to the number of the device on the bus,
which does not necessarily indicate its geographic location
in terms of a physical slot.
The
pci_find_device ();
function looks up the
Vt device_t
of a PCI device, given its
Fa vendor
and
Fa device
IDs.
Note that there can be multiple matches for this search; this function
only returns the first matching device.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |