0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef __BFA_DEFS_CNA_H__
0012 #define __BFA_DEFS_CNA_H__
0013
0014 #include "bfa_defs.h"
0015
0016
0017 struct bfa_port_fc_stats {
0018 u64 secs_reset;
0019 u64 tx_frames;
0020 u64 tx_words;
0021 u64 tx_lip;
0022 u64 tx_nos;
0023 u64 tx_ols;
0024 u64 tx_lr;
0025 u64 tx_lrr;
0026 u64 rx_frames;
0027 u64 rx_words;
0028 u64 lip_count;
0029 u64 nos_count;
0030 u64 ols_count;
0031 u64 lr_count;
0032 u64 lrr_count;
0033 u64 invalid_crcs;
0034 u64 invalid_crc_gd_eof;
0035 u64 undersized_frm;
0036 u64 oversized_frm;
0037 u64 bad_eof_frm;
0038 u64 error_frames;
0039 u64 dropped_frames;
0040 u64 link_failures;
0041 u64 loss_of_syncs;
0042 u64 loss_of_signals;
0043 u64 primseq_errs;
0044 u64 bad_os_count;
0045 u64 err_enc_out;
0046 u64 err_enc;
0047 u64 bbsc_frames_lost;
0048 u64 bbsc_credits_lost;
0049 u64 bbsc_link_resets;
0050 };
0051
0052
0053 struct bfa_port_eth_stats {
0054 u64 secs_reset;
0055 u64 frame_64;
0056 u64 frame_65_127;
0057 u64 frame_128_255;
0058 u64 frame_256_511;
0059 u64 frame_512_1023;
0060 u64 frame_1024_1518;
0061 u64 frame_1519_1522;
0062 u64 tx_bytes;
0063 u64 tx_packets;
0064 u64 tx_mcast_packets;
0065 u64 tx_bcast_packets;
0066 u64 tx_control_frame;
0067 u64 tx_drop;
0068 u64 tx_jabber;
0069 u64 tx_fcs_error;
0070 u64 tx_fragments;
0071 u64 rx_bytes;
0072 u64 rx_packets;
0073 u64 rx_mcast_packets;
0074 u64 rx_bcast_packets;
0075 u64 rx_control_frames;
0076 u64 rx_unknown_opcode;
0077 u64 rx_drop;
0078 u64 rx_jabber;
0079 u64 rx_fcs_error;
0080 u64 rx_alignment_error;
0081 u64 rx_frame_length_error;
0082 u64 rx_code_error;
0083 u64 rx_fragments;
0084 u64 rx_pause;
0085 u64 rx_zero_pause;
0086 u64 tx_pause;
0087 u64 tx_zero_pause;
0088 u64 rx_fcoe_pause;
0089 u64 rx_fcoe_zero_pause;
0090 u64 tx_fcoe_pause;
0091 u64 tx_fcoe_zero_pause;
0092 u64 rx_iscsi_pause;
0093 u64 rx_iscsi_zero_pause;
0094 u64 tx_iscsi_pause;
0095 u64 tx_iscsi_zero_pause;
0096 };
0097
0098
0099 union bfa_port_stats_u {
0100 struct bfa_port_fc_stats fc;
0101 struct bfa_port_eth_stats eth;
0102 };
0103
0104 #define BFA_CEE_LLDP_MAX_STRING_LEN (128)
0105 #define BFA_CEE_DCBX_MAX_PRIORITY (8)
0106 #define BFA_CEE_DCBX_MAX_PGID (8)
0107
0108 #define BFA_CEE_LLDP_SYS_CAP_OTHER 0x0001
0109 #define BFA_CEE_LLDP_SYS_CAP_REPEATER 0x0002
0110 #define BFA_CEE_LLDP_SYS_CAP_MAC_BRIDGE 0x0004
0111 #define BFA_CEE_LLDP_SYS_CAP_WLAN_AP 0x0008
0112 #define BFA_CEE_LLDP_SYS_CAP_ROUTER 0x0010
0113 #define BFA_CEE_LLDP_SYS_CAP_TELEPHONE 0x0020
0114 #define BFA_CEE_LLDP_SYS_CAP_DOCSIS_CD 0x0040
0115 #define BFA_CEE_LLDP_SYS_CAP_STATION 0x0080
0116 #define BFA_CEE_LLDP_SYS_CAP_CVLAN 0x0100
0117 #define BFA_CEE_LLDP_SYS_CAP_SVLAN 0x0200
0118 #define BFA_CEE_LLDP_SYS_CAP_TPMR 0x0400
0119
0120
0121 struct bfa_cee_lldp_str {
0122 u8 sub_type;
0123 u8 len;
0124 u8 rsvd[2];
0125 u8 value[BFA_CEE_LLDP_MAX_STRING_LEN];
0126 } __packed;
0127
0128
0129 struct bfa_cee_lldp_cfg {
0130 struct bfa_cee_lldp_str chassis_id;
0131 struct bfa_cee_lldp_str port_id;
0132 struct bfa_cee_lldp_str port_desc;
0133 struct bfa_cee_lldp_str sys_name;
0134 struct bfa_cee_lldp_str sys_desc;
0135 struct bfa_cee_lldp_str mgmt_addr;
0136 u16 time_to_live;
0137 u16 enabled_system_cap;
0138 } __packed;
0139
0140 enum bfa_cee_dcbx_version {
0141 DCBX_PROTOCOL_PRECEE = 1,
0142 DCBX_PROTOCOL_CEE = 2,
0143 };
0144
0145 enum bfa_cee_lls {
0146
0147 CEE_LLS_DOWN_NO_TLV = 0,
0148
0149 CEE_LLS_DOWN = 1,
0150 CEE_LLS_UP = 2,
0151 };
0152
0153
0154 struct bfa_cee_dcbx_cfg {
0155 u8 pgid[BFA_CEE_DCBX_MAX_PRIORITY];
0156 u8 pg_percentage[BFA_CEE_DCBX_MAX_PGID];
0157 u8 pfc_primap;
0158 u8 fcoe_primap;
0159 u8 iscsi_primap;
0160 u8 dcbx_version;
0161 u8 lls_fcoe;
0162 u8 lls_lan;
0163 u8 rsvd[2];
0164 } __packed;
0165
0166
0167
0168 enum bfa_cee_status {
0169 CEE_UP = 0,
0170 CEE_PHY_UP = 1,
0171 CEE_LOOPBACK = 2,
0172 CEE_PHY_DOWN = 3,
0173 };
0174
0175
0176 struct bfa_cee_attr {
0177 u8 cee_status;
0178 u8 error_reason;
0179 struct bfa_cee_lldp_cfg lldp_remote;
0180 struct bfa_cee_dcbx_cfg dcbx_remote;
0181 u8 src_mac[ETH_ALEN];
0182 u8 link_speed;
0183 u8 nw_priority;
0184 u8 filler[2];
0185 } __packed;
0186
0187
0188 struct bfa_cee_stats {
0189 u32 lldp_tx_frames;
0190 u32 lldp_rx_frames;
0191 u32 lldp_rx_frames_invalid;
0192 u32 lldp_rx_frames_new;
0193 u32 lldp_tlvs_unrecognized;
0194 u32 lldp_rx_shutdown_tlvs;
0195 u32 lldp_info_aged_out;
0196 u32 dcbx_phylink_ups;
0197 u32 dcbx_phylink_downs;
0198 u32 dcbx_rx_tlvs;
0199 u32 dcbx_rx_tlvs_invalid;
0200 u32 dcbx_control_tlv_error;
0201 u32 dcbx_feature_tlv_error;
0202 u32 dcbx_cee_cfg_new;
0203 u32 cee_status_down;
0204 u32 cee_status_up;
0205 u32 cee_hw_cfg_changed;
0206 u32 cee_rx_invalid_cfg;
0207 } __packed;
0208
0209 #endif