From ae23f0860f8e53d0855b2698fa3feca9f5fc0df5 Mon Sep 17 00:00:00 2001 From: "Federico G. Schwindt" Date: Tue, 7 Oct 2003 14:11:05 +0000 Subject: use PCI_PMCSR instead of some magic value. ok krw@ henning@ --- sys/dev/pci/cs4281.c | 4 ++-- sys/dev/pci/esa.c | 6 +++--- sys/dev/pci/if_dc_pci.c | 6 +++--- sys/dev/pci/if_stge.c | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/pci/cs4281.c b/sys/dev/pci/cs4281.c index 0df68cb0037..88adfc9c176 100644 --- a/sys/dev/pci/cs4281.c +++ b/sys/dev/pci/cs4281.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cs4281.c,v 1.15 2003/08/21 04:57:40 mickey Exp $ */ +/* $OpenBSD: cs4281.c,v 1.16 2003/10/07 14:11:04 fgsch Exp $ */ /* $Tera: cs4281.c,v 1.18 2000/12/27 14:24:45 tacha Exp $ */ /* @@ -324,7 +324,7 @@ cs4281_attach(parent, self, aux) &pci_pwrmgmt_cap_reg, 0)) { pcireg_t reg; - pci_pwrmgmt_csr_reg = pci_pwrmgmt_cap_reg + 4; + pci_pwrmgmt_csr_reg = pci_pwrmgmt_cap_reg + PCI_PMCSR; reg = pci_conf_read(pa->pa_pc, pa->pa_tag, pci_pwrmgmt_csr_reg); if ((reg & PCI_PMCSR_STATE_MASK) != PCI_PMCSR_STATE_D0) { pci_conf_write(pc, pa->pa_tag, pci_pwrmgmt_csr_reg, diff --git a/sys/dev/pci/esa.c b/sys/dev/pci/esa.c index ad56630c80c..6151dddc025 100644 --- a/sys/dev/pci/esa.c +++ b/sys/dev/pci/esa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: esa.c,v 1.7 2003/08/11 05:03:10 mickey Exp $ */ +/* $OpenBSD: esa.c,v 1.8 2003/10/07 14:11:04 fgsch Exp $ */ /* $NetBSD: esa.c,v 1.12 2002/03/24 14:17:35 jmcneill Exp $ */ /* @@ -1607,9 +1607,9 @@ esa_power(struct esa_softc *sc, int state) int pmcapreg; if (pci_get_capability(pc, tag, PCI_CAP_PWRMGMT, &pmcapreg, 0)) { - data = pci_conf_read(pc, tag, pmcapreg + 4); + data = pci_conf_read(pc, tag, pmcapreg + PCI_PMCSR); if ((data & PCI_PMCSR_STATE_MASK) != state) - pci_conf_write(pc, tag, pmcapreg + 4, state); + pci_conf_write(pc, tag, pmcapreg + PCI_PMCSR, state); } return (0); diff --git a/sys/dev/pci/if_dc_pci.c b/sys/dev/pci/if_dc_pci.c index 51947113dc0..f70398a7ad2 100644 --- a/sys/dev/pci/if_dc_pci.c +++ b/sys/dev/pci/if_dc_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_dc_pci.c,v 1.40 2003/09/29 18:53:58 mickey Exp $ */ +/* $OpenBSD: if_dc_pci.c,v 1.41 2003/10/07 14:11:04 fgsch Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -172,7 +172,7 @@ void dc_pci_acpi(self, aux) r = pci_conf_read(pc, pa->pa_tag, cptr) & 0xFF; if (r == 0x01) { - r = pci_conf_read(pc, pa->pa_tag, cptr + 4); + r = pci_conf_read(pc, pa->pa_tag, cptr + PCI_PMCSR); if (r & DC_PSTATE_D3) { u_int32_t iobase, membase, irq; @@ -186,7 +186,7 @@ void dc_pci_acpi(self, aux) "-- setting to D0\n", sc->sc_dev.dv_xname, r & DC_PSTATE_D3); r &= 0xFFFFFFFC; - pci_conf_write(pc, pa->pa_tag, cptr + 4, r); + pci_conf_write(pc, pa->pa_tag, cptr + PCI_PMCSR, r); /* Restore PCI config data. */ pci_conf_write(pc, pa->pa_tag, DC_PCI_CFBIO, iobase); diff --git a/sys/dev/pci/if_stge.c b/sys/dev/pci/if_stge.c index bfb1b183d93..bc45e7655ce 100644 --- a/sys/dev/pci/if_stge.c +++ b/sys/dev/pci/if_stge.c @@ -442,7 +442,7 @@ stge_attach(struct device *parent, struct device *self, void *aux) /* Get it out of power save mode if needed. */ if (pci_get_capability(pc, pa->pa_tag, PCI_CAP_PWRMGMT, &pmreg, 0)) { - pmode = pci_conf_read(pc, pa->pa_tag, pmreg + 4) & 0x3; + pmode = pci_conf_read(pc, pa->pa_tag, pmreg + PCI_PMCSR) & 0x3; if (pmode == 3) { /* * The card has lost all configuration data in @@ -453,7 +453,7 @@ stge_attach(struct device *parent, struct device *self, void *aux) } if (pmode != 0) { printf(": 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); } } -- cgit v1.2.3