1
2
3
4
5
6 #ifndef __NCSI_PKT_H__
7 #define __NCSI_PKT_H__
8
9 struct ncsi_pkt_hdr {
10 unsigned char mc_id;
11 unsigned char revision;
12 unsigned char reserved;
13 unsigned char id;
14 unsigned char type;
15 unsigned char channel;
16 __be16 length;
17 __be32 reserved1[2];
18 };
19
20 struct ncsi_cmd_pkt_hdr {
21 struct ncsi_pkt_hdr common;
22 };
23
24 struct ncsi_rsp_pkt_hdr {
25 struct ncsi_pkt_hdr common;
26 __be16 code;
27 __be16 reason;
28 };
29
30 struct ncsi_aen_pkt_hdr {
31 struct ncsi_pkt_hdr common;
32 unsigned char reserved2[3];
33 unsigned char type;
34 };
35
36
37 struct ncsi_cmd_pkt {
38 struct ncsi_cmd_pkt_hdr cmd;
39 __be32 checksum;
40 unsigned char pad[26];
41 };
42
43 struct ncsi_rsp_pkt {
44 struct ncsi_rsp_pkt_hdr rsp;
45 __be32 checksum;
46 unsigned char pad[22];
47 };
48
49
50 struct ncsi_cmd_sp_pkt {
51 struct ncsi_cmd_pkt_hdr cmd;
52 unsigned char reserved[3];
53 unsigned char hw_arbitration;
54 __be32 checksum;
55 unsigned char pad[22];
56 };
57
58
59 struct ncsi_cmd_dc_pkt {
60 struct ncsi_cmd_pkt_hdr cmd;
61 unsigned char reserved[3];
62 unsigned char ald;
63 __be32 checksum;
64 unsigned char pad[22];
65 };
66
67
68 struct ncsi_cmd_rc_pkt {
69 struct ncsi_cmd_pkt_hdr cmd;
70 __be32 reserved;
71 __be32 checksum;
72 unsigned char pad[22];
73 };
74
75
76 struct ncsi_cmd_ae_pkt {
77 struct ncsi_cmd_pkt_hdr cmd;
78 unsigned char reserved[3];
79 unsigned char mc_id;
80 __be32 mode;
81 __be32 checksum;
82 unsigned char pad[18];
83 };
84
85
86 struct ncsi_cmd_sl_pkt {
87 struct ncsi_cmd_pkt_hdr cmd;
88 __be32 mode;
89 __be32 oem_mode;
90 __be32 checksum;
91 unsigned char pad[18];
92 };
93
94
95 struct ncsi_cmd_svf_pkt {
96 struct ncsi_cmd_pkt_hdr cmd;
97 __be16 reserved;
98 __be16 vlan;
99 __be16 reserved1;
100 unsigned char index;
101 unsigned char enable;
102 __be32 checksum;
103 unsigned char pad[18];
104 };
105
106
107 struct ncsi_cmd_ev_pkt {
108 struct ncsi_cmd_pkt_hdr cmd;
109 unsigned char reserved[3];
110 unsigned char mode;
111 __be32 checksum;
112 unsigned char pad[22];
113 };
114
115
116 struct ncsi_cmd_sma_pkt {
117 struct ncsi_cmd_pkt_hdr cmd;
118 unsigned char mac[6];
119 unsigned char index;
120 unsigned char at_e;
121 __be32 checksum;
122 unsigned char pad[18];
123 };
124
125
126 struct ncsi_cmd_ebf_pkt {
127 struct ncsi_cmd_pkt_hdr cmd;
128 __be32 mode;
129 __be32 checksum;
130 unsigned char pad[22];
131 };
132
133
134 struct ncsi_cmd_egmf_pkt {
135 struct ncsi_cmd_pkt_hdr cmd;
136 __be32 mode;
137 __be32 checksum;
138 unsigned char pad[22];
139 };
140
141
142 struct ncsi_cmd_snfc_pkt {
143 struct ncsi_cmd_pkt_hdr cmd;
144 unsigned char reserved[3];
145 unsigned char mode;
146 __be32 checksum;
147 unsigned char pad[22];
148 };
149
150
151 struct ncsi_cmd_oem_pkt {
152 struct ncsi_cmd_pkt_hdr cmd;
153 __be32 mfr_id;
154 unsigned char data[];
155 };
156
157
158 struct ncsi_rsp_oem_pkt {
159 struct ncsi_rsp_pkt_hdr rsp;
160 __be32 mfr_id;
161 unsigned char data[];
162 };
163
164
165 struct ncsi_rsp_oem_mlx_pkt {
166 unsigned char cmd_rev;
167 unsigned char cmd;
168 unsigned char param;
169 unsigned char optional;
170 unsigned char data[];
171 };
172
173
174 struct ncsi_rsp_oem_bcm_pkt {
175 unsigned char ver;
176 unsigned char type;
177 __be16 len;
178 unsigned char data[];
179 };
180
181
182 struct ncsi_rsp_gls_pkt {
183 struct ncsi_rsp_pkt_hdr rsp;
184 __be32 status;
185 __be32 other;
186 __be32 oem_status;
187 __be32 checksum;
188 unsigned char pad[10];
189 };
190
191
192 struct ncsi_rsp_gvi_pkt {
193 struct ncsi_rsp_pkt_hdr rsp;
194 __be32 ncsi_version;
195 unsigned char reserved[3];
196 unsigned char alpha2;
197 unsigned char fw_name[12];
198 __be32 fw_version;
199 __be16 pci_ids[4];
200 __be32 mf_id;
201 __be32 checksum;
202 };
203
204
205 struct ncsi_rsp_gc_pkt {
206 struct ncsi_rsp_pkt_hdr rsp;
207 __be32 cap;
208 __be32 bc_cap;
209 __be32 mc_cap;
210 __be32 buf_cap;
211 __be32 aen_cap;
212 unsigned char vlan_cnt;
213 unsigned char mixed_cnt;
214 unsigned char mc_cnt;
215 unsigned char uc_cnt;
216 unsigned char reserved[2];
217 unsigned char vlan_mode;
218 unsigned char channel_cnt;
219 __be32 checksum;
220 };
221
222
223 struct ncsi_rsp_gp_pkt {
224 struct ncsi_rsp_pkt_hdr rsp;
225 unsigned char mac_cnt;
226 unsigned char reserved[2];
227 unsigned char mac_enable;
228 unsigned char vlan_cnt;
229 unsigned char reserved1;
230 __be16 vlan_enable;
231 __be32 link_mode;
232 __be32 bc_mode;
233 __be32 valid_modes;
234 unsigned char vlan_mode;
235 unsigned char fc_mode;
236 unsigned char reserved2[2];
237 __be32 aen_mode;
238 unsigned char mac[6];
239 __be16 vlan;
240 __be32 checksum;
241 };
242
243
244 struct ncsi_rsp_gcps_pkt {
245 struct ncsi_rsp_pkt_hdr rsp;
246 __be32 cnt_hi;
247 __be32 cnt_lo;
248 __be32 rx_bytes;
249 __be32 tx_bytes;
250 __be32 rx_uc_pkts;
251 __be32 rx_mc_pkts;
252 __be32 rx_bc_pkts;
253 __be32 tx_uc_pkts;
254 __be32 tx_mc_pkts;
255 __be32 tx_bc_pkts;
256 __be32 fcs_err;
257 __be32 align_err;
258 __be32 false_carrier;
259 __be32 runt_pkts;
260 __be32 jabber_pkts;
261 __be32 rx_pause_xon;
262 __be32 rx_pause_xoff;
263 __be32 tx_pause_xon;
264 __be32 tx_pause_xoff;
265 __be32 tx_s_collision;
266 __be32 tx_m_collision;
267 __be32 l_collision;
268 __be32 e_collision;
269 __be32 rx_ctl_frames;
270 __be32 rx_64_frames;
271 __be32 rx_127_frames;
272 __be32 rx_255_frames;
273 __be32 rx_511_frames;
274 __be32 rx_1023_frames;
275 __be32 rx_1522_frames;
276 __be32 rx_9022_frames;
277 __be32 tx_64_frames;
278 __be32 tx_127_frames;
279 __be32 tx_255_frames;
280 __be32 tx_511_frames;
281 __be32 tx_1023_frames;
282 __be32 tx_1522_frames;
283 __be32 tx_9022_frames;
284 __be32 rx_valid_bytes;
285 __be32 rx_runt_pkts;
286 __be32 rx_jabber_pkts;
287 __be32 checksum;
288 };
289
290
291 struct ncsi_rsp_gns_pkt {
292 struct ncsi_rsp_pkt_hdr rsp;
293 __be32 rx_cmds;
294 __be32 dropped_cmds;
295 __be32 cmd_type_errs;
296 __be32 cmd_csum_errs;
297 __be32 rx_pkts;
298 __be32 tx_pkts;
299 __be32 tx_aen_pkts;
300 __be32 checksum;
301 };
302
303
304 struct ncsi_rsp_gnpts_pkt {
305 struct ncsi_rsp_pkt_hdr rsp;
306 __be32 tx_pkts;
307 __be32 tx_dropped;
308 __be32 tx_channel_err;
309 __be32 tx_us_err;
310 __be32 rx_pkts;
311 __be32 rx_dropped;
312 __be32 rx_channel_err;
313 __be32 rx_us_err;
314 __be32 rx_os_err;
315 __be32 checksum;
316 };
317
318
319 struct ncsi_rsp_gps_pkt {
320 struct ncsi_rsp_pkt_hdr rsp;
321 __be32 status;
322 __be32 checksum;
323 };
324
325
326 struct ncsi_rsp_gpuuid_pkt {
327 struct ncsi_rsp_pkt_hdr rsp;
328 unsigned char uuid[16];
329 __be32 checksum;
330 };
331
332
333 struct ncsi_aen_lsc_pkt {
334 struct ncsi_aen_pkt_hdr aen;
335 __be32 status;
336 __be32 oem_status;
337 __be32 checksum;
338 unsigned char pad[14];
339 };
340
341
342 struct ncsi_aen_cr_pkt {
343 struct ncsi_aen_pkt_hdr aen;
344 __be32 checksum;
345 unsigned char pad[22];
346 };
347
348
349 struct ncsi_aen_hncdsc_pkt {
350 struct ncsi_aen_pkt_hdr aen;
351 __be32 status;
352 __be32 checksum;
353 unsigned char pad[18];
354 };
355
356
357 #define NCSI_PKT_REVISION 0x01
358
359
360 #define NCSI_PKT_CMD_CIS 0x00
361 #define NCSI_PKT_CMD_SP 0x01
362 #define NCSI_PKT_CMD_DP 0x02
363 #define NCSI_PKT_CMD_EC 0x03
364 #define NCSI_PKT_CMD_DC 0x04
365 #define NCSI_PKT_CMD_RC 0x05
366 #define NCSI_PKT_CMD_ECNT 0x06
367 #define NCSI_PKT_CMD_DCNT 0x07
368 #define NCSI_PKT_CMD_AE 0x08
369 #define NCSI_PKT_CMD_SL 0x09
370 #define NCSI_PKT_CMD_GLS 0x0a
371 #define NCSI_PKT_CMD_SVF 0x0b
372 #define NCSI_PKT_CMD_EV 0x0c
373 #define NCSI_PKT_CMD_DV 0x0d
374 #define NCSI_PKT_CMD_SMA 0x0e
375 #define NCSI_PKT_CMD_EBF 0x10
376 #define NCSI_PKT_CMD_DBF 0x11
377 #define NCSI_PKT_CMD_EGMF 0x12
378 #define NCSI_PKT_CMD_DGMF 0x13
379 #define NCSI_PKT_CMD_SNFC 0x14
380 #define NCSI_PKT_CMD_GVI 0x15
381 #define NCSI_PKT_CMD_GC 0x16
382 #define NCSI_PKT_CMD_GP 0x17
383 #define NCSI_PKT_CMD_GCPS 0x18
384 #define NCSI_PKT_CMD_GNS 0x19
385 #define NCSI_PKT_CMD_GNPTS 0x1a
386 #define NCSI_PKT_CMD_GPS 0x1b
387 #define NCSI_PKT_CMD_OEM 0x50
388 #define NCSI_PKT_CMD_PLDM 0x51
389 #define NCSI_PKT_CMD_GPUUID 0x52
390 #define NCSI_PKT_CMD_QPNPR 0x56
391 #define NCSI_PKT_CMD_SNPR 0x57
392
393
394
395 #define NCSI_PKT_RSP_CIS (NCSI_PKT_CMD_CIS + 0x80)
396 #define NCSI_PKT_RSP_SP (NCSI_PKT_CMD_SP + 0x80)
397 #define NCSI_PKT_RSP_DP (NCSI_PKT_CMD_DP + 0x80)
398 #define NCSI_PKT_RSP_EC (NCSI_PKT_CMD_EC + 0x80)
399 #define NCSI_PKT_RSP_DC (NCSI_PKT_CMD_DC + 0x80)
400 #define NCSI_PKT_RSP_RC (NCSI_PKT_CMD_RC + 0x80)
401 #define NCSI_PKT_RSP_ECNT (NCSI_PKT_CMD_ECNT + 0x80)
402 #define NCSI_PKT_RSP_DCNT (NCSI_PKT_CMD_DCNT + 0x80)
403 #define NCSI_PKT_RSP_AE (NCSI_PKT_CMD_AE + 0x80)
404 #define NCSI_PKT_RSP_SL (NCSI_PKT_CMD_SL + 0x80)
405 #define NCSI_PKT_RSP_GLS (NCSI_PKT_CMD_GLS + 0x80)
406 #define NCSI_PKT_RSP_SVF (NCSI_PKT_CMD_SVF + 0x80)
407 #define NCSI_PKT_RSP_EV (NCSI_PKT_CMD_EV + 0x80)
408 #define NCSI_PKT_RSP_DV (NCSI_PKT_CMD_DV + 0x80)
409 #define NCSI_PKT_RSP_SMA (NCSI_PKT_CMD_SMA + 0x80)
410 #define NCSI_PKT_RSP_EBF (NCSI_PKT_CMD_EBF + 0x80)
411 #define NCSI_PKT_RSP_DBF (NCSI_PKT_CMD_DBF + 0x80)
412 #define NCSI_PKT_RSP_EGMF (NCSI_PKT_CMD_EGMF + 0x80)
413 #define NCSI_PKT_RSP_DGMF (NCSI_PKT_CMD_DGMF + 0x80)
414 #define NCSI_PKT_RSP_SNFC (NCSI_PKT_CMD_SNFC + 0x80)
415 #define NCSI_PKT_RSP_GVI (NCSI_PKT_CMD_GVI + 0x80)
416 #define NCSI_PKT_RSP_GC (NCSI_PKT_CMD_GC + 0x80)
417 #define NCSI_PKT_RSP_GP (NCSI_PKT_CMD_GP + 0x80)
418 #define NCSI_PKT_RSP_GCPS (NCSI_PKT_CMD_GCPS + 0x80)
419 #define NCSI_PKT_RSP_GNS (NCSI_PKT_CMD_GNS + 0x80)
420 #define NCSI_PKT_RSP_GNPTS (NCSI_PKT_CMD_GNPTS + 0x80)
421 #define NCSI_PKT_RSP_GPS (NCSI_PKT_CMD_GPS + 0x80)
422 #define NCSI_PKT_RSP_OEM (NCSI_PKT_CMD_OEM + 0x80)
423 #define NCSI_PKT_RSP_PLDM (NCSI_PKT_CMD_PLDM + 0x80)
424 #define NCSI_PKT_RSP_GPUUID (NCSI_PKT_CMD_GPUUID + 0x80)
425 #define NCSI_PKT_RSP_QPNPR (NCSI_PKT_CMD_QPNPR + 0x80)
426 #define NCSI_PKT_RSP_SNPR (NCSI_PKT_CMD_SNPR + 0x80)
427
428
429 #define NCSI_PKT_RSP_C_COMPLETED 0x0000
430 #define NCSI_PKT_RSP_C_FAILED 0x0001
431 #define NCSI_PKT_RSP_C_UNAVAILABLE 0x0002
432 #define NCSI_PKT_RSP_C_UNSUPPORTED 0x0003
433 #define NCSI_PKT_RSP_R_NO_ERROR 0x0000
434 #define NCSI_PKT_RSP_R_INTERFACE 0x0001
435 #define NCSI_PKT_RSP_R_PARAM 0x0002
436 #define NCSI_PKT_RSP_R_CHANNEL 0x0003
437 #define NCSI_PKT_RSP_R_PACKAGE 0x0004
438 #define NCSI_PKT_RSP_R_LENGTH 0x0005
439 #define NCSI_PKT_RSP_R_UNKNOWN 0x7fff
440
441
442 #define NCSI_PKT_AEN 0xFF
443 #define NCSI_PKT_AEN_LSC 0x00
444 #define NCSI_PKT_AEN_CR 0x01
445 #define NCSI_PKT_AEN_HNCDSC 0x02
446
447 #endif