diff options
author | imp <imp@FreeBSD.org> | 2003-02-14 06:21:51 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2003-02-14 06:21:51 +0000 |
commit | e2a6a01e2fed06763687989ffbd8d549de6d159f (patch) | |
tree | 8e5a07d6a20a402375289a0b38407f8beb51859c | |
parent | dd95a3a11a37cf4c36be6183eb8a6eb8fc340ed7 (diff) | |
download | FreeBSD-src-e2a6a01e2fed06763687989ffbd8d549de6d159f.zip FreeBSD-src-e2a6a01e2fed06763687989ffbd8d549de6d159f.tar.gz |
o transition from exca_write to exca_putb and read->getb. This is so that
we can have additional different types of bridges.
o remove now bogus comment.
o Don't clear CARD_OK when we can't attach a card.
o minor style nits
# this make kldload of cardbus drivers work for me when the card is
# present on boot.
-rw-r--r-- | sys/dev/pccbb/pccbb.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c index 3ee2a7f..f27e3b9 100644 --- a/sys/dev/pccbb/pccbb.c +++ b/sys/dev/pccbb/pccbb.c @@ -541,8 +541,8 @@ cbb_chipinit(struct cbb_softc *sc) * other is to set CSC to 0. Since both methods are mutually * compatible, we do both. */ - exca_write(&sc->exca, EXCA_INTR, EXCA_INTR_ENABLE); - exca_write(&sc->exca, EXCA_CSC_INTR, 0); + exca_putb(&sc->exca, EXCA_INTR, EXCA_INTR_ENABLE); + exca_putb(&sc->exca, EXCA_CSC_INTR, 0); /* close all memory and io windows */ pci_write_config(sc->dev, CBBR_MEMBASE0, 0xffffffff, 4); @@ -633,6 +633,7 @@ cbb_attach(device_t brdev) sc->bsh = rman_get_bushandle(sc->base_res); exca_init(&sc->exca, brdev, sc->bst, sc->bsh, CBB_EXCA_OFFSET); sc->exca.flags |= EXCA_HAS_MEMREG_WIN; + sc->exca.chipset = EXCA_CARDBUS; cbb_chipinit(sc); /* attach children */ @@ -762,7 +763,7 @@ cbb_shutdown(device_t brdev) cbb_power(brdev, CARD_VCC_0V | CARD_VPP_0V); - exca_write(&sc->exca, EXCA_ADDRWIN_ENABLE, 0); + exca_putb(&sc->exca, EXCA_ADDRWIN_ENABLE, 0); pci_write_config(brdev, CBBR_MEMBASE0, 0, 4); pci_write_config(brdev, CBBR_MEMLIMIT0, 0, 4); pci_write_config(brdev, CBBR_MEMBASE1, 0, 4); @@ -798,10 +799,6 @@ cbb_setup_intr(device_t dev, device_t child, struct resource *irq, ih->arg = arg; STAILQ_INSERT_TAIL(&sc->intr_handlers, ih, entries); /* - * XXX we should do what old card does to ensure that we don't - * XXX call the function's interrupt routine(s). - */ - /* * XXX need to turn on ISA interrupts, if we ever support them, but * XXX for now that's all we need to do. */ @@ -956,11 +953,9 @@ cbb_insert(struct cbb_softc *sc) if (sc->pccarddev != NULL) { sc->flags |= CBB_16BIT_CARD; sc->flags |= CBB_CARD_OK; - if (CARD_ATTACH_CARD(sc->pccarddev) != 0) { + if (CARD_ATTACH_CARD(sc->pccarddev) != 0) device_printf(sc->dev, "PC Card card activation failed\n"); - sc->flags &= ~CBB_CARD_OK; - } } else { device_printf(sc->dev, "PC Card inserted, but no pccard bus.\n"); @@ -969,11 +964,9 @@ cbb_insert(struct cbb_softc *sc) if (sc->cbdev != NULL) { sc->flags &= ~CBB_16BIT_CARD; sc->flags |= CBB_CARD_OK; - if (CARD_ATTACH_CARD(sc->cbdev) != 0) { + if (CARD_ATTACH_CARD(sc->cbdev) != 0) device_printf(sc->dev, "CardBus card activation failed\n"); - sc->flags &= ~CBB_CARD_OK; - } } else { device_printf(sc->dev, "CardBus card inserted, but no cardbus bus.\n"); @@ -983,7 +976,7 @@ cbb_insert(struct cbb_softc *sc) * We should power the card down, and try again a couple of * times if this happens. XXX */ - device_printf (sc->dev, "Unsupported card type detected\n"); + device_printf(sc->dev, "Unsupported card type detected\n"); } } @@ -1052,7 +1045,6 @@ cbb_intr(void *arg) STAILQ_FOREACH(ih, &sc->intr_handlers, entries) { (*ih->intr)(ih->arg); } - } } |