#ifndef _BNXT_DCB_H
#define _BNXT_DCB_H
#define BNXT_IEEE_8021QAZ_MAX_TCS 8
#define BNXT_IEEE_8021QAZ_TSA_STRICT 0
#define BNXT_IEEE_8021QAZ_TSA_ETS 2
#define BNXT_IEEE_8021QAZ_TSA_VENDOR 255
#define BNXT_DCB_CAP_DCBX_HOST 0x01
#define BNXT_DCB_CAP_DCBX_LLD_MANAGED 0x02
#define BNXT_DCB_CAP_DCBX_VER_CEE 0x04
#define BNXT_DCB_CAP_DCBX_VER_IEEE 0x08
#define BNXT_DCB_CAP_DCBX_STATIC 0x10
#ifndef __struct_group
#define __struct_group(TAG, NAME, ATTRS, MEMBERS...) \
union { \
struct { MEMBERS } ATTRS; \
struct TAG { MEMBERS } ATTRS NAME; \
}
#endif
#ifndef struct_group_attr
#define struct_group_attr(NAME, ATTRS, MEMBERS...) \
__struct_group(, NAME, ATTRS, MEMBERS)
#endif
struct bnxt_cos2bw_cfg {
uint8_t pad[3];
struct_group_attr(cfg, __packed,
uint8_t queue_id;
uint32_t min_bw;
uint32_t max_bw;
#define BW_VALUE_UNIT_PERCENT1_100 (0x1UL << 29)
uint8_t tsa;
uint8_t pri_lvl;
uint8_t bw_weight;
);
uint8_t unused;
};
struct bnxt_dscp2pri_entry {
uint8_t dscp;
uint8_t mask;
uint8_t pri;
};
struct bnxt_ieee_ets {
uint8_t willing;
uint8_t ets_cap;
uint8_t cbs;
uint8_t tc_tx_bw[BNXT_IEEE_8021QAZ_MAX_TCS];
uint8_t tc_rx_bw[BNXT_IEEE_8021QAZ_MAX_TCS];
uint8_t tc_tsa[BNXT_IEEE_8021QAZ_MAX_TCS];
uint8_t prio_tc[BNXT_IEEE_8021QAZ_MAX_TCS];
uint8_t tc_reco_bw[BNXT_IEEE_8021QAZ_MAX_TCS];
uint8_t tc_reco_tsa[BNXT_IEEE_8021QAZ_MAX_TCS];
uint8_t reco_prio_tc[BNXT_IEEE_8021QAZ_MAX_TCS];
} __attribute__ ((__packed__));
struct bnxt_ieee_pfc {
uint8_t pfc_cap;
uint8_t pfc_en;
uint8_t mbc;
uint16_t delay;
uint64_t requests[BNXT_IEEE_8021QAZ_MAX_TCS];
uint64_t indications[BNXT_IEEE_8021QAZ_MAX_TCS];
} __attribute__ ((__packed__));
struct bnxt_dcb_app {
uint8_t selector;
uint8_t priority;
uint16_t protocol;
} __attribute__ ((__packed__));
struct bnxt_eee {
uint32_t cmd;
uint32_t supported;
uint32_t advertised;
uint32_t lp_advertised;
uint32_t eee_active;
uint32_t eee_enabled;
uint32_t tx_lpi_enabled;
uint32_t tx_lpi_timer;
uint32_t reserved[2];
} __attribute__ ((__packed__));
#define BNXT_IEEE_8021QAZ_APP_SEL_ETHERTYPE 1
#define BNXT_IEEE_8021QAZ_APP_SEL_STREAM 2
#define BNXT_IEEE_8021QAZ_APP_SEL_DGRAM 3
#define BNXT_IEEE_8021QAZ_APP_SEL_ANY 4
#define BNXT_IEEE_8021QAZ_APP_SEL_DSCP 5
#define ETH_P_ROCE 0x8915
#define ROCE_V2_UDP_DPORT 4791
#define BNXT_LLQ(q_profile) \
((q_profile) == HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE || \
(q_profile) == HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_NIC)
#define BNXT_CNPQ(q_profile) \
((q_profile) == HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP)
#define HWRM_STRUCT_DATA_SUBTYPE_HOST_OPERATIONAL 0x0300
#endif