Deleted Added
full compact
pccard.c (76424) pccard.c (82378)
1/* $NetBSD: pcmcia.c,v 1.23 2000/07/28 19:17:02 drochner Exp $ */
1/* $NetBSD: pcmcia.c,v 1.23 2000/07/28 19:17:02 drochner Exp $ */
2/* $FreeBSD: head/sys/dev/pccard/pccard.c 76424 2001-05-10 06:55:39Z imp $ */
2/* $FreeBSD: head/sys/dev/pccard/pccard.c 82378 2001-08-27 00:09:42Z jon $ */
3
4/*
5 * Copyright (c) 1997 Marc Horowitz. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright

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

65#endif
66
67#ifdef PCCARDVERBOSE
68int pccard_verbose = 1;
69#else
70int pccard_verbose = 0;
71#endif
72
3
4/*
5 * Copyright (c) 1997 Marc Horowitz. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright

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

65#endif
66
67#ifdef PCCARDVERBOSE
68int pccard_verbose = 1;
69#else
70int pccard_verbose = 0;
71#endif
72
73int pccard_print(void *, const char *);
73static int pccard_ccr_read(struct pccard_function *pf, int ccr);
74static void pccard_ccr_write(struct pccard_function *pf, int ccr, int val);
75static int pccard_attach_card(device_t dev);
76static int pccard_detach_card(device_t dev, int flags);
77static const struct pccard_product *pccard_product_lookup(device_t dev,
78 const struct pccard_product *tab, size_t ent_size,
79 pccard_product_match_fn matchfn);
80static int pccard_card_gettype(device_t dev, int *type);
81static void pccard_function_init(struct pccard_function *pf);
82static void pccard_function_free(struct pccard_function *pf);
83static int pccard_function_enable(struct pccard_function *pf);
84static void pccard_function_disable(struct pccard_function *pf);
85static int pccard_compat_do_probe(device_t bus, device_t dev);
86static int pccard_compat_do_attach(device_t bus, device_t dev);
87static int pccard_add_children(device_t dev, int busno);
88static int pccard_probe(device_t dev);
89static int pccard_attach(device_t dev);
90static int pccard_detach(device_t dev);
91static void pccard_print_resources(struct resource_list *rl,
92 const char *name, int type, int count, const char *format);
93static int pccard_print_child(device_t dev, device_t child);
94static int pccard_set_resource(device_t dev, device_t child, int type,
95 int rid, u_long start, u_long count);
96static int pccard_get_resource(device_t dev, device_t child, int type,
97 int rid, u_long *startp, u_long *countp);
98static void pccard_delete_resource(device_t dev, device_t child, int type,
99 int rid);
100static int pccard_set_res_flags(device_t dev, device_t child, int type,
101 int rid, u_int32_t flags);
102static int pccard_set_memory_offset(device_t dev, device_t child, int rid,
103 u_int32_t offset, u_int32_t *deltap);
104static int pccard_read_ivar(device_t bus, device_t child, int which,
105 u_char *result);
106static void pccard_driver_added(device_t dev, driver_t *driver);
107static struct resource *pccard_alloc_resource(device_t dev,
108 device_t child, int type, int *rid, u_long start,
109 u_long end, u_long count, u_int flags);
110static int pccard_release_resource(device_t dev, device_t child, int type,
111 int rid, struct resource *r);
112static void pccard_child_detached(device_t parent, device_t dev);
113static void pccard_intr(void *arg);
114static int pccard_setup_intr(device_t dev, device_t child,
115 struct resource *irq, int flags, driver_intr_t *intr,
116 void *arg, void **cookiep);
117static int pccard_teardown_intr(device_t dev, device_t child,
118 struct resource *r, void *cookie);
74
119
75int
120static int
76pccard_ccr_read(struct pccard_function *pf, int ccr)
77{
78 return (bus_space_read_1(pf->pf_ccrt, pf->pf_ccrh,
79 pf->pf_ccr_offset + ccr));
80}
81
121pccard_ccr_read(struct pccard_function *pf, int ccr)
122{
123 return (bus_space_read_1(pf->pf_ccrt, pf->pf_ccrh,
124 pf->pf_ccr_offset + ccr));
125}
126
82void
127static void
83pccard_ccr_write(struct pccard_function *pf, int ccr, int val)
84{
85 if ((pf->ccr_mask) & (1 << (ccr / 2))) {
86 bus_space_write_1(pf->pf_ccrt, pf->pf_ccrh,
87 pf->pf_ccr_offset + ccr, val);
88 }
89}
90
91static int
92pccard_attach_card(device_t dev)
93{
94 struct pccard_softc *sc = PCCARD_SOFTC(dev);
95 struct pccard_function *pf;
96 struct pccard_ivar *ivar;
97 device_t child;
128pccard_ccr_write(struct pccard_function *pf, int ccr, int val)
129{
130 if ((pf->ccr_mask) & (1 << (ccr / 2))) {
131 bus_space_write_1(pf->pf_ccrt, pf->pf_ccrh,
132 pf->pf_ccr_offset + ccr, val);
133 }
134}
135
136static int
137pccard_attach_card(device_t dev)
138{
139 struct pccard_softc *sc = PCCARD_SOFTC(dev);
140 struct pccard_function *pf;
141 struct pccard_ivar *ivar;
142 device_t child;
98 int attached;
99
143
100 sc->intr_handler_count = 0;
101 /*
102 * this is here so that when socket_enable calls gettype, trt happens
103 */
104 STAILQ_INIT(&sc->card.pf_head);
105
106 DEVPRINTF((dev, "chip_socket_enable\n"));
107 POWER_ENABLE_SOCKET(device_get_parent(dev), dev);
108

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

124 if (STAILQ_EMPTY(&sc->card.pf_head)) {
125 device_printf (dev, "Card has no functions!\n");
126 return (1);
127 }
128
129 if (1)
130 pccard_print_cis(dev);
131
144 /*
145 * this is here so that when socket_enable calls gettype, trt happens
146 */
147 STAILQ_INIT(&sc->card.pf_head);
148
149 DEVPRINTF((dev, "chip_socket_enable\n"));
150 POWER_ENABLE_SOCKET(device_get_parent(dev), dev);
151

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

167 if (STAILQ_EMPTY(&sc->card.pf_head)) {
168 device_printf (dev, "Card has no functions!\n");
169 return (1);
170 }
171
172 if (1)
173 pccard_print_cis(dev);
174
132 attached = 0;
133
134 DEVPRINTF((dev, "functions scanning\n"));
135 STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) {
136 if (STAILQ_EMPTY(&pf->cfe_head))
137 continue;
138
139 pf->sc = sc;
140 pf->cfe = NULL;
141 pf->dev = NULL;
142 }
175 DEVPRINTF((dev, "functions scanning\n"));
176 STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) {
177 if (STAILQ_EMPTY(&pf->cfe_head))
178 continue;
179
180 pf->sc = sc;
181 pf->cfe = NULL;
182 pf->dev = NULL;
183 }
143#if 0
144 DEVPRINTF((dev, "chip_socket_disable\n"));
145 POWER_DISABLE_SOCKET(device_get_parent(dev), dev);
146#endif
184
147 STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) {
148 if (STAILQ_EMPTY(&pf->cfe_head))
149 continue;
150 /*
151 * In NetBSD, the drivers are responsible for activating
152 * each function of a card. I think that in FreeBSD we
153 * want to activate them enough for the usual bus_*_resource
154 * routines will do the right thing. This many mean a

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

168 * XXX We might want to move the next two lines into
169 * XXX the pccard interface layer. For the moment, this
170 * XXX is OK, but some drivers want to pick the config
171 * XXX entry to use as well as some address tweaks (mostly
172 * XXX due to bugs in decode logic that makes some
173 * XXX addresses illegal or broken).
174 */
175 pccard_function_init(pf);
185 STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) {
186 if (STAILQ_EMPTY(&pf->cfe_head))
187 continue;
188 /*
189 * In NetBSD, the drivers are responsible for activating
190 * each function of a card. I think that in FreeBSD we
191 * want to activate them enough for the usual bus_*_resource
192 * routines will do the right thing. This many mean a

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

206 * XXX We might want to move the next two lines into
207 * XXX the pccard interface layer. For the moment, this
208 * XXX is OK, but some drivers want to pick the config
209 * XXX entry to use as well as some address tweaks (mostly
210 * XXX due to bugs in decode logic that makes some
211 * XXX addresses illegal or broken).
212 */
213 pccard_function_init(pf);
214 if (sc->sc_enabled_count == 0)
215 POWER_ENABLE_SOCKET(device_get_parent(dev), dev);
176 if (pccard_function_enable(pf) == 0 &&
177 device_probe_and_attach(child) == 0) {
216 if (pccard_function_enable(pf) == 0 &&
217 device_probe_and_attach(child) == 0) {
178 attached++;
179
180 DEVPRINTF((sc->dev, "function %d CCR at %d "
181 "offset %x: %x %x %x %x, %x %x %x %x, %x\n",
182 pf->number, pf->pf_ccr_window, pf->pf_ccr_offset,
183 pccard_ccr_read(pf, 0x00),
184 pccard_ccr_read(pf, 0x02), pccard_ccr_read(pf, 0x04),
185 pccard_ccr_read(pf, 0x06), pccard_ccr_read(pf, 0x0A),
186 pccard_ccr_read(pf, 0x0C), pccard_ccr_read(pf, 0x0E),
187 pccard_ccr_read(pf, 0x10), pccard_ccr_read(pf, 0x12)));
188 } else {
218 DEVPRINTF((sc->dev, "function %d CCR at %d "
219 "offset %x: %x %x %x %x, %x %x %x %x, %x\n",
220 pf->number, pf->pf_ccr_window, pf->pf_ccr_offset,
221 pccard_ccr_read(pf, 0x00),
222 pccard_ccr_read(pf, 0x02), pccard_ccr_read(pf, 0x04),
223 pccard_ccr_read(pf, 0x06), pccard_ccr_read(pf, 0x0A),
224 pccard_ccr_read(pf, 0x0C), pccard_ccr_read(pf, 0x0E),
225 pccard_ccr_read(pf, 0x10), pccard_ccr_read(pf, 0x12)));
226 } else {
189 device_delete_child(dev, child);
227 pccard_function_disable(pf);
190 }
191 }
228 }
229 }
230 if (sc->sc_enabled_count == 0)
231 pccard_detach_card(dev, 0);
192 return (0);
193}
194
195static int
196pccard_detach_card(device_t dev, int flags)
197{
198 struct pccard_softc *sc = PCCARD_SOFTC(dev);
199 struct pccard_function *pf;
232 return (0);
233}
234
235static int
236pccard_detach_card(device_t dev, int flags)
237{
238 struct pccard_softc *sc = PCCARD_SOFTC(dev);
239 struct pccard_function *pf;
240 struct pccard_config_entry *cfe;
200
201 /*
202 * We are running on either the PCCARD socket's event thread
203 * or in user context detaching a device by user request.
204 */
205 STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) {
241
242 /*
243 * We are running on either the PCCARD socket's event thread
244 * or in user context detaching a device by user request.
245 */
246 STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) {
206 if (STAILQ_FIRST(&pf->cfe_head) == NULL)
207 continue;
247 int state = device_get_state(pf->dev);
208
248
249 if (state == DS_ATTACHED || state == DS_BUSY)
250 device_detach(pf->dev);
209 pccard_function_disable(pf);
251 pccard_function_disable(pf);
210 /*
211 * XXX must also actually delete resources created by
212 * pccard_function_init(). If pccard_function_init
213 * keeps things allocated it is a bug.
214 */
252 pccard_function_free(pf);
215 if (pf->dev != NULL)
216 device_delete_child(dev, pf->dev);
217 }
253 if (pf->dev != NULL)
254 device_delete_child(dev, pf->dev);
255 }
256 if (sc->sc_enabled_count == 0)
257 POWER_DISABLE_SOCKET(device_get_parent(dev), dev);
258
259 while (NULL != (pf = STAILQ_FIRST(&sc->card.pf_head))) {
260 while (NULL != (cfe = STAILQ_FIRST(&pf->cfe_head))) {
261 STAILQ_REMOVE_HEAD(&pf->cfe_head, cfe_list);
262 free(cfe, M_DEVBUF);
263 }
264 STAILQ_REMOVE_HEAD(&sc->card.pf_head, pf_list);
265 free(pf, M_DEVBUF);
266 }
218 return (0);
219}
220
267 return (0);
268}
269
221const struct pccard_product *
270static const struct pccard_product *
222pccard_product_lookup(device_t dev, const struct pccard_product *tab,
223 size_t ent_size, pccard_product_match_fn matchfn)
224{
225 const struct pccard_product *ent;
226 int matches;
227 u_int32_t fcn;
228 u_int32_t vendor;
229 u_int32_t prod;

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

240 if (pccard_get_product(dev, &prod))
241 return (NULL);
242 if (pccard_get_function_number(dev, &fcn))
243 return (NULL);
244 if (pccard_get_vendor_str(dev, &vendorstr))
245 return (NULL);
246 if (pccard_get_product_str(dev, &prodstr))
247 return (NULL);
271pccard_product_lookup(device_t dev, const struct pccard_product *tab,
272 size_t ent_size, pccard_product_match_fn matchfn)
273{
274 const struct pccard_product *ent;
275 int matches;
276 u_int32_t fcn;
277 u_int32_t vendor;
278 u_int32_t prod;

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

289 if (pccard_get_product(dev, &prod))
290 return (NULL);
291 if (pccard_get_function_number(dev, &fcn))
292 return (NULL);
293 if (pccard_get_vendor_str(dev, &vendorstr))
294 return (NULL);
295 if (pccard_get_product_str(dev, &prodstr))
296 return (NULL);
248 for (ent = tab; ent->pp_name != NULL;
249 ent = (const struct pccard_product *)
250 ((const char *) ent + ent_size)) {
297 for (ent = tab; ent->pp_name != NULL; ent =
298 (const struct pccard_product *) ((const char *) ent + ent_size)) {
251 matches = 1;
252 if (matches && ent->pp_vendor != PCCARD_VENDOR_ANY &&
253 vendor != ent->pp_vendor)
254 matches = 0;
255 if (matches && ent->pp_product != PCCARD_PRODUCT_ANY &&
256 prod != ent->pp_product)
257 matches = 0;
258 if (matches && fcn != ent->pp_expfunc)

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

292 *type = PCCARD_IFTYPE_IO;
293 return (0);
294}
295
296/*
297 * Initialize a PCCARD function. May be called as long as the function is
298 * disabled.
299 */
299 matches = 1;
300 if (matches && ent->pp_vendor != PCCARD_VENDOR_ANY &&
301 vendor != ent->pp_vendor)
302 matches = 0;
303 if (matches && ent->pp_product != PCCARD_PRODUCT_ANY &&
304 prod != ent->pp_product)
305 matches = 0;
306 if (matches && fcn != ent->pp_expfunc)

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

340 *type = PCCARD_IFTYPE_IO;
341 return (0);
342}
343
344/*
345 * Initialize a PCCARD function. May be called as long as the function is
346 * disabled.
347 */
300void
348static void
301pccard_function_init(struct pccard_function *pf)
302{
303 struct pccard_config_entry *cfe;
304 int i;
305 struct pccard_ivar *devi = PCCARD_IVAR(pf->dev);
306 struct resource_list *rl = &devi->resources;
307 struct resource_list_entry *rle;
308 struct resource *r = 0;

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

364 /*
365 * Release resources that we partially allocated
366 * from this config entry.
367 */
368 for (i = 0; i < cfe->num_iospace; i++) {
369 if (cfe->iores[i] != NULL) {
370 bus_release_resource(bus, SYS_RES_IOPORT,
371 cfe->iorid[i], cfe->iores[i]);
349pccard_function_init(struct pccard_function *pf)
350{
351 struct pccard_config_entry *cfe;
352 int i;
353 struct pccard_ivar *devi = PCCARD_IVAR(pf->dev);
354 struct resource_list *rl = &devi->resources;
355 struct resource_list_entry *rle;
356 struct resource *r = 0;

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

412 /*
413 * Release resources that we partially allocated
414 * from this config entry.
415 */
416 for (i = 0; i < cfe->num_iospace; i++) {
417 if (cfe->iores[i] != NULL) {
418 bus_release_resource(bus, SYS_RES_IOPORT,
419 cfe->iorid[i], cfe->iores[i]);
372 rle = resource_list_find(rl, SYS_RES_IOPORT,
420 rle = resource_list_find(rl, SYS_RES_IOPORT,
373 cfe->iorid[i]);
374 rle->res = NULL;
375 resource_list_delete(rl, SYS_RES_IOPORT,
376 cfe->iorid[i]);
377 }
378 cfe->iores[i] = NULL;
379 }
380 if (cfe->irqmask && cfe->irqres != NULL) {
381 bus_release_resource(bus, SYS_RES_IRQ,
382 cfe->irqrid, cfe->irqres);
383 rle = resource_list_find(rl, SYS_RES_IRQ,
384 cfe->irqrid);
385 rle->res = NULL;
386 resource_list_delete(rl, SYS_RES_IRQ, cfe->irqrid);
387 cfe->irqres = NULL;
388 }
389 }
390}
391
421 cfe->iorid[i]);
422 rle->res = NULL;
423 resource_list_delete(rl, SYS_RES_IOPORT,
424 cfe->iorid[i]);
425 }
426 cfe->iores[i] = NULL;
427 }
428 if (cfe->irqmask && cfe->irqres != NULL) {
429 bus_release_resource(bus, SYS_RES_IRQ,
430 cfe->irqrid, cfe->irqres);
431 rle = resource_list_find(rl, SYS_RES_IRQ,
432 cfe->irqrid);
433 rle->res = NULL;
434 resource_list_delete(rl, SYS_RES_IRQ, cfe->irqrid);
435 cfe->irqres = NULL;
436 }
437 }
438}
439
440/*
441 * Free resources allocated by pccard_function_init(), May be called as long
442 * as the function is disabled.
443 */
444static void
445pccard_function_free(struct pccard_function *pf)
446{
447 struct pccard_ivar *devi = PCCARD_IVAR(pf->dev);
448 struct resource_list_entry *rle;
449
450 if (pf->pf_flags & PFF_ENABLED) {
451 printf("pccard_function_init: function is enabled");
452 return;
453 }
454
455 SLIST_FOREACH(rle, &devi->resources, link) {
456 if (rle->res) {
457 if (rle->res->r_dev != pf->sc->dev)
458 device_printf(pf->sc->dev,
459 "function_free: Resource still owned by "
460 "child, oops. "
461 "(type=%d, rid=%d, addr=%lx)\n",
462 rle->type, rle->rid,
463 rman_get_start(rle->res));
464 BUS_RELEASE_RESOURCE(device_get_parent(pf->sc->dev),
465 rle->res->r_dev, rle->type, rle->rid, rle->res);
466 rle->res = NULL;
467 }
468 }
469 resource_list_free(&devi->resources);
470}
471
392/* Enable a PCCARD function */
472/* Enable a PCCARD function */
393int
473static int
394pccard_function_enable(struct pccard_function *pf)
395{
396 struct pccard_function *tmp;
397 int reg;
398 device_t dev = pf->sc->dev;
399
400 if (pf->cfe == NULL) {
401 DEVPRVERBOSE((dev, "No config entry could be allocated.\n"));
402 return (ENOMEM);
403 }
404
405 /*
406 * Increase the reference count on the socket, enabling power, if
407 * necessary.
408 */
474pccard_function_enable(struct pccard_function *pf)
475{
476 struct pccard_function *tmp;
477 int reg;
478 device_t dev = pf->sc->dev;
479
480 if (pf->cfe == NULL) {
481 DEVPRVERBOSE((dev, "No config entry could be allocated.\n"));
482 return (ENOMEM);
483 }
484
485 /*
486 * Increase the reference count on the socket, enabling power, if
487 * necessary.
488 */
409 if (pf->sc->sc_enabled_count++ == 0)
410 POWER_ENABLE_SOCKET(device_get_parent(dev), dev);
411 DEVPRINTF((dev, "++enabled_count = %d\n", pf->sc->sc_enabled_count));
489 pf->sc->sc_enabled_count++;
412
413 if (pf->pf_flags & PFF_ENABLED) {
414 /*
415 * Don't do anything if we're already enabled.
416 */
417 return (0);
418 }
419
420 /*
421 * it's possible for different functions' CCRs to be in the same
422 * underlying page. Check for that.
423 */
424 STAILQ_FOREACH(tmp, &pf->sc->card.pf_head, pf_list) {
425 if ((tmp->pf_flags & PFF_ENABLED) &&
426 (pf->ccr_base >= (tmp->ccr_base - tmp->pf_ccr_offset)) &&
427 ((pf->ccr_base + PCCARD_CCR_SIZE) <=
490
491 if (pf->pf_flags & PFF_ENABLED) {
492 /*
493 * Don't do anything if we're already enabled.
494 */
495 return (0);
496 }
497
498 /*
499 * it's possible for different functions' CCRs to be in the same
500 * underlying page. Check for that.
501 */
502 STAILQ_FOREACH(tmp, &pf->sc->card.pf_head, pf_list) {
503 if ((tmp->pf_flags & PFF_ENABLED) &&
504 (pf->ccr_base >= (tmp->ccr_base - tmp->pf_ccr_offset)) &&
505 ((pf->ccr_base + PCCARD_CCR_SIZE) <=
428 (tmp->ccr_base - tmp->pf_ccr_offset +
429 tmp->pf_ccr_realsize))) {
506 (tmp->ccr_base - tmp->pf_ccr_offset +
507 tmp->pf_ccr_realsize))) {
430 pf->pf_ccrt = tmp->pf_ccrt;
431 pf->pf_ccrh = tmp->pf_ccrh;
432 pf->pf_ccr_realsize = tmp->pf_ccr_realsize;
433
434 /*
435 * pf->pf_ccr_offset = (tmp->pf_ccr_offset -
436 * tmp->ccr_base) + pf->ccr_base;
437 */

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

525 pf->pf_flags |= PFF_ENABLED;
526 return (0);
527
528 bad:
529 /*
530 * Decrement the reference count, and power down the socket, if
531 * necessary.
532 */
508 pf->pf_ccrt = tmp->pf_ccrt;
509 pf->pf_ccrh = tmp->pf_ccrh;
510 pf->pf_ccr_realsize = tmp->pf_ccr_realsize;
511
512 /*
513 * pf->pf_ccr_offset = (tmp->pf_ccr_offset -
514 * tmp->ccr_base) + pf->ccr_base;
515 */

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

603 pf->pf_flags |= PFF_ENABLED;
604 return (0);
605
606 bad:
607 /*
608 * Decrement the reference count, and power down the socket, if
609 * necessary.
610 */
533 if (--pf->sc->sc_enabled_count == 0)
534 POWER_DISABLE_SOCKET(device_get_parent(dev), dev);
611 pf->sc->sc_enabled_count--;
535 DEVPRINTF((dev, "bad --enabled_count = %d\n", pf->sc->sc_enabled_count));
536
537 return (1);
538}
539
540/* Disable PCCARD function. */
612 DEVPRINTF((dev, "bad --enabled_count = %d\n", pf->sc->sc_enabled_count));
613
614 return (1);
615}
616
617/* Disable PCCARD function. */
541void
618static void
542pccard_function_disable(struct pccard_function *pf)
543{
544 struct pccard_function *tmp;
545 device_t dev = pf->sc->dev;
546
547 if (pf->cfe == NULL)
548 panic("pccard_function_disable: function not initialized");
549
550 if ((pf->pf_flags & PFF_ENABLED) == 0) {
551 /*
552 * Don't do anything if we're already disabled.
553 */
554 return;
555 }
556
557 if (pf->intr_handler != NULL) {
619pccard_function_disable(struct pccard_function *pf)
620{
621 struct pccard_function *tmp;
622 device_t dev = pf->sc->dev;
623
624 if (pf->cfe == NULL)
625 panic("pccard_function_disable: function not initialized");
626
627 if ((pf->pf_flags & PFF_ENABLED) == 0) {
628 /*
629 * Don't do anything if we're already disabled.
630 */
631 return;
632 }
633
634 if (pf->intr_handler != NULL) {
558 pf->intr_handler = NULL;
559 pf->intr_handler_arg = NULL;
560 pf->intr_handler_cookie = NULL;
561 pccard_ccr_write(pf, PCCARD_CCR_OPTION,
562 pccard_ccr_read(pf, PCCARD_CCR_OPTION) &
563 ~PCCARD_CCR_OPTION_IREQ_ENABLE);
564
565 if (pf->sc->intr_handler_count == 1) {
566 struct pccard_ivar *ivar = PCCARD_IVAR(pf->dev);
567 struct resource_list_entry *rle = NULL;
568
569 pf->sc->intr_handler_count--;
570 rle = resource_list_find(&ivar->resources, SYS_RES_IRQ,
571 0);
572 if (rle == NULL)
573 panic("No IRQ for pccard?");
574
575 bus_teardown_intr(dev, rle->res,
576 &pf->sc->intr_handler_count);
577 }
635 struct pccard_ivar *devi = PCCARD_IVAR(pf->dev);
636 struct resource_list_entry *rle =
637 resource_list_find(&devi->resources, SYS_RES_IRQ, 0);
638 BUS_TEARDOWN_INTR(dev, pf->dev, rle->res,
639 pf->intr_handler_cookie);
578 }
579
580 /*
581 * it's possible for different functions' CCRs to be in the same
582 * underlying page. Check for that. Note we mark us as disabled
583 * first to avoid matching ourself.
584 */
585
586 pf->pf_flags &= ~PFF_ENABLED;
587 STAILQ_FOREACH(tmp, &pf->sc->card.pf_head, pf_list) {
588 if ((tmp->pf_flags & PFF_ENABLED) &&
589 (pf->ccr_base >= (tmp->ccr_base - tmp->pf_ccr_offset)) &&
590 ((pf->ccr_base + PCCARD_CCR_SIZE) <=
640 }
641
642 /*
643 * it's possible for different functions' CCRs to be in the same
644 * underlying page. Check for that. Note we mark us as disabled
645 * first to avoid matching ourself.
646 */
647
648 pf->pf_flags &= ~PFF_ENABLED;
649 STAILQ_FOREACH(tmp, &pf->sc->card.pf_head, pf_list) {
650 if ((tmp->pf_flags & PFF_ENABLED) &&
651 (pf->ccr_base >= (tmp->ccr_base - tmp->pf_ccr_offset)) &&
652 ((pf->ccr_base + PCCARD_CCR_SIZE) <=
591 (tmp->ccr_base - tmp->pf_ccr_offset + tmp->pf_ccr_realsize)))
653 (tmp->ccr_base - tmp->pf_ccr_offset +
654 tmp->pf_ccr_realsize)))
592 break;
593 }
594
595 /* Not used by anyone else; unmap the CCR. */
596 if (tmp == NULL) {
597 bus_release_resource(dev, SYS_RES_MEMORY, pf->ccr_rid,
598 pf->ccr_res);
599 pf->ccr_res = NULL;
600 }
601
602 /*
603 * Decrement the reference count, and power down the socket, if
604 * necessary.
605 */
655 break;
656 }
657
658 /* Not used by anyone else; unmap the CCR. */
659 if (tmp == NULL) {
660 bus_release_resource(dev, SYS_RES_MEMORY, pf->ccr_rid,
661 pf->ccr_res);
662 pf->ccr_res = NULL;
663 }
664
665 /*
666 * Decrement the reference count, and power down the socket, if
667 * necessary.
668 */
606 if (--pf->sc->sc_enabled_count == 0)
607 POWER_DISABLE_SOCKET(device_get_parent(dev), dev);
608 DEVPRINTF((dev, "--enabled_count = %d\n", pf->sc->sc_enabled_count));
669 pf->sc->sc_enabled_count--;
609}
610
611#if 0
612/* XXX These functions are needed, but not like this XXX */
613int
614pccard_io_map(struct pccard_function *pf, int width, bus_addr_t offset,
615 bus_size_t size, struct pccard_io_handle *pcihp, int *windowp)
616{

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

718{
719 struct pccard_softc *sc = PCCARD_SOFTC(dev);
720
721 sc->dev = dev;
722 sc->sc_enabled_count = 0;
723 return (bus_generic_attach(dev));
724}
725
670}
671
672#if 0
673/* XXX These functions are needed, but not like this XXX */
674int
675pccard_io_map(struct pccard_function *pf, int width, bus_addr_t offset,
676 bus_size_t size, struct pccard_io_handle *pcihp, int *windowp)
677{

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

779{
780 struct pccard_softc *sc = PCCARD_SOFTC(dev);
781
782 sc->dev = dev;
783 sc->sc_enabled_count = 0;
784 return (bus_generic_attach(dev));
785}
786
787static int
788pccard_detach(device_t dev)
789{
790 pccard_detach_card(dev, 0);
791 return 0;
792}
793
726static void
727pccard_print_resources(struct resource_list *rl, const char *name, int type,
728 int count, const char *format)
729{
730 struct resource_list_entry *rle;
731 int printed;
732 int i;
733

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

797 if (type == SYS_RES_MEMORY && rid >= PCCARD_NMEM)
798 return (EINVAL);
799 if (type == SYS_RES_IRQ && rid >= PCCARD_NIRQ)
800 return (EINVAL);
801 if (type == SYS_RES_DRQ && rid >= PCCARD_NDRQ)
802 return (EINVAL);
803
804 resource_list_add(rl, type, rid, start, start + count - 1, count);
794static void
795pccard_print_resources(struct resource_list *rl, const char *name, int type,
796 int count, const char *format)
797{
798 struct resource_list_entry *rle;
799 int printed;
800 int i;
801

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

865 if (type == SYS_RES_MEMORY && rid >= PCCARD_NMEM)
866 return (EINVAL);
867 if (type == SYS_RES_IRQ && rid >= PCCARD_NIRQ)
868 return (EINVAL);
869 if (type == SYS_RES_DRQ && rid >= PCCARD_NDRQ)
870 return (EINVAL);
871
872 resource_list_add(rl, type, rid, start, start + count - 1, count);
805
806 return (0);
873 if (NULL != resource_list_alloc(rl, device_get_parent(dev), dev,
874 type, &rid, start, start + count - 1, count, 0))
875 return 0;
876 else
877 return ENOMEM;
807}
808
809static int
810pccard_get_resource(device_t dev, device_t child, int type, int rid,
811 u_long *startp, u_long *countp)
812{
813 struct pccard_ivar *devi = PCCARD_IVAR(child);
814 struct resource_list *rl = &devi->resources;

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

839 u_int32_t flags)
840{
841 return (CARD_SET_RES_FLAGS(device_get_parent(dev), child, type,
842 rid, flags));
843}
844
845static int
846pccard_set_memory_offset(device_t dev, device_t child, int rid,
878}
879
880static int
881pccard_get_resource(device_t dev, device_t child, int type, int rid,
882 u_long *startp, u_long *countp)
883{
884 struct pccard_ivar *devi = PCCARD_IVAR(child);
885 struct resource_list *rl = &devi->resources;

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

910 u_int32_t flags)
911{
912 return (CARD_SET_RES_FLAGS(device_get_parent(dev), child, type,
913 rid, flags));
914}
915
916static int
917pccard_set_memory_offset(device_t dev, device_t child, int rid,
847 u_int32_t offset, u_int32_t *deltap)
918 u_int32_t offset, u_int32_t *deltap)
848
849{
850 return (CARD_SET_MEMORY_OFFSET(device_get_parent(dev), child, rid,
851 offset, deltap));
852}
853
854static int
855pccard_read_ivar(device_t bus, device_t child, int which, u_char *result)

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

894 break;
895 }
896 return (0);
897}
898
899static void
900pccard_driver_added(device_t dev, driver_t *driver)
901{
919
920{
921 return (CARD_SET_MEMORY_OFFSET(device_get_parent(dev), child, rid,
922 offset, deltap));
923}
924
925static int
926pccard_read_ivar(device_t bus, device_t child, int which, u_char *result)

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

965 break;
966 }
967 return (0);
968}
969
970static void
971pccard_driver_added(device_t dev, driver_t *driver)
972{
902 /*
903 * XXX eventually we need to attach stuff when we know we
904 * XXX have kids. For now we do nothing because we normally
905 * XXX add children ourselves. We don't want to necessarily
906 * XXX force a reprobe.
907 */
973 struct pccard_softc *sc = PCCARD_SOFTC(dev);
974 struct pccard_function *pf;
975 device_t child;
976
977 if (sc->sc_enabled_count == 0) {
978 CARD_REPROBE_CARD(device_get_parent(dev), dev);
979 return;
980 }
981
982 STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) {
983 if (STAILQ_EMPTY(&pf->cfe_head))
984 continue;
985 child = pf->dev;
986 if (device_get_state(child) != DS_NOTPRESENT)
987 continue;
988 if (pccard_function_enable(pf) == 0 &&
989 device_probe_and_attach(child) == 0) {
990 DEVPRINTF((sc->dev, "function %d CCR at %d "
991 "offset %x: %x %x %x %x, %x %x %x %x, %x\n",
992 pf->number, pf->pf_ccr_window, pf->pf_ccr_offset,
993 pccard_ccr_read(pf, 0x00),
994 pccard_ccr_read(pf, 0x02), pccard_ccr_read(pf, 0x04),
995 pccard_ccr_read(pf, 0x06), pccard_ccr_read(pf, 0x0A),
996 pccard_ccr_read(pf, 0x0C), pccard_ccr_read(pf, 0x0E),
997 pccard_ccr_read(pf, 0x10), pccard_ccr_read(pf, 0x12)));
998 } else {
999 pccard_function_disable(pf);
1000 }
1001 }
1002 return;
908}
909
910static struct resource *
911pccard_alloc_resource(device_t dev, device_t child, int type, int *rid,
912 u_long start, u_long end, u_long count, u_int flags)
913{
1003}
1004
1005static struct resource *
1006pccard_alloc_resource(device_t dev, device_t child, int type, int *rid,
1007 u_long start, u_long end, u_long count, u_int flags)
1008{
914 struct resource_list_entry *rle = NULL;
1009 struct pccard_ivar *dinfo;
1010 struct resource_list_entry *rle = 0;
1011 int passthrough = (device_get_parent(child) != dev);
915
1012
916 /* XXX: This is an ugly way to fudge the resources. */
1013 if (passthrough) {
1014 return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child,
1015 type, rid, start, end, count, flags));
1016 }
917
1017
918 if (device_get_parent(child) == dev) {
919 struct pccard_ivar *devi = PCCARD_IVAR(child);
920 struct resource_list *rl = &devi->resources;
1018 dinfo = device_get_ivars(child);
1019 rle = resource_list_find(&dinfo->resources, type, *rid);
921
1020
922 rle = resource_list_find(rl, type, *rid);
923 }
1021 if (!rle)
1022 return NULL; /* no resource of that type/rid */
924
1023
925 if (rle != NULL) {
926 if (flags & RF_ACTIVE)
927 bus_activate_resource(dev, type, rle->rid, rle->res);
928 return (rle->res);
1024 if (!rle->res) {
1025 device_printf(dev, "WARNING: Resource not reserved by pccard bus\n");
1026 return NULL;
1027 } else {
1028 if (rle->res->r_dev != dev) return NULL;
1029 bus_release_resource(dev, type, *rid, rle->res);
1030 rle->res = NULL;
1031 switch(type) {
1032 case SYS_RES_IOPORT:
1033 case SYS_RES_MEMORY:
1034 if (!(flags & RF_ALIGNMENT_MASK))
1035 flags |= rman_make_alignment_flags(rle->count);
1036 break;
1037 case SYS_RES_IRQ:
1038 flags |= RF_SHAREABLE;
1039 break;
1040 }
1041 return resource_list_alloc(&dinfo->resources, dev, child, type,
1042 rid, rle->start, rle->end, rle->count, flags);
929 }
1043 }
930 return (bus_generic_alloc_resource(dev, child, type, rid, start,
931 end, count, flags));
932}
933
934static int
935pccard_release_resource(device_t dev, device_t child, int type, int rid,
936 struct resource *r)
937{
1044}
1045
1046static int
1047pccard_release_resource(device_t dev, device_t child, int type, int rid,
1048 struct resource *r)
1049{
938 struct resource_list_entry *rle = NULL;
1050 struct pccard_ivar *dinfo;
1051 int passthrough = (device_get_parent(child) != dev);
1052 struct resource_list_entry *rle = 0;
1053 int ret;
1054 int flags;
939
1055
940 if (device_get_parent(child) == dev) {
941 struct pccard_ivar *devi = PCCARD_IVAR(child);
942 struct resource_list *rl = &devi->resources;
1056 if (passthrough)
1057 return BUS_RELEASE_RESOURCE(device_get_parent(dev), child,
1058 type, rid, r);
943
1059
944 rle = resource_list_find(rl, type, rid);
945 }
1060 dinfo = device_get_ivars(child);
946
1061
947 if (rle != NULL) {
948 return (bus_deactivate_resource(dev, type, rle->rid, rle->res));
949 }
1062 rle = resource_list_find(&dinfo->resources, type, rid);
950
1063
951 return (bus_generic_release_resource(dev, child, type, rid, r));
952}
953
954static int
955pccard_activate_resource(device_t dev, device_t child, int type, int rid,
956 struct resource *r)
957{
958 /* XXX need to write to the COR to activate this for mf cards */
959 struct resource_list_entry *rle = NULL;
960
961 if (device_get_parent(child) == dev) {
962 struct pccard_ivar *devi = PCCARD_IVAR(child);
963 struct resource_list *rl = &devi->resources;
964
965 rle = resource_list_find(rl, type, rid);
1064 if (!rle) {
1065 device_printf(dev, "Allocated resource not found, "
1066 "%d %x %lx %lx\n",
1067 type, rid, rman_get_start(r), rman_get_size(r));
1068 return ENOENT;
966 }
1069 }
967
968 if (rle != NULL) {
969 return (bus_activate_resource(dev, type, rle->rid, rle->res));
1070 if (!rle->res) {
1071 device_printf(dev, "Allocated resource not recorded\n");
1072 return ENOENT;
970 }
971
1073 }
1074
972 return (bus_generic_activate_resource(dev, child, type, rid, r));
973}
974
975static int
976pccard_deactivate_resource(device_t dev, device_t child, int type, int rid,
977 struct resource *r)
978{
979 /* XXX need to write to the COR to deactivate this for mf cards */
980 struct resource_list_entry *rle = NULL;
981
982 if (device_get_parent(child) == dev) {
983 struct pccard_ivar *devi = PCCARD_IVAR(child);
984 struct resource_list *rl = &devi->resources;
985
986 rle = resource_list_find(rl, type, rid);
1075 ret = BUS_RELEASE_RESOURCE(device_get_parent(dev), child,
1076 type, rid, r);
1077 switch(type) {
1078 case SYS_RES_IOPORT:
1079 case SYS_RES_MEMORY:
1080 flags = rman_make_alignment_flags(rle->count);
1081 break;
1082 case SYS_RES_IRQ:
1083 flags = RF_SHAREABLE;
1084 break;
1085 default:
1086 flags = 0;
987 }
1087 }
988
989 if (rle != NULL) {
990 return (bus_deactivate_resource(dev, type, rle->rid, rle->res));
991 }
992
993 return (bus_generic_deactivate_resource(dev, child, type, rid, r));
1088 rle->res = bus_alloc_resource(dev, type, &rid,
1089 rle->start, rle->end, rle->count, flags);
1090 if (rle->res == NULL)
1091 device_printf(dev, "release_resource: "
1092 "unable to reaquire resource\n");
1093 return ret;
994}
995
996static void
997pccard_child_detached(device_t parent, device_t dev)
998{
999 struct pccard_ivar *ivar = PCCARD_IVAR(dev);
1094}
1095
1096static void
1097pccard_child_detached(device_t parent, device_t dev)
1098{
1099 struct pccard_ivar *ivar = PCCARD_IVAR(dev);
1100 struct pccard_function *pf = ivar->fcn;
1000
1101
1001 if (parent == device_get_parent(dev))
1002 free(ivar, M_DEVBUF);
1102 pccard_function_disable(pf);
1003}
1004
1005static void
1006pccard_intr(void *arg)
1007{
1103}
1104
1105static void
1106pccard_intr(void *arg)
1107{
1008 struct pccard_softc *sc = (struct pccard_softc *) arg;
1009 struct pccard_function *pf;
1010 STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) {
1011 if (pf->intr_handler != NULL) {
1012 int reg = pccard_ccr_read(pf, PCCARD_CCR_STATUS);
1013 if (reg & PCCARD_CCR_STATUS_INTR) {
1014 pccard_ccr_write(pf, PCCARD_CCR_STATUS,
1015 reg & ~PCCARD_CCR_STATUS_INTR);
1016 pf->intr_handler(pf->intr_handler_arg);
1017 }
1018 }
1108 struct pccard_function *pf = (struct pccard_function*) arg;
1109 int reg;
1110
1111 if (pf->intr_handler == NULL)
1112 panic("Null interrupt handler?\n");
1113
1114 reg = pccard_ccr_read(pf, PCCARD_CCR_STATUS);
1115 if (reg & PCCARD_CCR_STATUS_INTR) {
1116 pccard_ccr_write(pf, PCCARD_CCR_STATUS,
1117 reg & ~PCCARD_CCR_STATUS_INTR);
1118 pf->intr_handler(pf->intr_handler_arg);
1019 }
1020}
1021
1022static int
1023pccard_setup_intr(device_t dev, device_t child, struct resource *irq,
1024 int flags, driver_intr_t *intr, void *arg, void **cookiep)
1025{
1026 struct pccard_ivar *ivar = PCCARD_IVAR(child);
1027 struct pccard_function *func = ivar->fcn;
1119 }
1120}
1121
1122static int
1123pccard_setup_intr(device_t dev, device_t child, struct resource *irq,
1124 int flags, driver_intr_t *intr, void *arg, void **cookiep)
1125{
1126 struct pccard_ivar *ivar = PCCARD_IVAR(child);
1127 struct pccard_function *func = ivar->fcn;
1028 struct resource_list_entry *rle = NULL;
1029 struct pccard_softc *sc = device_get_softc(dev);
1030
1031 if (func->intr_handler != NULL)
1032 panic("Only one interrupt handler per function allowed\n");
1033
1128
1129 if (func->intr_handler != NULL)
1130 panic("Only one interrupt handler per function allowed\n");
1131
1034 rle = resource_list_find(&ivar->resources, SYS_RES_IRQ, 0);
1035 if (rle == NULL || rle->res != irq)
1036 panic("irq in setup_intr does not match allocated irq\n");
1037
1038 func->intr_handler = intr;
1039 func->intr_handler_arg = arg;
1132 func->intr_handler = intr;
1133 func->intr_handler_arg = arg;
1040 func->intr_handler_cookie = *cookiep = func;
1134 func->intr_handler_cookie = *cookiep;
1041 pccard_ccr_write(func, PCCARD_CCR_OPTION,
1135 pccard_ccr_write(func, PCCARD_CCR_OPTION,
1042 pccard_ccr_read(func, PCCARD_CCR_OPTION) |
1136 pccard_ccr_read(func, PCCARD_CCR_OPTION) |
1043 PCCARD_CCR_OPTION_IREQ_ENABLE);
1044
1137 PCCARD_CCR_OPTION_IREQ_ENABLE);
1138
1045 if (sc->intr_handler_count++ == 0) {
1046 rle = resource_list_find(&ivar->resources, SYS_RES_IRQ, 0);
1047 if (rle == NULL)
1048 panic("No IRQ for pccard?");
1049
1050 bus_setup_intr(dev, rle->res, INTR_TYPE_TTY/* | INTR_FAST*/,
1051 pccard_intr, sc, (void*)&sc->intr_handler_count);
1052 }
1139 bus_setup_intr(dev, irq, INTR_TYPE_TTY/* | INTR_FAST*/,
1140 pccard_intr, func, cookiep);
1053 return (0);
1054}
1055
1056static int
1057pccard_teardown_intr(device_t dev, device_t child, struct resource *r,
1058 void *cookie)
1059{
1060 struct pccard_ivar *ivar = PCCARD_IVAR(child);
1061 struct pccard_function *func = ivar->fcn;
1141 return (0);
1142}
1143
1144static int
1145pccard_teardown_intr(device_t dev, device_t child, struct resource *r,
1146 void *cookie)
1147{
1148 struct pccard_ivar *ivar = PCCARD_IVAR(child);
1149 struct pccard_function *func = ivar->fcn;
1062 struct pccard_softc *sc = device_get_softc(dev);
1150 int ret;
1063
1151
1064 if (func->intr_handler_cookie != cookie)
1065 panic("pccard teardown of unknown interrupt handler\n");
1066
1067 func->intr_handler = NULL;
1068 func->intr_handler_arg = NULL;
1069 func->intr_handler_cookie = NULL;
1070 pccard_ccr_write(func, PCCARD_CCR_OPTION,
1071 pccard_ccr_read(func, PCCARD_CCR_OPTION) &
1072 ~PCCARD_CCR_OPTION_IREQ_ENABLE);
1073
1152 pccard_ccr_write(func, PCCARD_CCR_OPTION,
1153 pccard_ccr_read(func, PCCARD_CCR_OPTION) &
1154 ~PCCARD_CCR_OPTION_IREQ_ENABLE);
1155
1074 if (--sc->intr_handler_count == 0) {
1075 struct resource_list_entry *rle = NULL;
1076
1077 rle = resource_list_find(&ivar->resources, SYS_RES_IRQ, 0);
1078 if (rle == NULL)
1079 panic("No IRQ for pccard?");
1080
1081 bus_teardown_intr(dev, rle->res, &sc->intr_handler_count);
1156 ret = bus_teardown_intr(dev, r, cookie);
1157 if (ret == 0) {
1158 func->intr_handler = NULL;
1159 func->intr_handler_arg = NULL;
1160 func->intr_handler_cookie = NULL;
1082 }
1161 }
1083 return (0);
1162
1163 return (ret);
1084}
1085
1086static device_method_t pccard_methods[] = {
1087 /* Device interface */
1088 DEVMETHOD(device_probe, pccard_probe),
1089 DEVMETHOD(device_attach, pccard_attach),
1164}
1165
1166static device_method_t pccard_methods[] = {
1167 /* Device interface */
1168 DEVMETHOD(device_probe, pccard_probe),
1169 DEVMETHOD(device_attach, pccard_attach),
1090 DEVMETHOD(device_detach, bus_generic_detach),
1170 DEVMETHOD(device_detach, pccard_detach),
1091 DEVMETHOD(device_shutdown, bus_generic_shutdown),
1092 DEVMETHOD(device_suspend, bus_generic_suspend),
1093 DEVMETHOD(device_resume, bus_generic_resume),
1094
1095 /* Bus interface */
1096 DEVMETHOD(bus_print_child, pccard_print_child),
1097 DEVMETHOD(bus_driver_added, pccard_driver_added),
1098 DEVMETHOD(bus_child_detached, pccard_child_detached),
1099 DEVMETHOD(bus_alloc_resource, pccard_alloc_resource),
1100 DEVMETHOD(bus_release_resource, pccard_release_resource),
1171 DEVMETHOD(device_shutdown, bus_generic_shutdown),
1172 DEVMETHOD(device_suspend, bus_generic_suspend),
1173 DEVMETHOD(device_resume, bus_generic_resume),
1174
1175 /* Bus interface */
1176 DEVMETHOD(bus_print_child, pccard_print_child),
1177 DEVMETHOD(bus_driver_added, pccard_driver_added),
1178 DEVMETHOD(bus_child_detached, pccard_child_detached),
1179 DEVMETHOD(bus_alloc_resource, pccard_alloc_resource),
1180 DEVMETHOD(bus_release_resource, pccard_release_resource),
1101 DEVMETHOD(bus_activate_resource, pccard_activate_resource),
1102 DEVMETHOD(bus_deactivate_resource, pccard_deactivate_resource),
1181 DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
1182 DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
1103 DEVMETHOD(bus_setup_intr, pccard_setup_intr),
1104 DEVMETHOD(bus_teardown_intr, pccard_teardown_intr),
1105 DEVMETHOD(bus_set_resource, pccard_set_resource),
1106 DEVMETHOD(bus_get_resource, pccard_get_resource),
1107 DEVMETHOD(bus_delete_resource, pccard_delete_resource),
1108 DEVMETHOD(bus_read_ivar, pccard_read_ivar),
1109
1110 /* Card Interface */

--- 25 unchanged lines hidden ---
1183 DEVMETHOD(bus_setup_intr, pccard_setup_intr),
1184 DEVMETHOD(bus_teardown_intr, pccard_teardown_intr),
1185 DEVMETHOD(bus_set_resource, pccard_set_resource),
1186 DEVMETHOD(bus_get_resource, pccard_get_resource),
1187 DEVMETHOD(bus_delete_resource, pccard_delete_resource),
1188 DEVMETHOD(bus_read_ivar, pccard_read_ivar),
1189
1190 /* Card Interface */

--- 25 unchanged lines hidden ---