diff options
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/aac_pci.c | 17 | ||||
-rw-r--r-- | sys/dev/pci/hifn7751.c | 13 | ||||
-rw-r--r-- | sys/dev/pci/if_ath_pci.c | 14 | ||||
-rw-r--r-- | sys/dev/pci/ises.c | 15 | ||||
-rw-r--r-- | sys/dev/pci/lofn.c | 13 | ||||
-rw-r--r-- | sys/dev/pci/noct.c | 13 | ||||
-rw-r--r-- | sys/dev/pci/nofn.c | 14 | ||||
-rw-r--r-- | sys/dev/pci/safe.c | 16 | ||||
-rw-r--r-- | sys/dev/pci/ubsec.c | 16 |
9 files changed, 11 insertions, 120 deletions
diff --git a/sys/dev/pci/aac_pci.c b/sys/dev/pci/aac_pci.c index 82426428090..ed72f211acb 100644 --- a/sys/dev/pci/aac_pci.c +++ b/sys/dev/pci/aac_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aac_pci.c,v 1.18 2006/04/22 02:36:28 brad Exp $ */ +/* $OpenBSD: aac_pci.c,v 1.19 2006/06/29 21:34:51 deraadt Exp $ */ /*- * Copyright (c) 2000 Michael Smith @@ -216,7 +216,6 @@ aac_pci_attach(parent, self, aux) struct pci_attach_args *pa = aux; pci_chipset_tag_t pc = pa->pa_pc; struct aac_softc *sc = (void *)self; - pcireg_t command; bus_addr_t membase; bus_size_t memsize; pci_intr_handle_t ih; @@ -241,20 +240,6 @@ aac_pci_attach(parent, self, aux) } /* - * Verify that the adapter is correctly set up in PCI space. - */ - command = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); - AAC_DPRINTF(AAC_D_MISC, ("pci command status reg 0x08x ")); - if (!(command & PCI_COMMAND_MASTER_ENABLE)) { - printf("can't enable bus-master feature\n"); - goto bail_out; - } - if (!(command & PCI_COMMAND_MEM_ENABLE)) { - printf("memory window not available\n"); - goto bail_out; - } - - /* * Map control/status registers. */ if (pci_mapreg_map(pa, PCI_MAPREG_START, diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c index 13d8c3c5162..7ae75aae001 100644 --- a/sys/dev/pci/hifn7751.c +++ b/sys/dev/pci/hifn7751.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hifn7751.c,v 1.151 2006/01/04 00:02:29 brad Exp $ */ +/* $OpenBSD: hifn7751.c,v 1.152 2006/06/29 21:34:51 deraadt Exp $ */ /* * Invertex AEON / Hifn 7751 driver @@ -148,7 +148,6 @@ hifn_attach(struct device *parent, struct device *self, void *aux) const char *intrstr = NULL; char rbase; bus_size_t iosize0, iosize1; - u_int32_t cmd; u_int16_t ena; int rseg; caddr_t kva; @@ -172,16 +171,6 @@ hifn_attach(struct device *parent, struct device *self, void *aux) sc->sc_flags |= HIFN_IS_7811 | HIFN_HAS_RNG | HIFN_HAS_LEDS | HIFN_NO_BURSTWRITE; - cmd = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); - if (!(cmd & PCI_COMMAND_MEM_ENABLE)) { - printf(": memory mapping not enabled\n"); - return; - } - if (!(cmd & PCI_COMMAND_MASTER_ENABLE)) { - printf(": bus mastering not enabled\n"); - return; - } - if (pci_mapreg_map(pa, HIFN_BAR0, PCI_MAPREG_TYPE_MEM, 0, &sc->sc_st0, &sc->sc_sh0, NULL, &iosize0, 0)) { printf(": can't find mem space %d\n", 0); diff --git a/sys/dev/pci/if_ath_pci.c b/sys/dev/pci/if_ath_pci.c index 31c59429f38..2958be716e8 100644 --- a/sys/dev/pci/if_ath_pci.c +++ b/sys/dev/pci/if_ath_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ath_pci.c,v 1.11 2005/09/22 10:17:04 reyk Exp $ */ +/* $OpenBSD: if_ath_pci.c,v 1.12 2006/06/29 21:34:09 deraadt Exp $ */ /* $NetBSD: if_ath_pci.c,v 1.7 2004/06/30 05:58:17 mycroft Exp $ */ /*- @@ -126,7 +126,6 @@ ath_pci_attach(struct device *parent, struct device *self, void *aux) { struct ath_pci_softc *psc = (struct ath_pci_softc *)self; struct ath_softc *sc = &psc->sc_sc; - pcireg_t res; struct pci_attach_args *pa = aux; pci_chipset_tag_t pc = pa->pa_pc; pcitag_t pt = pa->pa_tag; @@ -139,17 +138,6 @@ ath_pci_attach(struct device *parent, struct device *self, void *aux) psc->sc_pc = pc; psc->sc_pcitag = pt; - res = pci_conf_read(pc, pt, PCI_COMMAND_STATUS_REG); - if ((res & PCI_COMMAND_MEM_ENABLE) == 0) { - printf(": couldn't enable memory mapping\n"); - goto bad; - } - - if ((res & PCI_COMMAND_MASTER_ENABLE) == 0) { - printf(": couldn't enable bus mastering\n"); - goto bad; - } - /* * Setup memory-mapping of PCI registers. */ diff --git a/sys/dev/pci/ises.c b/sys/dev/pci/ises.c index f7f5d728518..5a3bf6afa13 100644 --- a/sys/dev/pci/ises.c +++ b/sys/dev/pci/ises.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ises.c,v 1.30 2006/04/20 20:31:12 miod Exp $ */ +/* $OpenBSD: ises.c,v 1.31 2006/06/29 21:34:51 deraadt Exp $ */ /* * Copyright (c) 2000, 2001 Håkan Olsson (ho@crt.se) @@ -160,7 +160,6 @@ ises_attach(struct device *parent, struct device *self, void *aux) pci_intr_handle_t ih; const char *intrstr = NULL; bus_size_t memsize; - u_int32_t cmd; bus_dma_segment_t seg; int nsegs, error, state; @@ -170,18 +169,6 @@ ises_attach(struct device *parent, struct device *self, void *aux) SIMPLEQ_INIT(&sc->sc_cmdq); state = 0; - /* Verify PCI space */ - cmd = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); - if (!(cmd & PCI_COMMAND_MEM_ENABLE)) { - printf(": failed to enable memory mapping\n"); - return; - } - - if (!(cmd & PCI_COMMAND_MASTER_ENABLE)) { - printf(": failed to enable bus mastering\n"); - return; - } - /* Map control/status registers. */ if (pci_mapreg_map(pa, PCI_MAPREG_START, PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0, &sc->sc_memt, diff --git a/sys/dev/pci/lofn.c b/sys/dev/pci/lofn.c index f5369cea03d..7a51761f93e 100644 --- a/sys/dev/pci/lofn.c +++ b/sys/dev/pci/lofn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lofn.c,v 1.26 2004/05/04 16:59:31 grange Exp $ */ +/* $OpenBSD: lofn.c,v 1.27 2006/06/29 21:34:51 deraadt Exp $ */ /* * Copyright (c) 2001-2002 Jason L. Wright (jason@thought.net) @@ -106,19 +106,8 @@ lofn_attach(parent, self, aux) pci_intr_handle_t ih; const char *intrstr = NULL; bus_size_t iosize; - u_int32_t cmd; int algs[CRK_ALGORITHM_MAX + 1]; - cmd = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); - cmd |= PCI_COMMAND_MEM_ENABLE; - pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, cmd); - cmd = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); - - if (!(cmd & PCI_COMMAND_MEM_ENABLE)) { - printf(": failed to enable memory mapping\n"); - return; - } - if (pci_mapreg_map(pa, LOFN_BAR0, PCI_MAPREG_TYPE_MEM, 0, &sc->sc_st, &sc->sc_sh, NULL, &iosize, 0)) { printf(": can't map mem space\n"); diff --git a/sys/dev/pci/noct.c b/sys/dev/pci/noct.c index 64298a7a915..e25a4051ebe 100644 --- a/sys/dev/pci/noct.c +++ b/sys/dev/pci/noct.c @@ -1,4 +1,4 @@ -/* $OpenBSD: noct.c,v 1.16 2004/05/04 16:59:31 grange Exp $ */ +/* $OpenBSD: noct.c,v 1.17 2006/06/29 21:34:51 deraadt Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -141,17 +141,6 @@ noct_attach(parent, self, aux) pci_intr_handle_t ih; const char *intrstr = NULL; bus_size_t iosize = 0; - u_int32_t cmd; - - cmd = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); - cmd |= PCI_COMMAND_MEM_ENABLE; - pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, cmd); - cmd = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); - - if (!(cmd & PCI_COMMAND_MEM_ENABLE)) { - printf(": failed to enable memory mapping\n"); - goto fail; - } if (pci_mapreg_map(pa, NOCT_BAR0, PCI_MAPREG_MEM_TYPE_64BIT, 0, &sc->sc_st, &sc->sc_sh, NULL, &iosize, 0)) { diff --git a/sys/dev/pci/nofn.c b/sys/dev/pci/nofn.c index 9d26b0a7ef2..35ca1d69996 100644 --- a/sys/dev/pci/nofn.c +++ b/sys/dev/pci/nofn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nofn.c,v 1.14 2005/08/09 04:10:13 mickey Exp $ */ +/* $OpenBSD: nofn.c,v 1.15 2006/06/29 21:34:51 deraadt Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -111,21 +111,9 @@ nofn_attach(parent, self, aux) pci_intr_handle_t ih; const char *intrstr = NULL; bus_size_t bar0size = 0, bar3size = 0; - u_int32_t cmd; sc->sc_dmat = pa->pa_dmat; - cmd = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); - if (!(cmd & PCI_COMMAND_MEM_ENABLE)) { - printf(": failed to enable memory mapping\n"); - goto fail; - } - - if (!(cmd & PCI_COMMAND_MASTER_ENABLE)) { - printf(": failed to enable bus mastering\n"); - goto fail; - } - if (pci_mapreg_map(pa, NOFN_BAR0_REGS, PCI_MAPREG_TYPE_MEM, 0, &sc->sc_st, &sc->sc_sh, NULL, &bar0size, 0)) { printf(": can't map bar0 regs\n"); diff --git a/sys/dev/pci/safe.c b/sys/dev/pci/safe.c index 97a19eb1e40..6f8edf74fd8 100644 --- a/sys/dev/pci/safe.c +++ b/sys/dev/pci/safe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: safe.c,v 1.19 2006/03/12 19:41:13 deraadt Exp $ */ +/* $OpenBSD: safe.c,v 1.20 2006/06/29 21:34:51 deraadt Exp $ */ /*- * Copyright (c) 2003 Sam Leffler, Errno Consulting @@ -159,7 +159,7 @@ safe_attach(struct device *parent, struct device *self, void *aux) const char *intrstr = NULL; bus_size_t iosize; bus_addr_t raddr; - u_int32_t cmd, devinfo; + u_int32_t devinfo; int algs[CRYPTO_ALGORITHM_MAX + 1], i; /* XXX handle power management */ @@ -167,18 +167,6 @@ safe_attach(struct device *parent, struct device *self, void *aux) SIMPLEQ_INIT(&sc->sc_pkq); sc->sc_dmat = pa->pa_dmat; - cmd = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); - - if (!(cmd & PCI_COMMAND_MEM_ENABLE)) { - printf(": failed to enable memory mapping\n"); - return; - } - - if (!(cmd & PCI_COMMAND_MASTER_ENABLE)) { - printf(": failed to enable bus mastering\n"); - return; - } - /* * Setup memory-mapping of PCI registers. */ diff --git a/sys/dev/pci/ubsec.c b/sys/dev/pci/ubsec.c index 74201c4a6c9..3749c19a85e 100644 --- a/sys/dev/pci/ubsec.c +++ b/sys/dev/pci/ubsec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ubsec.c,v 1.136 2005/08/09 04:10:13 mickey Exp $ */ +/* $OpenBSD: ubsec.c,v 1.137 2006/06/29 21:34:51 deraadt Exp $ */ /* * Copyright (c) 2000 Jason L. Wright (jason@thought.net) @@ -154,7 +154,7 @@ ubsec_attach(struct device *parent, struct device *self, void *aux) const char *intrstr = NULL; struct ubsec_dma *dmap; bus_size_t iosize; - u_int32_t cmd, i; + u_int32_t i; int algs[CRYPTO_ALGORITHM_MAX + 1]; int kalgs[CRK_ALGORITHM_MAX + 1]; @@ -193,18 +193,6 @@ ubsec_attach(struct device *parent, struct device *self, void *aux) UBS_FLAGS_LONGCTX | UBS_FLAGS_HWNORM | UBS_FLAGS_BIGKEY; } - cmd = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); - - if (!(cmd & PCI_COMMAND_MEM_ENABLE)) { - printf(": failed to enable memory mapping\n"); - return; - } - - if (!(cmd & PCI_COMMAND_MASTER_ENABLE)) { - printf(": failed to enable bus mastering\n"); - return; - } - if (pci_mapreg_map(pa, BS_BAR, PCI_MAPREG_TYPE_MEM, 0, &sc->sc_st, &sc->sc_sh, NULL, &iosize, 0)) { printf(": can't find mem space\n"); |