From owner-p4-projects@FreeBSD.ORG Sat Oct 14 15:39:31 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 8D42C16A47B; Sat, 14 Oct 2006 15:39:31 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5114C16A416 for ; Sat, 14 Oct 2006 15:39:31 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 19F3143D7D for ; Sat, 14 Oct 2006 15:39:25 +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 k9EFdOYN035279 for ; Sat, 14 Oct 2006 15:39:24 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k9EFdOXC035274 for perforce@freebsd.org; Sat, 14 Oct 2006 15:39:24 GMT (envelope-from piso@freebsd.org) Date: Sat, 14 Oct 2006 15:39:24 GMT Message-Id: <200610141539.k9EFdOXC035274@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 107899 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: Sat, 14 Oct 2006 15:39:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=107899 Change 107899 by piso@piso_newluxor on 2006/10/14 15:38:37 filter-ize fxp. Affected files ... .. //depot/projects/soc2006/intr_filter/dev/fxp/if_fxp.c#4 edit Differences ... ==== //depot/projects/soc2006/intr_filter/dev/fxp/if_fxp.c#4 (text+ko) ==== @@ -211,7 +211,9 @@ static int fxp_shutdown(device_t dev); static int fxp_suspend(device_t dev); static int fxp_resume(device_t dev); - +#ifdef INTR_FILTER +static int fxp_filter(void *xsc); +#endif static void fxp_intr(void *xsc); static void fxp_intr_body(struct fxp_softc *sc, struct ifnet *ifp, uint8_t statack, int count); @@ -804,8 +806,14 @@ /* * Hook our interrupt after all initialization is complete. */ + +#ifdef INTR_FILTER + error = bus_setup_intr(dev, sc->fxp_res[1], INTR_TYPE_NET | INTR_MPSAFE, + fxp_filter, fxp_intr, sc, &sc->ih); +#else error = bus_setup_intr(dev, sc->fxp_res[1], INTR_TYPE_NET | INTR_MPSAFE, NULL, fxp_intr, sc, &sc->ih); +#endif if (error) { device_printf(dev, "could not setup irq\n"); ether_ifdetach(sc->ifp); @@ -1482,6 +1490,23 @@ } #endif /* DEVICE_POLLING */ +#ifdef INTR_FILTER +static int +fxp_filter(void *xsc) +{ + struct fxp_softc *sc = xsc; + uint8_t statack; + + statack = CSR_READ_1(sc, FXP_CSR_SCB_STATACK); + if (statack == 0xff || statack == 0) + return (FILTER_STRAY); + + /* disable interrupts */ + CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, FXP_SCB_INTR_DISABLE); + return (FILTER_HANDLED|FILTER_SCHEDULE_THREAD); +} +#endif + /* * Process interface interrupts. */ @@ -1522,6 +1547,10 @@ CSR_WRITE_1(sc, FXP_CSR_SCB_STATACK, statack); fxp_intr_body(sc, ifp, statack, -1); } +#ifdef INTR_FILTER + /* enable interrupts */ + CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, 0); +#endif FXP_UNLOCK(sc); }