summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pcidump
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2015-12-01 19:10:09 +0000
committerkettenis <kettenis@openbsd.org>2015-12-01 19:10:09 +0000
commit7b4098eb1cf31a81cb498843e9f24631b9d592ec (patch)
tree4542362983f63a451f12368f6940871844f41878 /usr.sbin/pcidump
parentChange a lot of "else if" lines to single switch block. (diff)
downloadwireguard-openbsd-7b4098eb1cf31a81cb498843e9f24631b9d592ec.tar.xz
wireguard-openbsd-7b4098eb1cf31a81cb498843e9f24631b9d592ec.zip
Print PME# state together with the PCI power state when enabled/asserted.
Diffstat (limited to 'usr.sbin/pcidump')
-rw-r--r--usr.sbin/pcidump/pcidump.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/pcidump/pcidump.c b/usr.sbin/pcidump/pcidump.c
index 32bb915a8d8..1673815dce9 100644
--- a/usr.sbin/pcidump/pcidump.c
+++ b/usr.sbin/pcidump/pcidump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcidump.c,v 1.38 2015/11/21 17:52:10 kettenis Exp $ */
+/* $OpenBSD: pcidump.c,v 1.39 2015/12/01 19:10:09 kettenis Exp $ */
/*
* Copyright (c) 2006, 2007 David Gwynne <loki@animata.net>
@@ -293,7 +293,12 @@ dump_pci_powerstate(int bus, int dev, int func, uint8_t ptr)
if (pci_read(bus, dev, func, ptr + PCI_PMCSR, &pmcsr) != 0)
return;
- printf("\t State: D%d\n", pmcsr & PCI_PMCSR_STATE_MASK);
+ printf("\t State: D%d", pmcsr & PCI_PMCSR_STATE_MASK);
+ if (pmcsr & PCI_PMCSR_PME_EN)
+ printf(" PME# enabled");
+ if (pmcsr & PCI_PMCSR_PME_STATUS)
+ printf(" PME# asserted");
+ printf("\n");
}
void