From owner-p4-projects@FreeBSD.ORG Sun Nov 12 17:40:37 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 4DE7E16A47C; Sun, 12 Nov 2006 17:40:37 +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 E1CA616A412 for ; Sun, 12 Nov 2006 17:40:36 +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 DB0D543D7E for ; Sun, 12 Nov 2006 17:40:34 +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 kACHeYoN047071 for ; Sun, 12 Nov 2006 17:40:34 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kACHeYMn047064 for perforce@freebsd.org; Sun, 12 Nov 2006 17:40:34 GMT (envelope-from sam@freebsd.org) Date: Sun, 12 Nov 2006 17:40:34 GMT Message-Id: <200611121740.kACHeYMn047064@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 109807 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: Sun, 12 Nov 2006 17:40:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=109807 Change 109807 by sam@sam_ebb on 2006/11/12 17:39:51 add comments Affected files ... .. //depot/projects/arm/src/sys/arm/xscale/ixp425/if_npe.c#22 edit Differences ... ==== //depot/projects/arm/src/sys/arm/xscale/ixp425/if_npe.c#22 (text+ko) ==== @@ -25,6 +25,22 @@ #include __FBSDID("$FreeBSD$"); +/* + * Intel XScale NPE Ethernet driver. + * + * This driver handles the two ports present on the IXP425. + * Packet processing is done by the Network Processing Engines + * (NPE's) that work together with a MAC and PHY. The MAC + * is also mapped to the XScale cpu; the PHY is accessed via + * the MAC. NPE-XScale communication happens through h/w + * queues managed by the Q Manager block. + * + * The code here replaces the ethAcc, ethMii, and ethDB classes + * in the Intel Access Library (IAL) and the OS-specific driver. + * + * XXX add vlan support + * XXX NPE-C port doesn't work yet + */ #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" #endif @@ -120,7 +136,15 @@ }; /* - * Per-unit static configuration for IXP425. + * Per-unit static configuration for IXP425. The tx and + * rx free Q id's are fixed by the NPE microcode. The + * rx Q id's are programmed to be separate to simplify + * multi-port processing. It may be better to handle + * all traffic through one Q (as done by the Intel drivers). + * + * Note that the PHY's are accessible only from MAC A + * on the IXP425. This and other platform-specific + * assumptions probably need to be handled through hints. */ static const struct { const char *desc; /* device description */ @@ -756,6 +780,15 @@ NPE_ASSERT_LOCKED(sc); + /* + * NB: to avoid sleeping with the softc lock held we + * split the NPE msg processing into two parts. The + * request for statistics is sent w/o waiting for a + * reply and then on the next tick we retrieve the + * results. This works because npe_tick is the only + * code that talks via the mailbox's (except at setup). + * This likely can be handled better. + */ if (ixpnpe_recvmsg(sc->sc_npe, msg) == 0 && msg[0] == ACK) { bus_dmamap_sync(sc->sc_stats_tag, sc->sc_stats_map, BUS_DMASYNC_POSTREAD); @@ -822,9 +855,9 @@ * Q manager callback on tx done queue. Reap mbufs * and return tx buffers to the free list. Finally * restart output. Note the microcode has only one - * txdone q wired into it so we must use the port id - * returned with each npebuf to decide where to send - * buffers. + * txdone q wired into it so we must use the NPE ID + * returned with each npehwbuf to decide where to + * send buffers. */ static void npe_txdone(int qid, void *arg) @@ -1021,7 +1054,7 @@ struct ifnet *ifp = sc->sc_ifp; NPE_ASSERT_LOCKED(sc); -if (ifp->if_drv_flags & IFF_DRV_RUNNING) return; +if (ifp->if_drv_flags & IFF_DRV_RUNNING) return;/*XXX*/ /* * Reset MAC core. @@ -1177,7 +1210,7 @@ } /* - * dequeu packets and transmit + * Dequeue packets and place on the h/w transmit queue. */ static void npestart_locked(struct ifnet *ifp)