New upstream version 18.08
[deb_dpdk.git] / drivers / net / qede / base / ecore_dcbx.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2016 - 2018 Cavium Inc.
3  * All rights reserved.
4  * www.cavium.com
5  */
6
7 #ifndef __ECORE_DCBX_H__
8 #define __ECORE_DCBX_H__
9
10 #include "ecore.h"
11 #include "ecore_mcp.h"
12 #include "mcp_public.h"
13 #include "reg_addr.h"
14 #include "ecore_hw.h"
15 #include "ecore_hsi_common.h"
16 #include "ecore_dcbx_api.h"
17
18 #define ECORE_DCBX_DSCP_DISABLED 0XFF
19
20 struct ecore_dcbx_info {
21         struct lldp_status_params_s lldp_remote[LLDP_MAX_LLDP_AGENTS];
22         struct lldp_config_params_s lldp_local[LLDP_MAX_LLDP_AGENTS];
23         struct dcbx_local_params local_admin;
24         struct ecore_dcbx_results results;
25         struct dcb_dscp_map dscp_map;
26         bool dscp_nig_update;
27         struct dcbx_mib operational;
28         struct dcbx_mib remote;
29         struct ecore_dcbx_set set;
30         struct ecore_dcbx_get get;
31         u8 dcbx_cap;
32         u16 iwarp_port;
33 };
34
35 struct ecore_dcbx_mib_meta_data {
36         struct lldp_config_params_s *lldp_local;
37         struct lldp_status_params_s *lldp_remote;
38         struct lldp_received_tlvs_s *lldp_tlvs;
39         struct dcbx_local_params *local_admin;
40         struct dcb_dscp_map *dscp_map;
41         struct dcbx_mib *mib;
42         osal_size_t size;
43         u32 addr;
44 };
45
46 /* ECORE local interface routines */
47 enum _ecore_status_t
48 ecore_dcbx_mib_update_event(struct ecore_hwfn *, struct ecore_ptt *,
49                             enum ecore_mib_read_type);
50
51 enum _ecore_status_t ecore_dcbx_info_alloc(struct ecore_hwfn *p_hwfn);
52 void ecore_dcbx_info_free(struct ecore_hwfn *p_hwfn);
53 void ecore_dcbx_set_pf_update_params(struct ecore_dcbx_results *p_src,
54                                      struct pf_update_ramrod_data *p_dest);
55
56 /* Returns TOS value for a given priority */
57 u8 ecore_dcbx_get_dscp_value(struct ecore_hwfn *p_hwfn, u8 pri);
58
59 enum _ecore_status_t
60 ecore_lldp_mib_update_event(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt);
61
62 #endif /* __ECORE_DCBX_H__ */