pccard.c (158086) | pccard.c (166453) |
---|---|
1/* $NetBSD: pcmcia.c,v 1.23 2000/07/28 19:17:02 drochner Exp $ */ 2 3/*- 4 * Copyright (c) 1997 Marc Horowitz. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 16 unchanged lines hidden (view full) --- 25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32#include <sys/cdefs.h> | 1/* $NetBSD: pcmcia.c,v 1.23 2000/07/28 19:17:02 drochner Exp $ */ 2 3/*- 4 * Copyright (c) 1997 Marc Horowitz. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 16 unchanged lines hidden (view full) --- 25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/dev/pccard/pccard.c 158086 2006-04-27 20:47:13Z imp $"); | 33__FBSDID("$FreeBSD: head/sys/dev/pccard/pccard.c 166453 2007-02-03 07:09:36Z imp $"); |
34 35#include <sys/param.h> 36#include <sys/systm.h> 37#include <sys/malloc.h> 38#include <sys/module.h> 39#include <sys/kernel.h> 40#include <sys/queue.h> 41#include <sys/sysctl.h> --- 250 unchanged lines hidden (view full) --- 292} 293 294static int 295pccard_detach_card(device_t dev) 296{ 297 struct pccard_softc *sc = PCCARD_SOFTC(dev); 298 struct pccard_function *pf; 299 struct pccard_config_entry *cfe; | 34 35#include <sys/param.h> 36#include <sys/systm.h> 37#include <sys/malloc.h> 38#include <sys/module.h> 39#include <sys/kernel.h> 40#include <sys/queue.h> 41#include <sys/sysctl.h> --- 250 unchanged lines hidden (view full) --- 292} 293 294static int 295pccard_detach_card(device_t dev) 296{ 297 struct pccard_softc *sc = PCCARD_SOFTC(dev); 298 struct pccard_function *pf; 299 struct pccard_config_entry *cfe; |
300 struct pccard_ivar *devi; |
|
300 int state; 301 302 /* 303 * We are running on either the PCCARD socket's event thread 304 * or in user context detaching a device by user request. 305 */ 306 STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) { 307 if (pf->dev == NULL) 308 continue; 309 state = device_get_state(pf->dev); 310 if (state == DS_ATTACHED || state == DS_BUSY) 311 device_detach(pf->dev); 312 if (pf->cfe != NULL) 313 pccard_function_disable(pf); 314 pccard_function_free(pf); | 301 int state; 302 303 /* 304 * We are running on either the PCCARD socket's event thread 305 * or in user context detaching a device by user request. 306 */ 307 STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) { 308 if (pf->dev == NULL) 309 continue; 310 state = device_get_state(pf->dev); 311 if (state == DS_ATTACHED || state == DS_BUSY) 312 device_detach(pf->dev); 313 if (pf->cfe != NULL) 314 pccard_function_disable(pf); 315 pccard_function_free(pf); |
316 devi = PCCARD_IVAR(pf->dev); |
|
315 device_delete_child(dev, pf->dev); | 317 device_delete_child(dev, pf->dev); |
318 free(devi, M_DEVBUF); |
|
316 } 317 if (sc->sc_enabled_count == 0) 318 POWER_DISABLE_SOCKET(device_get_parent(dev), dev); 319 320 while (NULL != (pf = STAILQ_FIRST(&sc->card.pf_head))) { 321 while (NULL != (cfe = STAILQ_FIRST(&pf->cfe_head))) { 322 STAILQ_REMOVE_HEAD(&pf->cfe_head, cfe_list); 323 free(cfe, M_DEVBUF); --- 1106 unchanged lines hidden --- | 319 } 320 if (sc->sc_enabled_count == 0) 321 POWER_DISABLE_SOCKET(device_get_parent(dev), dev); 322 323 while (NULL != (pf = STAILQ_FIRST(&sc->card.pf_head))) { 324 while (NULL != (cfe = STAILQ_FIRST(&pf->cfe_head))) { 325 STAILQ_REMOVE_HEAD(&pf->cfe_head, cfe_list); 326 free(cfe, M_DEVBUF); --- 1106 unchanged lines hidden --- |