summaryrefslogtreecommitdiffstats
path: root/sys/dev/pccbb
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-10-11 04:30:59 +0000
committerimp <imp@FreeBSD.org>2002-10-11 04:30:59 +0000
commit23099be2876ab22cc7d3121b0ab55868266b4035 (patch)
treea755cb1e1a9dd14595e96f9787592991cb990f3d /sys/dev/pccbb
parent16ad96c43ce9e270c0bf2f3b58686de00fc36391 (diff)
downloadFreeBSD-src-23099be2876ab22cc7d3121b0ab55868266b4035.zip
FreeBSD-src-23099be2876ab22cc7d3121b0ab55868266b4035.tar.gz
o Set CBB_CARD_OK just before CARD_ATTACH_CARD. If ATTACH_CARD fails, then
clear the bit. This allows ata driver to attach its children because it needs the interrupts enabled to succeed. Submitted by: iwasaki-san o Spell CardBus as CardBus, not Cardbus or CardBUS while I'm here.
Diffstat (limited to 'sys/dev/pccbb')
-rw-r--r--sys/dev/pccbb/pccbb.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c
index d0b4067..bef8215 100644
--- a/sys/dev/pccbb/pccbb.c
+++ b/sys/dev/pccbb/pccbb.c
@@ -60,7 +60,7 @@
*/
/*
- * Driver for PCI to Cardbus Bridge chips
+ * Driver for PCI to CardBus Bridge chips
*
* References:
* TI Datasheets:
@@ -510,8 +510,8 @@ cbb_chipinit(struct cbb_softc *sc)
topic_common:;
/*
* At offset 0xa0: SLOT CONTROL
- * 0x80 Enable Cardbus Functionality
- * 0x40 Enable Cardbus and PC Card registers
+ * 0x80 Enable CardBus Functionality
+ * 0x40 Enable CardBus and PC Card registers
* 0x20 Lock ID in exca regs
* 0x10 Write protect ID in config regs
* Clear the rest of the bits, which defaults the slot
@@ -955,11 +955,12 @@ cbb_insert(struct cbb_softc *sc)
if (sockstate & CBB_SOCKET_STAT_16BIT) {
if (sc->pccarddev != NULL) {
sc->flags |= CBB_16BIT_CARD;
- if (CARD_ATTACH_CARD(sc->pccarddev) != 0)
+ sc->flags |= CBB_CARD_OK;
+ if (CARD_ATTACH_CARD(sc->pccarddev) != 0) {
device_printf(sc->dev,
"PC Card card activation failed\n");
- else
- sc->flags |= CBB_CARD_OK;
+ sc->flags &= ~CBB_CARD_OK;
+ }
} else {
device_printf(sc->dev,
"PC Card inserted, but no pccard bus.\n");
@@ -967,14 +968,15 @@ cbb_insert(struct cbb_softc *sc)
} else if (sockstate & CBB_SOCKET_STAT_CB) {
if (sc->cbdev != NULL) {
sc->flags &= ~CBB_16BIT_CARD;
- if (CARD_ATTACH_CARD(sc->cbdev) != 0)
+ sc->flags |= CBB_CARD_OK;
+ if (CARD_ATTACH_CARD(sc->cbdev) != 0) {
device_printf(sc->dev,
"CardBus card activation failed\n");
- else
- sc->flags |= CBB_CARD_OK;
+ sc->flags &= ~CBB_CARD_OK;
+ }
} else {
device_printf(sc->dev,
- "CardBUS card inserted, but no cardbus bus.\n");
+ "CardBus card inserted, but no cardbus bus.\n");
}
} else {
/*
@@ -1233,7 +1235,7 @@ cbb_do_power(device_t brdev)
}
/************************************************************************/
-/* Cardbus power functions */
+/* CardBus power functions */
/************************************************************************/
static void
@@ -1281,7 +1283,7 @@ cbb_cardbus_power_disable_socket(device_t brdev, device_t child)
}
/************************************************************************/
-/* Cardbus Resource */
+/* CardBus Resource */
/************************************************************************/
static int
OpenPOWER on IntegriCloud