ecore_dcbx.h revision 8b25d1ad
1/*
2 * Copyright (c) 2016 QLogic Corporation.
3 * All rights reserved.
4 * www.qlogic.com
5 *
6 * See LICENSE.qede_pmd for copyright and licensing details.
7 */
8
9#ifndef __ECORE_DCBX_H__
10#define __ECORE_DCBX_H__
11
12#include "ecore.h"
13#include "ecore_mcp.h"
14#include "mcp_public.h"
15#include "reg_addr.h"
16#include "ecore_hw.h"
17#include "ecore_hsi_common.h"
18#include "ecore_dcbx_api.h"
19
20#define ECORE_MFW_GET_FIELD(name, field) \
21	(((name) & (field ## _MASK)) >> (field ## _SHIFT))
22
23struct ecore_dcbx_info {
24	struct lldp_status_params_s lldp_remote[LLDP_MAX_LLDP_AGENTS];
25	struct lldp_config_params_s lldp_local[LLDP_MAX_LLDP_AGENTS];
26	struct dcbx_local_params local_admin;
27	struct ecore_dcbx_results results;
28	struct dcbx_mib operational;
29	struct dcbx_mib remote;
30	struct ecore_dcbx_set set;
31	struct ecore_dcbx_get get;
32	u8 dcbx_cap;
33};
34
35/* Upper layer driver interface routines */
36enum _ecore_status_t ecore_dcbx_config_params(struct ecore_hwfn *,
37					      struct ecore_ptt *,
38					      struct ecore_dcbx_set *);
39
40/* ECORE local interface routines */
41enum _ecore_status_t
42ecore_dcbx_mib_update_event(struct ecore_hwfn *, struct ecore_ptt *,
43			    enum ecore_mib_read_type);
44
45enum _ecore_status_t ecore_dcbx_read_lldp_params(struct ecore_hwfn *,
46						 struct ecore_ptt *);
47enum _ecore_status_t ecore_dcbx_info_alloc(struct ecore_hwfn *p_hwfn);
48void ecore_dcbx_info_free(struct ecore_hwfn *, struct ecore_dcbx_info *);
49void ecore_dcbx_set_pf_update_params(struct ecore_dcbx_results *p_src,
50				     struct pf_update_ramrod_data *p_dest);
51/* @@@TBD eagle phy workaround */
52void ecore_dcbx_eagle_workaround(struct ecore_hwfn *, struct ecore_ptt *,
53				 bool set_to_pfc);
54
55#endif /* __ECORE_DCBX_H__ */
56