PERFORCE change 111647 for review
Paolo Pisati
piso at FreeBSD.org
Wed Dec 13 11:59:27 PST 2006
http://perforce.freebsd.org/chv.cgi?CH=111647
Change 111647 by piso at piso_newluxor on 2006/12/13 19:51:53
Fix pccbb making cbb_func_intr() filter-friendly:
o make it pass down the filter's result.
o in case of a missing card, treat it as legitim case
and return FILTER_HANDLED (just to eoi the interrupt).
Affected files ...
.. //depot/projects/soc2006/intr_filter/dev/pccbb/pccbb.c#7 edit
.. //depot/projects/soc2006/intr_filter/dev/pccbb/pccbbvar.h#5 edit
Differences ...
==== //depot/projects/soc2006/intr_filter/dev/pccbb/pccbb.c#7 (text+ko) ====
@@ -177,7 +177,7 @@
device_t child);
static void cbb_cardbus_power_disable_socket(device_t brdev,
device_t child);
-static void cbb_func_intr(void *arg);
+static int cbb_func_intr(void *arg);
static void
cbb_remove_res(struct cbb_softc *sc, struct resource *res)
@@ -362,16 +362,13 @@
* least common denominator until the base system supports mixing
* and matching better.
*/
- if (IS_FAST(filter, intr))
+ if (filter == NULL)
return (EINVAL);
ih = malloc(sizeof(struct cbb_intrhand), M_DEVBUF, M_NOWAIT);
if (ih == NULL)
return (ENOMEM);
*cookiep = ih;
- /*
- * XXX_FILTER this code doesn't take care of filters.
- */
- ih->intr = intr;
+ ih->intr = filter;
ih->arg = arg;
ih->sc = sc;
/*
@@ -379,7 +376,7 @@
* XXX for now that's all we need to do.
*/
err = BUS_SETUP_INTR(device_get_parent(dev), child, irq, flags,
- filter, cbb_func_intr, ih, &ih->cookie);
+ cbb_func_intr, intr, ih, &ih->cookie);
if (err != 0) {
free(ih, M_DEVBUF);
return (err);
@@ -604,7 +601,7 @@
* cbb_func_intr(), we could just check the SOCKET_MASK register and if
* CD changes were clear there, then we'd know the card was gone.
*/
-static void
+static int
cbb_func_intr(void *arg)
{
struct cbb_intrhand *ih = (struct cbb_intrhand *)arg;
@@ -614,17 +611,17 @@
* Make sure that the card is really there.
*/
if ((sc->flags & CBB_CARD_OK) == 0)
- return;
+ return (FILTER_HANDLED);
if (!CBB_CARD_PRESENT(cbb_get(sc, CBB_SOCKET_STATE))) {
sc->flags &= ~CBB_CARD_OK;
- return;
+ return (FILTER_HANDLED);
}
/*
* nb: don't have to check for giant or not, since that's done
* in the ISR dispatch
*/
- (*ih->intr)(ih->arg);
+ return ((*ih->intr)(ih->arg));
}
/************************************************************************/
==== //depot/projects/soc2006/intr_filter/dev/pccbb/pccbbvar.h#5 (text+ko) ====
@@ -32,7 +32,7 @@
*/
struct cbb_intrhand {
- driver_intr_t *intr;
+ driver_filter_t *intr;
void *arg;
struct cbb_softc *sc;
void *cookie;
More information about the p4-projects
mailing list