Module Name: src
Committed By: dyoung
Date: Thu Feb 25 23:40:39 UTC 2010
Modified Files:
src/sys/dev/cardbus: adv_cardbus.c ahc_cardbus.c com_cardbus.c
ehci_cardbus.c fwohci_cardbus.c if_ath_cardbus.c if_atw_cardbus.c
if_ex_cardbus.c if_fxp_cardbus.c if_ral_cardbus.c if_re_cardbus.c
if_rtk_cardbus.c if_tlp_cardbus.c njata_cardbus.c njs_cardbus.c
ohci_cardbus.c rbus_ppb.c uhci_cardbus.c
src/sys/dev/ic: i82557.c i82557var.h
Log Message:
Make fxp at cardbus detach during shutdown.
Stop calling (*cardbus_ctrl) to enable bus mastering, I/O and memory
spaces on the CardBus bridge. cbb(4) always enables that stuff,
anyway. In the process, avoid remembering what BAR we mapped by
writing CARDBUS_{IO,MEM}_ENABLE to sc_cben or sc_cbenable, and
record the BAR in use sc_bar, instead.
Replace more CARDBUS_ constants with PCI_ constants.
Compile-tested, only.
To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/cardbus/adv_cardbus.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/cardbus/ahc_cardbus.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/cardbus/com_cardbus.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/cardbus/ehci_cardbus.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/cardbus/fwohci_cardbus.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/cardbus/if_ath_cardbus.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/cardbus/if_atw_cardbus.c
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/cardbus/if_ex_cardbus.c
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/cardbus/if_fxp_cardbus.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/cardbus/if_ral_cardbus.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/cardbus/if_re_cardbus.c
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/cardbus/if_rtk_cardbus.c
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/cardbus/if_tlp_cardbus.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/cardbus/njata_cardbus.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/cardbus/njs_cardbus.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/cardbus/ohci_cardbus.c \
src/sys/dev/cardbus/rbus_ppb.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/cardbus/uhci_cardbus.c
cvs rdiff -u -r1.131 -r1.132 src/sys/dev/ic/i82557.c
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/ic/i82557var.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/cardbus/adv_cardbus.c
diff -u src/sys/dev/cardbus/adv_cardbus.c:1.23 src/sys/dev/cardbus/adv_cardbus.c:1.24
--- src/sys/dev/cardbus/adv_cardbus.c:1.23 Wed Feb 24 19:52:51 2010
+++ src/sys/dev/cardbus/adv_cardbus.c Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: adv_cardbus.c,v 1.23 2010/02/24 19:52:51 dyoung Exp $ */
+/* $NetBSD: adv_cardbus.c,v 1.24 2010/02/25 23:40:39 dyoung Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adv_cardbus.c,v 1.23 2010/02/24 19:52:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adv_cardbus.c,v 1.24 2010/02/25 23:40:39 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -76,7 +76,7 @@
cardbus_devfunc_t sc_ct; /* our CardBus devfuncs */
pcitag_t sc_tag;
- int sc_cbenable; /* what CardBus access type to enable */
+ int sc_bar;
int sc_csr; /* CSR bits */
bus_size_t sc_size;
};
@@ -150,7 +150,6 @@
csc->sc_ct = ct;
csc->sc_tag = ca->ca_tag;
- csc->sc_cbenable = 0;
/*
* Map the device.
@@ -164,7 +163,7 @@
#ifdef ADV_CARDBUS_DEBUG
printf("%s: memio enabled\n", DEVNAME(sc));
#endif
- csc->sc_cbenable = CARDBUS_MEM_ENABLE;
+ csc->sc_bar = ADV_CARDBUS_MMBA;
csc->sc_csr |= PCI_COMMAND_MEM_ENABLE;
} else
#endif
@@ -173,17 +172,14 @@
#ifdef ADV_CARDBUS_DEBUG
printf("%s: io enabled\n", DEVNAME(sc));
#endif
- csc->sc_cbenable = CARDBUS_IO_ENABLE;
+ csc->sc_bar = ADV_CARDBUS_IOBA;
csc->sc_csr |= PCI_COMMAND_IO_ENABLE;
} else {
+ csc->sc_bar = 0;
aprint_error_dev(&sc->sc_dev, "unable to map device registers\n");
return;
}
- /* Make sure the right access type is on the CardBus bridge. */
- (*ct->ct_cf->cardbus_ctrl)(cc, csc->sc_cbenable);
- (*ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_BM_ENABLE);
-
/* Enable the appropriate bits in the PCI CSR. */
reg = cardbus_conf_read(cc, cf, ca->ca_tag, PCI_COMMAND_STATUS_REG);
reg &= ~(PCI_COMMAND_IO_ENABLE|PCI_COMMAND_MEM_ENABLE);
@@ -254,19 +250,10 @@
sc->sc_ih = 0;
}
- if (csc->sc_cbenable) {
-#ifdef ADV_CARDBUS_ALLOW_MEMIO
- if (csc->sc_cbenable == CARDBUS_MEM_ENABLE) {
- Cardbus_mapreg_unmap(csc->sc_ct, ADV_CARDBUS_MMBA,
- sc->sc_iot, sc->sc_ioh, csc->sc_size);
- } else {
-#endif
- Cardbus_mapreg_unmap(csc->sc_ct, ADV_CARDBUS_IOBA,
- sc->sc_iot, sc->sc_ioh, csc->sc_size);
-#ifdef ADV_CARDBUS_ALLOW_MEMIO
- }
-#endif
- csc->sc_cbenable = 0;
+ if (csc->sc_bar != 0) {
+ Cardbus_mapreg_unmap(csc->sc_ct, csc->sc_bar,
+ sc->sc_iot, sc->sc_ioh, csc->sc_size);
+ csc->sc_bar = 0;
}
return 0;
Index: src/sys/dev/cardbus/ahc_cardbus.c
diff -u src/sys/dev/cardbus/ahc_cardbus.c:1.30 src/sys/dev/cardbus/ahc_cardbus.c:1.31
--- src/sys/dev/cardbus/ahc_cardbus.c:1.30 Wed Feb 24 19:52:51 2010
+++ src/sys/dev/cardbus/ahc_cardbus.c Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: ahc_cardbus.c,v 1.30 2010/02/24 19:52:51 dyoung Exp $ */
+/* $NetBSD: ahc_cardbus.c,v 1.31 2010/02/25 23:40:39 dyoung Exp $ */
/*-
* Copyright (c) 2000, 2005 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahc_cardbus.c,v 1.30 2010/02/24 19:52:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahc_cardbus.c,v 1.31 2010/02/25 23:40:39 dyoung Exp $");
#include "opt_ahc_cardbus.h"
@@ -79,7 +79,7 @@
cardbus_devfunc_t sc_ct; /* our CardBus devfuncs */
pcitag_t sc_tag;
- int sc_cbenable; /* what CardBus access type to enable */
+ int sc_bar;
int sc_csr; /* CSR bits */
bus_size_t sc_size;
};
@@ -132,22 +132,19 @@
if (Cardbus_mapreg_map(csc->sc_ct, AHC_CARDBUS_MMBA,
PCI_MAPREG_TYPE_MEM|PCI_MAPREG_MEM_TYPE_32BIT, 0,
&bst, &bsh, NULL, &csc->sc_size) == 0) {
- csc->sc_cbenable = CARDBUS_MEM_ENABLE;
+ csc->sc_bar = AHC_CARDBUS_MMBA;
csc->sc_csr |= PCI_COMMAND_MEM_ENABLE;
} else if (Cardbus_mapreg_map(csc->sc_ct, AHC_CARDBUS_IOBA,
PCI_MAPREG_TYPE_IO, 0, &bst, &bsh, NULL, &csc->sc_size) == 0) {
- csc->sc_cbenable = CARDBUS_IO_ENABLE;
+ csc->sc_bar = AHC_CARDBUS_IOBA;
csc->sc_csr |= PCI_COMMAND_IO_ENABLE;
} else {
+ csc->sc_bar = 0;
printf("%s: unable to map device registers\n",
ahc_name(ahc));
return;
}
- /* Make sure the right access type is on the CardBus bridge. */
- (*ct->ct_cf->cardbus_ctrl)(cc, csc->sc_cbenable);
- (*ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_BM_ENABLE);
-
/* Enable the appropriate bits in the PCI CSR. */
reg = cardbus_conf_read(cc, cf, ca->ca_tag, PCI_COMMAND_STATUS_REG);
reg &= ~(PCI_COMMAND_IO_ENABLE|PCI_COMMAND_MEM_ENABLE);
@@ -270,14 +267,10 @@
ahc->ih = 0;
}
- if (csc->sc_cbenable) {
- if (csc->sc_cbenable == CARDBUS_MEM_ENABLE)
- Cardbus_mapreg_unmap(csc->sc_ct, AHC_CARDBUS_MMBA,
- ahc->tag, ahc->bsh, csc->sc_size);
- else if (csc->sc_cbenable == CARDBUS_IO_ENABLE)
- Cardbus_mapreg_unmap(csc->sc_ct, AHC_CARDBUS_IOBA,
- ahc->tag, ahc->bsh, csc->sc_size);
- csc->sc_cbenable = 0;
+ if (csc->sc_bar != 0) {
+ Cardbus_mapreg_unmap(csc->sc_ct, csc->sc_bar,
+ ahc->tag, ahc->bsh, csc->sc_size);
+ csc->sc_bar = 0;
}
return (0);
Index: src/sys/dev/cardbus/com_cardbus.c
diff -u src/sys/dev/cardbus/com_cardbus.c:1.26 src/sys/dev/cardbus/com_cardbus.c:1.27
--- src/sys/dev/cardbus/com_cardbus.c:1.26 Thu Feb 25 22:31:51 2010
+++ src/sys/dev/cardbus/com_cardbus.c Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: com_cardbus.c,v 1.26 2010/02/25 22:31:51 dyoung Exp $ */
+/* $NetBSD: com_cardbus.c,v 1.27 2010/02/25 23:40:39 dyoung Exp $ */
/*
* Copyright (c) 2000 Johan Danielsson
@@ -40,7 +40,7 @@
updated below. */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com_cardbus.c,v 1.26 2010/02/25 22:31:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_cardbus.c,v 1.27 2010/02/25 23:40:39 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -64,7 +64,6 @@
pcireg_t cc_base;
bus_size_t cc_size;
pcireg_t cc_csr;
- int cc_cben;
pcitag_t cc_tag;
pcireg_t cc_reg;
int cc_type;
@@ -238,10 +237,8 @@
if(csc->cc_type == CARDBUS_MAPREG_TYPE_IO) {
csc->cc_base |= CARDBUS_MAPREG_TYPE_IO;
csc->cc_csr |= CARDBUS_COMMAND_IO_ENABLE;
- csc->cc_cben = CARDBUS_IO_ENABLE;
} else {
csc->cc_csr |= CARDBUS_COMMAND_MEM_ENABLE;
- csc->cc_cben = CARDBUS_MEM_ENABLE;
}
sc->sc_frequency = COM_FREQ;
@@ -273,10 +270,6 @@
Cardbus_conf_write(ct, csc->cc_tag, csc->cc_reg, csc->cc_base);
- /* enable accesses on cardbus bridge */
- (*cf->cardbus_ctrl)(cc, csc->cc_cben);
- (*cf->cardbus_ctrl)(cc, CARDBUS_BM_ENABLE);
-
/* and the card itself */
reg = Cardbus_conf_read(ct, csc->cc_tag, CARDBUS_COMMAND_STATUS_REG);
reg &= ~(CARDBUS_COMMAND_IO_ENABLE | CARDBUS_COMMAND_MEM_ENABLE);
Index: src/sys/dev/cardbus/ehci_cardbus.c
diff -u src/sys/dev/cardbus/ehci_cardbus.c:1.25 src/sys/dev/cardbus/ehci_cardbus.c:1.26
--- src/sys/dev/cardbus/ehci_cardbus.c:1.25 Wed Feb 24 19:52:51 2010
+++ src/sys/dev/cardbus/ehci_cardbus.c Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: ehci_cardbus.c,v 1.25 2010/02/24 19:52:51 dyoung Exp $ */
+/* $NetBSD: ehci_cardbus.c,v 1.26 2010/02/25 23:40:39 dyoung Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci_cardbus.c,v 1.25 2010/02/24 19:52:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci_cardbus.c,v 1.26 2010/02/25 23:40:39 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -162,8 +162,6 @@
#else
XXX (ct->ct_cf->cardbus_mem_open)(cc, 0, iob, iob + 0x40);
#endif
- (ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_MEM_ENABLE);
- (ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_BM_ENABLE);
/* Enable the device. */
csr = cardbus_conf_read(cc, cf, ca->ca_tag,
Index: src/sys/dev/cardbus/fwohci_cardbus.c
diff -u src/sys/dev/cardbus/fwohci_cardbus.c:1.28 src/sys/dev/cardbus/fwohci_cardbus.c:1.29
--- src/sys/dev/cardbus/fwohci_cardbus.c:1.28 Wed Feb 24 19:52:51 2010
+++ src/sys/dev/cardbus/fwohci_cardbus.c Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: fwohci_cardbus.c,v 1.28 2010/02/24 19:52:51 dyoung Exp $ */
+/* $NetBSD: fwohci_cardbus.c,v 1.29 2010/02/25 23:40:39 dyoung Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fwohci_cardbus.c,v 1.28 2010/02/24 19:52:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwohci_cardbus.c,v 1.29 2010/02/25 23:40:39 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -123,8 +123,6 @@
#else
XXX (ct->ct_cf->cardbus_mem_open)(cc, 0, iob, iob + 0x40);
#endif
- (ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_MEM_ENABLE);
- (ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_BM_ENABLE);
/* Disable interrupts, so we don't get any spurious ones. */
OHCI_CSR_WRITE(&sc->sc_sc, FWOHCI_INTMASKCLR, OHCI_INT_EN);
Index: src/sys/dev/cardbus/if_ath_cardbus.c
diff -u src/sys/dev/cardbus/if_ath_cardbus.c:1.39 src/sys/dev/cardbus/if_ath_cardbus.c:1.40
--- src/sys/dev/cardbus/if_ath_cardbus.c:1.39 Wed Feb 24 19:52:51 2010
+++ src/sys/dev/cardbus/if_ath_cardbus.c Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ath_cardbus.c,v 1.39 2010/02/24 19:52:51 dyoung Exp $ */
+/* $NetBSD: if_ath_cardbus.c,v 1.40 2010/02/25 23:40:39 dyoung Exp $ */
/*
* Copyright (c) 2003
* Ichiro FUKUHARA <[email protected]>.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ath_cardbus.c,v 1.39 2010/02/24 19:52:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ath_cardbus.c,v 1.40 2010/02/25 23:40:39 dyoung Exp $");
#include "opt_inet.h"
@@ -254,8 +254,6 @@
ath_cardbus_setup(struct ath_cardbus_softc *csc)
{
cardbus_devfunc_t ct = csc->sc_ct;
- cardbus_chipset_tag_t cc = ct->ct_cc;
- cardbus_function_tag_t cf = ct->ct_cf;
int rc;
pcireg_t reg;
@@ -263,11 +261,11 @@
aprint_debug("%s: cardbus_set_powerstate %d\n", __func__, rc);
/* Program the BAR. */
- cardbus_conf_write(cc, cf, csc->sc_tag, ATH_PCI_MMBA, csc->sc_bar_val);
+ Cardbus_conf_write(ct, csc->sc_tag, ATH_PCI_MMBA, csc->sc_bar_val);
/* Enable the appropriate bits in the PCI CSR. */
- reg = cardbus_conf_read(cc, cf, csc->sc_tag,
+ reg = Cardbus_conf_read(ct, csc->sc_tag,
PCI_COMMAND_STATUS_REG);
reg |= PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_MEM_ENABLE;
- cardbus_conf_write(cc, cf, csc->sc_tag, PCI_COMMAND_STATUS_REG, reg);
+ Cardbus_conf_write(ct, csc->sc_tag, PCI_COMMAND_STATUS_REG, reg);
}
Index: src/sys/dev/cardbus/if_atw_cardbus.c
diff -u src/sys/dev/cardbus/if_atw_cardbus.c:1.31 src/sys/dev/cardbus/if_atw_cardbus.c:1.32
--- src/sys/dev/cardbus/if_atw_cardbus.c:1.31 Wed Feb 24 23:38:40 2010
+++ src/sys/dev/cardbus/if_atw_cardbus.c Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: if_atw_cardbus.c,v 1.31 2010/02/24 23:38:40 dyoung Exp $ */
+/* $NetBSD: if_atw_cardbus.c,v 1.32 2010/02/25 23:40:39 dyoung Exp $ */
/*-
* Copyright (c) 1999, 2000, 2003 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_atw_cardbus.c,v 1.31 2010/02/24 23:38:40 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_atw_cardbus.c,v 1.32 2010/02/25 23:40:39 dyoung Exp $");
#include "opt_inet.h"
@@ -100,7 +100,6 @@
* region
*/
- int sc_cben; /* CardBus enables */
int sc_bar_reg; /* which BAR to use */
pcireg_t sc_bar_val; /* value of the BAR */
@@ -200,15 +199,17 @@
#if 0
printf("%s: signature %08x\n", device_xname(self),
(rev >> 4) & 0xf, rev & 0xf,
- cardbus_conf_read(ct->ct_cc, ct->ct_cf, csc->sc_tag, 0x80));
+ Cardbus_conf_read(ct, csc->sc_tag, 0x80));
#endif
/*
* Map the device.
*/
- csc->sc_csr = CARDBUS_COMMAND_MASTER_ENABLE;
+ csc->sc_csr = PCI_COMMAND_MASTER_ENABLE |
+ PCI_COMMAND_PARITY_ENABLE |
+ PCI_COMMAND_SERR_ENABLE;
if (Cardbus_mapreg_map(ct, ATW_PCI_MMBA,
- CARDBUS_MAPREG_TYPE_MEM, 0, &sc->sc_st, &sc->sc_sh, &adr,
+ PCI_MAPREG_TYPE_MEM, 0, &sc->sc_st, &sc->sc_sh, &adr,
&csc->sc_mapsize) == 0) {
#if 0
printf("%s: atw_cardbus_attach mapped %d bytes mem space\n",
@@ -218,12 +219,11 @@
#else
(*ct->ct_cf->cardbus_mem_open)(cc, 0, adr, adr+csc->sc_mapsize);
#endif
- csc->sc_cben = CARDBUS_MEM_ENABLE;
- csc->sc_csr |= CARDBUS_COMMAND_MEM_ENABLE;
+ csc->sc_csr |= PCI_COMMAND_MEM_ENABLE;
csc->sc_bar_reg = ATW_PCI_MMBA;
- csc->sc_bar_val = adr | CARDBUS_MAPREG_TYPE_MEM;
+ csc->sc_bar_val = adr | PCI_MAPREG_TYPE_MEM;
} else if (Cardbus_mapreg_map(ct, ATW_PCI_IOBA,
- CARDBUS_MAPREG_TYPE_IO, 0, &sc->sc_st, &sc->sc_sh, &adr,
+ PCI_MAPREG_TYPE_IO, 0, &sc->sc_st, &sc->sc_sh, &adr,
&csc->sc_mapsize) == 0) {
#if 0
printf("%s: atw_cardbus_attach mapped %d bytes I/O space\n",
@@ -233,10 +233,9 @@
#else
(*ct->ct_cf->cardbus_io_open)(cc, 0, adr, adr+csc->sc_mapsize);
#endif
- csc->sc_cben = CARDBUS_IO_ENABLE;
- csc->sc_csr |= CARDBUS_COMMAND_IO_ENABLE;
+ csc->sc_csr |= PCI_COMMAND_IO_ENABLE;
csc->sc_bar_reg = ATW_PCI_IOBA;
- csc->sc_bar_val = adr | CARDBUS_MAPREG_TYPE_IO;
+ csc->sc_bar_val = adr | PCI_MAPREG_TYPE_IO;
} else {
aprint_error_dev(self, "unable to map device registers\n");
return;
@@ -362,8 +361,6 @@
atw_cardbus_setup(struct atw_cardbus_softc *csc)
{
cardbus_devfunc_t ct = csc->sc_ct;
- cardbus_chipset_tag_t cc = ct->ct_cc;
- cardbus_function_tag_t cf = ct->ct_cf;
pcireg_t csr;
int rc;
@@ -371,18 +368,12 @@
aprint_debug("%s: cardbus_set_powerstate %d\n", __func__, rc);
/* Program the BAR. */
- cardbus_conf_write(cc, cf, csc->sc_tag, csc->sc_bar_reg,
+ Cardbus_conf_write(ct, csc->sc_tag, csc->sc_bar_reg,
csc->sc_bar_val);
- /* Make sure the right access type is on the CardBus bridge. */
- (*ct->ct_cf->cardbus_ctrl)(cc, csc->sc_cben);
- (*ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_BM_ENABLE);
-
/* Enable the appropriate bits in the PCI CSR. */
- csr = cardbus_conf_read(cc, cf, csc->sc_tag,
- CARDBUS_COMMAND_STATUS_REG);
- csr &= ~(CARDBUS_COMMAND_IO_ENABLE|CARDBUS_COMMAND_MEM_ENABLE);
+ csr = Cardbus_conf_read(ct, csc->sc_tag, PCI_COMMAND_STATUS_REG);
+ csr &= ~(PCI_COMMAND_IO_ENABLE|PCI_COMMAND_MEM_ENABLE);
csr |= csc->sc_csr;
- cardbus_conf_write(cc, cf, csc->sc_tag, CARDBUS_COMMAND_STATUS_REG,
- csr);
+ Cardbus_conf_write(ct, csc->sc_tag, PCI_COMMAND_STATUS_REG, csr);
}
Index: src/sys/dev/cardbus/if_ex_cardbus.c
diff -u src/sys/dev/cardbus/if_ex_cardbus.c:1.47 src/sys/dev/cardbus/if_ex_cardbus.c:1.48
--- src/sys/dev/cardbus/if_ex_cardbus.c:1.47 Wed Feb 24 19:52:51 2010
+++ src/sys/dev/cardbus/if_ex_cardbus.c Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ex_cardbus.c,v 1.47 2010/02/24 19:52:51 dyoung Exp $ */
+/* $NetBSD: if_ex_cardbus.c,v 1.48 2010/02/25 23:40:39 dyoung Exp $ */
/*
* Copyright (c) 1998 and 1999
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ex_cardbus.c,v 1.47 2010/02/24 19:52:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ex_cardbus.c,v 1.48 2010/02/25 23:40:39 dyoung Exp $");
/* #define EX_DEBUG 4 */ /* define to report information for debugging */
@@ -388,7 +388,6 @@
cardbus_conf_write(cc, cf, csc->sc_tag,
csc->sc_bar_reg, csc->sc_bar_val);
/* Make sure the right access type is on the CardBus bridge. */
- (ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_IO_ENABLE);
if (csc->sc_cardtype == EX_CB_CYCLONE) {
/* Program the BAR */
cardbus_conf_write(cc, cf, csc->sc_tag,
@@ -398,9 +397,7 @@
* memory access is enabled by BIOS, but some BIOSes do not
* enable it.
*/
- (ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_MEM_ENABLE);
}
- (ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_BM_ENABLE);
/* Enable the appropriate bits in the CARDBUS CSR. */
reg = cardbus_conf_read(cc, cf, csc->sc_tag,
Index: src/sys/dev/cardbus/if_fxp_cardbus.c
diff -u src/sys/dev/cardbus/if_fxp_cardbus.c:1.44 src/sys/dev/cardbus/if_fxp_cardbus.c:1.45
--- src/sys/dev/cardbus/if_fxp_cardbus.c:1.44 Thu Feb 25 22:31:51 2010
+++ src/sys/dev/cardbus/if_fxp_cardbus.c Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: if_fxp_cardbus.c,v 1.44 2010/02/25 22:31:51 dyoung Exp $ */
+/* $NetBSD: if_fxp_cardbus.c,v 1.45 2010/02/25 23:40:39 dyoung Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_fxp_cardbus.c,v 1.44 2010/02/25 22:31:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_fxp_cardbus.c,v 1.45 2010/02/25 23:40:39 dyoung Exp $");
#include "opt_inet.h"
#include "rnd.h"
@@ -95,11 +95,11 @@
pcitag_t tag;
pcireg_t base0_reg;
pcireg_t base1_reg;
- bus_size_t size;
};
-CFATTACH_DECL_NEW(fxp_cardbus, sizeof(struct fxp_cardbus_softc),
- fxp_cardbus_match, fxp_cardbus_attach, fxp_cardbus_detach, fxp_activate);
+CFATTACH_DECL3_NEW(fxp_cardbus, sizeof(struct fxp_cardbus_softc),
+ fxp_cardbus_match, fxp_cardbus_attach, fxp_cardbus_detach, fxp_activate,
+ NULL, null_childdetached, DVF_DETACH_SHUTDOWN);
#ifdef CBB_DEBUG
#define DPRINTF(X) printf X
@@ -131,7 +131,6 @@
bus_space_handle_t ioh, memh;
bus_addr_t adr;
- bus_size_t size;
sc->sc_dev = self;
csc->intrline = ca->ca_intrline;
@@ -142,18 +141,16 @@
* Map control/status registers.
*/
if (Cardbus_mapreg_map(csc->ct, CARDBUS_BASE1_REG,
- PCI_MAPREG_TYPE_IO, 0, &iot, &ioh, &adr, &size) == 0) {
+ PCI_MAPREG_TYPE_IO, 0, &iot, &ioh, &adr, &sc->sc_size) == 0) {
csc->base1_reg = adr | 1;
sc->sc_st = iot;
sc->sc_sh = ioh;
- csc->size = size;
} else if (Cardbus_mapreg_map(csc->ct, CARDBUS_BASE0_REG,
PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT,
- 0, &memt, &memh, &adr, &size) == 0) {
+ 0, &memt, &memh, &adr, &sc->sc_size) == 0) {
csc->base0_reg = adr;
sc->sc_st = memt;
sc->sc_sh = memh;
- csc->size = size;
} else
panic("%s: failed to allocate mem and io space", __func__);
@@ -192,8 +189,6 @@
fxp_cardbus_setup(struct fxp_softc * sc)
{
struct fxp_cardbus_softc *csc = (struct fxp_cardbus_softc *)sc;
- cardbus_chipset_tag_t cc = csc->ct->ct_cc;
- cardbus_function_tag_t cf = csc->ct->ct_cf;
pcireg_t command;
pcitag_t tag = csc->tag;
@@ -202,19 +197,15 @@
if (csc->base0_reg) {
Cardbus_conf_write(csc->ct, tag,
CARDBUS_BASE0_REG, csc->base0_reg);
- (cf->cardbus_ctrl) (cc, CARDBUS_MEM_ENABLE);
command |= CARDBUS_COMMAND_MEM_ENABLE |
CARDBUS_COMMAND_MASTER_ENABLE;
} else if (csc->base1_reg) {
Cardbus_conf_write(csc->ct, tag,
CARDBUS_BASE1_REG, csc->base1_reg);
- (cf->cardbus_ctrl) (cc, CARDBUS_IO_ENABLE);
command |= (CARDBUS_COMMAND_IO_ENABLE |
CARDBUS_COMMAND_MASTER_ENABLE);
}
- (cf->cardbus_ctrl) (cc, CARDBUS_BM_ENABLE);
-
/* enable the card */
Cardbus_conf_write(csc->ct, tag, CARDBUS_COMMAND_STATUS_REG, command);
}
@@ -269,21 +260,20 @@
panic("%s: data structure lacks", device_xname(self));
#endif
- rv = fxp_detach(sc);
- if (rv == 0) {
- /*
- * Unhook the interrupt handler.
- */
- cardbus_intr_disestablish(ct->ct_cc, ct->ct_cf, sc->sc_ih);
-
- /*
- * release bus space and close window
- */
- if (csc->base0_reg)
- reg = CARDBUS_BASE0_REG;
- else
- reg = CARDBUS_BASE1_REG;
- Cardbus_mapreg_unmap(ct, reg, sc->sc_st, sc->sc_sh, csc->size);
- }
- return (rv);
+ if ((rv = fxp_detach(sc, flags)) != 0)
+ return rv;
+ /*
+ * Unhook the interrupt handler.
+ */
+ cardbus_intr_disestablish(ct->ct_cc, ct->ct_cf, sc->sc_ih);
+
+ /*
+ * release bus space and close window
+ */
+ if (csc->base0_reg)
+ reg = CARDBUS_BASE0_REG;
+ else
+ reg = CARDBUS_BASE1_REG;
+ Cardbus_mapreg_unmap(ct, reg, sc->sc_st, sc->sc_sh, sc->sc_size);
+ return 0;
}
Index: src/sys/dev/cardbus/if_ral_cardbus.c
diff -u src/sys/dev/cardbus/if_ral_cardbus.c:1.18 src/sys/dev/cardbus/if_ral_cardbus.c:1.19
--- src/sys/dev/cardbus/if_ral_cardbus.c:1.18 Wed Feb 24 19:52:51 2010
+++ src/sys/dev/cardbus/if_ral_cardbus.c Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ral_cardbus.c,v 1.18 2010/02/24 19:52:51 dyoung Exp $ */
+/* $NetBSD: if_ral_cardbus.c,v 1.19 2010/02/25 23:40:39 dyoung Exp $ */
/* $OpenBSD: if_ral_cardbus.c,v 1.6 2006/01/09 20:03:31 damien Exp $ */
/*-
@@ -22,7 +22,7 @@
* CardBus front-end for the Ralink RT2560/RT2561/RT2561S/RT2661 driver.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ral_cardbus.c,v 1.18 2010/02/24 19:52:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ral_cardbus.c,v 1.19 2010/02/25 23:40:39 dyoung Exp $");
#include <sys/param.h>
@@ -260,10 +260,6 @@
cardbus_conf_write(cc, cf, csc->sc_tag, CARDBUS_BASE0_REG,
csc->sc_bar_val);
- /* make sure the right access type is on the cardbus bridge */
- (*cf->cardbus_ctrl)(cc, CARDBUS_MEM_ENABLE);
- (*cf->cardbus_ctrl)(cc, CARDBUS_BM_ENABLE);
-
/* enable the appropriate bits in the PCI CSR */
reg = cardbus_conf_read(cc, cf, csc->sc_tag,
CARDBUS_COMMAND_STATUS_REG);
Index: src/sys/dev/cardbus/if_re_cardbus.c
diff -u src/sys/dev/cardbus/if_re_cardbus.c:1.21 src/sys/dev/cardbus/if_re_cardbus.c:1.22
--- src/sys/dev/cardbus/if_re_cardbus.c:1.21 Wed Feb 24 19:52:51 2010
+++ src/sys/dev/cardbus/if_re_cardbus.c Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: if_re_cardbus.c,v 1.21 2010/02/24 19:52:51 dyoung Exp $ */
+/* $NetBSD: if_re_cardbus.c,v 1.22 2010/02/25 23:40:39 dyoung Exp $ */
/*
* Copyright (c) 2004 Jonathan Stone
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_re_cardbus.c,v 1.21 2010/02/24 19:52:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_re_cardbus.c,v 1.22 2010/02/25 23:40:39 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -93,7 +93,6 @@
cardbus_devfunc_t sc_ct;
pcitag_t sc_tag;
int sc_csr;
- int sc_cben;
int sc_bar_reg;
pcireg_t sc_bar_val;
bus_size_t sc_mapsize;
@@ -176,7 +175,6 @@
#else
(*ct->ct_cf->cardbus_io_open)(cc, 0, adr, adr+csc->sc_mapsize);
#endif
- csc->sc_cben = CARDBUS_IO_ENABLE;
csc->sc_csr |= CARDBUS_COMMAND_IO_ENABLE;
csc->sc_bar_reg = RTK_PCI_LOIO;
csc->sc_bar_val = adr | CARDBUS_MAPREG_TYPE_IO;
@@ -188,7 +186,6 @@
#else
(*ct->ct_cf->cardbus_mem_open)(cc, 0, adr, adr+csc->sc_mapsize);
#endif
- csc->sc_cben = CARDBUS_MEM_ENABLE;
csc->sc_csr |= CARDBUS_COMMAND_MEM_ENABLE;
csc->sc_bar_reg = RTK_PCI_LOMEM;
csc->sc_bar_val = adr | CARDBUS_MAPREG_TYPE_MEM;
@@ -297,10 +294,6 @@
cardbus_conf_write(cc, cf, csc->sc_tag,
csc->sc_bar_reg, csc->sc_bar_val);
- /* Make sure the right access type is on the CardBus bridge. */
- (*ct->ct_cf->cardbus_ctrl)(cc, csc->sc_cben);
- (*ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_BM_ENABLE);
-
/* Enable the appropriate bits in the CARDBUS CSR. */
reg = cardbus_conf_read(cc, cf, csc->sc_tag,
CARDBUS_COMMAND_STATUS_REG);
Index: src/sys/dev/cardbus/if_rtk_cardbus.c
diff -u src/sys/dev/cardbus/if_rtk_cardbus.c:1.40 src/sys/dev/cardbus/if_rtk_cardbus.c:1.41
--- src/sys/dev/cardbus/if_rtk_cardbus.c:1.40 Wed Feb 24 19:52:51 2010
+++ src/sys/dev/cardbus/if_rtk_cardbus.c Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: if_rtk_cardbus.c,v 1.40 2010/02/24 19:52:51 dyoung Exp $ */
+/* $NetBSD: if_rtk_cardbus.c,v 1.41 2010/02/25 23:40:39 dyoung Exp $ */
/*
* Copyright (c) 2000 Masanori Kanaoka
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_rtk_cardbus.c,v 1.40 2010/02/24 19:52:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rtk_cardbus.c,v 1.41 2010/02/25 23:40:39 dyoung Exp $");
#include "opt_inet.h"
#include "rnd.h"
@@ -128,7 +128,6 @@
cardbus_devfunc_t sc_ct;
pcitag_t sc_tag;
int sc_csr;
- int sc_cben;
int sc_bar_reg;
pcireg_t sc_bar_val;
bus_size_t sc_mapsize;
@@ -212,7 +211,6 @@
#else
(*ct->ct_cf->cardbus_io_open)(cc, 0, adr, adr+csc->sc_mapsize);
#endif
- csc->sc_cben = CARDBUS_IO_ENABLE;
csc->sc_csr |= CARDBUS_COMMAND_IO_ENABLE;
csc->sc_bar_reg = RTK_PCI_LOIO;
csc->sc_bar_val = adr | CARDBUS_MAPREG_TYPE_IO;
@@ -224,7 +222,6 @@
#else
(*ct->ct_cf->cardbus_mem_open)(cc, 0, adr, adr+csc->sc_mapsize);
#endif
- csc->sc_cben = CARDBUS_MEM_ENABLE;
csc->sc_csr |= CARDBUS_COMMAND_MEM_ENABLE;
csc->sc_bar_reg = RTK_PCI_LOMEM;
csc->sc_bar_val = adr | CARDBUS_MAPREG_TYPE_MEM;
@@ -334,10 +331,6 @@
cardbus_conf_write(cc, cf, csc->sc_tag,
csc->sc_bar_reg, csc->sc_bar_val);
- /* Make sure the right access type is on the CardBus bridge. */
- (*ct->ct_cf->cardbus_ctrl)(cc, csc->sc_cben);
- (*ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_BM_ENABLE);
-
/* Enable the appropriate bits in the CARDBUS CSR. */
reg = cardbus_conf_read(cc, cf, csc->sc_tag,
CARDBUS_COMMAND_STATUS_REG);
Index: src/sys/dev/cardbus/if_tlp_cardbus.c
diff -u src/sys/dev/cardbus/if_tlp_cardbus.c:1.63 src/sys/dev/cardbus/if_tlp_cardbus.c:1.64
--- src/sys/dev/cardbus/if_tlp_cardbus.c:1.63 Wed Feb 24 19:52:51 2010
+++ src/sys/dev/cardbus/if_tlp_cardbus.c Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: if_tlp_cardbus.c,v 1.63 2010/02/24 19:52:51 dyoung Exp $ */
+/* $NetBSD: if_tlp_cardbus.c,v 1.64 2010/02/25 23:40:39 dyoung Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tlp_cardbus.c,v 1.63 2010/02/24 19:52:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tlp_cardbus.c,v 1.64 2010/02/25 23:40:39 dyoung Exp $");
#include "opt_inet.h"
@@ -100,7 +100,6 @@
bus_size_t sc_mapsize; /* the size of mapped bus space
region */
- int sc_cben; /* CardBus enables */
int sc_bar_reg; /* which BAR to use */
pcireg_t sc_bar_val; /* value of the BAR */
@@ -313,7 +312,6 @@
#else
(*ct->ct_cf->cardbus_mem_open)(cc, 0, adr, adr+csc->sc_mapsize);
#endif
- csc->sc_cben = CARDBUS_MEM_ENABLE;
csc->sc_csr |= CARDBUS_COMMAND_MEM_ENABLE;
csc->sc_bar_reg = TULIP_PCI_MMBA;
csc->sc_bar_val = adr | CARDBUS_MAPREG_TYPE_MEM;
@@ -324,7 +322,6 @@
#else
(*ct->ct_cf->cardbus_io_open)(cc, 0, adr, adr+csc->sc_mapsize);
#endif
- csc->sc_cben = CARDBUS_IO_ENABLE;
csc->sc_csr |= CARDBUS_COMMAND_IO_ENABLE;
csc->sc_bar_reg = TULIP_PCI_IOBA;
csc->sc_bar_val = adr | CARDBUS_MAPREG_TYPE_IO;
@@ -587,10 +584,6 @@
cardbus_conf_write(cc, cf, csc->sc_tag, csc->sc_bar_reg,
csc->sc_bar_val);
- /* Make sure the right access type is on the CardBus bridge. */
- (*ct->ct_cf->cardbus_ctrl)(cc, csc->sc_cben);
- (*ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_BM_ENABLE);
-
/* Enable the appropriate bits in the PCI CSR. */
reg = cardbus_conf_read(cc, cf, csc->sc_tag, PCI_COMMAND_STATUS_REG);
reg &= ~(PCI_COMMAND_IO_ENABLE|PCI_COMMAND_MEM_ENABLE);
Index: src/sys/dev/cardbus/njata_cardbus.c
diff -u src/sys/dev/cardbus/njata_cardbus.c:1.10 src/sys/dev/cardbus/njata_cardbus.c:1.11
--- src/sys/dev/cardbus/njata_cardbus.c:1.10 Thu Feb 25 21:18:35 2010
+++ src/sys/dev/cardbus/njata_cardbus.c Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $Id: njata_cardbus.c,v 1.10 2010/02/25 21:18:35 dyoung Exp $ */
+/* $Id: njata_cardbus.c,v 1.11 2010/02/25 23:40:39 dyoung Exp $ */
/*
* Copyright (c) 2006 ITOH Yasufumi <[email protected]>.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: njata_cardbus.c,v 1.10 2010/02/25 21:18:35 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: njata_cardbus.c,v 1.11 2010/02/25 23:40:39 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -171,7 +171,6 @@
#endif
csr |= PCI_COMMAND_MEM_ENABLE;
sc->sc_flags = NJATA32_MEM_MAPPED;
- (*ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_MEM_ENABLE);
} else {
try_io:
if (Cardbus_mapreg_map(csc->sc_ct, NJATA32_CARDBUS_BASEADDR_IO,
@@ -183,7 +182,6 @@
#endif
csr |= PCI_COMMAND_IO_ENABLE;
sc->sc_flags = NJATA32_IO_MAPPED;
- (*ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_IO_ENABLE);
} else {
aprint_error("%s: unable to map device registers\n",
NJATA32NAME(sc));
@@ -191,9 +189,6 @@
}
}
- /* Make sure the right access type is on the CardBus bridge. */
- (*ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_BM_ENABLE);
-
/* Enable the appropriate bits in the PCI CSR. */
reg = cardbus_conf_read(cc, cf, ca->ca_tag, PCI_COMMAND_STATUS_REG);
reg &= ~(PCI_COMMAND_IO_ENABLE|PCI_COMMAND_MEM_ENABLE);
Index: src/sys/dev/cardbus/njs_cardbus.c
diff -u src/sys/dev/cardbus/njs_cardbus.c:1.13 src/sys/dev/cardbus/njs_cardbus.c:1.14
--- src/sys/dev/cardbus/njs_cardbus.c:1.13 Thu Feb 25 21:18:35 2010
+++ src/sys/dev/cardbus/njs_cardbus.c Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: njs_cardbus.c,v 1.13 2010/02/25 21:18:35 dyoung Exp $ */
+/* $NetBSD: njs_cardbus.c,v 1.14 2010/02/25 23:40:39 dyoung Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: njs_cardbus.c,v 1.13 2010/02/25 21:18:35 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: njs_cardbus.c,v 1.14 2010/02/25 23:40:39 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -166,7 +166,6 @@
#endif
csr |= PCI_COMMAND_MEM_ENABLE;
sc->sc_flags = NJSC32_MEM_MAPPED;
- (*ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_MEM_ENABLE);
} else {
try_io:
if (Cardbus_mapreg_map(csc->sc_ct, NJSC32_CARDBUS_BASEADDR_IO,
@@ -177,16 +176,12 @@
#endif
csr |= PCI_COMMAND_IO_ENABLE;
sc->sc_flags = NJSC32_IO_MAPPED;
- (*ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_IO_ENABLE);
} else {
aprint_error_dev(self, "unable to map device registers\n");
return;
}
}
- /* Make sure the right access type is on the CardBus bridge. */
- (*ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_BM_ENABLE);
-
/* Enable the appropriate bits in the PCI CSR. */
reg = cardbus_conf_read(cc, cf, ca->ca_tag, PCI_COMMAND_STATUS_REG);
reg &= ~(PCI_COMMAND_IO_ENABLE|PCI_COMMAND_MEM_ENABLE);
Index: src/sys/dev/cardbus/ohci_cardbus.c
diff -u src/sys/dev/cardbus/ohci_cardbus.c:1.33 src/sys/dev/cardbus/ohci_cardbus.c:1.34
--- src/sys/dev/cardbus/ohci_cardbus.c:1.33 Wed Feb 24 19:52:52 2010
+++ src/sys/dev/cardbus/ohci_cardbus.c Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: ohci_cardbus.c,v 1.33 2010/02/24 19:52:52 dyoung Exp $ */
+/* $NetBSD: ohci_cardbus.c,v 1.34 2010/02/25 23:40:39 dyoung Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci_cardbus.c,v 1.33 2010/02/24 19:52:52 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci_cardbus.c,v 1.34 2010/02/25 23:40:39 dyoung Exp $");
#include "ehci_cardbus.h"
@@ -140,8 +140,6 @@
#else
XXX (ct->ct_cf->cardbus_mem_open)(cc, 0, iob, iob + 0x40);
#endif
- (ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_MEM_ENABLE);
- (ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_BM_ENABLE);
/* Enable the device. */
csr = cardbus_conf_read(cc, cf, ca->ca_tag,
Index: src/sys/dev/cardbus/rbus_ppb.c
diff -u src/sys/dev/cardbus/rbus_ppb.c:1.33 src/sys/dev/cardbus/rbus_ppb.c:1.34
--- src/sys/dev/cardbus/rbus_ppb.c:1.33 Thu Feb 25 20:36:31 2010
+++ src/sys/dev/cardbus/rbus_ppb.c Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: rbus_ppb.c,v 1.33 2010/02/25 20:36:31 dyoung Exp $ */
+/* $NetBSD: rbus_ppb.c,v 1.34 2010/02/25 23:40:39 dyoung Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rbus_ppb.c,v 1.33 2010/02/25 20:36:31 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rbus_ppb.c,v 1.34 2010/02/25 23:40:39 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -750,19 +750,15 @@
if (csc->base0_reg) {
Cardbus_conf_write(csc->ct, tag,
CARDBUS_BASE0_REG, csc->base0_reg);
- (cf->cardbus_ctrl) (cc, CARDBUS_MEM_ENABLE);
command |= CARDBUS_COMMAND_MEM_ENABLE |
CARDBUS_COMMAND_MASTER_ENABLE;
} else if (csc->base1_reg) {
Cardbus_conf_write(csc->ct, tag,
CARDBUS_BASE1_REG, csc->base1_reg);
- (cf->cardbus_ctrl) (cc, CARDBUS_IO_ENABLE);
command |= (CARDBUS_COMMAND_IO_ENABLE |
CARDBUS_COMMAND_MASTER_ENABLE);
}
- (cf->cardbus_ctrl) (cc, CARDBUS_BM_ENABLE);
-
/* enable the card */
Cardbus_conf_write(csc->ct, tag, CARDBUS_COMMAND_STATUS_REG, command);
#endif
Index: src/sys/dev/cardbus/uhci_cardbus.c
diff -u src/sys/dev/cardbus/uhci_cardbus.c:1.14 src/sys/dev/cardbus/uhci_cardbus.c:1.15
--- src/sys/dev/cardbus/uhci_cardbus.c:1.14 Wed Feb 24 19:52:52 2010
+++ src/sys/dev/cardbus/uhci_cardbus.c Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: uhci_cardbus.c,v 1.14 2010/02/24 19:52:52 dyoung Exp $ */
+/* $NetBSD: uhci_cardbus.c,v 1.15 2010/02/25 23:40:39 dyoung Exp $ */
/*
* Copyright (c) 1998-2005 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhci_cardbus.c,v 1.14 2010/02/24 19:52:52 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci_cardbus.c,v 1.15 2010/02/25 23:40:39 dyoung Exp $");
#include "ehci_cardbus.h"
@@ -131,8 +131,6 @@
#else
XXX (ct->ct_cf->cardbus_io_open)(cc, 0, iob, iob + 0x40);
#endif
- (ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_IO_ENABLE);
- (ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_BM_ENABLE);
/* Enable the device. */
csr = cardbus_conf_read(cc, cf, tag, CARDBUS_COMMAND_STATUS_REG);
Index: src/sys/dev/ic/i82557.c
diff -u src/sys/dev/ic/i82557.c:1.131 src/sys/dev/ic/i82557.c:1.132
--- src/sys/dev/ic/i82557.c:1.131 Tue Jan 19 22:06:24 2010
+++ src/sys/dev/ic/i82557.c Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: i82557.c,v 1.131 2010/01/19 22:06:24 pooka Exp $ */
+/* $NetBSD: i82557.c,v 1.132 2010/02/25 23:40:39 dyoung Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.131 2010/01/19 22:06:24 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.132 2010/02/25 23:40:39 dyoung Exp $");
#include "rnd.h"
@@ -2491,7 +2491,7 @@
* Detach an i82557 interface.
*/
int
-fxp_detach(struct fxp_softc *sc)
+fxp_detach(struct fxp_softc *sc, int flags)
{
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
int i;
Index: src/sys/dev/ic/i82557var.h
diff -u src/sys/dev/ic/i82557var.h:1.47 src/sys/dev/ic/i82557var.h:1.48
--- src/sys/dev/ic/i82557var.h:1.47 Tue May 12 14:25:17 2009
+++ src/sys/dev/ic/i82557var.h Thu Feb 25 23:40:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: i82557var.h,v 1.47 2009/05/12 14:25:17 cegger Exp $ */
+/* $NetBSD: i82557var.h,v 1.48 2010/02/25 23:40:39 dyoung Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999, 2001 The NetBSD Foundation, Inc.
@@ -166,6 +166,7 @@
device_t sc_dev;
bus_space_tag_t sc_st; /* bus space tag */
bus_space_handle_t sc_sh; /* bus space handle */
+ bus_size_t sc_size; /* bus space size */
bus_dma_tag_t sc_dmat; /* bus dma tag */
struct ethercom sc_ethercom; /* ethernet common part */
void *sc_ih; /* interrupt handler cookie */
@@ -365,7 +366,7 @@
void fxp_attach(struct fxp_softc *);
int fxp_activate(device_t, enum devact);
-int fxp_detach(struct fxp_softc *);
+int fxp_detach(struct fxp_softc *, int);
int fxp_intr(void *);
int fxp_enable(struct fxp_softc*);