2 * Copyright (c) 2016 QLogic Corporation.
6 * See LICENSE.qede_pmd for copyright and licensing details.
9 #ifndef __ECORE_DCBX_API_H__
10 #define __ECORE_DCBX_API_H__
14 #define DCBX_CONFIG_MAX_APP_PROTOCOL 4
16 enum ecore_mib_read_type {
17 ECORE_DCBX_OPERATIONAL_MIB,
18 ECORE_DCBX_REMOTE_MIB,
20 ECORE_DCBX_REMOTE_LLDP_MIB,
21 ECORE_DCBX_LOCAL_LLDP_MIB
24 struct ecore_dcbx_app_data {
25 bool enable; /* DCB enabled */
26 bool update; /* Update indication */
27 u8 priority; /* Priority */
28 u8 tc; /* Traffic Class */
31 #ifndef __EXTRACT__LINUX__
32 enum dcbx_protocol_type {
34 DCBX_MAX_PROTOCOL_TYPE
38 /* We can't assume THE HSI values are available to clients, so we need
39 * to redefine those here.
41 #ifndef LLDP_CHASSIS_ID_STAT_LEN
42 #define LLDP_CHASSIS_ID_STAT_LEN 4
44 #ifndef LLDP_PORT_ID_STAT_LEN
45 #define LLDP_PORT_ID_STAT_LEN 4
47 #ifndef DCBX_MAX_APP_PROTOCOL
48 #define DCBX_MAX_APP_PROTOCOL 32
53 struct ecore_dcbx_lldp_remote {
54 u32 peer_chassis_id[LLDP_CHASSIS_ID_STAT_LEN];
55 u32 peer_port_id[LLDP_PORT_ID_STAT_LEN];
62 struct ecore_dcbx_lldp_local {
63 u32 local_chassis_id[LLDP_CHASSIS_ID_STAT_LEN];
64 u32 local_port_id[LLDP_PORT_ID_STAT_LEN];
67 struct ecore_dcbx_app_prio {
71 struct ecore_dcbx_params {
72 u32 app_bitmap[DCBX_MAX_APP_PROTOCOL];
78 bool valid; /* Indicate validity of params */
79 u32 ets_pri_tc_tbl[1];
81 u32 ets_tc_tsa_tbl[2];
89 struct ecore_dcbx_admin_params {
90 struct ecore_dcbx_params params;
91 bool valid; /* Indicate validity of params */
94 struct ecore_dcbx_remote_params {
95 struct ecore_dcbx_params params;
96 bool valid; /* Indicate validity of params */
99 struct ecore_dcbx_operational_params {
100 struct ecore_dcbx_app_prio app_prio;
101 struct ecore_dcbx_params params;
102 bool valid; /* Indicate validity of params */
109 struct ecore_dcbx_get {
110 struct ecore_dcbx_operational_params operational;
111 struct ecore_dcbx_lldp_remote lldp_remote;
112 struct ecore_dcbx_lldp_local lldp_local;
113 struct ecore_dcbx_remote_params remote;
114 struct ecore_dcbx_admin_params local;
118 struct ecore_dcbx_set {
119 struct ecore_dcbx_admin_params config;
124 struct ecore_dcbx_results {
127 struct ecore_dcbx_app_data arr[DCBX_MAX_PROTOCOL_TYPE];
130 struct ecore_dcbx_app_metadata {
131 enum dcbx_protocol_type id;
132 const char *name; /* @DPDK */
133 enum ecore_pci_personality personality;
136 struct ecore_dcbx_mib_meta_data {
137 struct lldp_config_params_s *lldp_local;
138 struct lldp_status_params_s *lldp_remote;
139 struct dcbx_local_params *local_admin;
140 struct dcbx_mib *mib;
146 ecore_dcbx_set_params(struct ecore_dcbx_results *p_data,
147 struct ecore_hw_info *p_info,
148 bool enable, bool update, u8 prio, u8 tc,
149 enum dcbx_protocol_type type,
150 enum ecore_pci_personality personality);
152 enum _ecore_status_t ecore_dcbx_query_params(struct ecore_hwfn *,
153 struct ecore_dcbx_get *,
154 enum ecore_mib_read_type);
156 static const struct ecore_dcbx_app_metadata ecore_dcbx_app_update[] = {
157 {DCBX_PROTOCOL_ETH, "ETH", ECORE_PCI_ETH}
160 #endif /* __ECORE_DCBX_API_H__ */