File: icmd_layouts.h

package info (click to toggle)
mstflint 4.33.0%2B1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 56,212 kB
  • sloc: ansic: 224,755; cpp: 116,860; ada: 19,665; sh: 11,406; python: 8,388; makefile: 1,541
file content (405 lines) | stat: -rw-r--r-- 16,722 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
/*
 * Copyright (c) 2013-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 *
 * This software is available to you under a choice of one of two
 * licenses.  You may choose to be licensed under the terms of the GNU
 * General Public License (GPL) Version 2, available from the file
 * COPYING in the main directory of this source tree, or the
 * OpenIB.org BSD license below:
 *
 *     Redistribution and use in source and binary forms, with or
 *     without modification, are permitted provided that the following
 *     conditions are met:
 *
 *      - Redistributions of source code must retain the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer.
 *
 *      - Redistributions in binary form must reproduce the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer in the documentation and/or other materials
 *        provided with the distribution.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

#ifndef ICMD_LAYOUTS_H
#define ICMD_LAYOUTS_H

#ifdef __cplusplus
extern "C"
{
#endif

#include "adb_to_c_utils.h"
/* Description -   */
/* Size in bytes - 16 */
struct connectib_FW_VERSION {
    /*---------------- DWORD[0] (Offset 0x0) ----------------*/
    /* Description -  */
    /* 0x0.16 - 0x0.31 */
    u_int16_t MAJOR;
    /*---------------- DWORD[1] (Offset 0x4) ----------------*/
    /* Description -  */
    /* 0x4.0 - 0x4.15 */
    u_int16_t SUBMINOR;
    /* Description -  */
    /* 0x4.16 - 0x4.31 */
    u_int16_t MINOR;
    /*---------------- DWORD[2] (Offset 0x8) ----------------*/
    /* Description -  */
    /* 0x8.8 - 0x8.15 */
    u_int8_t Hour;
    /* Description -  */
    /* 0x8.16 - 0x8.23 */
    u_int8_t Minutes;
    /* Description -  */
    /* 0x8.24 - 0x8.31 */
    u_int8_t Seconds;
    /*---------------- DWORD[3] (Offset 0xc) ----------------*/
    /* Description -  */
    /* 0xc.0 - 0xc.7 */
    u_int8_t Day;
    /* Description -  */
    /* 0xc.8 - 0xc.15 */
    u_int8_t Month;
    /* Description -  */
    /* 0xc.16 - 0xc.31 */
    u_int16_t Year;
};

/* Description -   */
/* Size in bytes - 16 */
struct connectib_icmd_set_port_sniffer {
    /*---------------- DWORD[0] (Offset 0x0) ----------------*/
    /* Description -  */
    /* 0x0.0 - 0x0.15 */
    u_int16_t gvmi;
    /*---------------- DWORD[1] (Offset 0x4) ----------------*/
    /* Description -  */
    /* 0x4.0 - 0x4.0 */
    u_int8_t sx_rx_;
    /* Description -  */
    /* 0x4.16 - 0x4.16 */
    u_int8_t attach_detach_;
    /*---------------- DWORD[2] (Offset 0x8) ----------------*/
    /* Description -  */
    /* 0x8.24 - 0x8.31 */
    u_int8_t port;
    /*---------------- DWORD[3] (Offset 0xc) ----------------*/
    /* Description -  */
    /* 0xc.0 - 0xc.23 */
    u_int32_t sniffer_qpn;
};

/* Description -   */
/* Size in bytes - 36 */
struct connectib_icmd_get_fw_info {
    /*---------------- DWORD[0] (Offset 0x0) ----------------*/
    /* Description -  */
    /* 0x0.0 - 0x10.31 */
    struct connectib_FW_VERSION fw_version;
    /*---------------- DWORD[4] (Offset 0x10) ----------------*/
    /* Description - Hash gen file signature */
    /* 0x10.0 - 0x10.15 */
    u_int16_t hash_signature;
    /*---------------- DWORD[5] (Offset 0x14) ----------------*/
    /* Description -  */
    /* 0x14.24 - 0x24.23 */
    char psid[17];
};


struct connectib_itrace_ctrl {
    /*---------------- DWORD[0] (Offset 0x0) ----------------*/
    /* Description - threashhold of logging to print from:
     *  0 - LOG_DEBUG
     *  1 - LOG_INFO
     *  2 - LOG_WARNING
     *  3 - LOG_ERROR */
    /* 0x0.0 - 0x0.7 */
    u_int8_t log_level;
    /* Description - added delay (usec) to prevent log event lost */
    /* 0x0.16 - 0x0.31 */
    u_int16_t log_delay;
};

struct connectib_itrace {
    /*---------------- DWORD[0] (Offset 0x0) ----------------*/
    /* Description - bit numbers:
     *  0=DEBUG_INIT
     *  1=INIT
     *  2=ICM
     *  3=ICM_FREE_LIST
     *  4=LOG_MOD_HOST_MNG
     *  5=CMD_IF
     *  6=PHY_IB
     *  7=PHY_RX_ADAP
     *  8=PHY_EYE_OPN
     *  9=PHY_GENERAL
     *  10=PHY_MANAGER
     *  11=PWR
     *  12=FLR
     *  13=ICM_ACCESS
     *  14=MAD
     *  15=RXT_CHECKS
     *  16=I2C
     *  17=TRANSPORT
     *  18=FW_LL
     *  19=RX_ERRORS
     *  20=CMDIF_DRIVER
     *  21=PROFILING
     *  22=MANAGEMENT
     *  23=FLASH
     *  24=STEERING
     *  25=IFARM
     *  26=ICMD
     *  27=PCI
     *  28=DC_CLEANUP
     *  29=PHY_ETH
     *  30=VIRT */
    /* 0x0.0 - 0x4.31 */
    u_int32_t unit_mask;
    /*---------------- DWORD[1] (Offset 0x4) ----------------*/
    /* Description -  */
    /* 0x4.0 - 0x8.31 */
    struct connectib_itrace_ctrl ctrl;
};

/* Description -   */
/* Size in bytes - 4 */
struct connectx4_component_authentication_configuration {
    /*---------------- DWORD[0] (Offset 0x0) ----------------*/
    /* Description - 0-NULL, 1-SHA256Digest, 3-2048 bit RSA */
    /* 0x0.0 - 0x0.7 */
    u_int8_t auth_type;
    /* Description - used for authenticating Factory Re-COnfiguration Responses */
    /* 0x0.27 - 0x0.27 */
    u_int8_t frc_en;
    /* Description - used for signing NVCONFIG at MLNX level */
    /* 0x0.28 - 0x0.28 */
    u_int8_t mlnx_nvconfig_en;
    /* Description - used for authenticating NVCONFIG at OEM level */
    /* 0x0.29 - 0x0.29 */
    u_int8_t vendor_nvconfig_en;
    /* Description - used for authenticating CS tokens at OEM level */
    /* 0x0.30 - 0x0.30 */
    u_int8_t cs_token_en;
    /* Description - Used for authenticating firmware, DBG_FW, DBG Tokens */
    /* 0x0.31 - 0x0.31 */
    u_int8_t fw_en;
};

/* Description -   */
/* Size in bytes - 544 */
struct connectx4_file_public_keys_3 {
    /*---------------- DWORD[0] (Offset 0x0) ----------------*/
    /* Description - public key exponent, FW should use an exponent of 65537 */
    /* 0x0.0 - 0x0.31 */
    u_int32_t keypair_exp;
    /*---------------- DWORD[1] (Offset 0x4) ----------------*/
    /* Description - UUID of this key created by server when it generates a keypair */
    /* 0x4.0 - 0x10.31 */
    u_int32_t keypair_uuid[4];
    /*---------------- DWORD[5] (Offset 0x14) ----------------*/
    /* Description - 4096 bit public-key */
    /* 0x14.0 - 0x210.31 */
    u_int32_t key[128];
    /*---------------- DWORD[133] (Offset 0x214) ----------------*/
    /* Description - configuration bits to enable authentication for each component */
    /* 0x214.0 - 0x214.31 */
    struct connectx4_component_authentication_configuration component_authentication_configuration;
};

/* Description -   */
/* Size in bytes - 4352 */
struct connectx4_public_keys_3 {
    /*---------------- DWORD[0] (Offset 0x0) ----------------*/
    /* Description -  */
    /* 0x0.0 - 0x10fc.31 */
    struct connectx4_file_public_keys_3 file_public_keys_3[8];
};

/* Description -   */
/* Size in bytes - 1536 */
struct connectx4_secure_boot_signatures {
    /*---------------- DWORD[0] (Offset 0x0) ----------------*/
    /* Description - boot signature of itocs: */
    /* 0x0.0 - 0x1fc.31 */
    u_int32_t boot_signature[128];
    /*---------------- DWORD[128] (Offset 0x200) ----------------*/
    /* Description - fw critical signature of itcos: HW_BOOT_INI, PCIE_PHY_UC_COMMANDS, PCIE_LINK_CODE */
    /* 0x200.0 - 0x3fc.31 */
    u_int32_t critical_signature[128];
    /*---------------- DWORD[256] (Offset 0x400) ----------------*/
    /* Description - fw non critical signatures of all other itocs  */
    /* 0x400.0 - 0x5fc.31 */
    u_int32_t non_critical_signature[128];
};

/* Description -  HW pointer entry */
/* Size in bytes - 8 */
struct connectx4_hw_pointer_entry {
    /*---------------- DWORD[0] (Offset 0x0) ----------------*/
    /* Description - pointer */
    /* 0x0.0 - 0x0.31 */
    u_int32_t ptr;
    /*---------------- DWORD[1] (Offset 0x4) ----------------*/
    /* Description - crc16 as calculated by HW */
    /* 0x4.0 - 0x4.15 */
    u_int16_t crc;
};

/* Description -  HW pointers */
/* Size in bytes - 128 */
struct connectx4_hw_pointers_arava {
    /*---------------- DWORD[0] (Offset 0x0) ----------------*/
    /* Description -  */
    /* 0x0.0 - 0x4.31 */
    struct connectx4_hw_pointer_entry boot_record_ptr;
    /*---------------- DWORD[2] (Offset 0x8) ----------------*/
    /* Description -  */
    /* 0x8.0 - 0xc.31 */
    struct connectx4_hw_pointer_entry boot2_ptr;
    /*---------------- DWORD[4] (Offset 0x10) ----------------*/
    /* Description -  */
    /* 0x10.0 - 0x14.31 */
    struct connectx4_hw_pointer_entry toc_ptr;
    /*---------------- DWORD[6] (Offset 0x18) ----------------*/
    /* Description -  */
    /* 0x18.0 - 0x1c.31 */
    struct connectx4_hw_pointer_entry tools_ptr;
    /*---------------- DWORD[8] (Offset 0x20) ----------------*/
    /* Description -  */
    /* 0x20.0 - 0x24.31 */
    struct connectx4_hw_pointer_entry authentication_start_pointer;
    /*---------------- DWORD[10] (Offset 0x28) ----------------*/
    /* Description -  */
    /* 0x28.0 - 0x2c.31 */
    struct connectx4_hw_pointer_entry authentication_end_pointer;
    /*---------------- DWORD[12] (Offset 0x30) ----------------*/
    /* Description -  */
    /* 0x30.0 - 0x34.31 */
    struct connectx4_hw_pointer_entry digest_pointer;
    /*---------------- DWORD[14] (Offset 0x38) ----------------*/
    /* Description -  */
    /* 0x38.0 - 0x3c.31 */
    struct connectx4_hw_pointer_entry digest_recovery_key_pointer;
    /*---------------- DWORD[16] (Offset 0x40) ----------------*/
    /* Description -  */
    /* 0x40.0 - 0x44.31 */
    struct connectx4_hw_pointer_entry fw_window_start_pointer;
    /*---------------- DWORD[18] (Offset 0x48) ----------------*/
    /* Description -  */
    /* 0x48.0 - 0x4c.31 */
    struct connectx4_hw_pointer_entry fw_window_end_pointer;
    /*---------------- DWORD[20] (Offset 0x50) ----------------*/
    /* Description -  */
    /* 0x50.0 - 0x54.31 */
    struct connectx4_hw_pointer_entry hmac_start_pointer;
    /*---------------- DWORD[22] (Offset 0x58) ----------------*/
    /* Description -  */
    /* 0x58.0 - 0x5c.31 */
    struct connectx4_hw_pointer_entry hmac_end_pointer;
    /*---------------- DWORD[24] (Offset 0x60) ----------------*/
    /* Description -  */
    /* 0x60.0 - 0x64.31 */
    struct connectx4_hw_pointer_entry public_key_pointer;
    /*---------------- DWORD[26] (Offset 0x68) ----------------*/
    /* Description -  */
    /* 0x68.0 - 0x6c.31 */
    struct connectx4_hw_pointer_entry reserved_ptr13_pointer;
    /*---------------- DWORD[28] (Offset 0x70) ----------------*/
    /* Description -  */
    /* 0x70.0 - 0x74.31 */
    struct connectx4_hw_pointer_entry reserved_ptr14_pointer;
    /*---------------- DWORD[30] (Offset 0x78) ----------------*/
    /* Description -  */
    /* 0x78.0 - 0x7c.31 */
    struct connectx4_hw_pointer_entry reserved_ptr15_pointer;
};


/* FW_VERSION */
void connectib_FW_VERSION_pack(const struct connectib_FW_VERSION* ptr_struct, u_int8_t* ptr_buff);
void connectib_FW_VERSION_unpack(struct connectib_FW_VERSION* ptr_struct, const u_int8_t* ptr_buff);
void connectib_FW_VERSION_print(const struct connectib_FW_VERSION* ptr_struct, FILE* file, int indent_level);
int connectib_FW_VERSION_size(void);
#define CONNECTIB_FW_VERSION_SIZE (0x10)
void connectib_FW_VERSION_dump(const struct connectib_FW_VERSION* ptr_struct, FILE* file);
/* icmd_get_fw_info */
void connectib_icmd_get_fw_info_pack(const struct connectib_icmd_get_fw_info* ptr_struct, u_int8_t* ptr_buff);
void connectib_icmd_get_fw_info_unpack(struct connectib_icmd_get_fw_info* ptr_struct, const u_int8_t* ptr_buff);
void connectib_icmd_get_fw_info_print(const struct connectib_icmd_get_fw_info* ptr_struct, FILE* file,
                                      int indent_level);
int connectib_icmd_get_fw_info_size(void);
#define CONNECTIB_ICMD_GET_FW_INFO_SIZE (0x24)
void connectib_icmd_get_fw_info_dump(const struct connectib_icmd_get_fw_info* ptr_struct, FILE* file);
/* itrace */
void connectib_itrace_pack(const struct connectib_itrace* ptr_struct, u_int8_t* ptr_buff);
void connectib_itrace_unpack(struct connectib_itrace* ptr_struct, const u_int8_t* ptr_buff);
void connectib_itrace_print(const struct connectib_itrace* ptr_struct, FILE* file, int indent_level);
int connectib_itrace_size(void);
#define CONNECTIB_ITRACE_SIZE (0x10)
void connectib_itrace_dump(const struct connectib_itrace* ptr_struct, FILE* file);
/* itrace_ctrl */
void connectib_itrace_ctrl_pack(const struct connectib_itrace_ctrl* ptr_struct, u_int8_t* ptr_buff);
void connectib_itrace_ctrl_unpack(struct connectib_itrace_ctrl* ptr_struct, const u_int8_t* ptr_buff);
void connectib_itrace_ctrl_print(const struct connectib_itrace_ctrl* ptr_struct, FILE* file, int indent_level);
int connectib_itrace_ctrl_size(void);
#define CONNECTIB_ITRACE_CTRL_SIZE (0x4)
void connectib_itrace_ctrl_dump(const struct connectib_itrace_ctrl* ptr_struct, FILE* file);
int connectib_icmd_set_port_sniffer_size(void);
void connectib_icmd_set_port_sniffer_unpack(struct connectib_icmd_set_port_sniffer* ptr_struct,
                                            const u_int8_t                        * ptr_buff);
void connectib_icmd_set_port_sniffer_pack(const struct connectib_icmd_set_port_sniffer* ptr_struct,
                                          u_int8_t                                    * ptr_buff);

void connectx4_public_keys_3_pack(const struct connectx4_public_keys_3* ptr_struct, u_int8_t* ptr_buff);
void connectx4_public_keys_3_unpack(struct connectx4_public_keys_3* ptr_struct, const u_int8_t* ptr_buff);
void connectx4_public_keys_3_print(const struct connectx4_public_keys_3* ptr_struct, FILE* fd, int indent_level);
unsigned int connectx4_public_keys_3_size(void);
#define CONNECTX4_PUBLIC_KEYS_3_SIZE (0x1100)
void connectx4_public_keys_3_dump(const struct connectx4_public_keys_3* ptr_struct, FILE* fd);
/* secure_boot_signatures */
void connectx4_secure_boot_signatures_pack(const struct connectx4_secure_boot_signatures* ptr_struct,
                                           u_int8_t                                     * ptr_buff);
void connectx4_secure_boot_signatures_unpack(struct connectx4_secure_boot_signatures* ptr_struct,
                                             const u_int8_t                         * ptr_buff);
void connectx4_secure_boot_signatures_print(const struct connectx4_secure_boot_signatures* ptr_struct,
                                            FILE                                         * fd,
                                            int                                            indent_level);
unsigned int connectx4_secure_boot_signatures_size(void);
#define CONNECTX4_SECURE_BOOT_SIGNATURES_SIZE (0x600)
void connectx4_secure_boot_signatures_dump(const struct connectx4_secure_boot_signatures* ptr_struct, FILE* fd);
/* file_public_keys_3 */
void connectx4_file_public_keys_3_pack(const struct connectx4_file_public_keys_3* ptr_struct, u_int8_t* ptr_buff);
void connectx4_file_public_keys_3_unpack(struct connectx4_file_public_keys_3* ptr_struct, const u_int8_t* ptr_buff);
void connectx4_file_public_keys_3_print(const struct connectx4_file_public_keys_3* ptr_struct,
                                        FILE                                     * fd,
                                        int                                        indent_level);
unsigned int connectx4_file_public_keys_3_size(void);
#define CONNECTX4_FILE_PUBLIC_KEYS_3_SIZE (0x220)
void connectx4_file_public_keys_3_dump(const struct connectx4_file_public_keys_3* ptr_struct, FILE* fd);
void connectx4_hw_pointers_arava_pack(const struct connectx4_hw_pointers_arava* ptr_struct, u_int8_t* ptr_buff);
void connectx4_hw_pointers_arava_unpack(struct connectx4_hw_pointers_arava* ptr_struct, const u_int8_t* ptr_buff);
void connectx4_hw_pointers_arava_print(const struct connectx4_hw_pointers_arava* ptr_struct, FILE* fd,
                                       int indent_level);
unsigned int connectx4_hw_pointers_arava_size(void);
#define CONNECTX4_HW_POINTERS_ARAVA_SIZE (0x80)
void connectx4_hw_pointers_arava_dump(const struct connectx4_hw_pointers_arava* ptr_struct, FILE* fd);


#define CONNECTX5_NV_DATA_SIZE (0x10000)

#ifdef __cplusplus
}
#endif
#endif /* ifndef ICMD_LAYOUTS_H */