Files @ bd21c8aa7237
Branch filter:

Location: vmkdrivers/vmkdrivers/src_9/drivers/net/nx_nic/nx_nic_minidump.h

unknown
ESXi-6.0.0b
  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
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
/*
 * Copyright (C) 2003 - 2009 NetXen, Inc.
 * Copyright (C) 2009 - QLogic Corporation.
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 * MA  02111-1307, USA.
 *
 * The full GNU General Public License is included in this distribution
 * in the file called LICENSE.
 *
 */
#ifndef __QL_MINIDUMP_H__
#define __QL_MINIDUMP_H__
int nx_nic_collect_minidump(struct unm_adapter_s *adapter);
u32 nx_nic_get_capture_size(struct unm_adapter_s *adapter);
u32 nx_nic_check_template_checksum(struct unm_adapter_s *adapter);

#define NX_NIC_MD_MIN_CAPTURE_MASK    		0x03
#define NX_NIC_MD_MAX_CAPTURE_MASK    		0xFF

#define NX_NIC_MD_DEFAULT_CAPTURE_MASK    	0x7F
#define NX_NIC_MINIDUMP_IOCTL_COPY_SIZE     4096

/*
 * Entry Type Defines
 */
#define RDNOP                   0
#define RDCRB                   1
#define RDMUX                   2
#define QUEUE                   3
#define BOARD                   4
#define RDSRE                   5
#define RDOCM                   6
#define PREGS                   7
#define L1DTG                   8
#define L1ITG                   9
#define CACHE                  10

#define L1DAT                  11
#define L1INS                  12
#define RDSTK                  13
#define RDCON                  14

#define L2DTG                  21
#define L2ITG                  22
#define L2DAT                  23
#define L2INS                  24
#define RDOC3                  25

#define MEMBK                  32

#define RDROM                  71
#define RDMEM                  72
#define RDMN                   73

#define INFOR                  81
#define CNTRL                  98

#define TLHDR                  99
#define RDEND                  255

#define PRIMQ                  103
#define SQG2Q                  104
#define SQG3Q                  105

/*
 * Opcodes for Control Entries.
 * These Flags are bit fields.
 */
#define QL_DBG_OPCODE_WR        0x01
#define QL_DBG_OPCODE_RW        0x02
#define QL_DBG_OPCODE_AND       0x04
#define QL_DBG_OPCODE_OR       	0x08
#define QL_DBG_OPCODE_POLL      0x10
#define QL_DBG_OPCODE_RDSTATE   0x20
#define QL_DBG_OPCODE_WRSTATE   0x40
#define QL_DBG_OPCODE_MDSTATE   0x80

/*
 * Template Header
 * Parts of the template header can be modified by the driver.
 * These include the saved_state_array, capture_debug_level, driver_timestamp
 * The driver_info_wordX is used to add info about the drivers environment.
 * It is important that drivers add identication and system info in these fields.
 */

#define QL_DBG_STATE_ARRAY_LEN        16
#define QL_DBG_CAP_SIZE_ARRAY_LEN     8
#define QL_DBG_RSVD_ARRAY_LEN         8


typedef struct ql_minidump_template_hdr_s {
	u32 entry_type;
	u32 first_entry_offset;
	u32 size_of_template;
	u32 capture_debug_level;

	u32 num_of_entries;
	u32 version;
	u32 driver_timestamp;
	u32 checksum;

	u32 driver_capture_mask;
	u32 driver_info_word2;
	u32 driver_info_word3;
	u32 driver_info_word4;

	u32 saved_state_array[QL_DBG_STATE_ARRAY_LEN];
	u32 capture_size_array[QL_DBG_CAP_SIZE_ARRAY_LEN];

	/*  markers_array used to capture some special locations on board */
	u32 markers_array[QL_DBG_RSVD_ARRAY_LEN];
	u32 num_of_free_entries;	/* For internal use */
	u32 free_entry_offset;	/* For internal use */
	u32 total_table_size;	/*  For internal use */
	u32 bkup_table_offset;	/*  For internal use */
} ql_minidump_template_hdr_t;

/*
 * Common Entry Header:  Common to All Entry Types
 */
/*
 * Driver Flags
 */
#define QL_DBG_SKIPPED_FLAG     0x80	/*  driver skipped this entry  */
#define QL_DBG_SIZE_ERR_FLAG    0x40	/*  entry size vs capture size mismatch */

/*
 * Driver Code is for driver to write some info about the entry.
 * Currently not used.
 */

typedef struct ql_minidump_entry_hdr_s {
	u32 entry_type;
	u32 entry_size;
	u32 entry_capture_size;
	union {
		struct {
			u8 entry_capture_mask;
			u8 entry_code;
			u8 driver_code;
			u8 driver_flags;
		};
		u32 entry_ctrl_word;
	};
} ql_minidump_entry_hdr_t;

/*
 * Generic Entry Including Header
 */
typedef struct ql_minidump_entry_s {
	ql_minidump_entry_hdr_t hdr;

	u32 entry_data00;
	u32 entry_data01;
	u32 entry_data02;
	u32 entry_data03;

	u32 entry_data04;
	u32 entry_data05;
	u32 entry_data06;
	u32 entry_data07;
} ql_minidump_entry_t;

/*
 *  Read CRB entry header
 */
typedef struct ql_minidump_entry_crb_s {
	ql_minidump_entry_hdr_t h;

	u32 addr;
	union {
		struct {
			u8 addr_stride;
			u8 state_index_a;
			u16 poll_timeout;
		};
		u32 addr_cntrl;
	};

	u32 data_size;
	u32 op_count;

	union {
		struct {
			u8 opcode;
			u8 state_index_v;
			u8 shl;
			u8 shr;
		};
		u32 control_value;
	};

	u32 value_1;
	u32 value_2;
	u32 value_3;
} ql_minidump_entry_crb_t;

/*
 *
 */
typedef struct ql_minidump_entry_cache_s {
	ql_minidump_entry_hdr_t h;

	u32 tag_reg_addr;
	union {
		struct {
			u16 tag_value_stride;
			u16 init_tag_value;
		};
		u32 select_addr_cntrl;
	};

	u32 data_size;
	u32 op_count;

	u32 control_addr;
	union {
		struct {
			u16 write_value;
			u8 poll_mask;
			u8 poll_wait;
		};
		u32 control_value;
	};

	u32 read_addr;
	union {
		struct {
			u8 read_addr_stride;
			u8 read_addr_cnt;
			u16 rsvd_1;
		};
		u32 read_addr_cntrl;
	};
} ql_minidump_entry_cache_t;

typedef struct ql_minidump_entry_rdocm_s {
	ql_minidump_entry_hdr_t h;

	u32 rsvd_0;
	union {
		struct {
			u32 rsvd_1;
		};
		u32 select_addr_cntrl;
	};

	u32 data_size;
	u32 op_count;

	u32 rsvd_2;
	u32 rsvd_3;

	u32 read_addr;
	union {
		struct {
			u32 read_addr_stride;
		};
		u32 read_addr_cntrl;
	};
} ql_minidump_entry_rdocm_t;

typedef struct ql_minidump_entry_rdmem_s {
	ql_minidump_entry_hdr_t h;

	union {
		struct {
			u32 select_addr_reg;
		};
		u32 rsvd_0;
	};

	union {
		struct {
			u8 addr_stride;
			u8 addr_cnt;
			u16 data_size;
		};
		u32 rsvd_1;
	};

	union {
		struct {
			u32 op_count;
		};
		u32 rsvd_2;
	};

	union {
		struct {
			u32 read_addr_reg;
		};
		u32 rsvd_3;
	};

	union {
		struct {
			u32 cntrl_addr_reg;
		};
		u32 rsvd_4;
	};

	union {
		struct {
			u8 wr_byte0;
			u8 wr_byte1;
			u8 poll_mask;
			u8 poll_cnt;
		};
		u32 rsvd_5;
	};

	u32 read_addr;
	u32 read_data_size;
} ql_minidump_entry_rdmem_t;

typedef struct ql_minidump_entry_rdrom_s {
	ql_minidump_entry_hdr_t h;

	union {
		struct {
			u32 select_addr_reg;
		};
		u32 rsvd_0;
	};

	union {
		struct {
			u8 addr_stride;
			u8 addr_cnt;
			u16 data_size;
		};
		u32 rsvd_1;
	};

	union {
		struct {
			u32 op_count;
		};
		u32 rsvd_2;
	};

	union {
		struct {
			u32 read_addr_reg;
		};
		u32 rsvd_3;
	};

	union {
		struct {
			u32 write_mask;
		};
		u32 rsvd_4;
	};

	union {
		struct {
			u32 read_mask;
		};
		u32 rsvd_5;
	};

	u32 read_addr;
	u32 read_data_size;
} ql_minidump_entry_rdrom_t;

typedef struct ql_minidump_entry_mux_s {
	ql_minidump_entry_hdr_t h;

	u32 select_addr;
	union {
		struct {
			u32 rsvd_0;
		};
		u32 select_addr_cntrl;
	};

	u32 data_size;
	u32 op_count;

	u32 select_value;
	u32 select_value_stride;

	u32 read_addr;
	u32 rsvd_1;

} ql_minidump_entry_mux_t;

/*
 *
 */
typedef struct ql_minidump_entry_queue_s {
	ql_minidump_entry_hdr_t h;

	u32 select_addr;
	union {
		struct {
			u16 queue_id_stride;
			u16 rsvd_0;
		};
		u32 select_addr_cntrl;
	};

	u32 data_size;
	u32 op_count;

	u32 rsvd_1;
	u32 rsvd_2;

	u32 read_addr;
	union {
		struct {
			u8 read_addr_stride;
			u8 read_addr_cnt;
			u16 rsvd_3;
		};
		u32 read_addr_cntrl;
	};

} ql_minidump_entry_queue_t;

#endif