--- public_html/manpages/pci.9 Wed May 21 11:06:26 2003
+++ public_html/manpages/pci-new.9 Wed Jun 4 16:05:22 2003
@@ -190,7 +190,11 @@
.Fn 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.
+by setting the
+.Dv PCIM_CMD_BUSMASTEREN
+bit in the
+.Dv PCIR_COMMAND
+register.
The
.Fn pci_disable_busmaster
function clears this bit.
@@ -199,13 +203,22 @@
.Fn 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
+by setting the
+.Dv PCIM_CMD_MEMEN
+or
+.Dv PCIM_CMD_PORTEN
+bit in the
+.Dv PCIR_COMMAND
register appropriately. The
.Fn pci_disable_io
-function clears the appropriate bit. The
+function clears the appropriate bit.
+The
.Fa state
argument specifies which resource is affected; this can be either
-SYS_RES_MEMORY or SYS_RES_IOPORT as appropriate.
+.Dv SYS_RES_MEMORY
+or
+.Dv SYS_RES_IOPORT
+as appropriate.
.Pp
.Em NOTE :
These functions should be used in preference to manually manipulating
@@ -216,7 +229,34 @@
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.
+state of
+.Dv PCI_POWERSTATE_D0
+is returned.
+The following power states are defined by ACPI:
+.Bl -hang -width PCI_POWERSTATE_UNKNOWN
+.It Dv PCI_POWERSTATE_D0
+State in which device is on and running.
+It is receiving full power from the system and delivering
+full functionality to the user.
+.It Dv PCI_POWERSTATE_D1
+Class-specific low-power state in which device context may or
+may not be lot.
+Buses in this state cannot do anything to the bus, to
+force devices to loose context.
+.It Dv PCI_POWERSTATE_D2
+Class-specific low-power state in which device context may or
+may not be lost.
+Attains greater power savings than
+.Dv PCI_POWERSTATE_D1 .
+Buses in this state can cause devices to loose some context.
+Devices
+.Em must
+be prepared for the bus to be in this state or higher.
+.It Dv PCI_POWERSTATE_D3
+State in which the device is off and not running.
+Device context is lost, and power from the device can
+be removed.
+.El
.Pp
The
.Fn pci_set_powerstate
@@ -224,14 +264,19 @@
.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
+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.
+of
+.Dv PCI_POWERSTATE_D0
+is set.
.Pp
The
.Fn pci_find_bsf
-function looks up the device_t of a PCI device, given its
+function looks up the
+.Vt device_t
+of a PCI device, given its
.Fa bus ,
.Fa slot ,
and
@@ -239,52 +284,25 @@
.Pp
The
.Fn pci_find_device
-function looks up the device_t of a PCI device, given its
+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.
-.Pp
-.Em NOTE :
-The instance variable interface is not currently used within the
-FreeBSD kernel (as of 5.1-BETA). This includes the following functions:
-.Fn pci_get_subvendor ,
-.Fn pci_set_subvendor ,
-.Fn pci_get_vendor ,
-.Fn pci_set_vendor ,
-.Fn pci_get_device ,
-.Fn pci_set_device ,
-.Fn pci_get_devid ,
-.Fn pci_set_devid ,
-.Fn pci_get_class ,
-.Fn pci_set_class ,
-.Fn pci_get_subclass ,
-.Fn pci_set_subclass ,
-.Fn pci_get_progif ,
-.Fn pci_set_progif ,
-.Fn pci_get_revid ,
-.Fn pci_set_revid ,
-.Fn pci_get_intpin ,
-.Fn pci_set_intpin ,
-.Fn pci_get_irq ,
-.Fn pci_set_irq ,
-.Fn pci_get_bus ,
-.Fn pci_set_bus ,
-.Fn pci_get_slot ,
-.Fn pci_set_slot ,
-.Fn pci_get_function ,
-.Fn pci_set_function ,
-.Fn pci_get_ethaddr ,
-.Fn pci_set_ethaddr
-.Sh NOTES
-The pci_addr_t type is defined according to the size of the PCI bus address
+.Sh IMPLEMENTATION NOTES
+The
+.Vt pci_addr_t
+type is defined according to the size of the PCI bus address
space on the target system.
.Sh BUGS
This manual page does not yet document PAE and how it affects memory-space
mapping of PCI devices.
.Sh SEE ALSO
.Xr bus_alloc_resource 9 ,
+.Xr bus_dma 9 ,
.Xr bus_release_resource 9 ,
.Xr bus_setup_intr 9 ,
.Xr bus_teardown_intr 9 ,
@@ -292,6 +310,11 @@
.Xr device 9 ,
.Xr driver 9 ,
.Xr rman 9
+.Rs
+.%B FreeBSD Developers' Handbook
+.%T NewBus
+.%O http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/developers-handbook/
+.Re
.Rs
.%A Shanley
.%A Anderson