Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci - Print Power Management Control/status register...



details:   https://anonhg.NetBSD.org/src/rev/2f6f59a41335
branches:  trunk
changeset: 362950:2f6f59a41335
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Jul 03 04:56:59 2018 +0000

description:
- Print Power Management Control/status register in 32bit.
- Simplify.

diffstat:

 sys/dev/pci/pci_subr.c |  20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diffs (57 lines):

diff -r 59fcf4a33216 -r 2f6f59a41335 sys/dev/pci/pci_subr.c
--- a/sys/dev/pci/pci_subr.c    Tue Jul 03 04:02:06 2018 +0000
+++ b/sys/dev/pci/pci_subr.c    Tue Jul 03 04:56:59 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_subr.c,v 1.201 2018/05/09 03:50:51 msaitoh Exp $   */
+/*     $NetBSD: pci_subr.c,v 1.202 2018/07/03 04:56:59 msaitoh Exp $   */
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.201 2018/05/09 03:50:51 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.202 2018/07/03 04:56:59 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -1172,11 +1172,9 @@
 pci_conf_print_pcipm_cap(const pcireg_t *regs, int capoff)
 {
        uint16_t caps, pmcsr;
-       pcireg_t reg;
 
        caps = regs[o2i(capoff)] >> PCI_PMCR_SHIFT;
-       reg = regs[o2i(capoff + PCI_PMCSR)];
-       pmcsr = reg & 0xffff;
+       pmcsr = regs[o2i(capoff + PCI_PMCSR)];
 
        printf("\n  PCI Power Management Capabilities Register\n");
 
@@ -1195,7 +1193,7 @@
        onoff("PME# support D3 hot", caps, PCI_PMCR_PME_D3HOT);
        onoff("PME# support D3 cold", caps, PCI_PMCR_PME_D3COLD);
 
-       printf("    Control/status register: 0x%04x\n", pmcsr);
+       printf("    Control/status register: 0x%08x\n", pmcsr);
        printf("      Power state: D%d\n", pmcsr & PCI_PMCSR_STATE_MASK);
        onoff("PCI Express reserved", (pmcsr >> 2), 1);
        onoff("No soft reset", pmcsr, PCI_PMCSR_NO_SOFTRST);
@@ -1207,11 +1205,11 @@
            __SHIFTOUT(pmcsr, PCI_PMCSR_DATASCL_MASK));
        onoff("PME# status", pmcsr, PCI_PMCSR_PME_STS);
        printf("    Bridge Support Extensions register: 0x%02x\n",
-           (reg >> 16) & 0xff);
-       onoff("B2/B3 support", reg, PCI_PMCSR_B2B3_SUPPORT);
-       onoff("Bus Power/Clock Control Enable", reg, PCI_PMCSR_BPCC_EN);
-       printf("    Data register: 0x%02x\n", __SHIFTOUT(reg, PCI_PMCSR_DATA));
-       
+           (pmcsr >> 16) & 0xff);
+       onoff("B2/B3 support", pmcsr, PCI_PMCSR_B2B3_SUPPORT);
+       onoff("Bus Power/Clock Control Enable", pmcsr, PCI_PMCSR_BPCC_EN);
+       printf("    Data register: 0x%02x\n",
+              __SHIFTOUT(pmcsr, PCI_PMCSR_DATA));
 }
 
 /* XXX pci_conf_print_vpd_cap */



Home | Main Index | Thread Index | Old Index