Deleted Added
sdiff udiff text old ( 226024 ) new ( 231987 )
full compact
1/*************************************************************************
2Copyright (c) 2003-2007 Cavium Networks (support@cavium.com). All rights
3reserved.
4
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are
8met:

--- 14 unchanged lines hidden (view full) ---

23This Software, including technical data, may be subject to U.S. export control laws, including the U.S. Export Administration Act and its associated regulations, and may be subject to export or import regulations in other countries.
24
25TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
26AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
27
28*************************************************************************/
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/mips/cavium/octe/ethernet-common.c 226024 2011-10-04 20:17:43Z marcel $");
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/bus.h>
36#include <sys/endian.h>
37#include <sys/kernel.h>
38#include <sys/mbuf.h>
39#include <sys/socket.h>
40
41#include <net/ethernet.h>
42#include <net/if.h>
43
44#include "wrapper-cvmx-includes.h"
45#include "ethernet-headers.h"
46
47extern int octeon_is_simulation(void);
48
49
50/**
51 * Set the multicast list. Currently unimplemented.
52 *
53 * @param dev Device to work on
54 */
55void cvm_oct_common_set_multicast_list(struct ifnet *ifp)
56{

--- 28 unchanged lines hidden (view full) ---

85 cvmx_write_csr(CVMX_GMXX_RXX_ADR_CAM_EN(index, interface), 1);
86
87 cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmx_cfg.u64);
88 }
89}
90
91
92/**
93 * Set the hardware MAC address for a device
94 *
95 * @param dev Device to change the MAC address for
96 * @param addr Address structure to change it too.
97 */
98void cvm_oct_common_set_mac_address(struct ifnet *ifp, const void *addr)
99{
100 cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc;

--- 162 unchanged lines hidden (view full) ---

263/**
264 * Per network device initialization
265 *
266 * @param dev Device to initialize
267 * @return Zero on success
268 */
269int cvm_oct_common_init(struct ifnet *ifp)
270{
271 char mac[6] = {
272 cvmx_sysinfo_get()->mac_addr_base[0],
273 cvmx_sysinfo_get()->mac_addr_base[1],
274 cvmx_sysinfo_get()->mac_addr_base[2],
275 cvmx_sysinfo_get()->mac_addr_base[3],
276 cvmx_sysinfo_get()->mac_addr_base[4],
277 cvmx_sysinfo_get()->mac_addr_base[5] };
278 cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc;
279
280 mac[5] += cvm_oct_mac_addr_offset++;
281
282 ifp->if_mtu = ETHERMTU;
283
284 cvm_oct_mdio_setup_device(ifp);
285
286 cvm_oct_common_set_mac_address(ifp, mac);
287 cvm_oct_common_change_mtu(ifp, ifp->if_mtu);
288

--- 25 unchanged lines hidden ---