xref: /linux/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.h (revision 10bfec0a2b4b9d3b81e09b43266ebe370bb17760)
1230ead01SArkadi Sharshevsky /*
2230ead01SArkadi Sharshevsky  * drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.h
3230ead01SArkadi Sharshevsky  * Copyright (c) 2017 Mellanox Technologies. All rights reserved.
4230ead01SArkadi Sharshevsky  * Copyright (c) 2017 Arkadi Sharshevsky <arkadis@mellanox.com>
5230ead01SArkadi Sharshevsky  *
6230ead01SArkadi Sharshevsky  * Redistribution and use in source and binary forms, with or without
7230ead01SArkadi Sharshevsky  * modification, are permitted provided that the following conditions are met:
8230ead01SArkadi Sharshevsky  *
9230ead01SArkadi Sharshevsky  * 1. Redistributions of source code must retain the above copyright
10230ead01SArkadi Sharshevsky  *    notice, this list of conditions and the following disclaimer.
11230ead01SArkadi Sharshevsky  * 2. Redistributions in binary form must reproduce the above copyright
12230ead01SArkadi Sharshevsky  *    notice, this list of conditions and the following disclaimer in the
13230ead01SArkadi Sharshevsky  *    documentation and/or other materials provided with the distribution.
14230ead01SArkadi Sharshevsky  * 3. Neither the names of the copyright holders nor the names of its
15230ead01SArkadi Sharshevsky  *    contributors may be used to endorse or promote products derived from
16230ead01SArkadi Sharshevsky  *    this software without specific prior written permission.
17230ead01SArkadi Sharshevsky  *
18230ead01SArkadi Sharshevsky  * Alternatively, this software may be distributed under the terms of the
19230ead01SArkadi Sharshevsky  * GNU General Public License ("GPL") version 2 as published by the Free
20230ead01SArkadi Sharshevsky  * Software Foundation.
21230ead01SArkadi Sharshevsky  *
22230ead01SArkadi Sharshevsky  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23230ead01SArkadi Sharshevsky  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24230ead01SArkadi Sharshevsky  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25230ead01SArkadi Sharshevsky  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26230ead01SArkadi Sharshevsky  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27230ead01SArkadi Sharshevsky  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28230ead01SArkadi Sharshevsky  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29230ead01SArkadi Sharshevsky  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30230ead01SArkadi Sharshevsky  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31230ead01SArkadi Sharshevsky  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32230ead01SArkadi Sharshevsky  * POSSIBILITY OF SUCH DAMAGE.
33230ead01SArkadi Sharshevsky  */
34230ead01SArkadi Sharshevsky 
35230ead01SArkadi Sharshevsky #ifndef _MLXSW_PIPELINE_H_
36230ead01SArkadi Sharshevsky #define _MLXSW_PIPELINE_H_
37230ead01SArkadi Sharshevsky 
38*10bfec0aSJiri Pirko #if IS_ENABLED(CONFIG_NET_DEVLINK)
39*10bfec0aSJiri Pirko 
40230ead01SArkadi Sharshevsky int mlxsw_sp_dpipe_init(struct mlxsw_sp *mlxsw_sp);
41230ead01SArkadi Sharshevsky void mlxsw_sp_dpipe_fini(struct mlxsw_sp *mlxsw_sp);
42230ead01SArkadi Sharshevsky 
43*10bfec0aSJiri Pirko #else
44*10bfec0aSJiri Pirko 
45*10bfec0aSJiri Pirko static inline int mlxsw_sp_dpipe_init(struct mlxsw_sp *mlxsw_sp)
46*10bfec0aSJiri Pirko {
47*10bfec0aSJiri Pirko 	return 0;
48*10bfec0aSJiri Pirko }
49*10bfec0aSJiri Pirko 
50*10bfec0aSJiri Pirko static inline void mlxsw_sp_dpipe_fini(struct mlxsw_sp *mlxsw_sp)
51*10bfec0aSJiri Pirko {
52*10bfec0aSJiri Pirko }
53*10bfec0aSJiri Pirko 
54*10bfec0aSJiri Pirko #endif
55*10bfec0aSJiri Pirko 
56d54b70feSArkadi Sharshevsky #define MLXSW_SP_DPIPE_TABLE_NAME_ERIF "mlxsw_erif"
576aecb36bSArkadi Sharshevsky #define MLXSW_SP_DPIPE_TABLE_NAME_HOST4 "mlxsw_host4"
58d54b70feSArkadi Sharshevsky 
59230ead01SArkadi Sharshevsky #endif /* _MLXSW_PIPELINE_H_*/
60