aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2005-09-21 19:47:00 +0000
committerWarner Losh <imp@FreeBSD.org>2005-09-21 19:47:00 +0000
commit50757d2fce73d1a6dc617306fb4da07ad85238b2 (patch)
tree924c3cc0875934d160403dc950c27f81ee569f56 /sys/dev
parenta01b41250c62e33c52cfc8357837795efd1e1003 (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/pci.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 0d8bd1cf6274..af40ca8d27d3 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -183,18 +183,20 @@ SYSCTL_INT(_hw_pci, OID_AUTO, enable_io_modes, CTLFLAG_RW,
enable these bits correctly. We'd like to do this all the time, but there\n\
are some peripherals that this causes problems with.");
-static int pci_do_powerstate = 1;
-TUNABLE_INT("hw.pci.do_powerstate", &pci_do_powerstate);
-SYSCTL_INT(_hw_pci, OID_AUTO, do_powerstate, CTLFLAG_RW,
- &pci_do_powerstate, 1,
- "Controls the behvior of the pci driver when it encounters\n\
-devices which no driver claims. Set to 0 causes the pci to leave\n\
-the device in D0. Set to 1 causes pci to conservatively devices\n\
-into D3 state. These are devices which have had issues in the past.\n\
-Set to 2 causes the bus driver to agressively place devices into D3 state.\n\
-The only devices it excludes are devices for which no drivers generally\n\
-exist in FreeBSD. Set to 3 causes the bus driver to place all unattached\n\
-devices into D3 state.");
+static int pci_do_power_nodriver = 0;
+TUNABLE_INT("hw.pci.do_power_nodriver", &pci_do_power_nodriver);
+SYSCTL_INT(_hw_pci, OID_AUTO, do_power_nodriver, CTLFLAG_RW,
+ &pci_do_power_nodriver, 0,
+ "Place a function into D3 state when no driver attaches to it. 0 means\n\
+disable. 1 means conservatively place devices into D3 state. 2 means\n\
+agressively place devices into D3 state. 3 means put absolutely everything\n\
+in D3 state.");
+
+static int pci_do_power_resume = 1;
+TUNABLE_INT("hw.pci.do_power_resume", &pci_do_power_resume);
+SYSCTL_INT(_hw_pci, OID_AUTO, do_power_resume, CTLFLAG_RW,
+ &pci_do_power_resume, 1,
+ "Transition from D3 -> D0 on resume.");
/* Find a device_t by bus/slot/function */
@@ -1071,7 +1073,7 @@ pci_suspend(device_t dev)
* device in the appropriate power state for this sleep state.
*/
acpi_dev = NULL;
- if (pci_do_powerstate)
+ if (pci_do_power_resume)
acpi_dev = devclass_get_device(devclass_find("acpi"), 0);
device_get_children(dev, &devlist, &numdevs);
for (i = 0; i < numdevs; i++) {
@@ -1118,7 +1120,7 @@ pci_resume(device_t dev)
* Set each child to D0 and restore its PCI configuration space.
*/
acpi_dev = NULL;
- if (pci_do_powerstate)
+ if (pci_do_power_resume)
acpi_dev = devclass_get_device(devclass_find("acpi"), 0);
device_get_children(dev, &devlist, &numdevs);
for (i = 0; i < numdevs; i++) {
@@ -1335,7 +1337,7 @@ pci_probe_nomatch(device_t dev, device_t child)
}
printf(" at device %d.%d (no driver attached)\n",
pci_get_slot(child), pci_get_function(child));
- if (pci_do_powerstate)
+ if (pci_do_power_nodriver)
pci_cfg_save(child,
(struct pci_devinfo *) device_get_ivars(child), 1);
return;
@@ -2011,7 +2013,7 @@ pci_cfg_save(device_t dev, struct pci_devinfo *dinfo, int setstate)
cls = pci_get_class(dev);
if (!setstate)
return;
- switch (pci_do_powerstate)
+ switch (pci_do_power_nodriver)
{
case 0: /* NO powerdown at all */
return;