From owner-p4-projects@FreeBSD.ORG Wed Dec 13 19:59:26 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AE43F16A526; Wed, 13 Dec 2006 19:59:26 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8518016A522 for ; Wed, 13 Dec 2006 19:59:26 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A0C743E79 for ; Wed, 13 Dec 2006 19:50:54 +0000 (GMT) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kBDJqBlB038274 for ; Wed, 13 Dec 2006 19:52:11 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kBDJqAux038271 for perforce@freebsd.org; Wed, 13 Dec 2006 19:52:10 GMT (envelope-from piso@freebsd.org) Date: Wed, 13 Dec 2006 19:52:10 GMT Message-Id: <200612131952.kBDJqAux038271@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 111647 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Dec 2006 19:59:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=111647 Change 111647 by piso@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;