Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Don't make assumptions of the actual value of PC...



details:   https://anonhg.NetBSD.org/src/rev/cb83254cdfba
branches:  trunk
changeset: 494924:cb83254cdfba
user:      tron <tron%NetBSD.org@localhost>
date:      Mon Jul 17 18:12:00 2000 +0000

description:
Don't make assumptions of the actual value of PCI_PMCSR_STATE_D0.
Problem noted by John Hawkinson.

diffstat:

 sys/dev/pci/if_epic_pci.c |  8 +++++---
 sys/dev/pci/if_tlp_pci.c  |  8 +++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diffs (58 lines):

diff -r f4ae09187090 -r cb83254cdfba sys/dev/pci/if_epic_pci.c
--- a/sys/dev/pci/if_epic_pci.c Mon Jul 17 17:53:44 2000 +0000
+++ b/sys/dev/pci/if_epic_pci.c Mon Jul 17 18:12:00 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_epic_pci.c,v 1.13 2000/07/17 17:53:44 tron Exp $    */
+/*     $NetBSD: if_epic_pci.c,v 1.14 2000/07/17 18:12:00 tron Exp $    */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -173,7 +173,8 @@
                        printf(": waking up from power state D%d\n%s",
                            reg & PCI_PMCSR_STATE_MASK, sc->sc_dev.dv_xname);
                        pci_conf_write(pc, pa->pa_tag, pmreg + 4,
-                                      reg & ~PCI_PMCSR_STATE_MASK);
+                           (reg & ~PCI_PMCSR_STATE_MASK) |
+                           PCI_PMCSR_STATE_D0);
                        break;
                case PCI_PMCSR_STATE_D3:
                        /*
@@ -183,7 +184,8 @@
                        printf(": unable to wake up from power state D3, "
                               "reboot required.\n");
                        pci_conf_write(pc, pa->pa_tag, pmreg + 4,
-                                      reg & ~PCI_PMCSR_STATE_MASK);
+                           (reg & ~PCI_PMCSR_STATE_MASK) |
+                           PCI_PMCSR_STATE_D0);
                        return;
                }
        }
diff -r f4ae09187090 -r cb83254cdfba sys/dev/pci/if_tlp_pci.c
--- a/sys/dev/pci/if_tlp_pci.c  Mon Jul 17 17:53:44 2000 +0000
+++ b/sys/dev/pci/if_tlp_pci.c  Mon Jul 17 18:12:00 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_tlp_pci.c,v 1.44 2000/07/17 17:53:44 tron Exp $     */
+/*     $NetBSD: if_tlp_pci.c,v 1.45 2000/07/17 18:12:00 tron Exp $     */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -489,7 +489,8 @@
                        printf(": waking up from power state D%d\n%s",
                            reg & PCI_PMCSR_STATE_MASK, sc->sc_dev.dv_xname);
                        pci_conf_write(pc, pa->pa_tag, pmreg + 4,
-                                      reg & ~PCI_PMCSR_STATE_MASK);
+                           (reg & ~PCI_PMCSR_STATE_MASK) |
+                           PCI_PMCSR_STATE_D0);
                        break;
                case PCI_PMCSR_STATE_D3:
                        /*
@@ -499,7 +500,8 @@
                        printf(": unable to wake up from power state D3, "
                               "reboot required.\n");
                        pci_conf_write(pc, pa->pa_tag, pmreg + 4,
-                                      reg & ~PCI_PMCSR_STATE_MASK);
+                           (reg & ~PCI_PMCSR_STATE_MASK) |
+                           PCI_PMCSR_STATE_D0);
                        return;
                }
        }



Home | Main Index | Thread Index | Old Index