From owner-svn-src-all@FreeBSD.ORG Thu May 2 19:47:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 72EBD2FD; Thu, 2 May 2013 19:47:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4BC8712A1; Thu, 2 May 2013 19:47:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42JlbqG094780; Thu, 2 May 2013 19:47:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42Jlaf3094778; Thu, 2 May 2013 19:47:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305021947.r42Jlaf3094778@svn.freebsd.org> From: Warner Losh Date: Thu, 2 May 2013 19:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250192 - head/sys/mips/cavium/octe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 02 May 2013 19:47:37 -0000 Author: imp Date: Thu May 2 19:47:36 2013 New Revision: 250192 URL: http://svnweb.freebsd.org/changeset/base/250192 Log: Use cvmx_mgmt_port_num_ports() instead of the inlined copy of a previous version of this function. Modified: head/sys/mips/cavium/octe/ethernet-common.c head/sys/mips/cavium/octe/wrapper-cvmx-includes.h Modified: head/sys/mips/cavium/octe/ethernet-common.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-common.c Thu May 2 19:45:53 2013 (r250191) +++ head/sys/mips/cavium/octe/ethernet-common.c Thu May 2 19:47:36 2013 (r250192) @@ -107,22 +107,7 @@ int cvm_assign_mac_address(uint64_t *mac if (cvm_oct_mac_addr == 0) return ENXIO; - /* - * The offset from mac_addr_base that should be used for the next port - * that is configured. By convention, if any mgmt ports exist on the - * chip, they get the first mac addresses. The ports controlled by - * driver that use this function are numbered sequencially following - * any mgmt addresses that may exist. - * - * XXX Would be nice if __cvmx_mgmt_port_num_ports() were - * not static to cvmx-mgmt-port.c. - */ - if (OCTEON_IS_MODEL(OCTEON_CN56XX)) - cvm_oct_mac_addr_offset = 1; - else if (OCTEON_IS_MODEL(OCTEON_CN52XX) || OCTEON_IS_MODEL(OCTEON_CN63XX)) - cvm_oct_mac_addr_offset = 2; - else - cvm_oct_mac_addr_offset = 0; + cvm_oct_mac_addr_offset = cvmx_mgmt_port_num_ports(); cvm_oct_mac_addr += cvm_oct_mac_addr_offset; } Modified: head/sys/mips/cavium/octe/wrapper-cvmx-includes.h ============================================================================== --- head/sys/mips/cavium/octe/wrapper-cvmx-includes.h Thu May 2 19:45:53 2013 (r250191) +++ head/sys/mips/cavium/octe/wrapper-cvmx-includes.h Thu May 2 19:47:36 2013 (r250192) @@ -44,6 +44,7 @@ AND WITH ALL FAULTS AND CAVIUM NETWORKS #include #include #include +#include #include #include