diff options
author | Juli Mallett <jmallett@FreeBSD.org> | 2010-11-28 06:20:41 +0000 |
---|---|---|
committer | Juli Mallett <jmallett@FreeBSD.org> | 2010-11-28 06:20:41 +0000 |
commit | 7a1e830cbcd5d33aa7fcdd8732e6ea26510508fd (patch) | |
tree | b8a47c127e9100c1078d4e43f050dccc3b15f210 /cvmx-mgmt-port.h | |
parent | 1c305b501145f696d3597fb9b5b2091caaa6f67c (diff) | |
download | src-7a1e830cbcd5d33aa7fcdd8732e6ea26510508fd.tar.gz src-7a1e830cbcd5d33aa7fcdd8732e6ea26510508fd.zip |
Import Cavium Octeon SDK 2.0 Simple Executive from cnusers.org.vendor/octeon-sdk/2.0.0
Notes
Notes:
svn path=/vendor-sys/octeon-sdk/dist/; revision=215976
svn path=/vendor-sys/octeon-sdk/2.0.0/; revision=215977; tag=vendor/octeon-sdk/2.0.0
Diffstat (limited to 'cvmx-mgmt-port.h')
-rw-r--r-- | cvmx-mgmt-port.h | 128 |
1 files changed, 76 insertions, 52 deletions
diff --git a/cvmx-mgmt-port.h b/cvmx-mgmt-port.h index 6b78cf60cfa2..90b531da5d77 100644 --- a/cvmx-mgmt-port.h +++ b/cvmx-mgmt-port.h @@ -1,39 +1,40 @@ /***********************license start*************** - * Copyright (c) 2003-2008 Cavium Networks (support@cavium.com). All rights - * reserved. - * - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of Cavium Networks nor the names of - * its contributors may be used to endorse or promote products - * derived from this software without specific prior written - * permission. - * - * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" - * AND 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. - * - * - * For any questions regarding licensing please contact marketing@caviumnetworks.com - * + * Copyright (c) 2003-2010 Cavium Networks (support@cavium.com). All rights + * reserved. + * + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + + * * Neither the name of Cavium Networks nor the names of + * its contributors may be used to endorse or promote products + * derived from this software without specific prior written + * permission. + + * This 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. + + * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" + * AND 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. ***********************license end**************************************/ @@ -41,17 +42,25 @@ + /** * @file * * Support functions for managing the MII management port * - * <hr>$Revision: 42115 $<hr> + * <hr>$Revision: 49448 $<hr> */ #ifndef __CVMX_MGMT_PORT_H__ #define __CVMX_MGMT_PORT_H__ +#include "cvmx-helper.h" +#include "cvmx-helper-board.h" + +#ifdef __cplusplus +extern "C" { +#endif + #define CVMX_MGMT_PORT_NUM_PORTS 2 /* Right now we only have one mgmt port */ #define CVMX_MGMT_PORT_NUM_TX_BUFFERS 16 /* Number of TX ring buffer entries and buffers */ #define CVMX_MGMT_PORT_NUM_RX_BUFFERS 128 /* Number of RX ring buffer entries and buffers */ @@ -63,11 +72,12 @@ typedef enum CVMX_MGMT_PORT_SUCCESS = 0, CVMX_MGMT_PORT_NO_MEMORY = -1, CVMX_MGMT_PORT_INVALID_PARAM = -2, + CVMX_MGMT_PORT_INIT_ERROR = -3, } cvmx_mgmt_port_result_t; /* Enumeration of Net Device interface flags. */ -typedef enum +typedef enum { CVMX_IFF_PROMISC = 0x100, /* receive all packets */ CVMX_IFF_ALLMULTI = 0x200, /* receive all multicast packets */ @@ -137,20 +147,6 @@ extern cvmx_mgmt_port_result_t cvmx_mgmt_port_send(int port, int packet_len, voi extern int cvmx_mgmt_port_receive(int port, int buffer_len, void *buffer); /** - * Get the management port link status: - * 100 = 100Mbps, full duplex - * 10 = 10Mbps, full duplex - * 0 = Link down - * -10 = 10Mpbs, half duplex - * -100 = 100Mbps, half duplex - * - * @param port Management port - * - * @return - */ -extern int cvmx_mgmt_port_get_link(int port); - -/** * Set the MAC address for a management port * * @param port Management port @@ -168,6 +164,7 @@ extern cvmx_mgmt_port_result_t cvmx_mgmt_port_set_mac(int port, uint64_t mac); * @return MAC address */ extern uint64_t cvmx_mgmt_port_get_mac(int port); +#define CVMX_MGMT_PORT_GET_MAC_ERROR ((unsigned long long)-2LL) /** * Set the multicast list. @@ -185,9 +182,36 @@ extern void cvmx_mgmt_port_set_multicast_list(int port, int flags); * to 1514 assuming the standard 14 byte L2 header. * * @param port Management port - * @param size_without_crc + * @param size_without_fcs * Size in bytes without FCS */ extern void cvmx_mgmt_port_set_max_packet_size(int port, int size_without_fcs); +/** + * Return the link state of an RGMII/MII port as returned by + * auto negotiation. The result of this function may not match + * Octeon's link config if auto negotiation has changed since + * the last call to __cvmx_mgmt_port_link_set(). + * + * @param port The RGMII/MII interface port to query + * + * @return Link state + */ +extern cvmx_helper_link_info_t cvmx_mgmt_port_link_get(int port); + +/** + * Configure RGMII/MII port for the specified link state. This + * function does not influence auto negotiation at the PHY level. + * + * @param port RGMII/MII interface port + * @param link_info The new link state + * + * @return Zero on success, negative on failure + */ +extern int cvmx_mgmt_port_link_set(int port, cvmx_helper_link_info_t link_info); + +#ifdef __cplusplus +} +#endif + #endif /* __CVMX_MGMT_PORT_H__ */ |