Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Use macro. No binary change.
details: https://anonhg.NetBSD.org/src/rev/c74691346fe1
branches: trunk
changeset: 353072:c74691346fe1
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Wed Apr 19 06:52:11 2017 +0000
description:
Use macro. No binary change.
diffstat:
sys/dev/pci/if_bce.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diffs (43 lines):
diff -r 0e33050ad87b -r c74691346fe1 sys/dev/pci/if_bce.c
--- a/sys/dev/pci/if_bce.c Wed Apr 19 06:43:05 2017 +0000
+++ b/sys/dev/pci/if_bce.c Wed Apr 19 06:52:11 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bce.c,v 1.44 2016/12/15 09:28:05 ozaki-r Exp $ */
+/* $NetBSD: if_bce.c,v 1.45 2017/04/19 06:52:11 msaitoh Exp $ */
/*
* Copyright (c) 2003 Clifford Wright. All rights reserved.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.44 2016/12/15 09:28:05 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.45 2017/04/19 06:52:11 msaitoh Exp $");
#include "vlan.h"
@@ -298,8 +298,9 @@
/* Get it out of power save mode if needed. */
if (pci_get_capability(pc, pa->pa_tag, PCI_CAP_PWRMGMT, &pmreg, NULL)) {
- pmode = pci_conf_read(pc, pa->pa_tag, pmreg + 4) & 0x3;
- if (pmode == 3) {
+ pmode = pci_conf_read(pc, pa->pa_tag, pmreg + PCI_PMCSR)
+ & PCI_PMCSR_STATE_MASK;
+ if (pmode == PCI_PMCSR_STATE_D3) {
/*
* The card has lost all configuration data in
* this state, so punt.
@@ -308,10 +309,10 @@
"unable to wake up from power state D3\n");
return;
}
- if (pmode != 0) {
+ if (pmode != PCI_PMCSR_STATE_D0) {
aprint_normal_dev(self,
"waking up from power state D%d\n", pmode);
- pci_conf_write(pc, pa->pa_tag, pmreg + 4, 0);
+ pci_conf_write(pc, pa->pa_tag, pmreg + PCI_PMCSR, 0);
}
}
if (pci_intr_map(pa, &ih)) {
Home |
Main Index |
Thread Index |
Old Index