summaryrefslogtreecommitdiffstats
path: root/sys/mips
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2013-05-02 19:47:36 +0000
committerimp <imp@FreeBSD.org>2013-05-02 19:47:36 +0000
commit4f1c369b1ff5e5dc0b3c3ac6af693afa2cb40d9a (patch)
tree2a450c5f8a0b5f09f73c5dbc0736134fe33ae1d4 /sys/mips
parent4335f7f258f47aee00251d7bc0685cc4a165a071 (diff)
downloadFreeBSD-src-4f1c369b1ff5e5dc0b3c3ac6af693afa2cb40d9a.zip
FreeBSD-src-4f1c369b1ff5e5dc0b3c3ac6af693afa2cb40d9a.tar.gz
Use cvmx_mgmt_port_num_ports() instead of the inlined copy of a
previous version of this function.
Diffstat (limited to 'sys/mips')
-rw-r--r--sys/mips/cavium/octe/ethernet-common.c17
-rw-r--r--sys/mips/cavium/octe/wrapper-cvmx-includes.h1
2 files changed, 2 insertions, 16 deletions
diff --git a/sys/mips/cavium/octe/ethernet-common.c b/sys/mips/cavium/octe/ethernet-common.c
index 80847f9..5349427 100644
--- a/sys/mips/cavium/octe/ethernet-common.c
+++ b/sys/mips/cavium/octe/ethernet-common.c
@@ -107,22 +107,7 @@ int cvm_assign_mac_address(uint64_t *macp, uint8_t *octets)
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;
}
diff --git a/sys/mips/cavium/octe/wrapper-cvmx-includes.h b/sys/mips/cavium/octe/wrapper-cvmx-includes.h
index 414faba..a7caf09 100644
--- a/sys/mips/cavium/octe/wrapper-cvmx-includes.h
+++ b/sys/mips/cavium/octe/wrapper-cvmx-includes.h
@@ -44,6 +44,7 @@ AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR W
#include <contrib/octeon-sdk/cvmx-app-init.h>
#include <contrib/octeon-sdk/cvmx-helper.h>
#include <contrib/octeon-sdk/cvmx-helper-board.h>
+#include <contrib/octeon-sdk/cvmx-mgmt-port.h>
#include <mips/cavium/octeon_irq.h>
#include <contrib/octeon-sdk/octeon-model.h>
OpenPOWER on IntegriCloud