Programming Interfaces Guide

Interconnect Controller Operations

The controller operations provide mechanisms for obtaining access to a controller. Controller operations can also determine the characteristics of the underlying interconnect. The following list contains information on controller operations:

rsm_get_controller

int rsm_get_controller(char *name, rsmapi_controller_handle_t *controller);

The rsm_get_controller operation acquires a controller handle for the given controller instance, such as sci0 or loopback. The returned controller handle is used for subsequent RSM library calls.

Return Values: Returns 0 if successful. Returns an error value otherwise.

RSMERR_BAD_CTLR_HNDL

Invalid controller handle

RSMERR_CTLR_NOT_PRESENT

Controller not present

RSMERR_INSUFFICIENT_MEM

Insufficient memory

RSMERR_BAD_LIBRARY_VERSION

Invalid library version

RSMERR_BAD_ADDR

Bad address

rsm_release_controller

int rsm_release_controller(rsmapi_controller_handle_t chdl);

This function releases the controller associated with the given controller handle. Each call to rsm_release_controller must have a matching rsm_get_controller. When all the controller handles associated with a controller are released, the system resources associated with the controller are freed. Attempting to access a controller handle, or attempting to access import or export segments on a released controller handle, is not legal. The results of such an attempt are undefined.

Return Values: Returns 0 if successful. Returns an error value otherwise.

RSMERR_BAD_CTLR_HNDL

Invalid controller handle

rsm_get_controller_attr

int rsm_get_controller_attr(rsmapi_controller_handle_t chdl, rsmapi_controller_attr_t *attr);

This function retrieves attributes for the specified controller handle. The following list describes the currently defined attributes for this function:

typedef struct {
     uint_t       attr_direct_access_sizes;
     uint_t       attr_atomic_sizes;
     size_t       attr_page_size;
     size_t       attr_max_export_segment_size;
     size_t       attr_tot_export_segment_size;
     ulong_t      attr_max_export_segments;
     size_t       attr_max_import_map_size;
     size_t       attr_tot_import_map_size;
     ulong_t      attr_max_import_segments;
 } rsmapi_controller_attr_t;

Return Values: Returns 0 if successful. Returns an error value otherwise.

RSMERR_BAD_CTLR_HNDL

Invalid controller handle

RSMERR_BAD_ADDR

Bad address