From owner-svn-src-all@FreeBSD.ORG Wed Jun 17 02:53:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9C351065674; Wed, 17 Jun 2009 02:53:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7CCB8FC19; Wed, 17 Jun 2009 02:53:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5H2r5bW059982; Wed, 17 Jun 2009 02:53:05 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5H2r5Tc059980; Wed, 17 Jun 2009 02:53:05 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906170253.n5H2r5Tc059980@svn.freebsd.org> From: Sam Leffler Date: Wed, 17 Jun 2009 02:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194321 - head/sys/arm/xscale/ixp425 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2009 02:53:06 -0000 Author: sam Date: Wed Jun 17 02:53:05 2009 New Revision: 194321 URL: http://svn.freebsd.org/changeset/base/194321 Log: o correct default miibase for NPE-B and NPE-C; these values are normally taken from the hints file so this should have no effect o set the port address "just in case" o add NPE-A support to the tx done qmgr callback Modified: head/sys/arm/xscale/ixp425/if_npe.c Modified: head/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/if_npe.c Wed Jun 17 02:52:35 2009 (r194320) +++ head/sys/arm/xscale/ixp425/if_npe.c Wed Jun 17 02:53:05 2009 (r194321) @@ -153,9 +153,9 @@ struct npe_softc { * 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. + * Note that the PHY's are accessible only from MAC B on the + * IXP425 and from MAC C on other devices. This and other + * platform-specific assumptions are handled with hints. */ static const struct { uint32_t macbase; @@ -177,7 +177,7 @@ static const struct { }, [NPE_B] = { .macbase = IXP425_MAC_B_HWBASE, - .miibase = IXP425_MAC_C_HWBASE, + .miibase = IXP425_MAC_B_HWBASE, .phy = 0, .rx_qid = 4, .rx_freeqid = 27, @@ -186,7 +186,7 @@ static const struct { }, [NPE_C] = { .macbase = IXP425_MAC_C_HWBASE, - .miibase = IXP425_MAC_C_HWBASE, + .miibase = IXP425_MAC_B_HWBASE, .phy = 1, .rx_qid = 12, .rx_freeqid = 28, @@ -239,6 +239,7 @@ static int npeioctl(struct ifnet * ifp, static int npe_setrxqosentry(struct npe_softc *, int classix, int trafclass, int qid); +static int npe_setportaddress(struct npe_softc *, const uint8_t mac[]); static int npe_setfirewallmode(struct npe_softc *, int onoff); static int npe_updatestats(struct npe_softc *); #if 0 @@ -666,7 +667,7 @@ npe_mac_reset(struct npe_softc *sc) static int npe_activate(device_t dev) { - struct npe_softc * sc = device_get_softc(dev); + struct npe_softc *sc = device_get_softc(dev); int error, i, macbase, miibase; /* @@ -1024,7 +1025,7 @@ npe_txdone(int qid, void *arg) struct txdone *td, q[NPE_MAX]; uint32_t entry; - /* XXX no NPE-A support */ + q[NPE_A].tail = &q[NPE_A].head; q[NPE_A].count = 0; q[NPE_B].tail = &q[NPE_B].head; q[NPE_B].count = 0; q[NPE_C].tail = &q[NPE_C].head; q[NPE_C].count = 0; /* XXX max # at a time? */ @@ -1043,6 +1044,8 @@ npe_txdone(int qid, void *arg) td->count++; } + if (q[NPE_A].count) + npe_txdone_finish(npes[NPE_A], &q[NPE_A]); if (q[NPE_B].count) npe_txdone_finish(npes[NPE_B], &q[NPE_B]); if (q[NPE_C].count) @@ -1252,6 +1255,7 @@ if (ifp->if_drv_flags & IFF_DRV_RUNNING) WR4(sc, NPE_MAC_RX_CNTRL2, 0); npe_setmac(sc, IF_LLADDR(ifp)); + npe_setportaddress(sc, IF_LLADDR(ifp)); npe_setmcast(sc); npe_startxmit(sc); @@ -1552,6 +1556,22 @@ npe_setrxqosentry(struct npe_softc *sc, } static int +npe_setportaddress(struct npe_softc *sc, const uint8_t mac[ETHER_ADDR_LEN]) +{ + uint32_t msg[2]; + + msg[0] = (NPE_SETPORTADDRESS << 24) + | (sc->sc_npeid << 20) + | (mac[0] << 8) + | (mac[1] << 0); + msg[1] = (mac[2] << 24) + | (mac[3] << 16) + | (mac[4] << 8) + | (mac[5] << 0); + return ixpnpe_sendandrecvmsg_sync(sc->sc_npe, msg, msg); +} + +static int npe_setfirewallmode(struct npe_softc *sc, int onoff) { uint32_t msg[2];