The Lanner MR-730 uses the first two MACs at its MAC base for the 10/100

management ports, and gigabit ports start at an offset of 2 from the MAC
base.
This commit is contained in:
jmallett 2011-02-12 02:41:33 +00:00
parent 8f9934fd6b
commit dc1138bc7d
2 changed files with 37 additions and 4 deletions

View File

@ -64,6 +64,8 @@
#include <contrib/octeon-sdk/cvmx-interrupt.h>
#include <contrib/octeon-sdk/cvmx-mgmt-port.h>
extern cvmx_bootinfo_t *octeon_bootinfo;
struct octm_softc {
struct ifnet *sc_ifp;
device_t sc_dev;
@ -173,10 +175,27 @@ octm_attach(device_t dev)
return (ENXIO);
}
mac = cvmx_mgmt_port_get_mac(sc->sc_port);
if (mac == CVMX_MGMT_PORT_GET_MAC_ERROR) {
device_printf(dev, "unable to read MAC.\n");
return (ENXIO);
switch (cvmx_sysinfo_get()->board_type) {
#if defined(OCTEON_VENDOR_LANNER)
case CVMX_BOARD_TYPE_CUST_LANNER_MR730:
/*
* The MR-730 uses its first two MACs for the management
* ports.
*/
mac = 0;
memcpy((u_int8_t *)&mac + 2, octeon_bootinfo->mac_addr_base,
6);
mac += sc->sc_port;
cvmx_mgmt_port_set_mac(sc->sc_port, mac);
break;
#endif
default:
mac = cvmx_mgmt_port_get_mac(sc->sc_port);
if (mac == CVMX_MGMT_PORT_GET_MAC_ERROR) {
device_printf(dev, "unable to read MAC.\n");
return (ENXIO);
}
break;
}
/* No watermark for input ring. */

View File

@ -279,6 +279,20 @@ int cvm_oct_common_init(struct ifnet *ifp)
octeon_bootinfo->mac_addr_base[5] + count};
cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc;
switch (cvmx_sysinfo_get()->board_type) {
#if defined(OCTEON_VENDOR_LANNER)
case CVMX_BOARD_TYPE_CUST_LANNER_MR730:
/*
* The MR-730 uses its first two MACs for the management
* ports.
*/
mac[5] += 2;
break;
#endif
default:
break;
}
ifp->if_mtu = ETHERMTU;
count++;