Deleted Added
full compact
ethernet.c (232812) ethernet.c (242346)
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:

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

22
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#include <sys/cdefs.h>
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:

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

22
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#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/mips/cavium/octe/ethernet.c 232812 2012-03-11 06:17:49Z jmallett $");
30__FBSDID("$FreeBSD: head/sys/mips/cavium/octe/ethernet.c 242346 2012-10-30 06:36:14Z jmallett $");
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/bus.h>
35#include <sys/conf.h>
36#include <sys/endian.h>
37#include <sys/kernel.h>
38#include <sys/rman.h>

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

69int pow_receive_group = 15;
70TUNABLE_INT("hw.octe.pow_receive_group", &pow_receive_group);
71/*
72 "\t\tPOW group to receive packets from. All ethernet hardware\n"
73 "\t\twill be configured to send incomming packets to this POW\n"
74 "\t\tgroup. Also any other software can submit packets to this\n"
75 "\t\tgroup for the kernel to process." */
76
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/bus.h>
35#include <sys/conf.h>
36#include <sys/endian.h>
37#include <sys/kernel.h>
38#include <sys/rman.h>

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

69int pow_receive_group = 15;
70TUNABLE_INT("hw.octe.pow_receive_group", &pow_receive_group);
71/*
72 "\t\tPOW group to receive packets from. All ethernet hardware\n"
73 "\t\twill be configured to send incomming packets to this POW\n"
74 "\t\tgroup. Also any other software can submit packets to this\n"
75 "\t\tgroup for the kernel to process." */
76
77extern int octeon_is_simulation(void);
78
79/**
80 * Periodic timer to check auto negotiation
81 */
82static struct callout cvm_oct_poll_timer;
83
84/**
85 * Array of every ethernet device owned by this driver indexed by
86 * the ipd input port number.

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

223 cvm_oct_num_output_buffers);
224 }
225
226 if (USE_RED)
227 cvmx_helper_setup_red(num_packet_buffers/4,
228 num_packet_buffers/8);
229
230 /* Enable the MII interface */
77/**
78 * Periodic timer to check auto negotiation
79 */
80static struct callout cvm_oct_poll_timer;
81
82/**
83 * Array of every ethernet device owned by this driver indexed by
84 * the ipd input port number.

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

221 cvm_oct_num_output_buffers);
222 }
223
224 if (USE_RED)
225 cvmx_helper_setup_red(num_packet_buffers/4,
226 num_packet_buffers/8);
227
228 /* Enable the MII interface */
231 if (!octeon_is_simulation())
229 if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_SIM)
232 cvmx_write_csr(CVMX_SMI_EN, 1);
233
234 /* Register an IRQ hander for to receive POW interrupts */
235 rid = 0;
236 sc->sc_rx_irq = bus_alloc_resource(bus, SYS_RES_IRQ, &rid,
237 OCTEON_IRQ_WORKQ0 + pow_receive_group,
238 OCTEON_IRQ_WORKQ0 + pow_receive_group,
239 1, RF_ACTIVE);

--- 272 unchanged lines hidden ---
230 cvmx_write_csr(CVMX_SMI_EN, 1);
231
232 /* Register an IRQ hander for to receive POW interrupts */
233 rid = 0;
234 sc->sc_rx_irq = bus_alloc_resource(bus, SYS_RES_IRQ, &rid,
235 OCTEON_IRQ_WORKQ0 + pow_receive_group,
236 OCTEON_IRQ_WORKQ0 + pow_receive_group,
237 1, RF_ACTIVE);

--- 272 unchanged lines hidden ---