Back to home page

OSCL-LXR

 
 

    


0001 /***********************license start***************
0002  * Author: Cavium Networks
0003  *
0004  * Contact: support@caviumnetworks.com
0005  * This file is part of the OCTEON SDK
0006  *
0007  * Copyright (c) 2003-2008 Cavium Networks
0008  *
0009  * This file is free software; you can redistribute it and/or modify
0010  * it under the terms of the GNU General Public License, Version 2, as
0011  * published by the Free Software Foundation.
0012  *
0013  * This file is distributed in the hope that it will be useful, but
0014  * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
0015  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
0016  * NONINFRINGEMENT.  See the GNU General Public License for more
0017  * details.
0018  *
0019  * You should have received a copy of the GNU General Public License
0020  * along with this file; if not, write to the Free Software
0021  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
0022  * or visit http://www.gnu.org/licenses/.
0023  *
0024  * This file may also be available under a different license from Cavium.
0025  * Contact Cavium Networks for more information
0026  ***********************license end**************************************/
0027 
0028 /**
0029  * @file
0030  *
0031  * Functions for XAUI initialization, configuration,
0032  * and monitoring.
0033  *
0034  */
0035 #ifndef __CVMX_HELPER_XAUI_H__
0036 #define __CVMX_HELPER_XAUI_H__
0037 
0038 /**
0039  * Probe a XAUI interface and determine the number of ports
0040  * connected to it. The XAUI interface should still be down
0041  * after this call.
0042  *
0043  * @interface: Interface to probe
0044  *
0045  * Returns Number of ports on the interface. Zero to disable.
0046  */
0047 extern int __cvmx_helper_xaui_probe(int interface);
0048 extern int __cvmx_helper_xaui_enumerate(int interface);
0049 
0050 /**
0051  * Bringup and enable a XAUI interface. After this call packet
0052  * I/O should be fully functional. This is called with IPD
0053  * enabled but PKO disabled.
0054  *
0055  * @interface: Interface to bring up
0056  *
0057  * Returns Zero on success, negative on failure
0058  */
0059 extern int __cvmx_helper_xaui_enable(int interface);
0060 
0061 /**
0062  * Return the link state of an IPD/PKO port as returned by
0063  * auto negotiation. The result of this function may not match
0064  * Octeon's link config if auto negotiation has changed since
0065  * the last call to cvmx_helper_link_set().
0066  *
0067  * @ipd_port: IPD/PKO port to query
0068  *
0069  * Returns Link state
0070  */
0071 extern union cvmx_helper_link_info __cvmx_helper_xaui_link_get(int ipd_port);
0072 
0073 /**
0074  * Configure an IPD/PKO port for the specified link state. This
0075  * function does not influence auto negotiation at the PHY level.
0076  * The passed link state must always match the link state returned
0077  * by cvmx_helper_link_get().
0078  *
0079  * @ipd_port:  IPD/PKO port to configure
0080  * @link_info: The new link state
0081  *
0082  * Returns Zero on success, negative on failure
0083  */
0084 extern int __cvmx_helper_xaui_link_set(int ipd_port,
0085                        union cvmx_helper_link_info link_info);
0086 
0087 #endif