0001
0002
0003
0004
0005
0006 #ifndef __NCSI_PKT_H__
0007 #define __NCSI_PKT_H__
0008
0009 struct ncsi_pkt_hdr {
0010 unsigned char mc_id;
0011 unsigned char revision;
0012 unsigned char reserved;
0013 unsigned char id;
0014 unsigned char type;
0015 unsigned char channel;
0016 __be16 length;
0017 __be32 reserved1[2];
0018 };
0019
0020 struct ncsi_cmd_pkt_hdr {
0021 struct ncsi_pkt_hdr common;
0022 };
0023
0024 struct ncsi_rsp_pkt_hdr {
0025 struct ncsi_pkt_hdr common;
0026 __be16 code;
0027 __be16 reason;
0028 };
0029
0030 struct ncsi_aen_pkt_hdr {
0031 struct ncsi_pkt_hdr common;
0032 unsigned char reserved2[3];
0033 unsigned char type;
0034 };
0035
0036
0037 struct ncsi_cmd_pkt {
0038 struct ncsi_cmd_pkt_hdr cmd;
0039 __be32 checksum;
0040 unsigned char pad[26];
0041 };
0042
0043 struct ncsi_rsp_pkt {
0044 struct ncsi_rsp_pkt_hdr rsp;
0045 __be32 checksum;
0046 unsigned char pad[22];
0047 };
0048
0049
0050 struct ncsi_cmd_sp_pkt {
0051 struct ncsi_cmd_pkt_hdr cmd;
0052 unsigned char reserved[3];
0053 unsigned char hw_arbitration;
0054 __be32 checksum;
0055 unsigned char pad[22];
0056 };
0057
0058
0059 struct ncsi_cmd_dc_pkt {
0060 struct ncsi_cmd_pkt_hdr cmd;
0061 unsigned char reserved[3];
0062 unsigned char ald;
0063 __be32 checksum;
0064 unsigned char pad[22];
0065 };
0066
0067
0068 struct ncsi_cmd_rc_pkt {
0069 struct ncsi_cmd_pkt_hdr cmd;
0070 __be32 reserved;
0071 __be32 checksum;
0072 unsigned char pad[22];
0073 };
0074
0075
0076 struct ncsi_cmd_ae_pkt {
0077 struct ncsi_cmd_pkt_hdr cmd;
0078 unsigned char reserved[3];
0079 unsigned char mc_id;
0080 __be32 mode;
0081 __be32 checksum;
0082 unsigned char pad[18];
0083 };
0084
0085
0086 struct ncsi_cmd_sl_pkt {
0087 struct ncsi_cmd_pkt_hdr cmd;
0088 __be32 mode;
0089 __be32 oem_mode;
0090 __be32 checksum;
0091 unsigned char pad[18];
0092 };
0093
0094
0095 struct ncsi_cmd_svf_pkt {
0096 struct ncsi_cmd_pkt_hdr cmd;
0097 __be16 reserved;
0098 __be16 vlan;
0099 __be16 reserved1;
0100 unsigned char index;
0101 unsigned char enable;
0102 __be32 checksum;
0103 unsigned char pad[18];
0104 };
0105
0106
0107 struct ncsi_cmd_ev_pkt {
0108 struct ncsi_cmd_pkt_hdr cmd;
0109 unsigned char reserved[3];
0110 unsigned char mode;
0111 __be32 checksum;
0112 unsigned char pad[22];
0113 };
0114
0115
0116 struct ncsi_cmd_sma_pkt {
0117 struct ncsi_cmd_pkt_hdr cmd;
0118 unsigned char mac[6];
0119 unsigned char index;
0120 unsigned char at_e;
0121 __be32 checksum;
0122 unsigned char pad[18];
0123 };
0124
0125
0126 struct ncsi_cmd_ebf_pkt {
0127 struct ncsi_cmd_pkt_hdr cmd;
0128 __be32 mode;
0129 __be32 checksum;
0130 unsigned char pad[22];
0131 };
0132
0133
0134 struct ncsi_cmd_egmf_pkt {
0135 struct ncsi_cmd_pkt_hdr cmd;
0136 __be32 mode;
0137 __be32 checksum;
0138 unsigned char pad[22];
0139 };
0140
0141
0142 struct ncsi_cmd_snfc_pkt {
0143 struct ncsi_cmd_pkt_hdr cmd;
0144 unsigned char reserved[3];
0145 unsigned char mode;
0146 __be32 checksum;
0147 unsigned char pad[22];
0148 };
0149
0150
0151 struct ncsi_cmd_oem_pkt {
0152 struct ncsi_cmd_pkt_hdr cmd;
0153 __be32 mfr_id;
0154 unsigned char data[];
0155 };
0156
0157
0158 struct ncsi_rsp_oem_pkt {
0159 struct ncsi_rsp_pkt_hdr rsp;
0160 __be32 mfr_id;
0161 unsigned char data[];
0162 };
0163
0164
0165 struct ncsi_rsp_oem_mlx_pkt {
0166 unsigned char cmd_rev;
0167 unsigned char cmd;
0168 unsigned char param;
0169 unsigned char optional;
0170 unsigned char data[];
0171 };
0172
0173
0174 struct ncsi_rsp_oem_bcm_pkt {
0175 unsigned char ver;
0176 unsigned char type;
0177 __be16 len;
0178 unsigned char data[];
0179 };
0180
0181
0182 struct ncsi_rsp_oem_intel_pkt {
0183 unsigned char cmd;
0184 unsigned char data[];
0185 };
0186
0187
0188 struct ncsi_rsp_gls_pkt {
0189 struct ncsi_rsp_pkt_hdr rsp;
0190 __be32 status;
0191 __be32 other;
0192 __be32 oem_status;
0193 __be32 checksum;
0194 unsigned char pad[10];
0195 };
0196
0197
0198 struct ncsi_rsp_gvi_pkt {
0199 struct ncsi_rsp_pkt_hdr rsp;
0200 __be32 ncsi_version;
0201 unsigned char reserved[3];
0202 unsigned char alpha2;
0203 unsigned char fw_name[12];
0204 __be32 fw_version;
0205 __be16 pci_ids[4];
0206 __be32 mf_id;
0207 __be32 checksum;
0208 };
0209
0210
0211 struct ncsi_rsp_gc_pkt {
0212 struct ncsi_rsp_pkt_hdr rsp;
0213 __be32 cap;
0214 __be32 bc_cap;
0215 __be32 mc_cap;
0216 __be32 buf_cap;
0217 __be32 aen_cap;
0218 unsigned char vlan_cnt;
0219 unsigned char mixed_cnt;
0220 unsigned char mc_cnt;
0221 unsigned char uc_cnt;
0222 unsigned char reserved[2];
0223 unsigned char vlan_mode;
0224 unsigned char channel_cnt;
0225 __be32 checksum;
0226 };
0227
0228
0229 struct ncsi_rsp_gp_pkt {
0230 struct ncsi_rsp_pkt_hdr rsp;
0231 unsigned char mac_cnt;
0232 unsigned char reserved[2];
0233 unsigned char mac_enable;
0234 unsigned char vlan_cnt;
0235 unsigned char reserved1;
0236 __be16 vlan_enable;
0237 __be32 link_mode;
0238 __be32 bc_mode;
0239 __be32 valid_modes;
0240 unsigned char vlan_mode;
0241 unsigned char fc_mode;
0242 unsigned char reserved2[2];
0243 __be32 aen_mode;
0244 unsigned char mac[6];
0245 __be16 vlan;
0246 __be32 checksum;
0247 };
0248
0249
0250 struct ncsi_rsp_gcps_pkt {
0251 struct ncsi_rsp_pkt_hdr rsp;
0252 __be32 cnt_hi;
0253 __be32 cnt_lo;
0254 __be32 rx_bytes;
0255 __be32 tx_bytes;
0256 __be32 rx_uc_pkts;
0257 __be32 rx_mc_pkts;
0258 __be32 rx_bc_pkts;
0259 __be32 tx_uc_pkts;
0260 __be32 tx_mc_pkts;
0261 __be32 tx_bc_pkts;
0262 __be32 fcs_err;
0263 __be32 align_err;
0264 __be32 false_carrier;
0265 __be32 runt_pkts;
0266 __be32 jabber_pkts;
0267 __be32 rx_pause_xon;
0268 __be32 rx_pause_xoff;
0269 __be32 tx_pause_xon;
0270 __be32 tx_pause_xoff;
0271 __be32 tx_s_collision;
0272 __be32 tx_m_collision;
0273 __be32 l_collision;
0274 __be32 e_collision;
0275 __be32 rx_ctl_frames;
0276 __be32 rx_64_frames;
0277 __be32 rx_127_frames;
0278 __be32 rx_255_frames;
0279 __be32 rx_511_frames;
0280 __be32 rx_1023_frames;
0281 __be32 rx_1522_frames;
0282 __be32 rx_9022_frames;
0283 __be32 tx_64_frames;
0284 __be32 tx_127_frames;
0285 __be32 tx_255_frames;
0286 __be32 tx_511_frames;
0287 __be32 tx_1023_frames;
0288 __be32 tx_1522_frames;
0289 __be32 tx_9022_frames;
0290 __be32 rx_valid_bytes;
0291 __be32 rx_runt_pkts;
0292 __be32 rx_jabber_pkts;
0293 __be32 checksum;
0294 };
0295
0296
0297 struct ncsi_rsp_gns_pkt {
0298 struct ncsi_rsp_pkt_hdr rsp;
0299 __be32 rx_cmds;
0300 __be32 dropped_cmds;
0301 __be32 cmd_type_errs;
0302 __be32 cmd_csum_errs;
0303 __be32 rx_pkts;
0304 __be32 tx_pkts;
0305 __be32 tx_aen_pkts;
0306 __be32 checksum;
0307 };
0308
0309
0310 struct ncsi_rsp_gnpts_pkt {
0311 struct ncsi_rsp_pkt_hdr rsp;
0312 __be32 tx_pkts;
0313 __be32 tx_dropped;
0314 __be32 tx_channel_err;
0315 __be32 tx_us_err;
0316 __be32 rx_pkts;
0317 __be32 rx_dropped;
0318 __be32 rx_channel_err;
0319 __be32 rx_us_err;
0320 __be32 rx_os_err;
0321 __be32 checksum;
0322 };
0323
0324
0325 struct ncsi_rsp_gps_pkt {
0326 struct ncsi_rsp_pkt_hdr rsp;
0327 __be32 status;
0328 __be32 checksum;
0329 };
0330
0331
0332 struct ncsi_rsp_gpuuid_pkt {
0333 struct ncsi_rsp_pkt_hdr rsp;
0334 unsigned char uuid[16];
0335 __be32 checksum;
0336 };
0337
0338
0339 struct ncsi_aen_lsc_pkt {
0340 struct ncsi_aen_pkt_hdr aen;
0341 __be32 status;
0342 __be32 oem_status;
0343 __be32 checksum;
0344 unsigned char pad[14];
0345 };
0346
0347
0348 struct ncsi_aen_cr_pkt {
0349 struct ncsi_aen_pkt_hdr aen;
0350 __be32 checksum;
0351 unsigned char pad[22];
0352 };
0353
0354
0355 struct ncsi_aen_hncdsc_pkt {
0356 struct ncsi_aen_pkt_hdr aen;
0357 __be32 status;
0358 __be32 checksum;
0359 unsigned char pad[18];
0360 };
0361
0362
0363 #define NCSI_PKT_REVISION 0x01
0364
0365
0366 #define NCSI_PKT_CMD_CIS 0x00
0367 #define NCSI_PKT_CMD_SP 0x01
0368 #define NCSI_PKT_CMD_DP 0x02
0369 #define NCSI_PKT_CMD_EC 0x03
0370 #define NCSI_PKT_CMD_DC 0x04
0371 #define NCSI_PKT_CMD_RC 0x05
0372 #define NCSI_PKT_CMD_ECNT 0x06
0373 #define NCSI_PKT_CMD_DCNT 0x07
0374 #define NCSI_PKT_CMD_AE 0x08
0375 #define NCSI_PKT_CMD_SL 0x09
0376 #define NCSI_PKT_CMD_GLS 0x0a
0377 #define NCSI_PKT_CMD_SVF 0x0b
0378 #define NCSI_PKT_CMD_EV 0x0c
0379 #define NCSI_PKT_CMD_DV 0x0d
0380 #define NCSI_PKT_CMD_SMA 0x0e
0381 #define NCSI_PKT_CMD_EBF 0x10
0382 #define NCSI_PKT_CMD_DBF 0x11
0383 #define NCSI_PKT_CMD_EGMF 0x12
0384 #define NCSI_PKT_CMD_DGMF 0x13
0385 #define NCSI_PKT_CMD_SNFC 0x14
0386 #define NCSI_PKT_CMD_GVI 0x15
0387 #define NCSI_PKT_CMD_GC 0x16
0388 #define NCSI_PKT_CMD_GP 0x17
0389 #define NCSI_PKT_CMD_GCPS 0x18
0390 #define NCSI_PKT_CMD_GNS 0x19
0391 #define NCSI_PKT_CMD_GNPTS 0x1a
0392 #define NCSI_PKT_CMD_GPS 0x1b
0393 #define NCSI_PKT_CMD_OEM 0x50
0394 #define NCSI_PKT_CMD_PLDM 0x51
0395 #define NCSI_PKT_CMD_GPUUID 0x52
0396 #define NCSI_PKT_CMD_QPNPR 0x56
0397 #define NCSI_PKT_CMD_SNPR 0x57
0398
0399
0400
0401 #define NCSI_PKT_RSP_CIS (NCSI_PKT_CMD_CIS + 0x80)
0402 #define NCSI_PKT_RSP_SP (NCSI_PKT_CMD_SP + 0x80)
0403 #define NCSI_PKT_RSP_DP (NCSI_PKT_CMD_DP + 0x80)
0404 #define NCSI_PKT_RSP_EC (NCSI_PKT_CMD_EC + 0x80)
0405 #define NCSI_PKT_RSP_DC (NCSI_PKT_CMD_DC + 0x80)
0406 #define NCSI_PKT_RSP_RC (NCSI_PKT_CMD_RC + 0x80)
0407 #define NCSI_PKT_RSP_ECNT (NCSI_PKT_CMD_ECNT + 0x80)
0408 #define NCSI_PKT_RSP_DCNT (NCSI_PKT_CMD_DCNT + 0x80)
0409 #define NCSI_PKT_RSP_AE (NCSI_PKT_CMD_AE + 0x80)
0410 #define NCSI_PKT_RSP_SL (NCSI_PKT_CMD_SL + 0x80)
0411 #define NCSI_PKT_RSP_GLS (NCSI_PKT_CMD_GLS + 0x80)
0412 #define NCSI_PKT_RSP_SVF (NCSI_PKT_CMD_SVF + 0x80)
0413 #define NCSI_PKT_RSP_EV (NCSI_PKT_CMD_EV + 0x80)
0414 #define NCSI_PKT_RSP_DV (NCSI_PKT_CMD_DV + 0x80)
0415 #define NCSI_PKT_RSP_SMA (NCSI_PKT_CMD_SMA + 0x80)
0416 #define NCSI_PKT_RSP_EBF (NCSI_PKT_CMD_EBF + 0x80)
0417 #define NCSI_PKT_RSP_DBF (NCSI_PKT_CMD_DBF + 0x80)
0418 #define NCSI_PKT_RSP_EGMF (NCSI_PKT_CMD_EGMF + 0x80)
0419 #define NCSI_PKT_RSP_DGMF (NCSI_PKT_CMD_DGMF + 0x80)
0420 #define NCSI_PKT_RSP_SNFC (NCSI_PKT_CMD_SNFC + 0x80)
0421 #define NCSI_PKT_RSP_GVI (NCSI_PKT_CMD_GVI + 0x80)
0422 #define NCSI_PKT_RSP_GC (NCSI_PKT_CMD_GC + 0x80)
0423 #define NCSI_PKT_RSP_GP (NCSI_PKT_CMD_GP + 0x80)
0424 #define NCSI_PKT_RSP_GCPS (NCSI_PKT_CMD_GCPS + 0x80)
0425 #define NCSI_PKT_RSP_GNS (NCSI_PKT_CMD_GNS + 0x80)
0426 #define NCSI_PKT_RSP_GNPTS (NCSI_PKT_CMD_GNPTS + 0x80)
0427 #define NCSI_PKT_RSP_GPS (NCSI_PKT_CMD_GPS + 0x80)
0428 #define NCSI_PKT_RSP_OEM (NCSI_PKT_CMD_OEM + 0x80)
0429 #define NCSI_PKT_RSP_PLDM (NCSI_PKT_CMD_PLDM + 0x80)
0430 #define NCSI_PKT_RSP_GPUUID (NCSI_PKT_CMD_GPUUID + 0x80)
0431 #define NCSI_PKT_RSP_QPNPR (NCSI_PKT_CMD_QPNPR + 0x80)
0432 #define NCSI_PKT_RSP_SNPR (NCSI_PKT_CMD_SNPR + 0x80)
0433
0434
0435 #define NCSI_PKT_RSP_C_COMPLETED 0x0000
0436 #define NCSI_PKT_RSP_C_FAILED 0x0001
0437 #define NCSI_PKT_RSP_C_UNAVAILABLE 0x0002
0438 #define NCSI_PKT_RSP_C_UNSUPPORTED 0x0003
0439 #define NCSI_PKT_RSP_R_NO_ERROR 0x0000
0440 #define NCSI_PKT_RSP_R_INTERFACE 0x0001
0441 #define NCSI_PKT_RSP_R_PARAM 0x0002
0442 #define NCSI_PKT_RSP_R_CHANNEL 0x0003
0443 #define NCSI_PKT_RSP_R_PACKAGE 0x0004
0444 #define NCSI_PKT_RSP_R_LENGTH 0x0005
0445 #define NCSI_PKT_RSP_R_UNKNOWN 0x7fff
0446
0447
0448 #define NCSI_PKT_AEN 0xFF
0449 #define NCSI_PKT_AEN_LSC 0x00
0450 #define NCSI_PKT_AEN_CR 0x01
0451 #define NCSI_PKT_AEN_HNCDSC 0x02
0452
0453 #endif