From owner-svn-src-stable-8@FreeBSD.ORG Sat Nov 13 00:58:35 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FAF410656A5; Sat, 13 Nov 2010 00:58:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E67958FC1D; Sat, 13 Nov 2010 00:58:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD0wYgj029608; Sat, 13 Nov 2010 00:58:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD0wYhD029606; Sat, 13 Nov 2010 00:58:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011130058.oAD0wYhD029606@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 13 Nov 2010 00:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215216 - stable/8/sys/dev/sk X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 00:58:35 -0000 Author: yongari Date: Sat Nov 13 00:58:34 2010 New Revision: 215216 URL: http://svn.freebsd.org/changeset/base/215216 Log: MFC r214899: Fix a long standing bug in programming station address for Yukon controllers. sk(4) never reprogrammed station address for Yukon controllers so overriding station address with ifconfig(8) was not possible. Fix the bug by reprogramming all registers that control station address, flow-control and virtual station address. Virtual station address has no use at this moment since driver does not make use of fail over feature. Tested by: "Mikhail T." aldan.algebra.com> Modified: stable/8/sys/dev/sk/if_sk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sk/if_sk.c ============================================================================== --- stable/8/sys/dev/sk/if_sk.c Sat Nov 13 00:55:16 2010 (r215215) +++ stable/8/sys/dev/sk/if_sk.c Sat Nov 13 00:58:34 2010 (r215216) @@ -3356,6 +3356,7 @@ sk_init_yukon(sc_if) u_int16_t reg; struct sk_softc *sc; struct ifnet *ifp; + u_int8_t *eaddr; int i; SK_IF_LOCK_ASSERT(sc_if); @@ -3431,19 +3432,19 @@ sk_init_yukon(sc_if) reg |= YU_SMR_MFL_JUMBO; SK_YU_WRITE_2(sc_if, YUKON_SMR, reg); - /* Setup Yukon's address */ - for (i = 0; i < 3; i++) { - /* Write Source Address 1 (unicast filter) */ + /* Setup Yukon's station address */ + eaddr = IF_LLADDR(sc_if->sk_ifp); + for (i = 0; i < 3; i++) + SK_YU_WRITE_2(sc_if, SK_MAC0_0 + i * 4, + eaddr[i * 2] | eaddr[i * 2 + 1] << 8); + /* Set GMAC source address of flow control. */ + for (i = 0; i < 3; i++) SK_YU_WRITE_2(sc_if, YUKON_SAL1 + i * 4, - IF_LLADDR(sc_if->sk_ifp)[i * 2] | - IF_LLADDR(sc_if->sk_ifp)[i * 2 + 1] << 8); - } - - for (i = 0; i < 3; i++) { - reg = sk_win_read_2(sc_if->sk_softc, - SK_MAC1_0 + i * 2 + sc_if->sk_port * 8); - SK_YU_WRITE_2(sc_if, YUKON_SAL2 + i * 4, reg); - } + eaddr[i * 2] | eaddr[i * 2 + 1] << 8); + /* Set GMAC virtual address. */ + for (i = 0; i < 3; i++) + SK_YU_WRITE_2(sc_if, YUKON_SAL2 + i * 4, + eaddr[i * 2] | eaddr[i * 2 + 1] << 8); /* Set Rx filter */ sk_rxfilter_yukon(sc_if);