Deleted Added
full compact
pccard.c (150468) pccard.c (153773)
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 150468 2005-09-22 14:51:11Z imp $");
33__FBSDID("$FreeBSD: head/sys/dev/pccard/pccard.c 153773 2005-12-28 05:30:09Z 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>

--- 139 unchanged lines hidden (view full) ---

181pccard_attach_card(device_t dev)
182{
183 struct pccard_softc *sc = PCCARD_SOFTC(dev);
184 struct pccard_function *pf;
185 struct pccard_ivar *ivar;
186 device_t child;
187 int i;
188
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>

--- 139 unchanged lines hidden (view full) ---

181pccard_attach_card(device_t dev)
182{
183 struct pccard_softc *sc = PCCARD_SOFTC(dev);
184 struct pccard_function *pf;
185 struct pccard_ivar *ivar;
186 device_t child;
187 int i;
188
189 /*
190 * this is here so that when socket_enable calls gettype, trt happens
191 */
192 STAILQ_INIT(&sc->card.pf_head);
189 if (!STAILQ_EMPTY(&sc->card.pf_head)) {
190 if (bootverbose || pccard_debug)
191 device_printf(dev, "Card already inserted.\n");
192 }
193
194 DEVPRINTF((dev, "chip_socket_enable\n"));
195 POWER_ENABLE_SOCKET(device_get_parent(dev), dev);
196
197 DEVPRINTF((dev, "read_cis\n"));
198 pccard_read_cis(sc);
199
200 DEVPRINTF((dev, "check_cis_quirks\n"));

--- 119 unchanged lines hidden (view full) ---

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);
324 }
325 STAILQ_REMOVE_HEAD(&sc->card.pf_head, pf_list);
326 free(pf, M_DEVBUF);
327 }
193
194 DEVPRINTF((dev, "chip_socket_enable\n"));
195 POWER_ENABLE_SOCKET(device_get_parent(dev), dev);
196
197 DEVPRINTF((dev, "read_cis\n"));
198 pccard_read_cis(sc);
199
200 DEVPRINTF((dev, "check_cis_quirks\n"));

--- 119 unchanged lines hidden (view full) ---

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);
324 }
325 STAILQ_REMOVE_HEAD(&sc->card.pf_head, pf_list);
326 free(pf, M_DEVBUF);
327 }
328 STAILQ_INIT(&sc->card.pf_head);
328 return (0);
329}
330
331static const struct pccard_product *
332pccard_do_product_lookup(device_t bus, device_t dev,
333 const struct pccard_product *tab, size_t ent_size,
334 pccard_product_match_fn matchfn)
335{

--- 437 unchanged lines hidden (view full) ---

773{
774 struct pccard_softc *sc = PCCARD_SOFTC(dev);
775 int err;
776
777 sc->dev = dev;
778 sc->sc_enabled_count = 0;
779 if ((err = pccard_device_create(sc)) != 0)
780 return (err);
329 return (0);
330}
331
332static const struct pccard_product *
333pccard_do_product_lookup(device_t bus, device_t dev,
334 const struct pccard_product *tab, size_t ent_size,
335 pccard_product_match_fn matchfn)
336{

--- 437 unchanged lines hidden (view full) ---

774{
775 struct pccard_softc *sc = PCCARD_SOFTC(dev);
776 int err;
777
778 sc->dev = dev;
779 sc->sc_enabled_count = 0;
780 if ((err = pccard_device_create(sc)) != 0)
781 return (err);
782 STAILQ_INIT(&sc->card.pf_head);
781 return (bus_generic_attach(dev));
782}
783
784static int
785pccard_detach(device_t dev)
786{
787 pccard_detach_card(dev);
788 pccard_device_destroy(device_get_softc(dev));

--- 639 unchanged lines hidden ---
783 return (bus_generic_attach(dev));
784}
785
786static int
787pccard_detach(device_t dev)
788{
789 pccard_detach_card(dev);
790 pccard_device_destroy(device_get_softc(dev));

--- 639 unchanged lines hidden ---