Switchtec Userspace  PROJECT_NUMBER = PROJECT_NUMBER=PROJECT_NUMBER = 2.2
Functions
Miscellaneous Commands

Various functions that fit don't fit into other categories. More...

Functions

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_log_to_file (struct switchtec_dev *dev, enum switchtec_log_type type, int fd)
 Dump the Switchtec log data to a file. More...
 
int switchtec_get_device_info (struct switchtec_dev *dev, enum switchtec_boot_phase *phase, enum switchtec_gen *gen, enum switchtec_rev *rev)
 Get device generation, revision, and boot phase info. More...
 
float switchtec_die_temp (struct switchtec_dev *dev)
 Get the die temperature of the switchtec device. 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...
 

Detailed Description

Various functions that fit don't fit into other categories.

Function Documentation

float switchtec_die_temp ( struct switchtec_dev *  dev)

Get the die temperature of the switchtec device.

Parameters
[in]devSwitchtec device handle
Returns
The die temperature (in degrees celsius) or a negative value on failure

Definition at line 846 of file switchtec.c.

int switchtec_echo ( struct switchtec_dev *  dev,
uint32_t  input,
uint32_t *  output 
)

Perform an MRPC echo command.

Parameters
[in]devSwitchtec device handle
[in]inputThe input data for the echo command
[out]outputThe result of the echo command
Returns
0 on success, error code on failure

The echo command takes 4 bytes and returns the bitwise-not of those bytes.

Definition at line 623 of file switchtec.c.

int switchtec_get_device_info ( struct switchtec_dev *  dev,
enum switchtec_boot_phase phase,
enum switchtec_gen gen,
enum switchtec_rev rev 
)

Get device generation, revision, and boot phase info.

Parameters
[in]devSwitchtec device handle
[out]phaseThe current boot phase
[out]genDevice generation
[out]revDevice revision
Returns
0 on success, error code on failure

Definition at line 796 of file switchtec.c.

int switchtec_hard_reset ( struct switchtec_dev *  dev)

Perform an MRPC hard reset command.

Parameters
[in]devSwitchtec device handle
Returns
0 on success, error code on failure

Note: if your system does not support hotplug this may leave the Switchtec device in an unusable state. A reboot would be required to fix this.

Definition at line 639 of file switchtec.c.

int switchtec_log_to_file ( struct switchtec_dev *  dev,
enum switchtec_log_type  type,
int  fd 
)

Dump the Switchtec log data to a file.

Parameters
[in]devSwitchtec device handle
[in]typeType of log data to dump
[in]fdFile descriptor to dump the data to
Returns
0 on success, error code on failure

Definition at line 745 of file switchtec.c.

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.

Parameters
[in]devSwitchtec device handle
[in]pffPort function number
[out]partitionPartition number
[out]portPort number
Returns
0 on success, negative on failure

Definition at line 181 of file platform.c.

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.

Parameters
[in]devSwitchtec device handle
[in]partitionPartition number
[in]portPort number
[out]pffPort function number
Returns
0 on success, negative on failure

Definition at line 196 of file platform.c.