pccard.c (150098) | pccard.c (150362) |
---|---|
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 150098 2005-09-13 17:56:36Z imp $"); | 33__FBSDID("$FreeBSD: head/sys/dev/pccard/pccard.c 150362 2005-09-20 06:47:33Z 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> 42#include <sys/types.h> 43 44#include <sys/bus.h> 45#include <machine/bus.h> 46#include <sys/rman.h> 47#include <machine/resource.h> 48 49#include <net/ethernet.h> 50 51#include <dev/pccard/pccardreg.h> 52#include <dev/pccard/pccardvar.h> | 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> 42#include <sys/types.h> 43 44#include <sys/bus.h> 45#include <machine/bus.h> 46#include <sys/rman.h> 47#include <machine/resource.h> 48 49#include <net/ethernet.h> 50 51#include <dev/pccard/pccardreg.h> 52#include <dev/pccard/pccardvar.h> |
53#include <dev/pccard/pccardvarp.h> |
|
53#include <dev/pccard/pccard_cis.h> 54 55#include "power_if.h" 56#include "card_if.h" 57 58#define PCCARDDEBUG 59 60/* sysctl vars */ --- 737 unchanged lines hidden (view full) --- 798 device_set_desc(dev, "16-bit PCCard bus"); 799 return (pccard_add_children(dev, device_get_unit(dev))); 800} 801 802static int 803pccard_attach(device_t dev) 804{ 805 struct pccard_softc *sc = PCCARD_SOFTC(dev); | 54#include <dev/pccard/pccard_cis.h> 55 56#include "power_if.h" 57#include "card_if.h" 58 59#define PCCARDDEBUG 60 61/* sysctl vars */ --- 737 unchanged lines hidden (view full) --- 799 device_set_desc(dev, "16-bit PCCard bus"); 800 return (pccard_add_children(dev, device_get_unit(dev))); 801} 802 803static int 804pccard_attach(device_t dev) 805{ 806 struct pccard_softc *sc = PCCARD_SOFTC(dev); |
807 int err; |
|
806 807 sc->dev = dev; 808 sc->sc_enabled_count = 0; | 808 809 sc->dev = dev; 810 sc->sc_enabled_count = 0; |
811 if ((err = pccard_device_create(sc)) != 0) 812 return (err); |
|
809 return (bus_generic_attach(dev)); 810} 811 812static int 813pccard_detach(device_t dev) 814{ 815 pccard_detach_card(dev); | 813 return (bus_generic_attach(dev)); 814} 815 816static int 817pccard_detach(device_t dev) 818{ 819 pccard_detach_card(dev); |
816 return 0; | 820 pccard_device_destroy(device_get_softc(dev)); 821 return (0); |
817} 818 819static int 820pccard_suspend(device_t self) 821{ 822 pccard_detach_card(self); 823 return (0); 824} --- 632 unchanged lines hidden --- | 822} 823 824static int 825pccard_suspend(device_t self) 826{ 827 pccard_detach_card(self); 828 return (0); 829} --- 632 unchanged lines hidden --- |