diff options
author | imp <imp@FreeBSD.org> | 2005-12-28 05:30:09 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2005-12-28 05:30:09 +0000 |
commit | f143799b50c83a9c27779ec6ba48bbffa6506c4b (patch) | |
tree | 2d1f9c9fccecd5525174a91857f3d5dde4721062 /sys/dev/pccard | |
parent | 772103ed777a9ec242ea29086a3de960e9c1c546 (diff) | |
download | FreeBSD-src-f143799b50c83a9c27779ec6ba48bbffa6506c4b.zip FreeBSD-src-f143799b50c83a9c27779ec6ba48bbffa6506c4b.tar.gz |
Add some sanity checking to the pccard insertion case. Whine if the
bridge tries to tell us about a new card when we have one already in
the socket.
Diffstat (limited to 'sys/dev/pccard')
-rw-r--r-- | sys/dev/pccard/pccard.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c index 47a150a..aa01893 100644 --- a/sys/dev/pccard/pccard.c +++ b/sys/dev/pccard/pccard.c @@ -186,10 +186,10 @@ pccard_attach_card(device_t dev) device_t child; int i; - /* - * this is here so that when socket_enable calls gettype, trt happens - */ - STAILQ_INIT(&sc->card.pf_head); + if (!STAILQ_EMPTY(&sc->card.pf_head)) { + if (bootverbose || pccard_debug) + device_printf(dev, "Card already inserted.\n"); + } DEVPRINTF((dev, "chip_socket_enable\n")); POWER_ENABLE_SOCKET(device_get_parent(dev), dev); @@ -325,6 +325,7 @@ pccard_detach_card(device_t dev) STAILQ_REMOVE_HEAD(&sc->card.pf_head, pf_list); free(pf, M_DEVBUF); } + STAILQ_INIT(&sc->card.pf_head); return (0); } @@ -778,6 +779,7 @@ pccard_attach(device_t dev) sc->sc_enabled_count = 0; if ((err = pccard_device_create(sc)) != 0) return (err); + STAILQ_INIT(&sc->card.pf_head); return (bus_generic_attach(dev)); } |