cvmx-helper-ilk.h revision 232809
1232809Sjmallett/***********************license start*************** 2232809Sjmallett * Copyright (c) 2010 Cavium Inc. (support@cavium.com). All rights 3232809Sjmallett * reserved. 4232809Sjmallett * 5232809Sjmallett * 6232809Sjmallett * Redistribution and use in source and binary forms, with or without 7232809Sjmallett * modification, are permitted provided that the following conditions are 8232809Sjmallett * met: 9232809Sjmallett * 10232809Sjmallett * * Redistributions of source code must retain the above copyright 11232809Sjmallett * notice, this list of conditions and the following disclaimer. 12232809Sjmallett * 13232809Sjmallett * * Redistributions in binary form must reproduce the above 14232809Sjmallett * copyright notice, this list of conditions and the following 15232809Sjmallett * disclaimer in the documentation and/or other materials provided 16232809Sjmallett * with the distribution. 17232809Sjmallett 18232809Sjmallett * * Neither the name of Cavium Inc. nor the names of 19232809Sjmallett * its contributors may be used to endorse or promote products 20232809Sjmallett * derived from this software without specific prior written 21232809Sjmallett * permission. 22232809Sjmallett 23232809Sjmallett * This Software, including technical data, may be subject to U.S. export control 24232809Sjmallett * laws, including the U.S. Export Administration Act and its associated 25232809Sjmallett * regulations, and may be subject to export or import regulations in other 26232809Sjmallett * countries. 27232809Sjmallett 28232809Sjmallett * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" 29232809Sjmallett * AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS OR 30232809Sjmallett * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO 31232809Sjmallett * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR 32232809Sjmallett * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM 33232809Sjmallett * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE, 34232809Sjmallett * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF 35232809Sjmallett * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR 36232809Sjmallett * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR 37232809Sjmallett * PERFORMANCE OF THE SOFTWARE LIES WITH YOU. 38232809Sjmallett ***********************license end**************************************/ 39232809Sjmallett 40232809Sjmallett 41232809Sjmallett 42232809Sjmallett 43232809Sjmallett 44232809Sjmallett 45232809Sjmallett 46232809Sjmallett/** 47232809Sjmallett * @file 48232809Sjmallett * 49232809Sjmallett * Functions for ILK initialization, configuration, 50232809Sjmallett * and monitoring. 51232809Sjmallett * 52232809Sjmallett * <hr>$Revision: 41586 $<hr> 53232809Sjmallett */ 54232809Sjmallett#ifndef __CVMX_HELPER_ILK_H__ 55232809Sjmallett#define __CVMX_HELPER_ILK_H__ 56232809Sjmallett 57232809Sjmallettextern int __cvmx_helper_ilk_enumerate(int interface); 58232809Sjmallett 59232809Sjmallett/** 60232809Sjmallett * @INTERNAL 61232809Sjmallett * Probe a ILK interface and determine the number of ports 62232809Sjmallett * connected to it. The ILK interface should still be down after 63232809Sjmallett * this call. 64232809Sjmallett * 65232809Sjmallett * @param interface Interface to probe 66232809Sjmallett * 67232809Sjmallett * @return Number of ports on the interface. Zero to disable. 68232809Sjmallett */ 69232809Sjmallettextern int __cvmx_helper_ilk_probe(int interface); 70232809Sjmallett 71232809Sjmallett/** 72232809Sjmallett * @INTERNAL 73232809Sjmallett * Bringup and enable a ILK interface. After this call packet 74232809Sjmallett * I/O should be fully functional. This is called with IPD 75232809Sjmallett * enabled but PKO disabled. 76232809Sjmallett * 77232809Sjmallett * @param interface Interface to bring up 78232809Sjmallett * 79232809Sjmallett * @return Zero on success, negative on failure 80232809Sjmallett */ 81232809Sjmallettextern int __cvmx_helper_ilk_enable(int interface); 82232809Sjmallett 83232809Sjmallett/** 84232809Sjmallett * @INTERNAL 85232809Sjmallett * Return the link state of an IPD/PKO port as returned by ILK link status. 86232809Sjmallett * 87232809Sjmallett * @param ipd_port IPD/PKO port to query 88232809Sjmallett * 89232809Sjmallett * @return Link state 90232809Sjmallett */ 91232809Sjmallettextern cvmx_helper_link_info_t __cvmx_helper_ilk_link_get(int ipd_port); 92232809Sjmallett 93232809Sjmallett/** 94232809Sjmallett * @INTERNAL 95232809Sjmallett * Configure an IPD/PKO port for the specified link state. This 96232809Sjmallett * function does not influence auto negotiation at the PHY level. 97232809Sjmallett * The passed link state must always match the link state returned 98232809Sjmallett * by cvmx_helper_link_get(). It is normally best to use 99232809Sjmallett * cvmx_helper_link_autoconf() instead. 100232809Sjmallett * 101232809Sjmallett * @param ipd_port IPD/PKO port to configure 102232809Sjmallett * @param link_info The new link state 103232809Sjmallett * 104232809Sjmallett * @return Zero on success, negative on failure 105232809Sjmallett */ 106232809Sjmallettextern int __cvmx_helper_ilk_link_set(int ipd_port, cvmx_helper_link_info_t link_info); 107232809Sjmallett 108232809Sjmallettextern void __cvmx_helper_ilk_show_stats (void); 109232809Sjmallett#endif 110232809Sjmallett 111