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

--- 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>
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-rgmii.c 232812 2012-03-11 06:17:49Z jmallett $");
31__FBSDID("$FreeBSD: head/sys/mips/cavium/octe/ethernet-rgmii.c 242346 2012-10-30 06:36:14Z jmallett $");
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/rman.h>

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

44#include <net/ethernet.h>
45#include <net/if.h>
46
47#include "wrapper-cvmx-includes.h"
48#include "ethernet-headers.h"
49
50#include "octebusvar.h"
51
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/rman.h>

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

44#include <net/ethernet.h>
45#include <net/if.h>
46
47#include "wrapper-cvmx-includes.h"
48#include "ethernet-headers.h"
49
50#include "octebusvar.h"
51
52extern int octeon_is_simulation(void);
53extern struct ifnet *cvm_oct_device[];
54
55static struct mtx global_register_lock;
56MTX_SYSINIT(global_register_lock, &global_register_lock,
57 "RGMII Global", MTX_SPIN);
58
59static int number_rgmii_ports;
60

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

251 }
252 number_rgmii_ports++;
253
254 /* Only true RGMII ports need to be polled. In GMII mode, port 0 is really
255 a RGMII port */
256 if (((priv->imode == CVMX_HELPER_INTERFACE_MODE_GMII) && (priv->port == 0)) ||
257 (priv->imode == CVMX_HELPER_INTERFACE_MODE_RGMII)) {
258
52extern struct ifnet *cvm_oct_device[];
53
54static struct mtx global_register_lock;
55MTX_SYSINIT(global_register_lock, &global_register_lock,
56 "RGMII Global", MTX_SPIN);
57
58static int number_rgmii_ports;
59

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

250 }
251 number_rgmii_ports++;
252
253 /* Only true RGMII ports need to be polled. In GMII mode, port 0 is really
254 a RGMII port */
255 if (((priv->imode == CVMX_HELPER_INTERFACE_MODE_GMII) && (priv->port == 0)) ||
256 (priv->imode == CVMX_HELPER_INTERFACE_MODE_RGMII)) {
257
259 if (!octeon_is_simulation()) {
258 if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_SIM) {
260
261 cvmx_gmxx_rxx_int_en_t gmx_rx_int_en;
262 int interface = INTERFACE(priv->port);
263 int index = INDEX(priv->port);
264
265 /* Enable interrupts on inband status changes for this port */
266 gmx_rx_int_en.u64 = cvmx_read_csr(CVMX_GMXX_RXX_INT_EN(index, interface));
267 gmx_rx_int_en.s.phy_dupx = 1;

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

280 cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc;
281 cvm_oct_common_uninit(ifp);
282
283 /* Only true RGMII ports need to be polled. In GMII mode, port 0 is really
284 a RGMII port */
285 if (((priv->imode == CVMX_HELPER_INTERFACE_MODE_GMII) && (priv->port == 0)) ||
286 (priv->imode == CVMX_HELPER_INTERFACE_MODE_RGMII)) {
287
259
260 cvmx_gmxx_rxx_int_en_t gmx_rx_int_en;
261 int interface = INTERFACE(priv->port);
262 int index = INDEX(priv->port);
263
264 /* Enable interrupts on inband status changes for this port */
265 gmx_rx_int_en.u64 = cvmx_read_csr(CVMX_GMXX_RXX_INT_EN(index, interface));
266 gmx_rx_int_en.s.phy_dupx = 1;

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

279 cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc;
280 cvm_oct_common_uninit(ifp);
281
282 /* Only true RGMII ports need to be polled. In GMII mode, port 0 is really
283 a RGMII port */
284 if (((priv->imode == CVMX_HELPER_INTERFACE_MODE_GMII) && (priv->port == 0)) ||
285 (priv->imode == CVMX_HELPER_INTERFACE_MODE_RGMII)) {
286
288 if (!octeon_is_simulation()) {
287 if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_SIM) {
289
290 cvmx_gmxx_rxx_int_en_t gmx_rx_int_en;
291 int interface = INTERFACE(priv->port);
292 int index = INDEX(priv->port);
293
294 /* Disable interrupts on inband status changes for this port */
295 gmx_rx_int_en.u64 = cvmx_read_csr(CVMX_GMXX_RXX_INT_EN(index, interface));
296 gmx_rx_int_en.s.phy_dupx = 0;

--- 12 unchanged lines hidden ---
288
289 cvmx_gmxx_rxx_int_en_t gmx_rx_int_en;
290 int interface = INTERFACE(priv->port);
291 int index = INDEX(priv->port);
292
293 /* Disable interrupts on inband status changes for this port */
294 gmx_rx_int_en.u64 = cvmx_read_csr(CVMX_GMXX_RXX_INT_EN(index, interface));
295 gmx_rx_int_en.s.phy_dupx = 0;

--- 12 unchanged lines hidden ---