Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
folium-app
GitHub Repository: folium-app/Folium
Path: blob/a-new-beginning/SharedDependencies/Sources/libslirp/include/ncsi-pkt.h
2 views
1
/* SPDX-License-Identifier: BSD-3-Clause */
2
/*
3
* Copyright Gavin Shan, IBM Corporation 2016.
4
*
5
* Redistribution and use in source and binary forms, with or without
6
* modification, are permitted provided that the following conditions
7
* are met:
8
*
9
* 1. Redistributions of source code must retain the above
10
* copyright notice, this list of conditions and the following
11
* disclaimer.
12
*
13
* 2. Redistributions in binary form must reproduce the above
14
* copyright notice, this list of conditions and the following
15
* disclaimer in the documentation and/or other materials provided
16
* with the distribution.
17
*
18
* 3. Neither the name of the copyright holder nor the names of its
19
* contributors may be used to endorse or promote products derived
20
* from this software without specific prior written permission.
21
*
22
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
27
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
33
* OF THE POSSIBILITY OF SUCH DAMAGE.
34
*/
35
36
#ifndef NCSI_PKT_H
37
#define NCSI_PKT_H
38
39
/* from linux/net/ncsi/ncsi-pkt.h */
40
#define __be32 uint32_t
41
#define __be16 uint16_t
42
43
SLIRP_PACKED_BEGIN
44
struct ncsi_pkt_hdr {
45
unsigned char mc_id; /* Management controller ID */
46
unsigned char revision; /* NCSI version - 0x01 */
47
unsigned char reserved; /* Reserved */
48
unsigned char id; /* Packet sequence number */
49
unsigned char type; /* Packet type */
50
unsigned char channel; /* Network controller ID */
51
__be16 length; /* Payload length */
52
__be32 reserved1[2]; /* Reserved */
53
} SLIRP_PACKED_END;
54
55
SLIRP_PACKED_BEGIN
56
struct ncsi_cmd_pkt_hdr {
57
struct ncsi_pkt_hdr common; /* Common NCSI packet header */
58
} SLIRP_PACKED_END;
59
60
SLIRP_PACKED_BEGIN
61
struct ncsi_rsp_pkt_hdr {
62
struct ncsi_pkt_hdr common; /* Common NCSI packet header */
63
__be16 code; /* Response code */
64
__be16 reason; /* Response reason */
65
} SLIRP_PACKED_END;
66
67
SLIRP_PACKED_BEGIN
68
struct ncsi_aen_pkt_hdr {
69
struct ncsi_pkt_hdr common; /* Common NCSI packet header */
70
unsigned char reserved2[3]; /* Reserved */
71
unsigned char type; /* AEN packet type */
72
} SLIRP_PACKED_END;
73
74
/* NCSI common command packet */
75
SLIRP_PACKED_BEGIN
76
struct ncsi_cmd_pkt {
77
struct ncsi_cmd_pkt_hdr cmd; /* Command header */
78
__be32 checksum; /* Checksum */
79
unsigned char pad[26];
80
} SLIRP_PACKED_END;
81
82
SLIRP_PACKED_BEGIN
83
struct ncsi_rsp_pkt {
84
struct ncsi_rsp_pkt_hdr rsp; /* Response header */
85
__be32 checksum; /* Checksum */
86
unsigned char pad[22];
87
} SLIRP_PACKED_END;
88
89
/* Select Package */
90
SLIRP_PACKED_BEGIN
91
struct ncsi_cmd_sp_pkt {
92
struct ncsi_cmd_pkt_hdr cmd; /* Command header */
93
unsigned char reserved[3]; /* Reserved */
94
unsigned char hw_arbitration; /* HW arbitration */
95
__be32 checksum; /* Checksum */
96
unsigned char pad[22];
97
} SLIRP_PACKED_END;
98
99
/* Disable Channel */
100
SLIRP_PACKED_BEGIN
101
struct ncsi_cmd_dc_pkt {
102
struct ncsi_cmd_pkt_hdr cmd; /* Command header */
103
unsigned char reserved[3]; /* Reserved */
104
unsigned char ald; /* Allow link down */
105
__be32 checksum; /* Checksum */
106
unsigned char pad[22];
107
} SLIRP_PACKED_END;
108
109
/* Reset Channel */
110
SLIRP_PACKED_BEGIN
111
struct ncsi_cmd_rc_pkt {
112
struct ncsi_cmd_pkt_hdr cmd; /* Command header */
113
__be32 reserved; /* Reserved */
114
__be32 checksum; /* Checksum */
115
unsigned char pad[22];
116
} SLIRP_PACKED_END;
117
118
/* AEN Enable */
119
SLIRP_PACKED_BEGIN
120
struct ncsi_cmd_ae_pkt {
121
struct ncsi_cmd_pkt_hdr cmd; /* Command header */
122
unsigned char reserved[3]; /* Reserved */
123
unsigned char mc_id; /* MC ID */
124
__be32 mode; /* AEN working mode */
125
__be32 checksum; /* Checksum */
126
unsigned char pad[18];
127
} SLIRP_PACKED_END;
128
129
/* Set Link */
130
SLIRP_PACKED_BEGIN
131
struct ncsi_cmd_sl_pkt {
132
struct ncsi_cmd_pkt_hdr cmd; /* Command header */
133
__be32 mode; /* Link working mode */
134
__be32 oem_mode; /* OEM link mode */
135
__be32 checksum; /* Checksum */
136
unsigned char pad[18];
137
} SLIRP_PACKED_END;
138
139
/* Set VLAN Filter */
140
SLIRP_PACKED_BEGIN
141
struct ncsi_cmd_svf_pkt {
142
struct ncsi_cmd_pkt_hdr cmd; /* Command header */
143
__be16 reserved; /* Reserved */
144
__be16 vlan; /* VLAN ID */
145
__be16 reserved1; /* Reserved */
146
unsigned char index; /* VLAN table index */
147
unsigned char enable; /* Enable or disable */
148
__be32 checksum; /* Checksum */
149
unsigned char pad[14];
150
} SLIRP_PACKED_END;
151
152
/* Enable VLAN */
153
SLIRP_PACKED_BEGIN
154
struct ncsi_cmd_ev_pkt {
155
struct ncsi_cmd_pkt_hdr cmd; /* Command header */
156
unsigned char reserved[3]; /* Reserved */
157
unsigned char mode; /* VLAN filter mode */
158
__be32 checksum; /* Checksum */
159
unsigned char pad[22];
160
} SLIRP_PACKED_END;
161
162
/* Set MAC Address */
163
SLIRP_PACKED_BEGIN
164
struct ncsi_cmd_sma_pkt {
165
struct ncsi_cmd_pkt_hdr cmd; /* Command header */
166
unsigned char mac[6]; /* MAC address */
167
unsigned char index; /* MAC table index */
168
unsigned char at_e; /* Addr type and operation */
169
__be32 checksum; /* Checksum */
170
unsigned char pad[18];
171
} SLIRP_PACKED_END;
172
173
/* Enable Broadcast Filter */
174
SLIRP_PACKED_BEGIN
175
struct ncsi_cmd_ebf_pkt {
176
struct ncsi_cmd_pkt_hdr cmd; /* Command header */
177
__be32 mode; /* Filter mode */
178
__be32 checksum; /* Checksum */
179
unsigned char pad[22];
180
} SLIRP_PACKED_END;
181
182
/* Enable Global Multicast Filter */
183
SLIRP_PACKED_BEGIN
184
struct ncsi_cmd_egmf_pkt {
185
struct ncsi_cmd_pkt_hdr cmd; /* Command header */
186
__be32 mode; /* Global MC mode */
187
__be32 checksum; /* Checksum */
188
unsigned char pad[22];
189
} SLIRP_PACKED_END;
190
191
/* Set NCSI Flow Control */
192
SLIRP_PACKED_BEGIN
193
struct ncsi_cmd_snfc_pkt {
194
struct ncsi_cmd_pkt_hdr cmd; /* Command header */
195
unsigned char reserved[3]; /* Reserved */
196
unsigned char mode; /* Flow control mode */
197
__be32 checksum; /* Checksum */
198
unsigned char pad[22];
199
} SLIRP_PACKED_END;
200
201
/* OEM Request Command as per NCSI Specification */
202
SLIRP_PACKED_BEGIN
203
struct ncsi_cmd_oem_pkt {
204
struct ncsi_cmd_pkt_hdr cmd; /* Command header */
205
__be32 mfr_id; /* Manufacture ID */
206
unsigned char data[]; /* OEM Payload Data */
207
} SLIRP_PACKED_END;
208
209
/* OEM Response Packet as per NCSI Specification */
210
SLIRP_PACKED_BEGIN
211
struct ncsi_rsp_oem_pkt {
212
struct ncsi_rsp_pkt_hdr rsp; /* Command header */
213
__be32 mfr_id; /* Manufacture ID */
214
unsigned char data[]; /* Payload data */
215
} SLIRP_PACKED_END;
216
217
/* Mellanox Response Data */
218
SLIRP_PACKED_BEGIN
219
struct ncsi_rsp_oem_mlx_pkt {
220
unsigned char cmd_rev; /* Command Revision */
221
unsigned char cmd; /* Command ID */
222
unsigned char param; /* Parameter */
223
unsigned char optional; /* Optional data */
224
unsigned char data[]; /* Data */
225
} SLIRP_PACKED_END;
226
227
/* Get Link Status */
228
SLIRP_PACKED_BEGIN
229
struct ncsi_rsp_gls_pkt {
230
struct ncsi_rsp_pkt_hdr rsp; /* Response header */
231
__be32 status; /* Link status */
232
__be32 other; /* Other indications */
233
__be32 oem_status; /* OEM link status */
234
__be32 checksum;
235
unsigned char pad[10];
236
} SLIRP_PACKED_END;
237
238
/* Get Version ID */
239
SLIRP_PACKED_BEGIN
240
struct ncsi_rsp_gvi_pkt {
241
struct ncsi_rsp_pkt_hdr rsp; /* Response header */
242
__be32 ncsi_version; /* NCSI version */
243
unsigned char reserved[3]; /* Reserved */
244
unsigned char alpha2; /* NCSI version */
245
unsigned char fw_name[12]; /* f/w name string */
246
__be32 fw_version; /* f/w version */
247
__be16 pci_ids[4]; /* PCI IDs */
248
__be32 mf_id; /* Manufacture ID */
249
__be32 checksum;
250
} SLIRP_PACKED_END;
251
252
/* Get Capabilities */
253
SLIRP_PACKED_BEGIN
254
struct ncsi_rsp_gc_pkt {
255
struct ncsi_rsp_pkt_hdr rsp; /* Response header */
256
__be32 cap; /* Capabilities */
257
__be32 bc_cap; /* Broadcast cap */
258
__be32 mc_cap; /* Multicast cap */
259
__be32 buf_cap; /* Buffering cap */
260
__be32 aen_cap; /* AEN cap */
261
unsigned char vlan_cnt; /* VLAN filter count */
262
unsigned char mixed_cnt; /* Mix filter count */
263
unsigned char mc_cnt; /* MC filter count */
264
unsigned char uc_cnt; /* UC filter count */
265
unsigned char reserved[2]; /* Reserved */
266
unsigned char vlan_mode; /* VLAN mode */
267
unsigned char channel_cnt; /* Channel count */
268
__be32 checksum; /* Checksum */
269
} SLIRP_PACKED_END;
270
271
/* Get Parameters */
272
SLIRP_PACKED_BEGIN
273
struct ncsi_rsp_gp_pkt {
274
struct ncsi_rsp_pkt_hdr rsp; /* Response header */
275
unsigned char mac_cnt; /* Number of MAC addr */
276
unsigned char reserved[2]; /* Reserved */
277
unsigned char mac_enable; /* MAC addr enable flags */
278
unsigned char vlan_cnt; /* VLAN tag count */
279
unsigned char reserved1; /* Reserved */
280
__be16 vlan_enable; /* VLAN tag enable flags */
281
__be32 link_mode; /* Link setting */
282
__be32 bc_mode; /* BC filter mode */
283
__be32 valid_modes; /* Valid mode parameters */
284
unsigned char vlan_mode; /* VLAN mode */
285
unsigned char fc_mode; /* Flow control mode */
286
unsigned char reserved2[2]; /* Reserved */
287
__be32 aen_mode; /* AEN mode */
288
unsigned char mac[6]; /* Supported MAC addr */
289
__be16 vlan; /* Supported VLAN tags */
290
__be32 checksum; /* Checksum */
291
} SLIRP_PACKED_END;
292
293
/* Get Controller Packet Statistics */
294
SLIRP_PACKED_BEGIN
295
struct ncsi_rsp_gcps_pkt {
296
struct ncsi_rsp_pkt_hdr rsp; /* Response header */
297
__be32 cnt_hi; /* Counter cleared */
298
__be32 cnt_lo; /* Counter cleared */
299
__be32 rx_bytes; /* Rx bytes */
300
__be32 tx_bytes; /* Tx bytes */
301
__be32 rx_uc_pkts; /* Rx UC packets */
302
__be32 rx_mc_pkts; /* Rx MC packets */
303
__be32 rx_bc_pkts; /* Rx BC packets */
304
__be32 tx_uc_pkts; /* Tx UC packets */
305
__be32 tx_mc_pkts; /* Tx MC packets */
306
__be32 tx_bc_pkts; /* Tx BC packets */
307
__be32 fcs_err; /* FCS errors */
308
__be32 align_err; /* Alignment errors */
309
__be32 false_carrier; /* False carrier detection */
310
__be32 runt_pkts; /* Rx runt packets */
311
__be32 jabber_pkts; /* Rx jabber packets */
312
__be32 rx_pause_xon; /* Rx pause XON frames */
313
__be32 rx_pause_xoff; /* Rx XOFF frames */
314
__be32 tx_pause_xon; /* Tx XON frames */
315
__be32 tx_pause_xoff; /* Tx XOFF frames */
316
__be32 tx_s_collision; /* Single collision frames */
317
__be32 tx_m_collision; /* Multiple collision frames */
318
__be32 l_collision; /* Late collision frames */
319
__be32 e_collision; /* Excessive collision frames */
320
__be32 rx_ctl_frames; /* Rx control frames */
321
__be32 rx_64_frames; /* Rx 64-bytes frames */
322
__be32 rx_127_frames; /* Rx 65-127 bytes frames */
323
__be32 rx_255_frames; /* Rx 128-255 bytes frames */
324
__be32 rx_511_frames; /* Rx 256-511 bytes frames */
325
__be32 rx_1023_frames; /* Rx 512-1023 bytes frames */
326
__be32 rx_1522_frames; /* Rx 1024-1522 bytes frames */
327
__be32 rx_9022_frames; /* Rx 1523-9022 bytes frames */
328
__be32 tx_64_frames; /* Tx 64-bytes frames */
329
__be32 tx_127_frames; /* Tx 65-127 bytes frames */
330
__be32 tx_255_frames; /* Tx 128-255 bytes frames */
331
__be32 tx_511_frames; /* Tx 256-511 bytes frames */
332
__be32 tx_1023_frames; /* Tx 512-1023 bytes frames */
333
__be32 tx_1522_frames; /* Tx 1024-1522 bytes frames */
334
__be32 tx_9022_frames; /* Tx 1523-9022 bytes frames */
335
__be32 rx_valid_bytes; /* Rx valid bytes */
336
__be32 rx_runt_pkts; /* Rx error runt packets */
337
__be32 rx_jabber_pkts; /* Rx error jabber packets */
338
__be32 checksum; /* Checksum */
339
} SLIRP_PACKED_END;
340
341
/* Get NCSI Statistics */
342
SLIRP_PACKED_BEGIN
343
struct ncsi_rsp_gns_pkt {
344
struct ncsi_rsp_pkt_hdr rsp; /* Response header */
345
__be32 rx_cmds; /* Rx NCSI commands */
346
__be32 dropped_cmds; /* Dropped commands */
347
__be32 cmd_type_errs; /* Command type errors */
348
__be32 cmd_csum_errs; /* Command checksum errors */
349
__be32 rx_pkts; /* Rx NCSI packets */
350
__be32 tx_pkts; /* Tx NCSI packets */
351
__be32 tx_aen_pkts; /* Tx AEN packets */
352
__be32 checksum; /* Checksum */
353
} SLIRP_PACKED_END;
354
355
/* Get NCSI Pass-through Statistics */
356
SLIRP_PACKED_BEGIN
357
struct ncsi_rsp_gnpts_pkt {
358
struct ncsi_rsp_pkt_hdr rsp; /* Response header */
359
__be32 tx_pkts; /* Tx packets */
360
__be32 tx_dropped; /* Tx dropped packets */
361
__be32 tx_channel_err; /* Tx channel errors */
362
__be32 tx_us_err; /* Tx undersize errors */
363
__be32 rx_pkts; /* Rx packets */
364
__be32 rx_dropped; /* Rx dropped packets */
365
__be32 rx_channel_err; /* Rx channel errors */
366
__be32 rx_us_err; /* Rx undersize errors */
367
__be32 rx_os_err; /* Rx oversize errors */
368
__be32 checksum; /* Checksum */
369
} SLIRP_PACKED_END;
370
371
/* Get package status */
372
SLIRP_PACKED_BEGIN
373
struct ncsi_rsp_gps_pkt {
374
struct ncsi_rsp_pkt_hdr rsp; /* Response header */
375
__be32 status; /* Hardware arbitration status */
376
__be32 checksum;
377
} SLIRP_PACKED_END;
378
379
/* Get package UUID */
380
SLIRP_PACKED_BEGIN
381
struct ncsi_rsp_gpuuid_pkt {
382
struct ncsi_rsp_pkt_hdr rsp; /* Response header */
383
unsigned char uuid[16]; /* UUID */
384
__be32 checksum;
385
} SLIRP_PACKED_END;
386
387
/* AEN: Link State Change */
388
SLIRP_PACKED_BEGIN
389
struct ncsi_aen_lsc_pkt {
390
struct ncsi_aen_pkt_hdr aen; /* AEN header */
391
__be32 status; /* Link status */
392
__be32 oem_status; /* OEM link status */
393
__be32 checksum; /* Checksum */
394
unsigned char pad[14];
395
} SLIRP_PACKED_END;
396
397
/* AEN: Configuration Required */
398
SLIRP_PACKED_BEGIN
399
struct ncsi_aen_cr_pkt {
400
struct ncsi_aen_pkt_hdr aen; /* AEN header */
401
__be32 checksum; /* Checksum */
402
unsigned char pad[22];
403
} SLIRP_PACKED_END;
404
405
/* AEN: Host Network Controller Driver Status Change */
406
SLIRP_PACKED_BEGIN
407
struct ncsi_aen_hncdsc_pkt {
408
struct ncsi_aen_pkt_hdr aen; /* AEN header */
409
__be32 status; /* Status */
410
__be32 checksum; /* Checksum */
411
unsigned char pad[18];
412
} SLIRP_PACKED_END;
413
414
/* NCSI packet revision */
415
#define NCSI_PKT_REVISION 0x01
416
417
/* NCSI packet commands */
418
#define NCSI_PKT_CMD_CIS 0x00 /* Clear Initial State */
419
#define NCSI_PKT_CMD_SP 0x01 /* Select Package */
420
#define NCSI_PKT_CMD_DP 0x02 /* Deselect Package */
421
#define NCSI_PKT_CMD_EC 0x03 /* Enable Channel */
422
#define NCSI_PKT_CMD_DC 0x04 /* Disable Channel */
423
#define NCSI_PKT_CMD_RC 0x05 /* Reset Channel */
424
#define NCSI_PKT_CMD_ECNT 0x06 /* Enable Channel Network Tx */
425
#define NCSI_PKT_CMD_DCNT 0x07 /* Disable Channel Network Tx */
426
#define NCSI_PKT_CMD_AE 0x08 /* AEN Enable */
427
#define NCSI_PKT_CMD_SL 0x09 /* Set Link */
428
#define NCSI_PKT_CMD_GLS 0x0a /* Get Link */
429
#define NCSI_PKT_CMD_SVF 0x0b /* Set VLAN Filter */
430
#define NCSI_PKT_CMD_EV 0x0c /* Enable VLAN */
431
#define NCSI_PKT_CMD_DV 0x0d /* Disable VLAN */
432
#define NCSI_PKT_CMD_SMA 0x0e /* Set MAC address */
433
#define NCSI_PKT_CMD_EBF 0x10 /* Enable Broadcast Filter */
434
#define NCSI_PKT_CMD_DBF 0x11 /* Disable Broadcast Filter */
435
#define NCSI_PKT_CMD_EGMF 0x12 /* Enable Global Multicast Filter */
436
#define NCSI_PKT_CMD_DGMF 0x13 /* Disable Global Multicast Filter */
437
#define NCSI_PKT_CMD_SNFC 0x14 /* Set NCSI Flow Control */
438
#define NCSI_PKT_CMD_GVI 0x15 /* Get Version ID */
439
#define NCSI_PKT_CMD_GC 0x16 /* Get Capabilities */
440
#define NCSI_PKT_CMD_GP 0x17 /* Get Parameters */
441
#define NCSI_PKT_CMD_GCPS 0x18 /* Get Controller Packet Statistics */
442
#define NCSI_PKT_CMD_GNS 0x19 /* Get NCSI Statistics */
443
#define NCSI_PKT_CMD_GNPTS 0x1a /* Get NCSI Pass-throu Statistics */
444
#define NCSI_PKT_CMD_GPS 0x1b /* Get package status */
445
#define NCSI_PKT_CMD_OEM 0x50 /* OEM */
446
#define NCSI_PKT_CMD_PLDM 0x51 /* PLDM request over NCSI over RBT */
447
#define NCSI_PKT_CMD_GPUUID 0x52 /* Get package UUID */
448
449
/* NCSI packet responses */
450
#define NCSI_PKT_RSP_CIS (NCSI_PKT_CMD_CIS + 0x80)
451
#define NCSI_PKT_RSP_SP (NCSI_PKT_CMD_SP + 0x80)
452
#define NCSI_PKT_RSP_DP (NCSI_PKT_CMD_DP + 0x80)
453
#define NCSI_PKT_RSP_EC (NCSI_PKT_CMD_EC + 0x80)
454
#define NCSI_PKT_RSP_DC (NCSI_PKT_CMD_DC + 0x80)
455
#define NCSI_PKT_RSP_RC (NCSI_PKT_CMD_RC + 0x80)
456
#define NCSI_PKT_RSP_ECNT (NCSI_PKT_CMD_ECNT + 0x80)
457
#define NCSI_PKT_RSP_DCNT (NCSI_PKT_CMD_DCNT + 0x80)
458
#define NCSI_PKT_RSP_AE (NCSI_PKT_CMD_AE + 0x80)
459
#define NCSI_PKT_RSP_SL (NCSI_PKT_CMD_SL + 0x80)
460
#define NCSI_PKT_RSP_GLS (NCSI_PKT_CMD_GLS + 0x80)
461
#define NCSI_PKT_RSP_SVF (NCSI_PKT_CMD_SVF + 0x80)
462
#define NCSI_PKT_RSP_EV (NCSI_PKT_CMD_EV + 0x80)
463
#define NCSI_PKT_RSP_DV (NCSI_PKT_CMD_DV + 0x80)
464
#define NCSI_PKT_RSP_SMA (NCSI_PKT_CMD_SMA + 0x80)
465
#define NCSI_PKT_RSP_EBF (NCSI_PKT_CMD_EBF + 0x80)
466
#define NCSI_PKT_RSP_DBF (NCSI_PKT_CMD_DBF + 0x80)
467
#define NCSI_PKT_RSP_EGMF (NCSI_PKT_CMD_EGMF + 0x80)
468
#define NCSI_PKT_RSP_DGMF (NCSI_PKT_CMD_DGMF + 0x80)
469
#define NCSI_PKT_RSP_SNFC (NCSI_PKT_CMD_SNFC + 0x80)
470
#define NCSI_PKT_RSP_GVI (NCSI_PKT_CMD_GVI + 0x80)
471
#define NCSI_PKT_RSP_GC (NCSI_PKT_CMD_GC + 0x80)
472
#define NCSI_PKT_RSP_GP (NCSI_PKT_CMD_GP + 0x80)
473
#define NCSI_PKT_RSP_GCPS (NCSI_PKT_CMD_GCPS + 0x80)
474
#define NCSI_PKT_RSP_GNS (NCSI_PKT_CMD_GNS + 0x80)
475
#define NCSI_PKT_RSP_GNPTS (NCSI_PKT_CMD_GNPTS + 0x80)
476
#define NCSI_PKT_RSP_GPS (NCSI_PKT_CMD_GPS + 0x80)
477
#define NCSI_PKT_RSP_OEM (NCSI_PKT_CMD_OEM + 0x80)
478
#define NCSI_PKT_RSP_PLDM (NCSI_PKT_CMD_PLDM + 0x80)
479
#define NCSI_PKT_RSP_GPUUID (NCSI_PKT_CMD_GPUUID + 0x80)
480
481
/* NCSI response code/reason */
482
#define NCSI_PKT_RSP_C_COMPLETED 0x0000 /* Command Completed */
483
#define NCSI_PKT_RSP_C_FAILED 0x0001 /* Command Failed */
484
#define NCSI_PKT_RSP_C_UNAVAILABLE 0x0002 /* Command Unavailable */
485
#define NCSI_PKT_RSP_C_UNSUPPORTED 0x0003 /* Command Unsupported */
486
#define NCSI_PKT_RSP_R_NO_ERROR 0x0000 /* No Error */
487
#define NCSI_PKT_RSP_R_INTERFACE 0x0001 /* Interface not ready */
488
#define NCSI_PKT_RSP_R_PARAM 0x0002 /* Invalid Parameter */
489
#define NCSI_PKT_RSP_R_CHANNEL 0x0003 /* Channel not Ready */
490
#define NCSI_PKT_RSP_R_PACKAGE 0x0004 /* Package not Ready */
491
#define NCSI_PKT_RSP_R_LENGTH 0x0005 /* Invalid payload length */
492
#define NCSI_PKT_RSP_R_UNKNOWN 0x7fff /* Command type unsupported */
493
494
/* NCSI AEN packet type */
495
#define NCSI_PKT_AEN 0xFF /* AEN Packet */
496
#define NCSI_PKT_AEN_LSC 0x00 /* Link status change */
497
#define NCSI_PKT_AEN_CR 0x01 /* Configuration required */
498
#define NCSI_PKT_AEN_HNCDSC 0x02 /* HNC driver status change */
499
500
/* OEM Vendor Manufacture ID */
501
#define NCSI_OEM_MFR_MLX_ID 0x8119
502
#define NCSI_OEM_MFR_BCM_ID 0x113d
503
#define NCSI_OEM_MFR_INTEL_ID 0x157
504
/* Intel specific OEM command */
505
#define NCSI_OEM_INTEL_CMD_GMA 0x06 /* CMD ID for Get MAC */
506
#define NCSI_OEM_INTEL_CMD_KEEP_PHY 0x20 /* CMD ID for Keep PHY up */
507
/* Broadcom specific OEM Command */
508
#define NCSI_OEM_BCM_CMD_GMA 0x01 /* CMD ID for Get MAC */
509
/* Mellanox specific OEM Command */
510
#define NCSI_OEM_MLX_CMD_GMA 0x00 /* CMD ID for Get MAC */
511
#define NCSI_OEM_MLX_CMD_GMA_PARAM 0x1b /* Parameter for GMA */
512
#define NCSI_OEM_MLX_CMD_SMAF 0x01 /* CMD ID for Set MC Affinity */
513
#define NCSI_OEM_MLX_CMD_SMAF_PARAM 0x07 /* Parameter for SMAF */
514
/* Offset in OEM request */
515
#define MLX_SMAF_MAC_ADDR_OFFSET 8 /* Offset for MAC in SMAF */
516
#define MLX_SMAF_MED_SUPPORT_OFFSET 14 /* Offset for medium in SMAF */
517
/* Mac address offset in OEM response */
518
#define BCM_MAC_ADDR_OFFSET 28
519
#define MLX_MAC_ADDR_OFFSET 8
520
#define INTEL_MAC_ADDR_OFFSET 1
521
522
/* Status offset in OEM response */
523
#define MLX_GMA_STATUS_OFFSET 0
524
/* OEM Response payload length */
525
#define MLX_GMA_PAYLOAD_LEN 24
526
527
#endif /* NCSI_PKT_H */
528
529