From owner-p4-projects@FreeBSD.ORG Fri Nov 17 19:02:46 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 BA3BF16A47C; Fri, 17 Nov 2006 19:02:46 +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 7903016A417 for ; Fri, 17 Nov 2006 19:02:46 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B071B43D8A for ; Fri, 17 Nov 2006 19:02:36 +0000 (GMT) (envelope-from sam@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 kAHJ2ajx030165 for ; Fri, 17 Nov 2006 19:02:36 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kAHJ2aMV030161 for perforce@freebsd.org; Fri, 17 Nov 2006 19:02:36 GMT (envelope-from sam@freebsd.org) Date: Fri, 17 Nov 2006 19:02:36 GMT Message-Id: <200611171902.kAHJ2aMV030161@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 110166 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: Fri, 17 Nov 2006 19:02:47 -0000 http://perforce.freebsd.org/chv.cgi?CH=110166 Change 110166 by sam@sam_ebb on 2006/11/17 19:02:31 o the physical address of the h/w descriptor passed to an NPE does include the portid in the low bits; not sure what goes there o correct format of NPE_SETRXQOSENTRY msg; the NPE id goes in bits 20..23, not the portid; this fixes the rx q setup for npe1 o correct memset on deactivate With these changes npe1 seems to work fine. Affected files ... .. //depot/projects/arm/src/sys/arm/xscale/ixp425/if_npe.c#23 edit Differences ... ==== //depot/projects/arm/src/sys/arm/xscale/ixp425/if_npe.c#23 (text+ko) ==== @@ -442,7 +442,6 @@ npe_dma_setup(struct npe_softc *sc, struct npedma *dma, const char *name, int nbuf, int maxseg) { - int portid = npeconfig[device_get_unit(sc->sc_dev)].portid; int error, i; memset(dma, 0, sizeof(dma)); @@ -515,8 +514,6 @@ "error %u\n", dma->name, i, error); return error; } - /* add port id once */ - npe->ix_neaddr |= portid << 3; npe->ix_hw = hw; } bus_dmamap_sync(dma->buf_tag, dma->buf_map, BUS_DMASYNC_PREWRITE); @@ -543,7 +540,7 @@ bus_dma_tag_destroy(dma->buf_tag); if (dma->mtag) bus_dma_tag_destroy(dma->mtag); - memset(dma, 0, sizeof(dma)); + memset(dma, 0, sizeof(*dma)); } static int @@ -553,7 +550,6 @@ int unit = device_get_unit(dev); int error, i; - /* load NPE firmware and start it running */ error = ixpnpe_init(sc->sc_npe, "npe_fw", npeconfig[unit].imageid); if (error != 0) @@ -1472,10 +1468,10 @@ static int npe_setrxqosentry(struct npe_softc *sc, int classix, int trafclass, int qid) { - int portid = npeconfig[device_get_unit(sc->sc_dev)].portid; + int npeid = npeconfig[device_get_unit(sc->sc_dev)].npeid; uint32_t msg[2]; - msg[0] = (NPE_SETRXQOSENTRY << 24) | (portid << 16) | classix; + msg[0] = (NPE_SETRXQOSENTRY << 24) | (npeid << 20) | classix; msg[1] = (trafclass << 24) | (1 << 23) | (qid << 16) | (qid << 4); return ixpnpe_sendandrecvmsg(sc->sc_npe, msg, msg); }