summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2012-03-01 20:20:55 +0000
committerjhb <jhb@FreeBSD.org>2012-03-01 20:20:55 +0000
commit87af6ebd2e92f46676ab96bbb6db52e01b9a85ce (patch)
tree58f45f74c955b124a7f04c4b6c9387dc9a70b6bc /share
parent0b4e8b5716a2cec48f18114a48d0ac11a0865ea0 (diff)
downloadFreeBSD-src-87af6ebd2e92f46676ab96bbb6db52e01b9a85ce.zip
FreeBSD-src-87af6ebd2e92f46676ab96bbb6db52e01b9a85ce.tar.gz
Add pci_save_state() and pci_restore_state() wrappers around
pci_cfg_save() and pci_cfg_restore() for device drivers to use when saving and restoring state (e.g. to handle device-specific resets). Reviewed by: imp MFC after: 2 weeks
Diffstat (limited to 'share')
-rw-r--r--share/man/man9/Makefile2
-rw-r--r--share/man/man9/pci.926
2 files changed, 28 insertions, 0 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index af2a216..81063b9 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -980,6 +980,8 @@ MLINKS+=pci.9 pci_disable_busmaster.9 \
pci.9 pci_find_device.9 \
pci.9 pci_get_powerstate.9 \
pci.9 pci_read_config.9 \
+ pci.9 pci_restore_state.9 \
+ pci.9 pci_save_state.9 \
pci.9 pci_set_powerstate.9 \
pci.9 pci_write_config.9
MLINKS+=pfil.9 pfil_add_hook.9 \
diff --git a/share/man/man9/pci.9 b/share/man/man9/pci.9
index d8ed624..93ea75e 100644
--- a/share/man/man9/pci.9
+++ b/share/man/man9/pci.9
@@ -38,6 +38,8 @@
.Nm pci_disable_io ,
.Nm pci_set_powerstate ,
.Nm pci_get_powerstate ,
+.Nm pci_save_state ,
+.Nm pci_restore_state ,
.Nm pci_find_bsf ,
.Nm pci_find_dbsf ,
.Nm pci_find_device
@@ -63,6 +65,10 @@
.Fn pci_get_powerstate "device_t dev"
.Ft uint32_t
.Fn pci_read_config "device_t dev" "int reg" "int width"
+.Ft void
+.Fn pci_save_state "device_t dev"
+.Ft void
+.Fn pci_restore_state "device_t dev"
.Ft device_t
.Fn pci_find_bsf "uint8_t bus" "uint8_t slot" "uint8_t func"
.Ft device_t
@@ -188,6 +194,26 @@ of
is set.
.Pp
The
+.Fn pci_save_state
+and
+.Fn pci_restore_state
+functions can be used by a device driver to save and restore standard PCI
+config registers.
+The
+.Fn pci_save_state
+function must be invoked while the device has valid state before
+.Fn pci_restore_state
+can be used.
+If the device is not in the fully-powered state
+.Pq Dv PCI_POWERSTATE_D0
+when
+.Fn pci_restore_state
+is invoked,
+then the device will be transitioned to
+.Dv PCI_POWERSTATE_D0
+before any config registers are restored.
+.Pp
+The
.Fn pci_find_bsf
function looks up the
.Vt device_t
OpenPOWER on IntegriCloud