xref: /openbmc/linux/drivers/net/ethernet/intel/i40e/i40e_dcb.h (revision 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e)
1ae06c70bSJeff Kirsher /* SPDX-License-Identifier: GPL-2.0 */
290bc8e00SArkadiusz Kubalewski /* Copyright(c) 2013 - 2021 Intel Corporation. */
3afb3ff0dSNeerav Parikh 
4afb3ff0dSNeerav Parikh #ifndef _I40E_DCB_H_
5afb3ff0dSNeerav Parikh #define _I40E_DCB_H_
6afb3ff0dSNeerav Parikh 
7afb3ff0dSNeerav Parikh #include "i40e_type.h"
8afb3ff0dSNeerav Parikh 
990bc8e00SArkadiusz Kubalewski #define I40E_DCBX_STATUS_NOT_STARTED	0
10afb3ff0dSNeerav Parikh #define I40E_DCBX_STATUS_IN_PROGRESS	1
11afb3ff0dSNeerav Parikh #define I40E_DCBX_STATUS_DONE		2
1290bc8e00SArkadiusz Kubalewski #define I40E_DCBX_STATUS_MULTIPLE_PEERS	3
13afb3ff0dSNeerav Parikh #define I40E_DCBX_STATUS_DISABLED	7
14afb3ff0dSNeerav Parikh 
15afb3ff0dSNeerav Parikh #define I40E_TLV_TYPE_END		0
16afb3ff0dSNeerav Parikh #define I40E_TLV_TYPE_ORG		127
17afb3ff0dSNeerav Parikh 
18afb3ff0dSNeerav Parikh #define I40E_IEEE_8021QAZ_OUI		0x0080C2
19afb3ff0dSNeerav Parikh #define I40E_IEEE_SUBTYPE_ETS_CFG	9
20afb3ff0dSNeerav Parikh #define I40E_IEEE_SUBTYPE_ETS_REC	10
21afb3ff0dSNeerav Parikh #define I40E_IEEE_SUBTYPE_PFC_CFG	11
22afb3ff0dSNeerav Parikh #define I40E_IEEE_SUBTYPE_APP_PRI	12
23afb3ff0dSNeerav Parikh 
24909b2d16SNeerav Parikh #define I40E_CEE_DCBX_OUI		0x001b21
25909b2d16SNeerav Parikh #define I40E_CEE_DCBX_TYPE		2
26909b2d16SNeerav Parikh 
2790bc8e00SArkadiusz Kubalewski #define I40E_CEE_SUBTYPE_CTRL		1
28909b2d16SNeerav Parikh #define I40E_CEE_SUBTYPE_PG_CFG		2
29909b2d16SNeerav Parikh #define I40E_CEE_SUBTYPE_PFC_CFG	3
30909b2d16SNeerav Parikh #define I40E_CEE_SUBTYPE_APP_PRI	4
31909b2d16SNeerav Parikh 
32909b2d16SNeerav Parikh #define I40E_CEE_MAX_FEAT_TYPE		3
3365c275e4SSylwia Wnuczko #define I40E_LLDP_CURRENT_STATUS_XL710_OFFSET	0x2B
3465c275e4SSylwia Wnuczko #define I40E_LLDP_CURRENT_STATUS_X722_OFFSET	0x31
35ff924657SSylwia Wnuczko #define I40E_LLDP_CURRENT_STATUS_OFFSET		1
36ff924657SSylwia Wnuczko #define I40E_LLDP_CURRENT_STATUS_SIZE		1
37ff924657SSylwia Wnuczko 
38afb3ff0dSNeerav Parikh /* Defines for LLDP TLV header */
39afb3ff0dSNeerav Parikh #define I40E_LLDP_TLV_LEN_SHIFT		0
40afb3ff0dSNeerav Parikh #define I40E_LLDP_TLV_LEN_MASK		(0x01FF << I40E_LLDP_TLV_LEN_SHIFT)
41afb3ff0dSNeerav Parikh #define I40E_LLDP_TLV_TYPE_SHIFT	9
42afb3ff0dSNeerav Parikh #define I40E_LLDP_TLV_TYPE_MASK		(0x7F << I40E_LLDP_TLV_TYPE_SHIFT)
43afb3ff0dSNeerav Parikh #define I40E_LLDP_TLV_SUBTYPE_SHIFT	0
44afb3ff0dSNeerav Parikh #define I40E_LLDP_TLV_SUBTYPE_MASK	(0xFF << I40E_LLDP_TLV_SUBTYPE_SHIFT)
45afb3ff0dSNeerav Parikh #define I40E_LLDP_TLV_OUI_SHIFT		8
46afb3ff0dSNeerav Parikh #define I40E_LLDP_TLV_OUI_MASK		(0xFFFFFF << I40E_LLDP_TLV_OUI_SHIFT)
47afb3ff0dSNeerav Parikh 
48afb3ff0dSNeerav Parikh /* Defines for IEEE ETS TLV */
49afb3ff0dSNeerav Parikh #define I40E_IEEE_ETS_MAXTC_SHIFT	0
50afb3ff0dSNeerav Parikh #define I40E_IEEE_ETS_MAXTC_MASK	(0x7 << I40E_IEEE_ETS_MAXTC_SHIFT)
51afb3ff0dSNeerav Parikh #define I40E_IEEE_ETS_CBS_SHIFT		6
5241a1d04bSJesse Brandeburg #define I40E_IEEE_ETS_CBS_MASK		BIT(I40E_IEEE_ETS_CBS_SHIFT)
53afb3ff0dSNeerav Parikh #define I40E_IEEE_ETS_WILLING_SHIFT	7
5441a1d04bSJesse Brandeburg #define I40E_IEEE_ETS_WILLING_MASK	BIT(I40E_IEEE_ETS_WILLING_SHIFT)
55afb3ff0dSNeerav Parikh #define I40E_IEEE_ETS_PRIO_0_SHIFT	0
56afb3ff0dSNeerav Parikh #define I40E_IEEE_ETS_PRIO_0_MASK	(0x7 << I40E_IEEE_ETS_PRIO_0_SHIFT)
57afb3ff0dSNeerav Parikh #define I40E_IEEE_ETS_PRIO_1_SHIFT	4
58afb3ff0dSNeerav Parikh #define I40E_IEEE_ETS_PRIO_1_MASK	(0x7 << I40E_IEEE_ETS_PRIO_1_SHIFT)
599fa61dd2SNeerav Parikh #define I40E_CEE_PGID_PRIO_0_SHIFT	0
609fa61dd2SNeerav Parikh #define I40E_CEE_PGID_PRIO_0_MASK	(0xF << I40E_CEE_PGID_PRIO_0_SHIFT)
619fa61dd2SNeerav Parikh #define I40E_CEE_PGID_PRIO_1_SHIFT	4
629fa61dd2SNeerav Parikh #define I40E_CEE_PGID_PRIO_1_MASK	(0xF << I40E_CEE_PGID_PRIO_1_SHIFT)
639fa61dd2SNeerav Parikh #define I40E_CEE_PGID_STRICT		15
64afb3ff0dSNeerav Parikh 
65afb3ff0dSNeerav Parikh /* Defines for IEEE TSA types */
66afb3ff0dSNeerav Parikh #define I40E_IEEE_TSA_STRICT		0
67afb3ff0dSNeerav Parikh #define I40E_IEEE_TSA_ETS		2
68afb3ff0dSNeerav Parikh 
69afb3ff0dSNeerav Parikh /* Defines for IEEE PFC TLV */
7090bc8e00SArkadiusz Kubalewski #define I40E_DCB_PFC_ENABLED		2
7190bc8e00SArkadiusz Kubalewski #define I40E_DCB_PFC_FORCED_NUM_TC	2
72afb3ff0dSNeerav Parikh #define I40E_IEEE_PFC_CAP_SHIFT		0
73afb3ff0dSNeerav Parikh #define I40E_IEEE_PFC_CAP_MASK		(0xF << I40E_IEEE_PFC_CAP_SHIFT)
74afb3ff0dSNeerav Parikh #define I40E_IEEE_PFC_MBC_SHIFT		6
7541a1d04bSJesse Brandeburg #define I40E_IEEE_PFC_MBC_MASK		BIT(I40E_IEEE_PFC_MBC_SHIFT)
76afb3ff0dSNeerav Parikh #define I40E_IEEE_PFC_WILLING_SHIFT	7
7741a1d04bSJesse Brandeburg #define I40E_IEEE_PFC_WILLING_MASK	BIT(I40E_IEEE_PFC_WILLING_SHIFT)
78afb3ff0dSNeerav Parikh 
79afb3ff0dSNeerav Parikh /* Defines for IEEE APP TLV */
80afb3ff0dSNeerav Parikh #define I40E_IEEE_APP_SEL_SHIFT		0
81afb3ff0dSNeerav Parikh #define I40E_IEEE_APP_SEL_MASK		(0x7 << I40E_IEEE_APP_SEL_SHIFT)
82afb3ff0dSNeerav Parikh #define I40E_IEEE_APP_PRIO_SHIFT	5
83afb3ff0dSNeerav Parikh #define I40E_IEEE_APP_PRIO_MASK		(0x7 << I40E_IEEE_APP_PRIO_SHIFT)
84afb3ff0dSNeerav Parikh 
8590bc8e00SArkadiusz Kubalewski /* TLV definitions for preparing MIB */
8690bc8e00SArkadiusz Kubalewski #define I40E_TLV_ID_CHASSIS_ID		0
8790bc8e00SArkadiusz Kubalewski #define I40E_TLV_ID_PORT_ID		1
8890bc8e00SArkadiusz Kubalewski #define I40E_TLV_ID_TIME_TO_LIVE	2
8990bc8e00SArkadiusz Kubalewski #define I40E_IEEE_TLV_ID_ETS_CFG	3
9090bc8e00SArkadiusz Kubalewski #define I40E_IEEE_TLV_ID_ETS_REC	4
9190bc8e00SArkadiusz Kubalewski #define I40E_IEEE_TLV_ID_PFC_CFG	5
9290bc8e00SArkadiusz Kubalewski #define I40E_IEEE_TLV_ID_APP_PRI	6
9390bc8e00SArkadiusz Kubalewski #define I40E_TLV_ID_END_OF_LLDPPDU	7
9490bc8e00SArkadiusz Kubalewski #define I40E_TLV_ID_START		I40E_IEEE_TLV_ID_ETS_CFG
9590bc8e00SArkadiusz Kubalewski 
9690bc8e00SArkadiusz Kubalewski #define I40E_IEEE_TLV_HEADER_LENGTH	2
9790bc8e00SArkadiusz Kubalewski #define I40E_IEEE_ETS_TLV_LENGTH	25
9890bc8e00SArkadiusz Kubalewski #define I40E_IEEE_PFC_TLV_LENGTH	6
9990bc8e00SArkadiusz Kubalewski #define I40E_IEEE_APP_TLV_LENGTH	11
10090bc8e00SArkadiusz Kubalewski 
10190bc8e00SArkadiusz Kubalewski /* Defines for default SW DCB config */
10290bc8e00SArkadiusz Kubalewski #define I40E_IEEE_DEFAULT_ETS_TCBW	100
10390bc8e00SArkadiusz Kubalewski #define I40E_IEEE_DEFAULT_ETS_WILLING	1
10490bc8e00SArkadiusz Kubalewski #define I40E_IEEE_DEFAULT_PFC_WILLING	1
10590bc8e00SArkadiusz Kubalewski #define I40E_IEEE_DEFAULT_NUM_APPS	1
10690bc8e00SArkadiusz Kubalewski #define I40E_IEEE_DEFAULT_APP_PRIO	3
107afb3ff0dSNeerav Parikh 
108afb3ff0dSNeerav Parikh #pragma pack(1)
109afb3ff0dSNeerav Parikh /* IEEE 802.1AB LLDP Organization specific TLV */
110afb3ff0dSNeerav Parikh struct i40e_lldp_org_tlv {
111afb3ff0dSNeerav Parikh 	__be16 typelength;
112afb3ff0dSNeerav Parikh 	__be32 ouisubtype;
113afb3ff0dSNeerav Parikh 	u8 tlvinfo[1];
114afb3ff0dSNeerav Parikh };
115909b2d16SNeerav Parikh 
116909b2d16SNeerav Parikh struct i40e_cee_tlv_hdr {
117909b2d16SNeerav Parikh 	__be16 typelen;
118909b2d16SNeerav Parikh 	u8 operver;
119909b2d16SNeerav Parikh 	u8 maxver;
120909b2d16SNeerav Parikh };
121909b2d16SNeerav Parikh 
122909b2d16SNeerav Parikh struct i40e_cee_ctrl_tlv {
123909b2d16SNeerav Parikh 	struct i40e_cee_tlv_hdr hdr;
124909b2d16SNeerav Parikh 	__be32 seqno;
125909b2d16SNeerav Parikh 	__be32 ackno;
126909b2d16SNeerav Parikh };
127909b2d16SNeerav Parikh 
128909b2d16SNeerav Parikh struct i40e_cee_feat_tlv {
129909b2d16SNeerav Parikh 	struct i40e_cee_tlv_hdr hdr;
130909b2d16SNeerav Parikh 	u8 en_will_err; /* Bits: |En|Will|Err|Reserved(5)| */
13190bc8e00SArkadiusz Kubalewski #define I40E_CEE_FEAT_TLV_ENABLE_MASK	0x80
132909b2d16SNeerav Parikh #define I40E_CEE_FEAT_TLV_WILLING_MASK	0x40
13390bc8e00SArkadiusz Kubalewski #define I40E_CEE_FEAT_TLV_ERR_MASK	0x20
134909b2d16SNeerav Parikh 	u8 subtype;
135909b2d16SNeerav Parikh 	u8 tlvinfo[1];
136909b2d16SNeerav Parikh };
137909b2d16SNeerav Parikh 
138909b2d16SNeerav Parikh struct i40e_cee_app_prio {
139909b2d16SNeerav Parikh 	__be16 protocol;
140909b2d16SNeerav Parikh 	u8 upper_oui_sel; /* Bits: |Upper OUI(6)|Selector(2)| */
141909b2d16SNeerav Parikh #define I40E_CEE_APP_SELECTOR_MASK	0x03
142909b2d16SNeerav Parikh 	__be16 lower_oui;
143909b2d16SNeerav Parikh 	u8 prio_map;
144909b2d16SNeerav Parikh };
145afb3ff0dSNeerav Parikh #pragma pack()
146afb3ff0dSNeerav Parikh 
14790bc8e00SArkadiusz Kubalewski enum i40e_get_fw_lldp_status_resp {
14890bc8e00SArkadiusz Kubalewski 	I40E_GET_FW_LLDP_STATUS_DISABLED = 0,
14990bc8e00SArkadiusz Kubalewski 	I40E_GET_FW_LLDP_STATUS_ENABLED = 1
15090bc8e00SArkadiusz Kubalewski };
15190bc8e00SArkadiusz Kubalewski 
15290bc8e00SArkadiusz Kubalewski /* Data structures to pass for SW DCBX */
15390bc8e00SArkadiusz Kubalewski struct i40e_rx_pb_config {
15490bc8e00SArkadiusz Kubalewski 	u32	shared_pool_size;
15590bc8e00SArkadiusz Kubalewski 	u32	shared_pool_high_wm;
15690bc8e00SArkadiusz Kubalewski 	u32	shared_pool_low_wm;
15790bc8e00SArkadiusz Kubalewski 	u32	shared_pool_high_thresh[I40E_MAX_TRAFFIC_CLASS];
15890bc8e00SArkadiusz Kubalewski 	u32	shared_pool_low_thresh[I40E_MAX_TRAFFIC_CLASS];
15990bc8e00SArkadiusz Kubalewski 	u32	tc_pool_size[I40E_MAX_TRAFFIC_CLASS];
16090bc8e00SArkadiusz Kubalewski 	u32	tc_pool_high_wm[I40E_MAX_TRAFFIC_CLASS];
16190bc8e00SArkadiusz Kubalewski 	u32	tc_pool_low_wm[I40E_MAX_TRAFFIC_CLASS];
16290bc8e00SArkadiusz Kubalewski };
16390bc8e00SArkadiusz Kubalewski 
16490bc8e00SArkadiusz Kubalewski enum i40e_dcb_arbiter_mode {
16590bc8e00SArkadiusz Kubalewski 	I40E_DCB_ARB_MODE_STRICT_PRIORITY = 0,
16690bc8e00SArkadiusz Kubalewski 	I40E_DCB_ARB_MODE_ROUND_ROBIN = 1
16790bc8e00SArkadiusz Kubalewski };
16890bc8e00SArkadiusz Kubalewski 
16990bc8e00SArkadiusz Kubalewski #define I40E_DCB_DEFAULT_MAX_EXPONENT		0xB
17090bc8e00SArkadiusz Kubalewski #define I40E_DEFAULT_PAUSE_TIME			0xffff
17190bc8e00SArkadiusz Kubalewski #define I40E_MAX_FRAME_SIZE			4608 /* 4.5 KB */
17290bc8e00SArkadiusz Kubalewski 
17390bc8e00SArkadiusz Kubalewski #define I40E_DEVICE_RPB_SIZE			968000 /* 968 KB */
17490bc8e00SArkadiusz Kubalewski 
17590bc8e00SArkadiusz Kubalewski /* BitTimes (BT) conversion */
17690bc8e00SArkadiusz Kubalewski #define I40E_BT2KB(BT) (((BT) + (8 * 1024 - 1)) / (8 * 1024))
17790bc8e00SArkadiusz Kubalewski #define I40E_B2BT(BT) ((BT) * 8)
17890bc8e00SArkadiusz Kubalewski #define I40E_BT2B(BT) (((BT) + (8 - 1)) / 8)
17990bc8e00SArkadiusz Kubalewski 
18090bc8e00SArkadiusz Kubalewski /* Max Frame(TC) = MFS(max) + MFS(TC) */
18190bc8e00SArkadiusz Kubalewski #define I40E_MAX_FRAME_TC(mfs_max, mfs_tc)	I40E_B2BT((mfs_max) + (mfs_tc))
18290bc8e00SArkadiusz Kubalewski 
18390bc8e00SArkadiusz Kubalewski /* EEE Tx LPI Exit time in Bit Times */
18490bc8e00SArkadiusz Kubalewski #define I40E_EEE_TX_LPI_EXIT_TIME		142500
18590bc8e00SArkadiusz Kubalewski 
18690bc8e00SArkadiusz Kubalewski /* PCI Round Trip Time in Bit Times */
18790bc8e00SArkadiusz Kubalewski #define I40E_PCIRTT_LINK_SPEED_10G		20000
18890bc8e00SArkadiusz Kubalewski #define I40E_PCIRTT_BYTE_LINK_SPEED_20G		40000
18990bc8e00SArkadiusz Kubalewski #define I40E_PCIRTT_BYTE_LINK_SPEED_40G		80000
19090bc8e00SArkadiusz Kubalewski 
19190bc8e00SArkadiusz Kubalewski /* PFC Frame Delay Bit Times */
19290bc8e00SArkadiusz Kubalewski #define I40E_PFC_FRAME_DELAY			672
19390bc8e00SArkadiusz Kubalewski 
19490bc8e00SArkadiusz Kubalewski /* Worst case Cable (10GBase-T) Delay Bit Times */
19590bc8e00SArkadiusz Kubalewski #define I40E_CABLE_DELAY			5556
19690bc8e00SArkadiusz Kubalewski 
19790bc8e00SArkadiusz Kubalewski /* Higher Layer Delay @10G Bit Times */
19890bc8e00SArkadiusz Kubalewski #define I40E_HIGHER_LAYER_DELAY_10G		6144
19990bc8e00SArkadiusz Kubalewski 
20090bc8e00SArkadiusz Kubalewski /* Interface Delays in Bit Times */
20190bc8e00SArkadiusz Kubalewski /* TODO: Add for other link speeds 20G/40G/etc. */
20290bc8e00SArkadiusz Kubalewski #define I40E_INTERFACE_DELAY_10G_MAC_CONTROL	8192
20390bc8e00SArkadiusz Kubalewski #define I40E_INTERFACE_DELAY_10G_MAC		8192
20490bc8e00SArkadiusz Kubalewski #define I40E_INTERFACE_DELAY_10G_RS		8192
20590bc8e00SArkadiusz Kubalewski 
20690bc8e00SArkadiusz Kubalewski #define I40E_INTERFACE_DELAY_XGXS		2048
20790bc8e00SArkadiusz Kubalewski #define I40E_INTERFACE_DELAY_XAUI		2048
20890bc8e00SArkadiusz Kubalewski 
20990bc8e00SArkadiusz Kubalewski #define I40E_INTERFACE_DELAY_10G_BASEX_PCS	2048
21090bc8e00SArkadiusz Kubalewski #define I40E_INTERFACE_DELAY_10G_BASER_PCS	3584
21190bc8e00SArkadiusz Kubalewski #define I40E_INTERFACE_DELAY_LX4_PMD		512
21290bc8e00SArkadiusz Kubalewski #define I40E_INTERFACE_DELAY_CX4_PMD		512
21390bc8e00SArkadiusz Kubalewski #define I40E_INTERFACE_DELAY_SERIAL_PMA		512
21490bc8e00SArkadiusz Kubalewski #define I40E_INTERFACE_DELAY_PMD		512
21590bc8e00SArkadiusz Kubalewski 
21690bc8e00SArkadiusz Kubalewski #define I40E_INTERFACE_DELAY_10G_BASET		25600
21790bc8e00SArkadiusz Kubalewski 
21890bc8e00SArkadiusz Kubalewski /* Hardware RX DCB config related defines */
21990bc8e00SArkadiusz Kubalewski #define I40E_DCB_1_PORT_THRESHOLD		0xF
22090bc8e00SArkadiusz Kubalewski #define I40E_DCB_1_PORT_FIFO_SIZE		0x10
22190bc8e00SArkadiusz Kubalewski #define I40E_DCB_2_PORT_THRESHOLD_LOW_NUM_TC	0xF
22290bc8e00SArkadiusz Kubalewski #define I40E_DCB_2_PORT_FIFO_SIZE_LOW_NUM_TC	0x10
22390bc8e00SArkadiusz Kubalewski #define I40E_DCB_2_PORT_THRESHOLD_HIGH_NUM_TC	0xC
22490bc8e00SArkadiusz Kubalewski #define I40E_DCB_2_PORT_FIFO_SIZE_HIGH_NUM_TC	0x8
22590bc8e00SArkadiusz Kubalewski #define I40E_DCB_4_PORT_THRESHOLD_LOW_NUM_TC	0x9
22690bc8e00SArkadiusz Kubalewski #define I40E_DCB_4_PORT_FIFO_SIZE_LOW_NUM_TC	0x8
22790bc8e00SArkadiusz Kubalewski #define I40E_DCB_4_PORT_THRESHOLD_HIGH_NUM_TC	0x6
22890bc8e00SArkadiusz Kubalewski #define I40E_DCB_4_PORT_FIFO_SIZE_HIGH_NUM_TC	0x4
22990bc8e00SArkadiusz Kubalewski #define I40E_DCB_WATERMARK_START_FACTOR		0x2
23090bc8e00SArkadiusz Kubalewski 
23190bc8e00SArkadiusz Kubalewski /* delay values for with 10G BaseT in Bit Times */
23290bc8e00SArkadiusz Kubalewski #define I40E_INTERFACE_DELAY_10G_COPPER	\
23390bc8e00SArkadiusz Kubalewski 	(I40E_INTERFACE_DELAY_10G_MAC + (2 * I40E_INTERFACE_DELAY_XAUI) \
23490bc8e00SArkadiusz Kubalewski 	 + I40E_INTERFACE_DELAY_10G_BASET)
23590bc8e00SArkadiusz Kubalewski #define I40E_DV_TC(mfs_max, mfs_tc) \
23690bc8e00SArkadiusz Kubalewski 		((2 * I40E_MAX_FRAME_TC(mfs_max, mfs_tc)) \
23790bc8e00SArkadiusz Kubalewski 		 + I40E_PFC_FRAME_DELAY \
23890bc8e00SArkadiusz Kubalewski 		 + (2 * I40E_CABLE_DELAY) \
23990bc8e00SArkadiusz Kubalewski 		 + (2 * I40E_INTERFACE_DELAY_10G_COPPER) \
24090bc8e00SArkadiusz Kubalewski 		 + I40E_HIGHER_LAYER_DELAY_10G)
I40E_STD_DV_TC(u32 mfs_max,u32 mfs_tc)24190bc8e00SArkadiusz Kubalewski static inline u32 I40E_STD_DV_TC(u32 mfs_max, u32 mfs_tc)
24290bc8e00SArkadiusz Kubalewski {
24390bc8e00SArkadiusz Kubalewski 	return I40E_DV_TC(mfs_max, mfs_tc) + I40E_B2BT(mfs_max);
24490bc8e00SArkadiusz Kubalewski }
24590bc8e00SArkadiusz Kubalewski 
24690bc8e00SArkadiusz Kubalewski /* APIs for SW DCBX */
24790bc8e00SArkadiusz Kubalewski void i40e_dcb_hw_rx_fifo_config(struct i40e_hw *hw,
24890bc8e00SArkadiusz Kubalewski 				enum i40e_dcb_arbiter_mode ets_mode,
24990bc8e00SArkadiusz Kubalewski 				enum i40e_dcb_arbiter_mode non_ets_mode,
25090bc8e00SArkadiusz Kubalewski 				u32 max_exponent, u8 lltc_map);
25190bc8e00SArkadiusz Kubalewski void i40e_dcb_hw_rx_cmd_monitor_config(struct i40e_hw *hw,
25290bc8e00SArkadiusz Kubalewski 				       u8 num_tc, u8 num_ports);
25390bc8e00SArkadiusz Kubalewski void i40e_dcb_hw_pfc_config(struct i40e_hw *hw,
25490bc8e00SArkadiusz Kubalewski 			    u8 pfc_en, u8 *prio_tc);
25590bc8e00SArkadiusz Kubalewski void i40e_dcb_hw_set_num_tc(struct i40e_hw *hw, u8 num_tc);
25690bc8e00SArkadiusz Kubalewski u8 i40e_dcb_hw_get_num_tc(struct i40e_hw *hw);
25790bc8e00SArkadiusz Kubalewski void i40e_dcb_hw_rx_ets_bw_config(struct i40e_hw *hw, u8 *bw_share,
25890bc8e00SArkadiusz Kubalewski 				  u8 *mode, u8 *prio_type);
25990bc8e00SArkadiusz Kubalewski void i40e_dcb_hw_rx_up2tc_config(struct i40e_hw *hw, u8 *prio_tc);
26090bc8e00SArkadiusz Kubalewski void i40e_dcb_hw_calculate_pool_sizes(struct i40e_hw *hw,
26190bc8e00SArkadiusz Kubalewski 				      u8 num_ports, bool eee_enabled,
26290bc8e00SArkadiusz Kubalewski 				      u8 pfc_en, u32 *mfs_tc,
26390bc8e00SArkadiusz Kubalewski 				      struct i40e_rx_pb_config *pb_cfg);
26490bc8e00SArkadiusz Kubalewski void i40e_dcb_hw_rx_pb_config(struct i40e_hw *hw,
26590bc8e00SArkadiusz Kubalewski 			      struct i40e_rx_pb_config *old_pb_cfg,
26690bc8e00SArkadiusz Kubalewski 			      struct i40e_rx_pb_config *new_pb_cfg);
267*5180ff13SJan Sokolowski int i40e_get_dcbx_status(struct i40e_hw *hw,
268afb3ff0dSNeerav Parikh 			 u16 *status);
269*5180ff13SJan Sokolowski int i40e_lldp_to_dcb_config(u8 *lldpmib,
270afb3ff0dSNeerav Parikh 			    struct i40e_dcbx_config *dcbcfg);
271*5180ff13SJan Sokolowski int i40e_aq_get_dcb_config(struct i40e_hw *hw, u8 mib_type,
272afb3ff0dSNeerav Parikh 			   u8 bridgetype,
273afb3ff0dSNeerav Parikh 			   struct i40e_dcbx_config *dcbcfg);
274*5180ff13SJan Sokolowski int i40e_get_dcb_config(struct i40e_hw *hw);
275*5180ff13SJan Sokolowski int i40e_init_dcb(struct i40e_hw *hw,
27690bc8e00SArkadiusz Kubalewski 		  bool enable_mib_change);
277*5180ff13SJan Sokolowski int
27890bc8e00SArkadiusz Kubalewski i40e_get_fw_lldp_status(struct i40e_hw *hw,
27990bc8e00SArkadiusz Kubalewski 			enum i40e_get_fw_lldp_status_resp *lldp_status);
280*5180ff13SJan Sokolowski int i40e_set_dcb_config(struct i40e_hw *hw);
281*5180ff13SJan Sokolowski int i40e_dcb_config_to_lldp(u8 *lldpmib, u16 *miblen,
28290bc8e00SArkadiusz Kubalewski 			    struct i40e_dcbx_config *dcbcfg);
283afb3ff0dSNeerav Parikh #endif /* _I40E_DCB_H_ */
284