From 23099be2876ab22cc7d3121b0ab55868266b4035 Mon Sep 17 00:00:00 2001 From: imp Date: Fri, 11 Oct 2002 04:30:59 +0000 Subject: 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. --- sys/dev/pccbb/pccbb.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'sys/dev/pccbb') 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 -- cgit v1.1