Switchtec Userspace
PROJECT_NUMBER = 4.2
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
enum
switchtec_diag_loopback_type {
138
DIAG_LOOPBACK_RX_TO_TX = 0,
139
DIAG_LOOPBACK_TX_TO_RX = 1,
140
};
141
142
enum
switchtec_diag_loopback_type_gen5 {
143
DIAG_LOOPBACK_PARALEL_DATAPATH = 5,
144
DIAG_LOOPBACK_EXTERNAL_DATAPATH = 6,
145
};
146
147
struct
switchtec_diag_loopback_in
{
148
uint8_t sub_cmd;
149
uint8_t port_id;
150
uint8_t enable;
151
uint8_t type;
152
};
153
154
struct
switchtec_diag_loopback_out
{
155
uint8_t port_id;
156
uint8_t enabled;
157
uint8_t type;
158
uint8_t resvdd;
159
};
160
161
struct
switchtec_diag_loopback_ltssm_in
{
162
uint8_t sub_cmd;
163
uint8_t port_id;
164
uint8_t enable;
165
uint8_t speed;
166
};
167
168
struct
switchtec_diag_loopback_ltssm_out
{
169
uint8_t port_id;
170
uint8_t enabled;
171
uint8_t speed;
172
uint8_t resvd;
173
};
174
175
struct
switchtec_diag_pat_gen_in
{
176
uint8_t sub_cmd;
177
uint8_t port_id;
178
uint8_t pattern_type;
179
uint8_t lane_id;
180
};
181
182
struct
switchtec_diag_pat_gen_inject
{
183
uint8_t sub_cmd;
184
uint8_t port_id;
185
uint16_t resvd;
186
uint32_t err_cnt;
187
};
188
189
struct
switchtec_diag_pat_gen_out
{
190
uint8_t port_id;
191
uint8_t pattern_type;
192
uint16_t resvd;
193
uint32_t err_cnt_lo;
194
uint32_t err_cnt_hi;
195
};
196
197
struct
switchtec_diag_port_eye_start
{
198
uint8_t sub_cmd;
199
uint8_t resvd1[3];
200
uint32_t resvd2;
201
uint32_t lane_mask[4];
202
int16_t x_start;
203
int16_t y_start;
204
int16_t x_end;
205
int16_t y_end;
206
uint16_t x_step;
207
uint16_t y_step;
208
uint32_t step_interval;
209
};
210
211
struct
switchtec_diag_port_eye_cmd
{
212
uint8_t sub_cmd;
213
uint8_t data_mode;
214
uint8_t resvd;
215
uint8_t status;
216
};
217
218
struct
switchtec_diag_port_eye_fetch
{
219
uint8_t sub_cmd;
220
uint8_t data_mode;
221
uint8_t resvd1;
222
uint8_t status;
223
uint32_t time_remaining;
224
uint32_t lane_mask[4];
225
uint8_t x_start;
226
uint8_t resvd2;
227
int16_t y_start;
228
uint8_t data_count_lo;
229
uint8_t frame_status;
230
uint8_t resvd3;
231
uint8_t data_count_hi;
232
union
{
233
struct
{
234
uint32_t error_cnt_lo;
235
uint32_t error_cnt_hi;
236
uint32_t sample_cnt_lo;
237
uint32_t sample_cnt_hi;
238
} raw[62];
239
struct
{
240
uint16_t ratio;
241
} ratio[496];
242
};
243
};
244
245
246
struct
switchtec_gen5_diag_eye_run_in
{
247
uint8_t sub_cmd;
248
uint8_t capture_depth;
249
uint8_t timeout_disable;
250
uint8_t resvd1;
251
uint32_t lane_mask[4];
252
};
253
254
struct
switchtec_diag_cross_hair_in
{
255
uint8_t sub_cmd;
256
uint8_t lane_id;
257
uint8_t all_lanes;
258
uint8_t num_lanes;
259
};
260
261
struct
switchtec_diag_cross_hair_get
{
262
uint8_t lane_id;
263
uint8_t state;
264
265
union
{
266
struct
{
267
int8_t byte0;
268
int8_t byte1;
269
int16_t word0;
270
int16_t word1;
271
int16_t word2;
272
int16_t word3;
273
};
274
struct
{
275
uint8_t prev_state;
276
uint8_t _byte1;
277
int16_t x_pos;
278
int16_t y_pos;
279
};
280
struct
{
281
int8_t eye_left_lim;
282
int8_t eye_right_lim;
283
int16_t eye_bot_left_lim;
284
int16_t eye_bot_right_lim;
285
int16_t eye_top_left_lim;
286
int16_t eye_top_right_lim;
287
};
288
};
289
};
290
291
struct
switchtec_diag_ltssm_log_dmp_out
{
292
uint32_t dw0;
293
uint32_t ram_timestamp;
294
uint32_t unused;
295
uint32_t arc;
296
};
297
298
struct
switchtec_tlp_inject_in
{
299
uint32_t dest_port;
300
uint32_t tlp_type;
301
uint32_t tlp_length;
302
uint32_t ecrc;
303
uint32_t raw_tlp_data[SWITCHTEC_DIAG_MAX_TLP_DWORDS];
304
};
305
306
enum
switchtec_aer_event_gen_result {
307
AER_EVENT_GEN_SUCCESS = 0,
308
AER_EVENT_GEN_FAIL = 1,
309
};
310
311
struct
switchtec_aer_event_gen_in
{
312
uint8_t sub_cmd;
313
uint8_t phys_port_id;
314
uint8_t reserved[2];
315
uint32_t err_mask;
316
uint32_t hdr_log[4];
317
};
318
319
struct
osa_type_config_in
{
320
uint8_t sub_cmd;
321
uint8_t stack_id;
322
uint16_t reserved;
323
uint16_t lane_mask;
324
uint8_t direction;
325
uint8_t link_rate;
326
uint8_t os_types;
327
uint8_t reserved2;
328
uint16_t reserved3;
329
};
330
331
struct
osa_pattern_config_in
{
332
uint8_t sub_cmd;
333
uint8_t stack_id;
334
uint16_t reserved;
335
uint16_t lane_mask;
336
uint8_t direction;
337
uint8_t link_rate;
338
uint32_t pat_val_dword0;
339
uint32_t pat_val_dword1;
340
uint32_t pat_val_dword2;
341
uint32_t pat_val_dword3;
342
uint32_t pat_mask_dword0;
343
uint32_t pat_mask_dword1;
344
uint32_t pat_mask_dword2;
345
uint32_t pat_mask_dword3;
346
};
347
348
struct
osa_capture_ctrl_in
{
349
uint8_t sub_cmd;
350
uint8_t stack_id;
351
uint16_t reserved;
352
uint16_t lane_mask;
353
uint8_t direction;
354
uint8_t drop_single_os;
355
uint8_t stop_mode;
356
uint8_t snapshot_mode;
357
uint16_t post_trig_entries;
358
uint8_t os_types;
359
uint8_t reserved2;
360
uint16_t reserved3;
361
};
362
363
#endif
osa_capture_ctrl_in
Definition
diag.h:348
osa_pattern_config_in
Definition
diag.h:331
osa_type_config_in
Definition
diag.h:319
switchtec_aer_event_gen_in
Definition
diag.h:311
switchtec_diag_cross_hair_get
Definition
diag.h:261
switchtec_diag_cross_hair_in
Definition
diag.h:254
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:147
switchtec_diag_loopback_ltssm_in
Definition
diag.h:161
switchtec_diag_loopback_ltssm_out
Definition
diag.h:168
switchtec_diag_loopback_out
Definition
diag.h:154
switchtec_diag_ltssm_log_dmp_out
Definition
diag.h:291
switchtec_diag_pat_gen_in
Definition
diag.h:175
switchtec_diag_pat_gen_inject
Definition
diag.h:182
switchtec_diag_pat_gen_out
Definition
diag.h:189
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:211
switchtec_diag_port_eye_fetch
Definition
diag.h:218
switchtec_diag_port_eye_start
Definition
diag.h:197
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
Definition
diag.h:132
switchtec_gen5_diag_eye_run_in
Definition
diag.h:246
switchtec_tlp_inject_in
Definition
diag.h:298
switchtec.h
Main Switchtec header.
Generated by
1.17.0