New upstream version 17.11-rc3
[deb_dpdk.git] / drivers / net / qede / base / ecore_dcbx.h
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_DCBX_DSCP_DISABLED 0XFF
21
22 struct ecore_dcbx_info {
23         struct lldp_status_params_s lldp_remote[LLDP_MAX_LLDP_AGENTS];
24         struct lldp_config_params_s lldp_local[LLDP_MAX_LLDP_AGENTS];
25         struct dcbx_local_params local_admin;
26         struct ecore_dcbx_results results;
27         struct dcb_dscp_map dscp_map;
28         bool dscp_nig_update;
29         struct dcbx_mib operational;
30         struct dcbx_mib remote;
31         struct ecore_dcbx_set set;
32         struct ecore_dcbx_get get;
33         u8 dcbx_cap;
34         u16 iwarp_port;
35 };
36
37 struct ecore_dcbx_mib_meta_data {
38         struct lldp_config_params_s *lldp_local;
39         struct lldp_status_params_s *lldp_remote;
40         struct lldp_received_tlvs_s *lldp_tlvs;
41         struct dcbx_local_params *local_admin;
42         struct dcb_dscp_map *dscp_map;
43         struct dcbx_mib *mib;
44         osal_size_t size;
45         u32 addr;
46 };
47
48 /* ECORE local interface routines */
49 enum _ecore_status_t
50 ecore_dcbx_mib_update_event(struct ecore_hwfn *, struct ecore_ptt *,
51                             enum ecore_mib_read_type);
52
53 enum _ecore_status_t ecore_dcbx_info_alloc(struct ecore_hwfn *p_hwfn);
54 void ecore_dcbx_info_free(struct ecore_hwfn *p_hwfn);
55 void ecore_dcbx_set_pf_update_params(struct ecore_dcbx_results *p_src,
56                                      struct pf_update_ramrod_data *p_dest);
57
58 /* Returns TOS value for a given priority */
59 u8 ecore_dcbx_get_dscp_value(struct ecore_hwfn *p_hwfn, u8 pri);
60
61 enum _ecore_status_t
62 ecore_lldp_mib_update_event(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt);
63
64 #endif /* __ECORE_DCBX_H__ */