xref: /OK3568_Linux_fs/kernel/arch/mips/include/asm/octeon/cvmx-helper-loop.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /***********************license start***************
2*4882a593Smuzhiyun  * Author: Cavium Networks
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Contact: support@caviumnetworks.com
5*4882a593Smuzhiyun  * This file is part of the OCTEON SDK
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  * Copyright (c) 2003-2008 Cavium Networks
8*4882a593Smuzhiyun  *
9*4882a593Smuzhiyun  * This file is free software; you can redistribute it and/or modify
10*4882a593Smuzhiyun  * it under the terms of the GNU General Public License, Version 2, as published by
11*4882a593Smuzhiyun  * the Free Software Foundation.
12*4882a593Smuzhiyun  *
13*4882a593Smuzhiyun  * This file is distributed in the hope that it will be useful,
14*4882a593Smuzhiyun  * but AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty of
15*4882a593Smuzhiyun  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or NONINFRINGEMENT.
16*4882a593Smuzhiyun  * See the GNU General Public License for more details.
17*4882a593Smuzhiyun  *
18*4882a593Smuzhiyun  * You should have received a copy of the GNU General Public License
19*4882a593Smuzhiyun  * along with this file; if not, write to the Free Software
20*4882a593Smuzhiyun  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21*4882a593Smuzhiyun  * or visit http://www.gnu.org/licenses/.
22*4882a593Smuzhiyun  *
23*4882a593Smuzhiyun  * This file may also be available under a different license from Cavium.
24*4882a593Smuzhiyun  * Contact Cavium Networks for more information
25*4882a593Smuzhiyun  ***********************license end**************************************/
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun /**
28*4882a593Smuzhiyun  * @file
29*4882a593Smuzhiyun  *
30*4882a593Smuzhiyun  * Functions for LOOP initialization, configuration,
31*4882a593Smuzhiyun  * and monitoring.
32*4882a593Smuzhiyun  *
33*4882a593Smuzhiyun  */
34*4882a593Smuzhiyun #ifndef __CVMX_HELPER_LOOP_H__
35*4882a593Smuzhiyun #define __CVMX_HELPER_LOOP_H__
36*4882a593Smuzhiyun 
37*4882a593Smuzhiyun /**
38*4882a593Smuzhiyun  * Probe a LOOP interface and determine the number of ports
39*4882a593Smuzhiyun  * connected to it. The LOOP interface should still be down after
40*4882a593Smuzhiyun  * this call.
41*4882a593Smuzhiyun  *
42*4882a593Smuzhiyun  * @interface: Interface to probe
43*4882a593Smuzhiyun  *
44*4882a593Smuzhiyun  * Returns Number of ports on the interface. Zero to disable.
45*4882a593Smuzhiyun  */
46*4882a593Smuzhiyun extern int __cvmx_helper_loop_probe(int interface);
__cvmx_helper_loop_enumerate(int interface)47*4882a593Smuzhiyun static inline int __cvmx_helper_loop_enumerate(int interface) {return 4; }
48*4882a593Smuzhiyun 
49*4882a593Smuzhiyun /**
50*4882a593Smuzhiyun  * Bringup and enable a LOOP interface. After this call packet
51*4882a593Smuzhiyun  * I/O should be fully functional. This is called with IPD
52*4882a593Smuzhiyun  * enabled but PKO disabled.
53*4882a593Smuzhiyun  *
54*4882a593Smuzhiyun  * @interface: Interface to bring up
55*4882a593Smuzhiyun  *
56*4882a593Smuzhiyun  * Returns Zero on success, negative on failure
57*4882a593Smuzhiyun  */
58*4882a593Smuzhiyun extern int __cvmx_helper_loop_enable(int interface);
59*4882a593Smuzhiyun 
60*4882a593Smuzhiyun #endif
61