1*14b24e2bSVaishali Kulkarni /*
2*14b24e2bSVaishali Kulkarni * CDDL HEADER START
3*14b24e2bSVaishali Kulkarni *
4*14b24e2bSVaishali Kulkarni * The contents of this file are subject to the terms of the
5*14b24e2bSVaishali Kulkarni * Common Development and Distribution License, v.1,  (the "License").
6*14b24e2bSVaishali Kulkarni * You may not use this file except in compliance with the License.
7*14b24e2bSVaishali Kulkarni *
8*14b24e2bSVaishali Kulkarni * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*14b24e2bSVaishali Kulkarni * or http://opensource.org/licenses/CDDL-1.0.
10*14b24e2bSVaishali Kulkarni * See the License for the specific language governing permissions
11*14b24e2bSVaishali Kulkarni * and limitations under the License.
12*14b24e2bSVaishali Kulkarni *
13*14b24e2bSVaishali Kulkarni * When distributing Covered Code, include this CDDL HEADER in each
14*14b24e2bSVaishali Kulkarni * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*14b24e2bSVaishali Kulkarni * If applicable, add the following below this CDDL HEADER, with the
16*14b24e2bSVaishali Kulkarni * fields enclosed by brackets "[]" replaced with your own identifying
17*14b24e2bSVaishali Kulkarni * information: Portions Copyright [yyyy] [name of copyright owner]
18*14b24e2bSVaishali Kulkarni *
19*14b24e2bSVaishali Kulkarni * CDDL HEADER END
20*14b24e2bSVaishali Kulkarni */
21*14b24e2bSVaishali Kulkarni 
22*14b24e2bSVaishali Kulkarni /*
23*14b24e2bSVaishali Kulkarni * Copyright 2014-2017 Cavium, Inc.
24*14b24e2bSVaishali Kulkarni * The contents of this file are subject to the terms of the Common Development
25*14b24e2bSVaishali Kulkarni * and Distribution License, v.1,  (the "License").
26*14b24e2bSVaishali Kulkarni 
27*14b24e2bSVaishali Kulkarni * You may not use this file except in compliance with the License.
28*14b24e2bSVaishali Kulkarni 
29*14b24e2bSVaishali Kulkarni * You can obtain a copy of the License at available
30*14b24e2bSVaishali Kulkarni * at http://opensource.org/licenses/CDDL-1.0
31*14b24e2bSVaishali Kulkarni 
32*14b24e2bSVaishali Kulkarni * See the License for the specific language governing permissions and
33*14b24e2bSVaishali Kulkarni * limitations under the License.
34*14b24e2bSVaishali Kulkarni */
35*14b24e2bSVaishali Kulkarni 
36*14b24e2bSVaishali Kulkarni #ifndef __ECORE_DCBX_H__
37*14b24e2bSVaishali Kulkarni #define __ECORE_DCBX_H__
38*14b24e2bSVaishali Kulkarni 
39*14b24e2bSVaishali Kulkarni #include "ecore.h"
40*14b24e2bSVaishali Kulkarni #include "ecore_mcp.h"
41*14b24e2bSVaishali Kulkarni #include "mcp_public.h"
42*14b24e2bSVaishali Kulkarni #include "reg_addr.h"
43*14b24e2bSVaishali Kulkarni #include "ecore_hw.h"
44*14b24e2bSVaishali Kulkarni #include "ecore_hsi_common.h"
45*14b24e2bSVaishali Kulkarni #include "ecore_dcbx_api.h"
46*14b24e2bSVaishali Kulkarni 
47*14b24e2bSVaishali Kulkarni struct ecore_dcbx_info {
48*14b24e2bSVaishali Kulkarni 	struct lldp_status_params_s lldp_remote[LLDP_MAX_LLDP_AGENTS];
49*14b24e2bSVaishali Kulkarni 	struct lldp_config_params_s lldp_local[LLDP_MAX_LLDP_AGENTS];
50*14b24e2bSVaishali Kulkarni 	struct dcbx_local_params local_admin;
51*14b24e2bSVaishali Kulkarni 	struct ecore_dcbx_results results;
52*14b24e2bSVaishali Kulkarni 	struct dcb_dscp_map dscp_map;
53*14b24e2bSVaishali Kulkarni 	bool dscp_nig_update;
54*14b24e2bSVaishali Kulkarni 	struct dcbx_mib operational;
55*14b24e2bSVaishali Kulkarni 	struct dcbx_mib remote;
56*14b24e2bSVaishali Kulkarni 	struct ecore_dcbx_set set;
57*14b24e2bSVaishali Kulkarni 	struct ecore_dcbx_get get;
58*14b24e2bSVaishali Kulkarni 	u8 dcbx_cap;
59*14b24e2bSVaishali Kulkarni 	u16 iwarp_port;
60*14b24e2bSVaishali Kulkarni };
61*14b24e2bSVaishali Kulkarni 
62*14b24e2bSVaishali Kulkarni struct ecore_dcbx_mib_meta_data {
63*14b24e2bSVaishali Kulkarni 	struct lldp_config_params_s *lldp_local;
64*14b24e2bSVaishali Kulkarni 	struct lldp_status_params_s *lldp_remote;
65*14b24e2bSVaishali Kulkarni 	struct dcbx_local_params *local_admin;
66*14b24e2bSVaishali Kulkarni 	struct dcb_dscp_map *dscp_map;
67*14b24e2bSVaishali Kulkarni 	struct dcbx_mib *mib;
68*14b24e2bSVaishali Kulkarni 	osal_size_t size;
69*14b24e2bSVaishali Kulkarni 	u32 addr;
70*14b24e2bSVaishali Kulkarni };
71*14b24e2bSVaishali Kulkarni 
72*14b24e2bSVaishali Kulkarni /* ECORE local interface routines */
73*14b24e2bSVaishali Kulkarni enum _ecore_status_t
74*14b24e2bSVaishali Kulkarni ecore_dcbx_mib_update_event(struct ecore_hwfn *, struct ecore_ptt *,
75*14b24e2bSVaishali Kulkarni 			    enum ecore_mib_read_type);
76*14b24e2bSVaishali Kulkarni 
77*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_dcbx_read_lldp_params(struct ecore_hwfn *,
78*14b24e2bSVaishali Kulkarni 						 struct ecore_ptt *);
79*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_dcbx_info_alloc(struct ecore_hwfn *p_hwfn);
80*14b24e2bSVaishali Kulkarni void ecore_dcbx_info_free(struct ecore_hwfn *);
81*14b24e2bSVaishali Kulkarni void ecore_dcbx_set_pf_update_params(struct ecore_dcbx_results *p_src,
82*14b24e2bSVaishali Kulkarni 				     struct pf_update_ramrod_data *p_dest);
83*14b24e2bSVaishali Kulkarni 
84*14b24e2bSVaishali Kulkarni #endif /* __ECORE_DCBX_H__ */