Velocity Userspace
|
Switchtec diagnostic functions. More...
#include "switchtec_priv.h"
#include "switchtec/diag.h"
#include "switchtec/endian.h"
#include "switchtec/switchtec.h"
#include "switchtec/utils.h"
#include <errno.h>
#include <math.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
Go to the source code of this file.
Functions | |
int | switchtec_diag_cross_hair_enable (struct switchtec_dev *dev, int lane_id) |
Enable cross hair on specified lane. More... | |
int | switchtec_diag_cross_hair_disable (struct switchtec_dev *dev) |
Disable active cross hair. More... | |
int | switchtec_diag_cross_hair_get (struct switchtec_dev *dev, int start_lane_id, int num_lanes, struct switchtec_diag_cross_hair *res) |
Disable active cross hair. More... | |
int | switchtec_diag_eye_set_mode (struct switchtec_dev *dev, enum switchtec_diag_eye_data_mode mode) |
Set the data mode for the next Eye Capture. More... | |
int | switchtec_diag_eye_start (struct switchtec_dev *dev, int lane_mask[4], struct range *x_range, struct range *y_range, int step_interval) |
Start a PCIe Eye Capture. More... | |
int | switchtec_diag_eye_fetch (struct switchtec_dev *dev, double *pixels, size_t pixel_cnt, int *lane_id) |
Start a PCIe Eye Capture. More... | |
int | switchtec_diag_eye_cancel (struct switchtec_dev *dev) |
Cancel in-progress eye capture. More... | |
int | switchtec_diag_loopback_set (struct switchtec_dev *dev, int port_id, int enable, enum switchtec_diag_ltssm_speed ltssm_speed) |
Setup Loopback Mode. More... | |
int | switchtec_diag_loopback_get (struct switchtec_dev *dev, int port_id, int *enabled, enum switchtec_diag_ltssm_speed *ltssm_speed) |
Setup Loopback Mode. More... | |
int | switchtec_diag_pattern_gen_set (struct switchtec_dev *dev, int port_id, enum switchtec_diag_pattern type) |
Setup Pattern Generator. More... | |
int | switchtec_diag_pattern_gen_get (struct switchtec_dev *dev, int port_id, enum switchtec_diag_pattern *type) |
Get Pattern Generator set on port. More... | |
int | switchtec_diag_pattern_mon_set (struct switchtec_dev *dev, int port_id, enum switchtec_diag_pattern type) |
Setup Pattern Monitor. More... | |
int | switchtec_diag_pattern_mon_get (struct switchtec_dev *dev, int port_id, int lane_id, enum switchtec_diag_pattern *type, unsigned long long *err_cnt) |
Get Pattern Monitor. More... | |
int | switchtec_diag_pattern_inject (struct switchtec_dev *dev, int port_id, unsigned int err_cnt) |
Inject error into pattern generator. More... | |
int | switchtec_diag_rcvr_obj (struct switchtec_dev *dev, int port_id, int lane_id, enum switchtec_diag_link link, struct switchtec_rcvr_obj *res) |
Get the receiver object. More... | |
int | switchtec_diag_port_eq_tx_coeff (struct switchtec_dev *dev, int port_id, enum switchtec_diag_end end, enum switchtec_diag_link link, struct switchtec_port_eq_coeff *res) |
Get the port equalization TX coefficients. More... | |
int | switchtec_diag_port_eq_tx_table (struct switchtec_dev *dev, int port_id, enum switchtec_diag_link link, struct switchtec_port_eq_table *res) |
Get the far end TX equalization table. More... | |
int | switchtec_diag_port_eq_tx_fslf (struct switchtec_dev *dev, int port_id, int lane_id, enum switchtec_diag_end end, enum switchtec_diag_link link, struct switchtec_port_eq_tx_fslf *res) |
Get the equalization FS/LF. More... | |
int | switchtec_diag_rcvr_ext (struct switchtec_dev *dev, int port_id, int lane_id, enum switchtec_diag_link link, struct switchtec_rcvr_ext *res) |
Get the Extended Receiver Object. More... | |
int | switchtec_diag_perm_table (struct switchtec_dev *dev, struct switchtec_mrpc table[MRPC_MAX_ID]) |
Get the permission table. More... | |
int | switchtec_diag_refclk_ctl (struct switchtec_dev *dev, int stack_id, bool en) |
Control the refclk output for a stack. More... | |
int | switchtec_diag_ltssm_log (struct switchtec_dev *dev, int port, int *log_count, struct switchtec_diag_ltssm_log *log_data) |
Get the LTSSM log of a port on a switchtec device. More... | |
Switchtec diagnostic functions.
Definition in file diag.c.
int switchtec_diag_cross_hair_disable | ( | struct switchtec_dev * | dev | ) |
int switchtec_diag_cross_hair_enable | ( | struct switchtec_dev * | dev, |
int | lane_id | ||
) |
int switchtec_diag_cross_hair_get | ( | struct switchtec_dev * | dev, |
int | start_lane_id, | ||
int | num_lanes, | ||
struct switchtec_diag_cross_hair * | res | ||
) |
int switchtec_diag_eye_cancel | ( | struct switchtec_dev * | dev | ) |
int switchtec_diag_eye_fetch | ( | struct switchtec_dev * | dev, |
double * | pixels, | ||
size_t | pixel_cnt, | ||
int * | lane_id | ||
) |
Start a PCIe Eye Capture.
[in] | dev | Switchtec device handle |
[out] | pixels | Resulting pixel data |
[in] | pixel_cnt | Space in pixel array |
[out] | lane_id | The lane for the resulting pixels |
pixel_cnt needs to be greater than 62 in raw mode or 496 in ratio mode, otherwise data will be lost and the number of pixels fetched will be greater than the space in the pixel buffer.
int switchtec_diag_eye_set_mode | ( | struct switchtec_dev * | dev, |
enum switchtec_diag_eye_data_mode | mode | ||
) |
int switchtec_diag_eye_start | ( | struct switchtec_dev * | dev, |
int | lane_mask[4], | ||
struct range * | x_range, | ||
struct range * | y_range, | ||
int | step_interval | ||
) |
Start a PCIe Eye Capture.
[in] | dev | Switchtec device handle |
[in] | lane_mask | Bitmap of the lanes to capture |
[in] | x_range | Time range: start should be between 0 and 63, end between start and 63. |
[in] | y_range | Voltage range: start should be between -255 and 255, end between start and 255. |
[in] | step_interval | Sampling time in milliseconds for each step |
int switchtec_diag_loopback_get | ( | struct switchtec_dev * | dev, |
int | port_id, | ||
int * | enabled, | ||
enum switchtec_diag_ltssm_speed * | ltssm_speed | ||
) |
Setup Loopback Mode.
[in] | dev | Switchtec device handle |
[in] | port_id | Physical port ID |
[out] | enabled | Set of enum switchtec_diag_loopback_enable indicating which loopback modes are enabled |
[out] | ltssm_speed | LTSSM loopback max speed |
int switchtec_diag_loopback_set | ( | struct switchtec_dev * | dev, |
int | port_id, | ||
int | enable, | ||
enum switchtec_diag_ltssm_speed | ltssm_speed | ||
) |
Setup Loopback Mode.
[in] | dev | Switchtec device handle |
[in] | port_id | Physical port ID |
[in] | enable | Any enum switchtec_diag_loopback_enable flags or'd together to enable specific loopback modes |
[in] | ltssm_speed | LTSSM loopback max speed |
int switchtec_diag_ltssm_log | ( | struct switchtec_dev * | dev, |
int | port, | ||
int * | log_count, | ||
struct switchtec_diag_ltssm_log * | log_data | ||
) |
int switchtec_diag_pattern_gen_get | ( | struct switchtec_dev * | dev, |
int | port_id, | ||
enum switchtec_diag_pattern * | type | ||
) |
int switchtec_diag_pattern_gen_set | ( | struct switchtec_dev * | dev, |
int | port_id, | ||
enum switchtec_diag_pattern | type | ||
) |
int switchtec_diag_pattern_inject | ( | struct switchtec_dev * | dev, |
int | port_id, | ||
unsigned int | err_cnt | ||
) |
Inject error into pattern generator.
[in] | dev | Switchtec device handle |
[in] | port_id | Physical port ID |
[in] | err_cnt | Number of errors seen |
Injects up to err_cnt errors into each lane of the TX port. It's recommended that the err_cnt be less than 1000, otherwise the firmware runs the risk of consuming too many resources and crashing.
int switchtec_diag_pattern_mon_get | ( | struct switchtec_dev * | dev, |
int | port_id, | ||
int | lane_id, | ||
enum switchtec_diag_pattern * | type, | ||
unsigned long long * | err_cnt | ||
) |
int switchtec_diag_pattern_mon_set | ( | struct switchtec_dev * | dev, |
int | port_id, | ||
enum switchtec_diag_pattern | type | ||
) |
int switchtec_diag_perm_table | ( | struct switchtec_dev * | dev, |
struct switchtec_mrpc | table[MRPC_MAX_ID] | ||
) |
int switchtec_diag_port_eq_tx_coeff | ( | struct switchtec_dev * | dev, |
int | port_id, | ||
enum switchtec_diag_end | end, | ||
enum switchtec_diag_link | link, | ||
struct switchtec_port_eq_coeff * | res | ||
) |
int switchtec_diag_port_eq_tx_fslf | ( | struct switchtec_dev * | dev, |
int | port_id, | ||
int | lane_id, | ||
enum switchtec_diag_end | end, | ||
enum switchtec_diag_link | link, | ||
struct switchtec_port_eq_tx_fslf * | res | ||
) |
int switchtec_diag_port_eq_tx_table | ( | struct switchtec_dev * | dev, |
int | port_id, | ||
enum switchtec_diag_link | link, | ||
struct switchtec_port_eq_table * | res | ||
) |
int switchtec_diag_rcvr_ext | ( | struct switchtec_dev * | dev, |
int | port_id, | ||
int | lane_id, | ||
enum switchtec_diag_link | link, | ||
struct switchtec_rcvr_ext * | res | ||
) |
int switchtec_diag_rcvr_obj | ( | struct switchtec_dev * | dev, |
int | port_id, | ||
int | lane_id, | ||
enum switchtec_diag_link | link, | ||
struct switchtec_rcvr_obj * | res | ||
) |
int switchtec_diag_refclk_ctl | ( | struct switchtec_dev * | dev, |
int | stack_id, | ||
bool | en | ||
) |