Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better handled by calling bus_space_subregion(). Now there is a 1:1 mapping between I/O spaces in the config table and windows mapped in the function. Rework the multifunction mapping code to take advantage of this by using both I/O base addresses if necessary.
This commit is contained in:
parent
b43cbaf291
commit
ebed70c6e6
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: aic_pcmcia.c,v 1.22 2002/10/02 16:52:04 thorpej Exp $ */
|
||||
/* $NetBSD: aic_pcmcia.c,v 1.23 2004/08/08 23:17:12 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Marc Horowitz. All rights reserved.
|
||||
|
@ -30,7 +30,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: aic_pcmcia.c,v 1.22 2002/10/02 16:52:04 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: aic_pcmcia.c,v 1.23 2004/08/08 23:17:12 mycroft Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -148,8 +148,8 @@ aic_pcmcia_attach(parent, self, aux)
|
|||
}
|
||||
|
||||
/* Map in the io space */
|
||||
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_AUTO, 0, psc->sc_pcioh.size,
|
||||
&psc->sc_pcioh, &psc->sc_io_window)) {
|
||||
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_AUTO, &psc->sc_pcioh,
|
||||
&psc->sc_io_window)) {
|
||||
printf(": can't map i/o space\n");
|
||||
goto iomap_failed;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: com_pcmcia.c,v 1.39 2004/08/07 05:27:39 mycroft Exp $ */
|
||||
/* $NetBSD: com_pcmcia.c,v 1.40 2004/08/08 23:17:12 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -68,7 +68,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: com_pcmcia.c,v 1.39 2004/08/07 05:27:39 mycroft Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: com_pcmcia.c,v 1.40 2004/08/08 23:17:12 mycroft Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -272,8 +272,8 @@ found:
|
|||
/* map in the io space */
|
||||
|
||||
if (pcmcia_io_map(pa->pf, ((cfe->flags & PCMCIA_CFE_IO16) ?
|
||||
PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8), 0, psc->sc_pcioh.size,
|
||||
&psc->sc_pcioh, &psc->sc_io_window)) {
|
||||
PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8), &psc->sc_pcioh,
|
||||
&psc->sc_io_window)) {
|
||||
aprint_error("%s: can't map i/o space\n", self->dv_xname);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: esl_pcmcia.c,v 1.8 2002/10/02 16:52:06 thorpej Exp $ */
|
||||
/* $NetBSD: esl_pcmcia.c,v 1.9 2004/08/08 23:17:12 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 Jared D. McNeill <jmcneill@invisible.yi.org>
|
||||
|
@ -34,7 +34,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: esl_pcmcia.c,v 1.8 2002/10/02 16:52:06 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: esl_pcmcia.c,v 1.9 2004/08/08 23:17:12 mycroft Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -144,8 +144,8 @@ esl_pcmcia_attach(struct device *parent, struct device *self, void *aux)
|
|||
}
|
||||
|
||||
/* Map in the I/O space */
|
||||
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_AUTO, 0, esc->sc_pcioh.size,
|
||||
&esc->sc_pcioh, &esc->sc_io_window)) {
|
||||
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_AUTO, &esc->sc_pcioh,
|
||||
&esc->sc_io_window)) {
|
||||
printf(": can't map i/o space\n");
|
||||
goto iomap_failed;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: esp_pcmcia.c,v 1.16 2003/12/28 06:50:42 itohy Exp $ */
|
||||
/* $NetBSD: esp_pcmcia.c,v 1.17 2004/08/08 23:17:12 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: esp_pcmcia.c,v 1.16 2003/12/28 06:50:42 itohy Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: esp_pcmcia.c,v 1.17 2004/08/08 23:17:12 mycroft Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -216,8 +216,8 @@ esp_pcmcia_attach(parent, self, aux)
|
|||
}
|
||||
|
||||
/* Map in the I/O space */
|
||||
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_AUTO, 0, esc->sc_pcioh.size,
|
||||
&esc->sc_pcioh, &esc->sc_io_window)) {
|
||||
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_AUTO, &esc->sc_pcioh,
|
||||
&esc->sc_io_window)) {
|
||||
printf(": can't map i/o space\n");
|
||||
goto iomap_failed;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: fdc_pcmcia.c,v 1.10 2002/10/02 16:52:07 thorpej Exp $ */
|
||||
/* $NetBSD: fdc_pcmcia.c,v 1.11 2004/08/08 23:17:12 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: fdc_pcmcia.c,v 1.10 2002/10/02 16:52:07 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: fdc_pcmcia.c,v 1.11 2004/08/08 23:17:12 mycroft Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -183,8 +183,8 @@ fdc_pcmcia_attach(parent, self, aux)
|
|||
}
|
||||
|
||||
/* Map in the io space */
|
||||
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_AUTO, 0, psc->sc_pcioh.size,
|
||||
&psc->sc_pcioh, &psc->sc_io_window)) {
|
||||
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_AUTO, &psc->sc_pcioh,
|
||||
&psc->sc_io_window)) {
|
||||
printf(": can't map i/o space\n");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_an_pcmcia.c,v 1.19 2004/07/07 06:43:22 mycroft Exp $ */
|
||||
/* $NetBSD: if_an_pcmcia.c,v 1.20 2004/08/08 23:17:12 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_an_pcmcia.c,v 1.19 2004/07/07 06:43:22 mycroft Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_an_pcmcia.c,v 1.20 2004/08/08 23:17:12 mycroft Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -194,8 +194,8 @@ an_pcmcia_attach(parent, self, aux)
|
|||
goto fail1;
|
||||
}
|
||||
|
||||
if (pcmcia_io_map(psc->sc_pf, PCMCIA_WIDTH_AUTO, 0, psc->sc_pcioh.size,
|
||||
&psc->sc_pcioh, &psc->sc_io_window) != 0) {
|
||||
if (pcmcia_io_map(psc->sc_pf, PCMCIA_WIDTH_AUTO, &psc->sc_pcioh,
|
||||
&psc->sc_io_window) != 0) {
|
||||
printf("%s: failed to map io space\n", sc->sc_dev.dv_xname);
|
||||
goto fail2;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_awi_pcmcia.c,v 1.28 2003/10/22 09:13:17 mjl Exp $ */
|
||||
/* $NetBSD: if_awi_pcmcia.c,v 1.29 2004/08/08 23:17:12 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
|
@ -45,7 +45,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_awi_pcmcia.c,v 1.28 2003/10/22 09:13:17 mjl Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_awi_pcmcia.c,v 1.29 2004/08/08 23:17:12 mycroft Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -231,8 +231,8 @@ awi_pcmcia_find(psc, pa, cfe)
|
|||
&psc->sc_pcioh) != 0)
|
||||
goto fail;
|
||||
|
||||
if (pcmcia_io_map(psc->sc_pf, PCMCIA_WIDTH_AUTO, 0, psc->sc_pcioh.size,
|
||||
&psc->sc_pcioh, &psc->sc_io_window))
|
||||
if (pcmcia_io_map(psc->sc_pf, PCMCIA_WIDTH_AUTO, &psc->sc_pcioh,
|
||||
&psc->sc_io_window))
|
||||
goto fail_io_free;
|
||||
|
||||
/* Enable the card. */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_cnw.c,v 1.25 2003/11/10 08:55:41 wiz Exp $ */
|
||||
/* $NetBSD: if_cnw.c,v 1.26 2004/08/08 23:17:12 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -112,7 +112,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_cnw.c,v 1.25 2003/11/10 08:55:41 wiz Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_cnw.c,v 1.26 2004/08/08 23:17:12 mycroft Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "bpfilter.h"
|
||||
|
@ -528,8 +528,8 @@ cnw_attach(parent, self, aux)
|
|||
printf(": can't allocate i/o space\n");
|
||||
goto fail;
|
||||
}
|
||||
if (pcmcia_io_map(sc->sc_pf, PCMCIA_WIDTH_IO16, 0,
|
||||
CNW_IO_SIZE, &sc->sc_pcioh, &sc->sc_iowin) != 0) {
|
||||
if (pcmcia_io_map(sc->sc_pf, PCMCIA_WIDTH_IO16, &sc->sc_pcioh,
|
||||
&sc->sc_iowin) != 0) {
|
||||
printf(": can't map i/o space\n");
|
||||
pcmcia_io_free(sc->sc_pf, &sc->sc_pcioh);
|
||||
goto fail;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_cs_pcmcia.c,v 1.6 2004/07/07 06:43:22 mycroft Exp $ */
|
||||
/* $NetBSD: if_cs_pcmcia.c,v 1.7 2004/08/08 23:17:12 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c)2001 YAMAMOTO Takashi,
|
||||
|
@ -27,7 +27,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_cs_pcmcia.c,v 1.6 2004/07/07 06:43:22 mycroft Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_cs_pcmcia.c,v 1.7 2004/08/08 23:17:12 mycroft Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -192,8 +192,8 @@ cs_pcmcia_enable(struct cs_softc *sc)
|
|||
struct cs_pcmcia_softc *psc = (void *)sc;
|
||||
struct pcmcia_function *pf = psc->sc_pf;
|
||||
|
||||
if (pcmcia_io_map(pf, PCMCIA_WIDTH_AUTO, 0, psc->sc_pcioh.size,
|
||||
&psc->sc_pcioh, &psc->sc_io_window) != 0) {
|
||||
if (pcmcia_io_map(pf, PCMCIA_WIDTH_AUTO, &psc->sc_pcioh,
|
||||
&psc->sc_io_window) != 0) {
|
||||
printf("%s: can't map i/o space\n", DEVNAME(sc));
|
||||
goto fail;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_ep_pcmcia.c,v 1.42 2004/07/07 18:57:00 mycroft Exp $ */
|
||||
/* $NetBSD: if_ep_pcmcia.c,v 1.43 2004/08/08 23:17:13 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -67,7 +67,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ep_pcmcia.c,v 1.42 2004/07/07 18:57:00 mycroft Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ep_pcmcia.c,v 1.43 2004/08/08 23:17:13 mycroft Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -329,8 +329,8 @@ ep_pcmcia_attach(parent, self, aux)
|
|||
sc->sc_ioh = psc->sc_pcioh.ioh;
|
||||
|
||||
if (pcmcia_io_map(pa->pf, ((cfe->flags & PCMCIA_CFE_IO16) ?
|
||||
PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8), 0, cfe->iospace[0].length,
|
||||
&psc->sc_pcioh, &psc->sc_io_window)) {
|
||||
PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8), &psc->sc_pcioh,
|
||||
&psc->sc_io_window)) {
|
||||
aprint_error("%s: can't map i/o space\n", self->dv_xname);
|
||||
goto iomap_failed;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_mbe_pcmcia.c,v 1.30 2002/11/30 14:15:12 tsutsui Exp $ */
|
||||
/* $NetBSD: if_mbe_pcmcia.c,v 1.31 2004/08/08 23:17:13 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_mbe_pcmcia.c,v 1.30 2002/11/30 14:15:12 tsutsui Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_mbe_pcmcia.c,v 1.31 2004/08/08 23:17:13 mycroft Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -242,9 +242,8 @@ mbe_pcmcia_attach(parent, self, aux)
|
|||
* Don't bother checking flags; the back-end sets the chip
|
||||
* into 16-bit mode.
|
||||
*/
|
||||
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_IO16, 0,
|
||||
mpp->mpp_ioalign ? mpp->mpp_ioalign : cfe->iospace[0].length,
|
||||
&psc->sc_pcioh, &psc->sc_io_window)) {
|
||||
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_IO16, &psc->sc_pcioh,
|
||||
&psc->sc_io_window)) {
|
||||
printf(": can't map i/o space\n");
|
||||
goto iomap_failed;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_ne_pcmcia.c,v 1.125 2004/08/07 05:27:39 mycroft Exp $ */
|
||||
/* $NetBSD: if_ne_pcmcia.c,v 1.126 2004/08/08 23:17:13 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Marc Horowitz. All rights reserved.
|
||||
|
@ -30,7 +30,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ne_pcmcia.c,v 1.125 2004/08/07 05:27:39 mycroft Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ne_pcmcia.c,v 1.126 2004/08/08 23:17:13 mycroft Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -76,8 +76,7 @@ struct ne_pcmcia_softc {
|
|||
|
||||
/* PCMCIA-specific goo */
|
||||
struct pcmcia_io_handle sc_pcioh; /* PCMCIA i/o information */
|
||||
int sc_asic_io_window; /* i/o window for ASIC */
|
||||
int sc_nic_io_window; /* i/o window for NIC */
|
||||
int sc_io_window; /* i/o window */
|
||||
struct pcmcia_function *sc_pf; /* our PCMCIA function */
|
||||
void *sc_ih; /* interrupt handle */
|
||||
};
|
||||
|
@ -634,21 +633,12 @@ ne_pcmcia_attach(parent, self, aux)
|
|||
goto fail_2;
|
||||
}
|
||||
|
||||
/* some cards claim to be io16, but they're lying. */
|
||||
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_IO8,
|
||||
NE2000_NIC_OFFSET, NE2000_NIC_NPORTS,
|
||||
&psc->sc_pcioh, &psc->sc_nic_io_window)) {
|
||||
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_IO16, &psc->sc_pcioh,
|
||||
&psc->sc_io_window)) {
|
||||
aprint_error("%s: can't map NIC i/o space\n", self->dv_xname);
|
||||
goto fail_3;
|
||||
}
|
||||
|
||||
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_IO16,
|
||||
NE2000_ASIC_OFFSET, NE2000_ASIC_NPORTS,
|
||||
&psc->sc_pcioh, &psc->sc_asic_io_window)) {
|
||||
aprint_error("%s: can't map ASIC i/o space\n", self->dv_xname);
|
||||
goto fail_4;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read the station address from the board.
|
||||
*/
|
||||
|
@ -672,7 +662,7 @@ again:
|
|||
if (enaddr != NULL)
|
||||
aprint_error("%s: ethernet vendor code %02x:%02x:%02x\n",
|
||||
self->dv_xname, enaddr[0], enaddr[1], enaddr[2]);
|
||||
goto fail_5;
|
||||
goto fail_4;
|
||||
|
||||
found:
|
||||
if ((ne_dev->flags & NE2000DVF_DL10019) != 0) {
|
||||
|
@ -759,28 +749,24 @@ found:
|
|||
}
|
||||
|
||||
if (ne2000_attach(nsc, enaddr))
|
||||
goto fail_5;
|
||||
goto fail_4;
|
||||
|
||||
pcmcia_function_disable(pa->pf);
|
||||
return;
|
||||
|
||||
fail_5:
|
||||
/* Unmap ASIC i/o windows. */
|
||||
pcmcia_io_unmap(psc->sc_pf, psc->sc_asic_io_window);
|
||||
|
||||
fail_4:
|
||||
fail_4:
|
||||
/* Unmap NIC i/o windows. */
|
||||
pcmcia_io_unmap(psc->sc_pf, psc->sc_nic_io_window);
|
||||
pcmcia_io_unmap(psc->sc_pf, psc->sc_io_window);
|
||||
|
||||
fail_3:
|
||||
fail_3:
|
||||
pcmcia_function_disable(pa->pf);
|
||||
|
||||
fail_2:
|
||||
fail_2:
|
||||
/* Free our i/o space. */
|
||||
pcmcia_io_free(psc->sc_pf, &psc->sc_pcioh);
|
||||
|
||||
fail_1:
|
||||
psc->sc_nic_io_window = -1;
|
||||
fail_1:
|
||||
psc->sc_io_window = -1;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -791,7 +777,7 @@ ne_pcmcia_detach(self, flags)
|
|||
struct ne_pcmcia_softc *psc = (struct ne_pcmcia_softc *)self;
|
||||
int error;
|
||||
|
||||
if (psc->sc_nic_io_window == -1)
|
||||
if (psc->sc_io_window == -1)
|
||||
/* Nothing to detach. */
|
||||
return (0);
|
||||
|
||||
|
@ -800,8 +786,7 @@ ne_pcmcia_detach(self, flags)
|
|||
return (error);
|
||||
|
||||
/* Unmap our i/o windows. */
|
||||
pcmcia_io_unmap(psc->sc_pf, psc->sc_asic_io_window);
|
||||
pcmcia_io_unmap(psc->sc_pf, psc->sc_nic_io_window);
|
||||
pcmcia_io_unmap(psc->sc_pf, psc->sc_io_window);
|
||||
|
||||
/* Free our i/o space. */
|
||||
pcmcia_io_free(psc->sc_pf, &psc->sc_pcioh);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_sm_pcmcia.c,v 1.35 2004/08/08 15:44:13 mycroft Exp $ */
|
||||
/* $NetBSD: if_sm_pcmcia.c,v 1.36 2004/08/08 23:17:13 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -38,7 +38,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_sm_pcmcia.c,v 1.35 2004/08/08 15:44:13 mycroft Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_sm_pcmcia.c,v 1.36 2004/08/08 23:17:13 mycroft Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -177,8 +177,8 @@ sm_pcmcia_attach(parent, self, aux)
|
|||
sc->sc_enable = sm_pcmcia_enable;
|
||||
sc->sc_disable = sm_pcmcia_disable;
|
||||
|
||||
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_AUTO, 0, cfe->iospace[0].length,
|
||||
&psc->sc_pcioh, &psc->sc_io_window)) {
|
||||
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_AUTO, &psc->sc_pcioh,
|
||||
&psc->sc_io_window)) {
|
||||
aprint_error("%s: can't map i/o space\n", self->dv_xname);
|
||||
goto iomap_failed;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_tr_pcmcia.c,v 1.11 2002/10/02 16:52:16 thorpej Exp $ */
|
||||
/* $NetBSD: if_tr_pcmcia.c,v 1.12 2004/08/08 23:17:13 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
|
||||
|
@ -41,7 +41,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_tr_pcmcia.c,v 1.11 2002/10/02 16:52:16 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_tr_pcmcia.c,v 1.12 2004/08/08 23:17:13 mycroft Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -147,8 +147,8 @@ tr_pcmcia_attach(parent, self, aux)
|
|||
if (pcmcia_io_alloc(pa->pf, cfe->iospace[0].start,
|
||||
cfe->iospace[0].length, cfe->iospace[0].length, &psc->sc_pioh) != 0)
|
||||
printf(": can't allocate pio space\n");
|
||||
if (pcmcia_io_map(psc->sc_pf, PCMCIA_WIDTH_IO8, 0, /* XXX _AUTO? */
|
||||
cfe->iospace[0].length, &psc->sc_pioh, &psc->sc_pio_window) != 0) {
|
||||
if (pcmcia_io_map(psc->sc_pf, PCMCIA_WIDTH_IO8, /* XXX _AUTO? */
|
||||
&psc->sc_pioh, &psc->sc_pio_window) != 0) {
|
||||
printf(": can't map pio space\n");
|
||||
pcmcia_io_free(psc->sc_pf, &psc->sc_pioh);
|
||||
return;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_wi_pcmcia.c,v 1.47 2004/08/07 17:18:09 mycroft Exp $ */
|
||||
/* $NetBSD: if_wi_pcmcia.c,v 1.48 2004/08/08 23:17:13 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
|
@ -41,7 +41,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_wi_pcmcia.c,v 1.47 2004/08/07 17:18:09 mycroft Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_wi_pcmcia.c,v 1.48 2004/08/08 23:17:13 mycroft Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -335,8 +335,8 @@ wi_pcmcia_find(psc, pa, cfe)
|
|||
printf("%s: can't allocate i/o space\n", sc->sc_dev.dv_xname);
|
||||
goto fail1;
|
||||
}
|
||||
if (pcmcia_io_map(psc->sc_pf, PCMCIA_WIDTH_AUTO, 0,
|
||||
psc->sc_pcioh.size, &psc->sc_pcioh, &psc->sc_io_window) != 0) {
|
||||
if (pcmcia_io_map(psc->sc_pf, PCMCIA_WIDTH_AUTO, &psc->sc_pcioh,
|
||||
&psc->sc_io_window) != 0) {
|
||||
printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname);
|
||||
goto fail2;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
* Fritz!Card pcmcia specific routines for isic driver
|
||||
* ---------------------------------------------------
|
||||
*
|
||||
* $Id: isic_pcmcia_avm_fritz.c,v 1.5 2002/03/29 11:10:38 martin Exp $
|
||||
* $Id: isic_pcmcia_avm_fritz.c,v 1.6 2004/08/08 23:17:13 mycroft Exp $
|
||||
*
|
||||
* last edit-date: [Fri Jan 5 11:39:32 2001]
|
||||
*
|
||||
|
@ -43,7 +43,7 @@
|
|||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia_avm_fritz.c,v 1.5 2002/03/29 11:10:38 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia_avm_fritz.c,v 1.6 2004/08/08 23:17:13 mycroft Exp $");
|
||||
|
||||
#include "opt_isicpcmcia.h"
|
||||
#ifdef ISICPCMCIA_AVM_A1
|
||||
|
@ -440,8 +440,8 @@ isic_attach_fritzpcmcia(struct pcmcia_isic_softc *psc, struct pcmcia_config_entr
|
|||
|
||||
/* map the selected space */
|
||||
if (pcmcia_io_map(pa->pf, ((cfe->flags & PCMCIA_CFE_IO16) ?
|
||||
PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8), 0,
|
||||
cfe->iospace[i].length, &psc->sc_pcioh, &psc->sc_io_window)) {
|
||||
PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8), &psc->sc_pcioh,
|
||||
&psc->sc_io_window)) {
|
||||
printf(": can't map i/o space\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia_elsa_isdnmc.c,v 1.6 2003/12/04 13:57:31 keihan Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia_elsa_isdnmc.c,v 1.7 2004/08/08 23:17:13 mycroft Exp $");
|
||||
|
||||
#include "opt_isicpcmcia.h"
|
||||
#ifdef ISICPCMCIA_ELSA_ISDNMC
|
||||
|
@ -275,8 +275,8 @@ isic_attach_elsaisdnmc(struct pcmcia_isic_softc *psc, struct pcmcia_config_entry
|
|||
|
||||
/* map them */
|
||||
if (pcmcia_io_map(pa->pf, ((cfe->flags & PCMCIA_CFE_IO16) ?
|
||||
PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8), 0,
|
||||
cfe->iospace[0].length, &psc->sc_pcioh, &psc->sc_io_window)) {
|
||||
PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8), &psc->sc_pcioh,
|
||||
&psc->sc_io_window)) {
|
||||
printf(": can't map i/o space\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia_elsa_mcall.c,v 1.6 2003/12/04 13:57:31 keihan Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia_elsa_mcall.c,v 1.7 2004/08/08 23:17:13 mycroft Exp $");
|
||||
|
||||
#include "opt_isicpcmcia.h"
|
||||
#ifdef ISICPCMCIA_ELSA_MCALL
|
||||
|
@ -202,8 +202,8 @@ isic_attach_elsamcall(struct pcmcia_isic_softc *psc, struct pcmcia_config_entry
|
|||
|
||||
/* map them */
|
||||
if (pcmcia_io_map(pa->pf, ((cfe->flags & PCMCIA_CFE_IO16) ?
|
||||
PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8), 0,
|
||||
cfe->iospace[0].length, &psc->sc_pcioh, &psc->sc_io_window)) {
|
||||
PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8), &psc->sc_pcioh,
|
||||
&psc->sc_io_window)) {
|
||||
printf(": can't map i/o space\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia_sbspeedstar2.c,v 1.6 2003/12/04 13:57:31 keihan Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia_sbspeedstar2.c,v 1.7 2004/08/08 23:17:13 mycroft Exp $");
|
||||
|
||||
#include "opt_isicpcmcia.h"
|
||||
#ifdef ISICPCMCIA_SBSPEEDSTAR2
|
||||
|
@ -209,8 +209,8 @@ isic_attach_sbspeedstar2(struct pcmcia_isic_softc *psc, struct pcmcia_config_ent
|
|||
|
||||
/* map them */
|
||||
if (pcmcia_io_map(pa->pf, ((cfe->flags & PCMCIA_CFE_IO16) ?
|
||||
PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8), 0,
|
||||
cfe->iospace[0].length, &psc->sc_pcioh, &psc->sc_io_window)) {
|
||||
PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8), &psc->sc_pcioh,
|
||||
&psc->sc_io_window)) {
|
||||
printf(": can't map i/o space\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: mhzc.c,v 1.19 2004/08/08 15:12:20 mycroft Exp $ */
|
||||
/* $NetBSD: mhzc.c,v 1.20 2004/08/08 23:17:13 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -46,7 +46,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: mhzc.c,v 1.19 2004/08/08 15:12:20 mycroft Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: mhzc.c,v 1.20 2004/08/08 23:17:13 mycroft Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_ns.h"
|
||||
|
@ -693,8 +693,7 @@ com_mhzc_attach(parent, self, aux)
|
|||
|
||||
aprint_normal("\n");
|
||||
|
||||
if (pcmcia_io_map(msc->sc_pf, PCMCIA_WIDTH_IO8, 0,
|
||||
msc->sc_modem_pcioh.size, &msc->sc_modem_pcioh,
|
||||
if (pcmcia_io_map(msc->sc_pf, PCMCIA_WIDTH_IO8, &msc->sc_modem_pcioh,
|
||||
&msc->sc_modem_io_window)) {
|
||||
aprint_error("%s: unable to map I/O space\n",
|
||||
sc->sc_dev.dv_xname);
|
||||
|
@ -781,8 +780,7 @@ sm_mhzc_attach(parent, self, aux)
|
|||
|
||||
aprint_normal("\n");
|
||||
|
||||
if (pcmcia_io_map(msc->sc_pf, PCMCIA_WIDTH_AUTO, 0,
|
||||
msc->sc_ethernet_pcioh.size, &msc->sc_ethernet_pcioh,
|
||||
if (pcmcia_io_map(msc->sc_pf, PCMCIA_WIDTH_AUTO, &msc->sc_ethernet_pcioh,
|
||||
&msc->sc_ethernet_io_window)) {
|
||||
aprint_error("%s: unable to map I/O space\n",
|
||||
sc->sc_dev.dv_xname);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: nca_pcmcia.c,v 1.9 2002/10/02 16:52:19 thorpej Exp $ */
|
||||
/* $NetBSD: nca_pcmcia.c,v 1.10 2004/08/08 23:17:13 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: nca_pcmcia.c,v 1.9 2002/10/02 16:52:19 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: nca_pcmcia.c,v 1.10 2004/08/08 23:17:13 mycroft Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -143,8 +143,8 @@ nca_pcmcia_attach(parent, self, aux)
|
|||
}
|
||||
|
||||
/* Map in the I/O space */
|
||||
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_AUTO, 0, esc->sc_pcioh.size,
|
||||
&esc->sc_pcioh, &esc->sc_io_window)) {
|
||||
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_AUTO, &esc->sc_pcioh,
|
||||
&esc->sc_io_window)) {
|
||||
printf(": can't map i/o space\n");
|
||||
goto iomap_failed;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pcmcia.c,v 1.40 2004/08/08 05:33:04 mycroft Exp $ */
|
||||
/* $NetBSD: pcmcia.c,v 1.41 2004/08/08 23:17:13 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Marc Horowitz. All rights reserved.
|
||||
|
@ -30,7 +30,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pcmcia.c,v 1.40 2004/08/08 05:33:04 mycroft Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pcmcia.c,v 1.41 2004/08/08 23:17:13 mycroft Exp $");
|
||||
|
||||
#include "opt_pcmciaverbose.h"
|
||||
|
||||
|
@ -484,6 +484,18 @@ pcmcia_function_enable(pf)
|
|||
}
|
||||
}
|
||||
|
||||
if (pcmcia_mfc(pf->sc)) {
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_IOBASE0,
|
||||
(pf->pf_mfc_iobase[0] >> 0) & 0xff);
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_IOBASE1,
|
||||
(pf->pf_mfc_iobase[0] >> 8) & 0xff);
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_IOBASE2,
|
||||
(pf->pf_mfc_iobase[1] >> 0) & 0xff);
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_IOBASE3,
|
||||
(pf->pf_mfc_iobase[1] >> 8) & 0xff);
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_IOSIZE, pf->pf_mfc_iomask);
|
||||
}
|
||||
|
||||
reg = (pf->cfe->number & PCMCIA_CCR_OPTION_CFINDEX);
|
||||
reg |= PCMCIA_CCR_OPTION_LEVIREQ;
|
||||
if (pcmcia_mfc(pf->sc)) {
|
||||
|
@ -496,7 +508,6 @@ pcmcia_function_enable(pf)
|
|||
pcmcia_ccr_write(pf, PCMCIA_CCR_OPTION, reg);
|
||||
|
||||
reg = 0;
|
||||
|
||||
if ((pf->cfe->flags & PCMCIA_CFE_IO16) == 0)
|
||||
reg |= PCMCIA_CCR_STATUS_IOIS8;
|
||||
if (pf->cfe->flags & PCMCIA_CFE_AUDIO)
|
||||
|
@ -505,25 +516,6 @@ pcmcia_function_enable(pf)
|
|||
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_SOCKETCOPY, 0);
|
||||
|
||||
if (pcmcia_mfc(pf->sc)) {
|
||||
long tmp, iosize;
|
||||
|
||||
tmp = pf->pf_mfc_iomax - pf->pf_mfc_iobase;
|
||||
/* round up to nearest (2^n)-1 */
|
||||
for (iosize = 1; iosize < tmp; iosize <<= 1)
|
||||
;
|
||||
iosize--;
|
||||
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_IOBASE0,
|
||||
pf->pf_mfc_iobase & 0xff);
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_IOBASE1,
|
||||
(pf->pf_mfc_iobase >> 8) & 0xff);
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_IOBASE2, 0);
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_IOBASE3, 0);
|
||||
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_IOSIZE, iosize);
|
||||
}
|
||||
|
||||
#ifdef PCMCIADEBUG
|
||||
if (pcmcia_debug) {
|
||||
SIMPLEQ_FOREACH(tmp, &pf->sc->card.pf_head, pf_list) {
|
||||
|
@ -618,18 +610,16 @@ out:
|
|||
}
|
||||
|
||||
int
|
||||
pcmcia_io_map(pf, width, offset, size, pcihp, windowp)
|
||||
pcmcia_io_map(pf, width, pcihp, windowp)
|
||||
struct pcmcia_function *pf;
|
||||
int width;
|
||||
bus_addr_t offset;
|
||||
bus_size_t size;
|
||||
struct pcmcia_io_handle *pcihp;
|
||||
int *windowp;
|
||||
{
|
||||
int reg;
|
||||
|
||||
if (pcmcia_chip_io_map(pf->sc->pct, pf->sc->pch,
|
||||
width, offset, size, pcihp, windowp))
|
||||
width, 0, pcihp->size, pcihp, windowp))
|
||||
return (1);
|
||||
|
||||
/*
|
||||
|
@ -639,38 +629,31 @@ pcmcia_io_map(pf, width, offset, size, pcihp, windowp)
|
|||
*/
|
||||
|
||||
if (pcmcia_mfc(pf->sc)) {
|
||||
long tmp, iosize;
|
||||
int win;
|
||||
long iomask;
|
||||
|
||||
if (pf->pf_mfc_iomax == 0) {
|
||||
pf->pf_mfc_iobase = pcihp->addr + offset;
|
||||
pf->pf_mfc_iomax = pf->pf_mfc_iobase + size;
|
||||
} else {
|
||||
/* this makes the assumption that nothing overlaps */
|
||||
if (pf->pf_mfc_iobase > pcihp->addr + offset)
|
||||
pf->pf_mfc_iobase = pcihp->addr + offset;
|
||||
if (pf->pf_mfc_iomax < pcihp->addr + offset + size)
|
||||
pf->pf_mfc_iomax = pcihp->addr + offset + size;
|
||||
}
|
||||
|
||||
tmp = pf->pf_mfc_iomax - pf->pf_mfc_iobase;
|
||||
/* round up to nearest (2^n)-1 */
|
||||
for (iosize = 1; iosize >= tmp; iosize <<= 1)
|
||||
for (iomask = 1; iomask < pcihp->size; iomask <<= 1)
|
||||
;
|
||||
iosize--;
|
||||
iomask--;
|
||||
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_IOBASE0,
|
||||
pf->pf_mfc_iobase & 0xff);
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_IOBASE1,
|
||||
(pf->pf_mfc_iobase >> 8) & 0xff);
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_IOBASE2, 0);
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_IOBASE3, 0);
|
||||
win = pf->pf_mfc_windows;
|
||||
KASSERT(win < 2);
|
||||
printf("win %d = addr %lx size %lx iomask %lx\n", win, (long)pcihp->addr, (long)pcihp->size, (long)iomask);
|
||||
pf->pf_mfc_iobase[win] = pcihp->addr;
|
||||
pf->pf_mfc_iomask = iomask;
|
||||
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_IOSIZE, iosize);
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_IOBASE0 + 2 * win,
|
||||
(pcihp->addr >> 0) & 0xff);
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_IOBASE1 + 2 * win,
|
||||
(pcihp->addr >> 8) & 0xff);
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_IOSIZE, iomask);
|
||||
|
||||
reg = pcmcia_ccr_read(pf, PCMCIA_CCR_OPTION);
|
||||
reg |= PCMCIA_CCR_OPTION_ADDR_DECODE;
|
||||
pcmcia_ccr_write(pf, PCMCIA_CCR_OPTION, reg);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -680,9 +663,16 @@ pcmcia_io_unmap(pf, window)
|
|||
int window;
|
||||
{
|
||||
|
||||
pcmcia_chip_io_unmap(pf->sc->pct, pf->sc->pch, window);
|
||||
if (pcmcia_mfc(pf->sc)) {
|
||||
/*
|
||||
* Don't bother trying to unmap windows in the CCR here,
|
||||
* because we generally get called when a card has been
|
||||
* ejected, and the CCR isn't there any more.
|
||||
*/
|
||||
--pf->pf_mfc_windows;
|
||||
}
|
||||
|
||||
/* XXX Anything for multi-function cards? */
|
||||
pcmcia_chip_io_unmap(pf->sc->pct, pf->sc->pch, window);
|
||||
}
|
||||
|
||||
void *
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pcmciavar.h,v 1.20 2004/08/08 05:33:04 mycroft Exp $ */
|
||||
/* $NetBSD: pcmciavar.h,v 1.21 2004/08/08 23:17:13 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Marc Horowitz. All rights reserved.
|
||||
|
@ -139,8 +139,9 @@ struct pcmcia_function {
|
|||
#define pf_ccr_realsize pf_pcmh.realsize
|
||||
bus_size_t pf_ccr_offset;
|
||||
int pf_ccr_window;
|
||||
long pf_mfc_iobase;
|
||||
long pf_mfc_iomax;
|
||||
bus_addr_t pf_mfc_iobase[2];
|
||||
bus_size_t pf_mfc_iomask;
|
||||
int pf_mfc_windows;
|
||||
int (*ih_fct) __P((void *));
|
||||
void *ih_arg;
|
||||
int ih_ipl;
|
||||
|
@ -296,8 +297,8 @@ void pcmcia_function_disable __P((struct pcmcia_function *));
|
|||
#define pcmcia_io_free(pf, pciohp) \
|
||||
(pcmcia_chip_io_free((pf)->sc->pct, (pf)->sc->pch, (pciohp)))
|
||||
|
||||
int pcmcia_io_map __P((struct pcmcia_function *, int, bus_addr_t,
|
||||
bus_size_t, struct pcmcia_io_handle *, int *));
|
||||
int pcmcia_io_map __P((struct pcmcia_function *, int,
|
||||
struct pcmcia_io_handle *, int *));
|
||||
void pcmcia_io_unmap __P((struct pcmcia_function *, int));
|
||||
|
||||
void pcmcia_free_pf __P((struct pcmcia_function_head *));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pcmcom.c,v 1.14 2003/01/01 00:10:24 thorpej Exp $ */
|
||||
/* $NetBSD: pcmcom.c,v 1.15 2004/08/08 23:17:13 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -51,7 +51,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pcmcom.c,v 1.14 2003/01/01 00:10:24 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pcmcom.c,v 1.15 2004/08/08 23:17:13 mycroft Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -256,8 +256,8 @@ pcmcom_attach_slave(sc, slave)
|
|||
|
||||
printf("%s: slave %d", sc->sc_dev.dv_xname, slave);
|
||||
|
||||
if (pcmcia_io_map(sc->sc_pf, PCMCIA_WIDTH_IO8, 0, psi->psi_pcioh.size,
|
||||
&psi->psi_pcioh, &psi->psi_io_window)) {
|
||||
if (pcmcia_io_map(sc->sc_pf, PCMCIA_WIDTH_IO8, &psi->psi_pcioh,
|
||||
&psi->psi_io_window)) {
|
||||
printf(": can't map i/o space\n");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: spc_pcmcia.c,v 1.1 2004/07/07 08:47:22 mycroft Exp $ */
|
||||
/* $NetBSD: spc_pcmcia.c,v 1.2 2004/08/08 23:17:13 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000, 2004 The NetBSD Foundation, Inc.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: spc_pcmcia.c,v 1.1 2004/07/07 08:47:22 mycroft Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: spc_pcmcia.c,v 1.2 2004/08/08 23:17:13 mycroft Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -172,8 +172,8 @@ spc_pcmcia_attach(parent, self, aux)
|
|||
}
|
||||
|
||||
/* Map in the I/O space */
|
||||
if (pcmcia_io_map(pf, PCMCIA_WIDTH_AUTO, 0, sc->sc_pcioh.size,
|
||||
&sc->sc_pcioh, &sc->sc_io_window)) {
|
||||
if (pcmcia_io_map(pf, PCMCIA_WIDTH_AUTO, &sc->sc_pcioh,
|
||||
&sc->sc_io_window)) {
|
||||
printf("%s: can't map i/o space\n", self->dv_xname);
|
||||
goto iomap_failed;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: wdc_pcmcia.c,v 1.69 2004/07/07 06:43:22 mycroft Exp $ */
|
||||
/* $NetBSD: wdc_pcmcia.c,v 1.70 2004/08/08 23:17:13 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: wdc_pcmcia.c,v 1.69 2004/07/07 06:43:22 mycroft Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: wdc_pcmcia.c,v 1.70 2004/08/08 23:17:13 mycroft Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/device.h>
|
||||
|
@ -304,8 +304,8 @@ wdc_pcmcia_attach(parent, self, aux)
|
|||
|
||||
aprint_normal("%s: memory mapped mode\n", self->dv_xname);
|
||||
} else {
|
||||
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_AUTO, 0,
|
||||
sc->sc_pioh.size, &sc->sc_pioh, &sc->sc_iowindow)) {
|
||||
if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_AUTO, &sc->sc_pioh,
|
||||
&sc->sc_iowindow)) {
|
||||
aprint_error("%s: can't map first I/O space\n",
|
||||
self->dv_xname);
|
||||
goto map_failed;
|
||||
|
@ -314,8 +314,8 @@ wdc_pcmcia_attach(parent, self, aux)
|
|||
|
||||
if (cfe->num_iospace <= 1 || sc->sc_flags & WDC_PCMCIA_MEMMODE)
|
||||
sc->sc_auxiowindow = -1;
|
||||
else if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_AUTO, 0,
|
||||
sc->sc_auxpioh.size, &sc->sc_auxpioh, &sc->sc_auxiowindow)) {
|
||||
else if (pcmcia_io_map(pa->pf, PCMCIA_WIDTH_AUTO, &sc->sc_auxpioh,
|
||||
&sc->sc_auxiowindow)) {
|
||||
aprint_error("%s: can't map second I/O space\n",
|
||||
self->dv_xname);
|
||||
goto mapaux_failed;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: xirc.c,v 1.2 2004/08/08 07:25:20 mycroft Exp $ */
|
||||
/* $NetBSD: xirc.c,v 1.3 2004/08/08 23:17:13 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2004 The NetBSD Foundation, Inc.
|
||||
|
@ -38,7 +38,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: xirc.c,v 1.2 2004/08/08 07:25:20 mycroft Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: xirc.c,v 1.3 2004/08/08 23:17:13 mycroft Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_ns.h"
|
||||
|
@ -588,8 +588,7 @@ com_xirc_attach(parent, self, aux)
|
|||
|
||||
aprint_normal("\n");
|
||||
|
||||
if (pcmcia_io_map(msc->sc_pf, PCMCIA_WIDTH_IO8, 0,
|
||||
msc->sc_modem_pcioh.size, &msc->sc_modem_pcioh,
|
||||
if (pcmcia_io_map(msc->sc_pf, PCMCIA_WIDTH_IO8, &msc->sc_modem_pcioh,
|
||||
&msc->sc_modem_io_window)) {
|
||||
aprint_error("%s: unable to map I/O space\n", self->dv_xname);
|
||||
return;
|
||||
|
@ -674,8 +673,7 @@ xi_xirc_attach(parent, self, aux)
|
|||
|
||||
aprint_normal("\n");
|
||||
|
||||
if (pcmcia_io_map(msc->sc_pf, PCMCIA_WIDTH_AUTO, 0,
|
||||
msc->sc_ethernet_pcioh.size, &msc->sc_ethernet_pcioh,
|
||||
if (pcmcia_io_map(msc->sc_pf, PCMCIA_WIDTH_AUTO, &msc->sc_ethernet_pcioh,
|
||||
&msc->sc_ethernet_io_window)) {
|
||||
aprint_error("%s: unable to map I/O space\n", self->dv_xname);
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue