|
struct switchtec_dev * | switchtec_open (const char *device) |
| Open a Switchtec device by string. More...
|
|
struct switchtec_dev * | switchtec_open_by_path (const char *path) |
| Open a switchtec device by path. More...
|
|
struct switchtec_dev * | switchtec_open_by_index (int index) |
| Open a switchtec device by index. More...
|
|
struct switchtec_dev * | switchtec_open_by_pci_addr (int domain, int bus, int device, int func) |
| Open a switchtec device by PCI address (BDF) More...
|
|
struct switchtec_dev * | switchtec_open_i2c (const char *path, int i2c_addr) |
| Open a switchtec device behind an I2C device. More...
|
|
struct switchtec_dev * | switchtec_open_uart (int fd) |
| Open a switchtec device behind a uart device. More...
|
|
struct switchtec_dev * | switchtec_open_eth (const char *ip, const int inst) |
| Open a switchtec device over ethernet. More...
|
|
void | switchtec_close (struct switchtec_dev *dev) |
| Close a Switchtec device handle. More...
|
|
int | switchtec_list (struct switchtec_device_info **devlist) |
| List all the switchtec devices in the system. More...
|
|
void | switchtec_list_free (struct switchtec_device_info *devlist) |
| Free a list of device info structures allocated by switchtec_list() More...
|
|
int | switchtec_get_fw_version (struct switchtec_dev *dev, char *buf, size_t buflen) |
| Get the firmware version as a user readable string. More...
|
|
int | switchtec_cmd (struct switchtec_dev *dev, uint32_t cmd, const void *payload, size_t payload_len, void *resp, size_t resp_len) |
| Execute an MRPC command. More...
|
|
int | switchtec_get_devices (struct switchtec_dev *dev, struct switchtec_status *status, int ports) |
| Populate an already retrieved switchtec_status structure list with information about the devices plugged into the switch. More...
|
|
int | switchtec_pff_to_port (struct switchtec_dev *dev, int pff, int *partition, int *port) |
| Convert a port function index to a partition and port number. More...
|
|
int | switchtec_port_to_pff (struct switchtec_dev *dev, int partition, int port, int *pff) |
| Convert a partition and port number to a port function index. More...
|
|
int | switchtec_event_summary (struct switchtec_dev *dev, struct switchtec_event_summary *sum) |
| Retrieve a summary of all the events that have occurred in the switch. More...
|
|
int | switchtec_event_check (struct switchtec_dev *dev, struct switchtec_event_summary *check, struct switchtec_event_summary *res) |
| Check if one or more events have occurred. More...
|
|
int | switchtec_event_ctl (struct switchtec_dev *dev, enum switchtec_event_id e, int index, int flags, uint32_t data[5]) |
| Enable, disable and clear events or retrieve event data. More...
|
|
int | switchtec_event_wait (struct switchtec_dev *dev, int timeout_ms) |
| Wait for any event to occur (typically just an interrupt) More...
|
|
const _PURE char * | switchtec_name (struct switchtec_dev *dev) |
| Get the string that was used to open the deviec. More...
|
|
_PURE int | switchtec_partition (struct switchtec_dev *dev) |
| Get the partiton number of the device that was opened. More...
|
|
_PURE int | switchtec_device_id (struct switchtec_dev *dev) |
| Get the device id of the device. More...
|
|
_PURE enum switchtec_gen | switchtec_gen (struct switchtec_dev *dev) |
| Get the generation of the device. More...
|
|
_PURE enum switchtec_variant | switchtec_variant (struct switchtec_dev *dev) |
| Get the variant type of the device. More...
|
|
_PURE enum switchtec_boot_phase | switchtec_boot_phase (struct switchtec_dev *dev) |
| Get boot phase of the device. More...
|
|
int | switchtec_echo (struct switchtec_dev *dev, uint32_t input, uint32_t *output) |
| Perform an MRPC echo command. More...
|
|
int | switchtec_hard_reset (struct switchtec_dev *dev) |
| Perform an MRPC hard reset command. More...
|
|
int | switchtec_status (struct switchtec_dev *dev, struct switchtec_status **status) |
| Get the status of all the ports on a switchtec device. More...
|
|
void | switchtec_status_free (struct switchtec_status *status, int ports) |
| Free a list of status structures allocated by switchtec_status() More...
|
|
int | switchtec_get_device_info (struct switchtec_dev *dev, enum switchtec_boot_phase *phase, enum switchtec_gen *gen, enum switchtec_rev *rev, struct ping_dev_info *ping_info) |
| Get device generation, revision, and boot phase info. More...
|
|
const char * | switchtec_strerror (void) |
| Return a message coresponding to the last error. More...
|
|
void | switchtec_perror (const char *str) |
| Print an error string to stdout. More...
|
|
int | switchtec_log_to_file (struct switchtec_dev *dev, enum switchtec_log_type type, int fd, FILE *log_def_file, struct switchtec_log_file_info *info) |
| Dump the Switchtec log data to a file. More...
|
|
int | switchtec_parse_log (FILE *bin_log_file, FILE *log_def_file, FILE *parsed_log_file, enum switchtec_log_parse_type log_type, enum switchtec_gen gen, struct switchtec_log_file_info *info) |
| Parse a binary app log or mailbox log to a text file. More...
|
|
int | switchtec_log_def_to_file (struct switchtec_dev *dev, enum switchtec_log_def_type type, FILE *file) |
| Dump the Switchtec log definition data to a file. More...
|
|
float | switchtec_die_temp (struct switchtec_dev *dev) |
| Get the die temperature of the switchtec device. More...
|
|
int | switchtec_calc_lane_id (struct switchtec_dev *dev, int phys_port_id, int lane_id, struct switchtec_status *port) |
| Calculate the global lane ID for a lane within a physical port. More...
|
|
int | switchtec_calc_port_lane (struct switchtec_dev *dev, int lane_id, int *phys_port_id, int *port_lane_id, struct switchtec_status *port) |
| Calculate the port and lane within the port from a global lane ID. More...
|
|
int | switchtec_calc_lane_mask (struct switchtec_dev *dev, int phys_port_id, int lane_id, int num_lanes, int *lane_mask, struct switchtec_status *port) |
| Calculate the lane mask for lanes within a physical port. More...
|
|
static int | switchtec_is_gen3 (struct switchtec_dev *dev) |
| Return whether a Switchtec device is a Gen 3 device.
|
|
static int | switchtec_is_gen4 (struct switchtec_dev *dev) |
| Return whether a Switchtec device is a Gen 4 device.
|
|
static int | switchtec_is_gen5 (struct switchtec_dev *dev) |
| Return whether a Switchtec device is a Gen 5 device.
|
|
static int | switchtec_max_supported_ports (struct switchtec_dev *dev) |
| Return the max number of ports of a Switchtec device.
|
|
static int | switchtec_is_pfx (struct switchtec_dev *dev) |
| Return whether a Switchtec device is PFX.
|
|
static int | switchtec_is_pfxl (struct switchtec_dev *dev) |
| Return whether a Switchtec device is PFX-L.
|
|
static int | switchtec_is_pfxi (struct switchtec_dev *dev) |
| Return whether a Switchtec device is PFX-I.
|
|
static int | switchtec_is_pfxa (struct switchtec_dev *dev) |
| Return whether a Switchtec device is PFX-A.
|
|
static int | switchtec_is_pfx_all (struct switchtec_dev *dev) |
| Return whether a Switchtec device is PFX(L/I/A).
|
|
static int | switchtec_is_psx (struct switchtec_dev *dev) |
| Return whether a Switchtec device is PSX.
|
|
static int | switchtec_is_psxa (struct switchtec_dev *dev) |
| Return whether a Switchtec device is PSX-A.
|
|
static int | switchtec_is_psx_all (struct switchtec_dev *dev) |
| Return whether a Switchtec device is PSX(A).
|
|
static int | switchtec_is_psx_pfx_all (struct switchtec_dev *dev) |
| Return whether a Switchtec device is PFX or PSX.
|
|
static int | switchtec_is_pax (struct switchtec_dev *dev) |
| Return whether a Switchtec device is PAX.
|
|
static int | switchtec_is_paxa (struct switchtec_dev *dev) |
| Return whether a Switchtec device is PAX-A.
|
|
static int | switchtec_is_pax_all (struct switchtec_dev *dev) |
| Return whether a Switchtec device is PAX(A).
|
|
static const char * | switchtec_gen_str (struct switchtec_dev *dev) |
| Return the generation string of a Switchtec device.
|
|
static const char * | stmfd_rev_str (uint8_t rev) |
| Return the revision string for Stamford Platform.
|
|
static const char * | switchtec_rev_str (enum switchtec_rev rev) |
| Return the revision string.
|
|
static const char * | switchtec_fw_image_gen_str (struct switchtec_fw_image_info *inf) |
| Return the generation string of a Switchtec fw image.
|
|
static const char * | switchtec_variant_str (struct switchtec_dev *dev) |
| Return the variant string of a Switchtec device.
|
|
static const char * | switchtec_phase_id_str (enum switchtec_boot_phase phase_id) |
| Return the phase string for a phase id.
|
|
int | switchtec_event_summary_set (struct switchtec_event_summary *sum, enum switchtec_event_id e, int index) |
| Set a bit corresponding to an event in a summary structure. More...
|
|
int | switchtec_event_summary_test (struct switchtec_event_summary *sum, enum switchtec_event_id e, int index) |
| Test if a bit corresponding to an event is set in a summary structure. More...
|
|
int | switchtec_event_summary_iter (struct switchtec_event_summary *sum, enum switchtec_event_id *e, int *idx) |
| Iterate through all set bits in an event summary structure. More...
|
|
enum switchtec_event_type | switchtec_event_info (enum switchtec_event_id e, const char **name, const char **desc) |
| Get the name and description strings as well as the type (global, partition or pff) for a specific event ID. More...
|
|
int | switchtec_event_wait_for (struct switchtec_dev *dev, enum switchtec_event_id e, int index, struct switchtec_event_summary *res, int timeout_ms) |
| Block until a specific event occurs. More...
|
|
int | switchtec_fw_toggle_active_partition (struct switchtec_dev *dev, int toggle_bl2, int toggle_key, int toggle_fw, int toggle_cfg) |
| Toggle the active firmware partition for the main or configuration images. More...
|
|
int | switchtec_fw_write_fd (struct switchtec_dev *dev, int img_fd, int dont_activate, int force, void(*progress_callback)(int cur, int tot)) |
| Write a firmware file to the switchtec device. More...
|
|
int | switchtec_fw_write_file (struct switchtec_dev *dev, FILE *fimg, int dont_activate, int force, void(*progress_callback)(int cur, int tot)) |
| Write a firmware file to the switchtec device. More...
|
|
int | switchtec_fw_read_fd (struct switchtec_dev *dev, int fd, unsigned long addr, size_t len, void(*progress_callback)(int cur, int tot)) |
| Read a Switchtec device's flash data into a file. More...
|
|
int | switchtec_fw_body_read_fd (struct switchtec_dev *dev, int fd, struct switchtec_fw_image_info *info, void(*progress_callback)(int cur, int tot)) |
| Read a Switchtec device's flash image body into a file. More...
|
|
int | switchtec_fw_read (struct switchtec_dev *dev, unsigned long addr, size_t len, void *buf) |
| Read a Switchtec device's flash data. More...
|
|
void | switchtec_fw_perror (const char *s, int ret) |
| Print an error string to stdout. More...
|
|
int | switchtec_fw_file_info (int fd, struct switchtec_fw_image_info *info) |
| Retrieve information about a firmware image file. More...
|
|
int | switchtec_fw_file_secure_version_newer (struct switchtec_dev *dev, int img_fd) |
| Check if the secure version of an image file is newer than that of the image on device. More...
|
|
const char * | switchtec_fw_image_type (const struct switchtec_fw_image_info *info) |
| Return a string describing the type of a firmware image. More...
|
|
struct switchtec_fw_part_summary * | switchtec_fw_part_summary (struct switchtec_dev *dev) |
| Return firmware summary information structure for the flash partitfons in the device. More...
|
|
void | switchtec_fw_part_summary_free (struct switchtec_fw_part_summary *summary) |
| Free a firmware part summary data structure. More...
|
|
int | switchtec_fw_img_write_hdr (int fd, struct switchtec_fw_image_info *info) |
| Write the header for a Switchtec firmware image file. More...
|
|
int | switchtec_fw_is_boot_ro (struct switchtec_dev *dev) |
| Check if the boot partition is marked as read-only. More...
|
|
int | switchtec_fw_set_boot_ro (struct switchtec_dev *dev, enum switchtec_fw_ro ro) |
| Set or clear a boot partition's read-only flag. More...
|
|
enum switchtec_gen | switchtec_fw_version_to_gen (unsigned int version) |
| Extract generation information from FW version number. More...
|
|
bool | switchtec_stack_bif_port_valid (struct switchtec_dev *dev, int stack_id, int port_id) |
| Return true if a port within a stack is valid. More...
|
|
int | switchtec_stack_bif_width (struct switchtec_dev *dev, int stack_id, int port_bif) |
| Return the number of stack ports used for a given bifurcation. More...
|
|
int | switchtec_get_stack_bif (struct switchtec_dev *dev, int stack_id, int port_bif[SWITCHTEC_PORTS_PER_STACK]) |
| Get the bifurcation of ports in a stack. More...
|
|
int | switchtec_set_stack_bif (struct switchtec_dev *dev, int stack_id, int port_bif[SWITCHTEC_PORTS_PER_STACK]) |
| Set the bifurcation of ports in a stack. More...
|
|
int | switchtec_evcntr_type_count (void) |
| Get the number of event counter types. More...
|
|
const char * | switchtec_evcntr_type_str (int *type_mask) |
| Get a string for the event indicated by lowest bit set in the type_mask. More...
|
|
int | switchtec_evcntr_setup (struct switchtec_dev *dev, unsigned stack_id, unsigned cntr_id, struct switchtec_evcntr_setup *setup) |
| Setup an event counter performance monitor. More...
|
|
int | switchtec_evcntr_get_setup (struct switchtec_dev *dev, unsigned stack_id, unsigned cntr_id, unsigned nr_cntrs, struct switchtec_evcntr_setup *res) |
| Retrieve the setup information for one or more event counters. More...
|
|
int | switchtec_evcntr_get (struct switchtec_dev *dev, unsigned stack_id, unsigned cntr_id, unsigned nr_cntrs, unsigned *res, int clear) |
| Retrieve the current counts for one or more event counters. More...
|
|
int | switchtec_evcntr_get_both (struct switchtec_dev *dev, unsigned stack_id, unsigned cntr_id, unsigned nr_cntrs, struct switchtec_evcntr_setup *setup, unsigned *counts, int clear) |
| Retrieve the current counts and setup information for one or more event counters. More...
|
|
int | switchtec_evcntr_wait (struct switchtec_dev *dev, int timeout_ms) |
| Block until any event counter has reached its threshold. More...
|
|
void | switchtec_bwcntr_sub (struct switchtec_bwcntr_res *new_cntr, struct switchtec_bwcntr_res *old_cntr) |
| Subtract all the values between two bwcntr result structures. More...
|
|
int | switchtec_bwcntr_set_many (struct switchtec_dev *dev, int nr_ports, int *phys_port_ids, enum switchtec_bw_type bw_type) |
| Set bandwidth type for a number of ports. More...
|
|
int | switchtec_bwcntr_set_all (struct switchtec_dev *dev, enum switchtec_bw_type bw_type) |
| Set bandwidth type for all the ports in the system. More...
|
|
int | switchtec_bwcntr_many (struct switchtec_dev *dev, int nr_ports, int *phys_port_ids, int clear, struct switchtec_bwcntr_res *res) |
| Retrieve the bandwidth counter results for a number of ports. More...
|
|
int | switchtec_bwcntr_all (struct switchtec_dev *dev, int clear, struct switchtec_port_id **ports, struct switchtec_bwcntr_res **res) |
| Retrieve the bandwidth counter results for all the ports in the system. More...
|
|
uint64_t | switchtec_bwcntr_tot (struct switchtec_bwcntr_dir *d) |
| Get the total. More...
|
|
int | switchtec_lat_setup_many (struct switchtec_dev *dev, int nr_ports, int *egress_port_ids, int *ingress_port_ids) |
| Setup a number of latency counters. More...
|
|
int | switchtec_lat_setup (struct switchtec_dev *dev, int egress_port_id, int ingress_port_id, int clear) |
| Setup a latency counter. More...
|
|
int | switchtec_lat_get_many (struct switchtec_dev *dev, int nr_ports, int clear, int *egress_port_ids, int *cur_ns, int *max_ns) |
| Get a number of latency counter results. More...
|
|
int | switchtec_lat_get (struct switchtec_dev *dev, int clear, int egress_port_ids, int *cur_ns, int *max_ns) |
| Get a single latency counter result. More...
|
|
gasptr_t | switchtec_gas_map (struct switchtec_dev *dev, int writeable, size_t *map_size) |
| Map the GAS and return a pointer to access the gas. More...
|
|
void | switchtec_gas_unmap (struct switchtec_dev *dev, gasptr_t map) |
| Unmap the GAS region mapped with. More...
|
|
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_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_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_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...
|
|