Deleted Added
full compact
pccard.c (181395) pccard.c (188179)
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 181395 2008-08-07 21:16:14Z imp $");
33__FBSDID("$FreeBSD: head/sys/dev/pccard/pccard.c 188179 2009-02-05 19:38:31Z 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>

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

100static int pccard_print_child(device_t dev, device_t child);
101static int pccard_set_resource(device_t dev, device_t child, int type,
102 int rid, u_long start, u_long count);
103static int pccard_get_resource(device_t dev, device_t child, int type,
104 int rid, u_long *startp, u_long *countp);
105static void pccard_delete_resource(device_t dev, device_t child, int type,
106 int rid);
107static int pccard_set_res_flags(device_t dev, device_t child, int type,
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>

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

100static int pccard_print_child(device_t dev, device_t child);
101static int pccard_set_resource(device_t dev, device_t child, int type,
102 int rid, u_long start, u_long count);
103static int pccard_get_resource(device_t dev, device_t child, int type,
104 int rid, u_long *startp, u_long *countp);
105static void pccard_delete_resource(device_t dev, device_t child, int type,
106 int rid);
107static int pccard_set_res_flags(device_t dev, device_t child, int type,
108 int rid, uint32_t flags);
108 int rid, u_long flags);
109static int pccard_set_memory_offset(device_t dev, device_t child, int rid,
110 uint32_t offset, uint32_t *deltap);
111static int pccard_probe_and_attach_child(device_t dev, device_t child,
112 struct pccard_function *pf);
113static void pccard_probe_nomatch(device_t cbdev, device_t child);
114static int pccard_read_ivar(device_t bus, device_t child, int which,
109static int pccard_set_memory_offset(device_t dev, device_t child, int rid,
110 uint32_t offset, uint32_t *deltap);
111static int pccard_probe_and_attach_child(device_t dev, device_t child,
112 struct pccard_function *pf);
113static void pccard_probe_nomatch(device_t cbdev, device_t child);
114static int pccard_read_ivar(device_t bus, device_t child, int which,
115 u_char *result);
115 uintptr_t *result);
116static void pccard_driver_added(device_t dev, driver_t *driver);
117static struct resource *pccard_alloc_resource(device_t dev,
118 device_t child, int type, int *rid, u_long start,
119 u_long end, u_long count, u_int flags);
120static int pccard_release_resource(device_t dev, device_t child, int type,
121 int rid, struct resource *r);
122static void pccard_child_detached(device_t parent, device_t dev);
123static int pccard_filter(void *arg);

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

967{
968 struct pccard_ivar *devi = PCCARD_IVAR(child);
969 struct resource_list *rl = &devi->resources;
970 resource_list_delete(rl, type, rid);
971}
972
973static int
974pccard_set_res_flags(device_t dev, device_t child, int type, int rid,
116static void pccard_driver_added(device_t dev, driver_t *driver);
117static struct resource *pccard_alloc_resource(device_t dev,
118 device_t child, int type, int *rid, u_long start,
119 u_long end, u_long count, u_int flags);
120static int pccard_release_resource(device_t dev, device_t child, int type,
121 int rid, struct resource *r);
122static void pccard_child_detached(device_t parent, device_t dev);
123static int pccard_filter(void *arg);

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

967{
968 struct pccard_ivar *devi = PCCARD_IVAR(child);
969 struct resource_list *rl = &devi->resources;
970 resource_list_delete(rl, type, rid);
971}
972
973static int
974pccard_set_res_flags(device_t dev, device_t child, int type, int rid,
975 uint32_t flags)
975 u_long flags)
976{
977 return (CARD_SET_RES_FLAGS(device_get_parent(dev), child, type,
978 rid, flags));
979}
980
981static int
982pccard_set_memory_offset(device_t dev, device_t child, int rid,
983 uint32_t offset, uint32_t *deltap)

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

1050 pccard_safe_quote(cis1, sc->card.cis1_info[1], sizeof(cis1));
1051 snprintf(buf, buflen, "manufacturer=0x%04x product=0x%04x "
1052 "cisvendor=\"%s\" cisproduct=\"%s\" function_type=%d",
1053 sc->card.manufacturer, sc->card.product, cis0, cis1, pf->function);
1054 return (0);
1055}
1056
1057static int
976{
977 return (CARD_SET_RES_FLAGS(device_get_parent(dev), child, type,
978 rid, flags));
979}
980
981static int
982pccard_set_memory_offset(device_t dev, device_t child, int rid,
983 uint32_t offset, uint32_t *deltap)

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

1050 pccard_safe_quote(cis1, sc->card.cis1_info[1], sizeof(cis1));
1051 snprintf(buf, buflen, "manufacturer=0x%04x product=0x%04x "
1052 "cisvendor=\"%s\" cisproduct=\"%s\" function_type=%d",
1053 sc->card.manufacturer, sc->card.product, cis0, cis1, pf->function);
1054 return (0);
1055}
1056
1057static int
1058pccard_read_ivar(device_t bus, device_t child, int which, u_char *result)
1058pccard_read_ivar(device_t bus, device_t child, int which, uintptr_t *result)
1059{
1060 struct pccard_ivar *devi = PCCARD_IVAR(child);
1061 struct pccard_function *pf = devi->pf;
1062 struct pccard_softc *sc = PCCARD_SOFTC(bus);
1063
1064 if (!pf)
1065 panic("No pccard function pointer");
1066 switch (which) {

--- 415 unchanged lines hidden ---
1059{
1060 struct pccard_ivar *devi = PCCARD_IVAR(child);
1061 struct pccard_function *pf = devi->pf;
1062 struct pccard_softc *sc = PCCARD_SOFTC(bus);
1063
1064 if (!pf)
1065 panic("No pccard function pointer");
1066 switch (which) {

--- 415 unchanged lines hidden ---