Switchtec Userspace
PROJECT_NUMBER = 4.4
Toggle main menu visibility
Loading...
Searching...
No Matches
inc
switchtec
diag.h
Go to the documentation of this file.
1
/*
2
* Microsemi Switchtec(tm) PCIe Management Library
3
* Copyright (c) 2021, Microsemi Corporation
4
*
5
* Permission is hereby granted, free of charge, to any person obtaining a
6
* copy of this software and associated documentation files (the "Software"),
7
* to deal in the Software without restriction, including without limitation
8
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
9
* and/or sell copies of the Software, and to permit persons to whom the
10
* Software is furnished to do so, subject to the following conditions:
11
*
12
* The above copyright notice and this permission notice shall be included
13
* in all copies or substantial portions of the Software.
14
*
15
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21
* OTHER DEALINGS IN THE SOFTWARE.
22
*
23
*/
24
25
#ifndef LIBSWITCHTEC_DIAG_H
26
#define LIBSWITCHTEC_DIAG_H
27
28
#include "
switchtec.h
"
29
30
#include <stdint.h>
31
36
37
struct
switchtec_diag_rcvr_obj_dump_in
{
38
uint8_t port_id;
39
uint8_t lane_id;
40
uint16_t resvd;
41
};
42
43
struct
switchtec_diag_rcvr_obj_dump_out
{
44
uint8_t port_id;
45
uint8_t lane_id;
46
uint8_t ctle;
47
uint8_t target_amplitude;
48
uint8_t speculative_dfe;
49
int8_t dynamic_dfe[7];
50
};
51
52
enum
{
53
DIAG_PORT_EQ_STATUS_OP_PER_PORT = 0,
54
DIAG_PORT_EQ_STATUS_OP_PER_LANE = 1,
55
};
56
57
struct
switchtec_diag_port_eq_status_in
{
58
uint8_t sub_cmd;
59
uint8_t op_type;
60
uint8_t port_id;
61
uint8_t lane_id;
62
};
63
64
struct
switchtec_diag_port_eq_status_in2
{
65
uint8_t sub_cmd;
66
uint8_t port_id;
67
uint8_t lane_id;
68
uint8_t resvd;
69
};
70
71
struct
switchtec_diag_port_eq_status_out
{
72
uint8_t sub_cmd;
73
uint8_t op_type;
74
uint8_t port_id;
75
uint8_t lane_id;
76
77
struct
{
78
uint8_t pre;
79
uint8_t post;
80
} cursors[16];
81
};
82
83
struct
switchtec_diag_port_eq_table_out
{
84
uint8_t sub_cmd;
85
uint8_t port_id;
86
uint8_t lane_id;
87
uint8_t step_cnt;
88
struct
{
89
uint8_t pre_cursor;
90
uint8_t post_cursor;
91
uint8_t fom;
92
uint8_t pre_cursor_up;
93
uint8_t post_cursor_up;
94
uint8_t error_status;
95
uint8_t active_status;
96
uint8_t speed;
97
} steps[126];
98
};
99
100
struct
switchtec_diag_port_eq_tx_fslf_out
{
101
uint8_t sub_cmd;
102
uint8_t port_id;
103
uint8_t lane_id;
104
uint8_t fs;
105
uint8_t lf;
106
uint8_t resvd[3];
107
};
108
109
struct
switchtec_diag_ext_recv_obj_dump_in
{
110
uint8_t sub_cmd;
111
uint8_t port_id;
112
uint8_t lane_id;
113
uint8_t resvd;
114
};
115
116
struct
switchtec_diag_ext_dump_coeff_prev_in
{
117
uint8_t sub_cmd;
118
uint8_t op_type;
119
uint8_t port_id;
120
uint8_t lane_id;
121
};
122
123
struct
switchtec_diag_rcvr_ext_out
{
124
uint8_t port_id;
125
uint8_t lane_id;
126
uint16_t ctle2_rx_mode;
127
uint8_t dtclk_9;
128
uint8_t dtclk_8_6;
129
uint8_t dtclk_5;
130
};
131
132
struct
switchtec_diag_refclk_ctl_in
{
133
uint8_t sub_cmd;
134
uint8_t stack_id;
135
};
136
137
struct
switchtec_diag_refclk_ctl_in_gen6
{
138
uint8_t sub_cmd;
139
uint8_t csu_id;
140
uint8_t reserved[2];
141
};
142
143
enum
switchtec_diag_loopback_type {
144
DIAG_LOOPBACK_RX_TO_TX = 0,
145
DIAG_LOOPBACK_TX_TO_RX = 1,
146
};
147
148
enum
switchtec_diag_loopback_type_gen5 {
149
DIAG_LOOPBACK_PARALEL_DATAPATH = 5,
150
DIAG_LOOPBACK_EXTERNAL_DATAPATH = 6,
151
DIAG_LOOPBACK_PIPE_DATAPATH = 8,
152
};
153
154
struct
switchtec_diag_loopback_in
{
155
uint8_t sub_cmd;
156
uint8_t port_id;
157
uint8_t enable;
158
uint8_t type;
159
};
160
161
struct
switchtec_diag_loopback_out
{
162
uint8_t port_id;
163
uint8_t enabled;
164
uint8_t type;
165
uint8_t resvdd;
166
};
167
168
struct
switchtec_diag_loopback_ltssm_in
{
169
uint8_t sub_cmd;
170
uint8_t port_id;
171
uint8_t enable;
172
uint8_t speed;
173
};
174
175
struct
switchtec_diag_loopback_ltssm_out
{
176
uint8_t port_id;
177
uint8_t enabled;
178
uint8_t speed;
179
uint8_t resvd;
180
};
181
182
struct
switchtec_diag_pat_gen_in
{
183
uint8_t sub_cmd;
184
uint8_t port_id;
185
uint8_t pattern_type;
186
uint8_t lane_id;
187
};
188
189
struct
switchtec_diag_pat_gen_inject
{
190
uint8_t sub_cmd;
191
uint8_t port_id;
192
uint16_t resvd;
193
uint32_t err_cnt;
194
};
195
196
struct
switchtec_diag_pat_gen_out
{
197
uint8_t port_id;
198
uint8_t pattern_type;
199
uint16_t resvd;
200
uint32_t err_cnt_lo;
201
uint32_t err_cnt_hi;
202
};
203
204
struct
switchtec_diag_port_eye_start
{
205
uint8_t sub_cmd;
206
uint8_t resvd1[3];
207
uint32_t resvd2;
208
uint32_t lane_mask[4];
209
int16_t x_start;
210
int16_t y_start;
211
int16_t x_end;
212
int16_t y_end;
213
uint16_t x_step;
214
uint16_t y_step;
215
uint32_t step_interval;
216
};
217
218
struct
switchtec_diag_port_eye_cmd
{
219
uint8_t sub_cmd;
220
uint8_t data_mode;
221
uint8_t resvd;
222
uint8_t status;
223
};
224
225
struct
switchtec_diag_port_eye_fetch
{
226
uint8_t sub_cmd;
227
uint8_t data_mode;
228
uint8_t resvd1;
229
uint8_t status;
230
uint32_t time_remaining;
231
uint32_t lane_mask[4];
232
uint8_t x_start;
233
uint8_t resvd2;
234
int16_t y_start;
235
uint8_t data_count_lo;
236
uint8_t frame_status;
237
uint8_t resvd3;
238
uint8_t data_count_hi;
239
union
{
240
struct
{
241
uint32_t error_cnt_lo;
242
uint32_t error_cnt_hi;
243
uint32_t sample_cnt_lo;
244
uint32_t sample_cnt_hi;
245
} raw[62];
246
struct
{
247
uint16_t ratio;
248
} ratio[496];
249
};
250
};
251
252
253
struct
switchtec_gen5_diag_eye_run_in
{
254
uint8_t sub_cmd;
255
uint8_t capture_depth;
256
uint8_t timeout_disable;
257
uint8_t resvd1;
258
uint32_t lane_mask[4];
259
};
260
261
struct
switchtec_gen6_diag_eye_run_in
{
262
uint8_t sub_cmd;
263
uint8_t resvd1;
264
uint8_t timeout_disable;
265
uint8_t resvd2;
266
uint32_t lane_mask[4];
267
uint8_t sar_sel;
268
uint8_t intleav_sel;
269
uint8_t vstep;
270
int8_t hstep;
271
uint8_t data_mode;
272
uint8_t eye_mode;
273
uint16_t resvd3;
274
uint32_t ref_timer_lwr;
275
uint32_t ref_timer_upp;
276
};
277
278
struct
switchtec_diag_cross_hair_in
{
279
uint8_t sub_cmd;
280
uint8_t lane_id;
281
uint8_t all_lanes;
282
uint8_t num_lanes;
283
};
284
285
struct
switchtec_diag_cross_hair_get
{
286
uint8_t lane_id;
287
uint8_t state;
288
289
union
{
290
struct
{
291
int8_t byte0;
292
int8_t byte1;
293
int16_t word0;
294
int16_t word1;
295
int16_t word2;
296
int16_t word3;
297
};
298
struct
{
299
uint8_t prev_state;
300
uint8_t _byte1;
301
int16_t x_pos;
302
int16_t y_pos;
303
};
304
struct
{
305
int8_t eye_left_lim;
306
int8_t eye_right_lim;
307
int16_t eye_bot_left_lim;
308
int16_t eye_bot_right_lim;
309
int16_t eye_top_left_lim;
310
int16_t eye_top_right_lim;
311
};
312
};
313
};
314
315
struct
switchtec_diag_ltssm_log_dmp_out
{
316
uint32_t dw0;
317
uint32_t ram_timestamp;
318
uint32_t unused;
319
uint32_t arc;
320
};
321
322
struct
switchtec_tlp_inject_in
{
323
uint32_t dest_port;
324
uint32_t tlp_type;
325
uint32_t tlp_length;
326
uint32_t ecrc;
327
uint32_t raw_tlp_data[SWITCHTEC_DIAG_MAX_TLP_DWORDS];
328
};
329
330
enum
switchtec_aer_event_gen_result {
331
AER_EVENT_GEN_SUCCESS = 0,
332
AER_EVENT_GEN_FAIL = 1,
333
};
334
335
struct
switchtec_aer_event_gen_in
{
336
uint8_t sub_cmd;
337
uint8_t phys_port_id;
338
uint8_t reserved[2];
339
uint32_t err_mask;
340
uint32_t hdr_log[4];
341
};
342
343
struct
osa_type_config_in
{
344
uint8_t sub_cmd;
345
uint8_t stack_id;
346
uint16_t reserved;
347
uint16_t lane_mask;
348
uint8_t direction;
349
uint8_t link_rate;
350
uint16_t os_types;
351
uint16_t reserved2;
352
};
353
354
struct
osa_pattern_config_in
{
355
uint8_t sub_cmd;
356
uint8_t stack_id;
357
uint16_t reserved;
358
uint16_t lane_mask;
359
uint8_t direction;
360
uint8_t link_rate;
361
uint32_t pat_val_dword0;
362
uint32_t pat_val_dword1;
363
uint32_t pat_val_dword2;
364
uint32_t pat_val_dword3;
365
uint32_t pat_mask_dword0;
366
uint32_t pat_mask_dword1;
367
uint32_t pat_mask_dword2;
368
uint32_t pat_mask_dword3;
369
};
370
371
struct
osa_capture_ctrl_in
{
372
uint8_t sub_cmd;
373
uint8_t stack_id;
374
uint16_t reserved;
375
uint16_t lane_mask;
376
uint8_t direction;
377
uint8_t drop_single_os;
378
uint8_t stop_mode;
379
uint8_t snapshot_mode;
380
uint16_t post_trig_entries;
381
uint16_t os_types;
382
uint16_t reserved2;
383
};
384
385
#endif
osa_capture_ctrl_in
Definition
diag.h:371
osa_pattern_config_in
Definition
diag.h:354
osa_type_config_in
Definition
diag.h:343
switchtec_aer_event_gen_in
Definition
diag.h:335
switchtec_diag_cross_hair_get
Definition
diag.h:285
switchtec_diag_cross_hair_in
Definition
diag.h:278
switchtec_diag_ext_dump_coeff_prev_in
Definition
diag.h:116
switchtec_diag_ext_recv_obj_dump_in
Definition
diag.h:109
switchtec_diag_loopback_in
Definition
diag.h:154
switchtec_diag_loopback_ltssm_in
Definition
diag.h:168
switchtec_diag_loopback_ltssm_out
Definition
diag.h:175
switchtec_diag_loopback_out
Definition
diag.h:161
switchtec_diag_ltssm_log_dmp_out
Definition
diag.h:315
switchtec_diag_pat_gen_in
Definition
diag.h:182
switchtec_diag_pat_gen_inject
Definition
diag.h:189
switchtec_diag_pat_gen_out
Definition
diag.h:196
switchtec_diag_port_eq_status_in2
Definition
diag.h:64
switchtec_diag_port_eq_status_in
Definition
diag.h:57
switchtec_diag_port_eq_status_out
Definition
diag.h:71
switchtec_diag_port_eq_table_out
Definition
diag.h:83
switchtec_diag_port_eq_tx_fslf_out
Definition
diag.h:100
switchtec_diag_port_eye_cmd
Definition
diag.h:218
switchtec_diag_port_eye_fetch
Definition
diag.h:225
switchtec_diag_port_eye_start
Definition
diag.h:204
switchtec_diag_rcvr_ext_out
Definition
diag.h:123
switchtec_diag_rcvr_obj_dump_in
Definition
diag.h:37
switchtec_diag_rcvr_obj_dump_out
Definition
diag.h:43
switchtec_diag_refclk_ctl_in_gen6
Definition
diag.h:137
switchtec_diag_refclk_ctl_in
Definition
diag.h:132
switchtec_gen5_diag_eye_run_in
Definition
diag.h:253
switchtec_gen6_diag_eye_run_in
Definition
diag.h:261
switchtec_tlp_inject_in
Definition
diag.h:322
switchtec.h
Main Switchtec header.
Generated by
1.17.0