diff options
author | 2005-09-11 18:17:08 +0000 | |
---|---|---|
committer | 2005-09-11 18:17:08 +0000 | |
commit | b6bd472f231b40a4ce2677fc23f95dcf5c53c507 (patch) | |
tree | 860b5de1bb539b2e9faabb64ff5df2874fc39363 /sys/dev/pci/if_rl_pci.c | |
parent | Process window size changes after xread(). [change window size] (diff) | |
download | wireguard-openbsd-b6bd472f231b40a4ce2677fc23f95dcf5c53c507.tar.xz wireguard-openbsd-b6bd472f231b40a4ce2677fc23f95dcf5c53c507.zip |
do not inline pci_mapreg_map() anymore as it is olrite now; brad@ ok
Diffstat (limited to 'sys/dev/pci/if_rl_pci.c')
-rw-r--r-- | sys/dev/pci/if_rl_pci.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/sys/dev/pci/if_rl_pci.c b/sys/dev/pci/if_rl_pci.c index a912bf53dfe..99871148955 100644 --- a/sys/dev/pci/if_rl_pci.c +++ b/sys/dev/pci/if_rl_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rl_pci.c,v 1.9 2003/12/29 23:06:55 brad Exp $ */ +/* $OpenBSD: if_rl_pci.c,v 1.10 2005/09/11 18:17:08 mickey Exp $ */ /* * Copyright (c) 1997, 1998 @@ -119,7 +119,6 @@ rl_pci_attach(parent, self, aux) pci_chipset_tag_t pc = pa->pa_pc; pci_intr_handle_t ih; const char *intrstr = NULL; - bus_addr_t iobase; bus_size_t iosize; u_int32_t command; @@ -134,29 +133,21 @@ rl_pci_attach(parent, self, aux) /* * Map control/status registers. */ - if (pci_io_find(pc, pa->pa_tag, RL_PCI_LOIO, &iobase, &iosize)) { - printf(": can't find i/o space\n"); - return; - } - if (bus_space_map(pa->pa_iot, iobase, iosize, 0, &sc->rl_bhandle)) { + if (pci_mapreg_map(pa, RL_PCI_LOIO, PCI_MAPREG_TYPE_IO, 0, + &sc->rl_btag, &sc->rl_bhandle, NULL, &iosize, 0)) { printf(": can't map i/o space\n"); return; } - sc->rl_btag = pa->pa_iot; #else if (!(command & PCI_COMMAND_MEM_ENABLE)) { printf(": failed to enable memory mapping\n"); return; } - if (pci_mem_find(pc, pa->pa_tag, RL_PCI_LOMEM, &iobase, &iosize, NULL)){ - printf(": can't find mem space\n"); - return; - } - if (bus_space_map(pa->pa_memt, iobase, iosize, 0, &sc->rl_bhandle)) { + if (pci_mapreg_map(pa, RL_PCI_LOMEM, PCI_MAPREG_TYPE_MEM, 0, + &sc->rl_btag, &sc->rl_bhandle, NULL, &iosize, 0)){ printf(": can't map mem space\n"); return; } - sc->rl_btag = pa->pa_memt; #endif /* @@ -164,6 +155,7 @@ rl_pci_attach(parent, self, aux) */ if (pci_intr_map(pa, &ih)) { printf(": couldn't map interrupt\n"); + bus_space_unmap(sc->rl_btag, sc->rl_bhandle, iosize); return; } @@ -175,6 +167,7 @@ rl_pci_attach(parent, self, aux) if (intrstr != NULL) printf(" at %s", intrstr); printf("\n"); + bus_space_unmap(sc->rl_btag, sc->rl_bhandle, iosize); return; } printf(": %s", intrstr); |