The card_attach_now flag hasn't been necessary or useful for some time.

Garbage collect the code and corresponding documentation.
This commit is contained in:
nathanw 2001-02-12 04:52:48 +00:00
parent 54caa65cf6
commit eb65359d14
2 changed files with 7 additions and 37 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: cardbus.4,v 1.8 2001/01/28 02:33:04 nathanw Exp $ .\" $NetBSD: cardbus.4,v 1.9 2001/02/12 04:52:48 nathanw Exp $
.\" .\"
.\" Copyright (c) 1999-2001 The NetBSD Foundation, Inc. .\" Copyright (c) 1999-2001 The NetBSD Foundation, Inc.
.\" All rights reserved. .\" All rights reserved.
@ -44,7 +44,7 @@
.Nd CardBus driver .Nd CardBus driver
.Sh SYNOPSIS .Sh SYNOPSIS
.Cd "cbb* at pci? dev? function ?" .Cd "cbb* at pci? dev? function ?"
.Cd "cardslot* at cbb? flags 0x0000" .Cd "cardslot* at cbb?"
.Cd "cardbus* at cardslot?" .Cd "cardbus* at cardslot?"
.Cd "pcmcia* at cardslot?" .Cd "pcmcia* at cardslot?"
.Cd "XX* at cardbus? dev ? function ?" .Cd "XX* at cardbus? dev ? function ?"
@ -67,15 +67,6 @@ or
.Cm pcmcia .Cm pcmcia
devices, respectively. devices, respectively.
.Pp .Pp
The flags of a
.Cm cardslot
device definition determine when the device is attached. If the flag
is set to 1, card attaching will occur at slot attachment time. If the
flag is set to 0 (the default), card attaching is deferred until after
normal autoconfiguration has ended. If a card is used as a boot device
(for example, a flash memory card card or a network card), the flag should
be set to to 1.
.Pp
.Sh SUPPORTED DEVICES .Sh SUPPORTED DEVICES
.Nx .Nx
includes the following machine-independent CardBus includes the following machine-independent CardBus

View File

@ -1,4 +1,4 @@
/* $NetBSD: cardslot.c,v 1.12 2001/01/28 01:49:54 nathanw Exp $ */ /* $NetBSD: cardslot.c,v 1.13 2001/02/12 04:52:49 nathanw Exp $ */
/* /*
* Copyright (c) 1999 and 2000 * Copyright (c) 1999 and 2000
@ -116,8 +116,6 @@ cardslotattach(parent, self, aux)
struct cardbus_softc *csc; struct cardbus_softc *csc;
struct pcmcia_softc *psc; struct pcmcia_softc *psc;
int card_attach_now;
sc->sc_slot = sc->sc_dev.dv_unit; sc->sc_slot = sc->sc_dev.dv_unit;
sc->sc_cb_softc = NULL; sc->sc_cb_softc = NULL;
sc->sc_16_softc = NULL; sc->sc_16_softc = NULL;
@ -155,35 +153,16 @@ cardslotattach(parent, self, aux)
#endif #endif
} }
card_attach_now = sc->sc_dev.dv_cfdata->cf_flags & 0x01;
if (csc && (csc->sc_cf->cardbus_ctrl)(csc->sc_cc, CARDBUS_CD)) { if (csc && (csc->sc_cf->cardbus_ctrl)(csc->sc_cc, CARDBUS_CD)) {
DPRINTF(("cardslotattach: CardBus card found\n")); DPRINTF(("cardslotattach: CardBus card found\n"));
if (card_attach_now) { /* attach deferred */
if (cardbus_attach_card(sc->sc_cb_softc) > 0) { cardslot_event_throw(sc, CARDSLOT_EVENT_INSERTION_CB);
/* at least one function works */
CARDSLOT_SET_WORK(sc->sc_status, CARDSLOT_STATUS_WORKING);
} else {
/* no functions work or this card is not known */
CARDSLOT_SET_WORK(sc->sc_status, CARDSLOT_STATUS_NOTWORK);
}
CARDSLOT_SET_CARDTYPE(sc->sc_status, CARDSLOT_STATUS_CARD_CB);
} else {
/* attach deferred */
cardslot_event_throw(sc, CARDSLOT_EVENT_INSERTION_CB);
}
} }
if (psc && (psc->pct->card_detect)(psc->pch)) { if (psc && (psc->pct->card_detect)(psc->pch)) {
DPRINTF(("cardbusattach: 16-bit card found\n")); DPRINTF(("cardbusattach: 16-bit card found\n"));
if (card_attach_now) { /* attach deferred */
/* attach now */ cardslot_event_throw(sc, CARDSLOT_EVENT_INSERTION_16);
pcmcia_card_attach((struct device *)sc->sc_16_softc);
CARDSLOT_SET_CARDTYPE(sc->sc_status, CARDSLOT_STATUS_CARD_16);
} else {
/* attach deferred */
cardslot_event_throw(sc, CARDSLOT_EVENT_INSERTION_16);
}
} }
} }