Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_xport.c File Reference
#include "ocs.h"

Go to the source code of this file.

Detailed Description

FC transport API

Definition in file ocs_xport.c.

Data Structures

struct  ocs_xport_post_node_event_t
 Post node event callback argument. More...
 

Macros

#define OCS_XPORT_STATS_TIMER_MS   3 * 1000
 

Functions

static void ocs_xport_link_stats_cb (int32_t status, uint32_t num_counters, ocs_hal_link_stat_counts_t *counters, void *arg)
 
static void ocs_xport_host_stats_cb (int32_t status, uint32_t num_counters, ocs_hal_host_stat_counts_t *counters, void *arg)
 
static void ocs_xport_async_link_stats_cb (int32_t status, uint32_t num_counters, ocs_hal_link_stat_counts_t *counters, void *arg)
 
static void ocs_xport_async_host_stats_cb (int32_t status, uint32_t num_counters, ocs_hal_host_stat_counts_t *counters, void *arg)
 
static int32_t ocs_xport_stats_timer_cb (ocs_hal_t *hal, int32_t status, uint8_t *mqe, void *arg)
 
ocs_xport_t * ocs_xport_alloc (ocs_t *ocs)
 Allocate a transport object. More...
 
static void ocs_xport_rq_threads_teardown (ocs_xport_t *xport)
 Create the RQ threads and the circular buffers used to pass sequences. More...
 
static int32_t ocs_xport_rq_threads_create (ocs_xport_t *xport, uint32_t num_rq_threads)
 Create the RQ threads and the circular buffers used to pass sequences. More...
 
int32_t ocs_xport_attach (ocs_xport_t *xport)
 Do as much allocation as possible, but do not initialization the device. More...
 
static int32_t ocs_tow_io_size_valid (int32_t tow_feature, int32_t tow_io_size)
 
static int32_t ocs_tow_feature_valid (int32_t tow_feature)
 
static int32_t ocs_tow_setup (ocs_t *ocs)
 Setup AXR/FB optimized write parameters. Must be called after sli_setup. More...
 
int32_t ocs_xport_initialize (ocs_xport_t *xport)
 Initializes the device. More...
 
int32_t ocs_xport_detach (ocs_xport_t *xport)
 Detaches the transport from the device. More...
 
void ocs_xport_domain_list_empty_cb (ocs_t *ocs, void *arg)
 domain list empty callback More...
 
static int32_t ocs_xport_post_node_event_cb (ocs_hal_t *hal, int32_t status, uint8_t *mqe, void *arg)
 post node event callback More...
 
static void ocs_xport_force_free (ocs_xport_t *xport)
 Initiate force free. More...
 
int32_t ocs_xport_control (ocs_xport_t *xport, ocs_xport_ctrl_e cmd,...)
 Perform transport attach function. More...
 
int32_t ocs_xport_status (ocs_xport_t *xport, ocs_xport_status_e cmd, ocs_xport_stats_t *result)
 Return status on a link. More...
 
void ocs_device_stop_stats_timers (ocs_t *ocs)
 
void ocs_xport_config_stats_timer (void *arg)
 Get FC link and host Statistics periodically. More...
 
void ocs_xport_free (ocs_xport_t *xport)
 Free a transport object. More...
 
int32_t ocs_xport_cb (void *arg, ocs_hal_xport_event_e event)
 callback function for xport from HAL. More...
 

Macro Details

#define OCS_XPORT_STATS_TIMER_MS   3 * 1000

Definition at line 58 of file ocs_xport.c.

Function Details

void ocs_device_stop_stats_timers ( ocs_t *  ocs)

Definition at line 1319 of file ocs_xport.c.

static int32_t ocs_tow_feature_valid ( int32_t  tow_feature)
static

Definition at line 340 of file ocs_xport.c.

static int32_t ocs_tow_io_size_valid ( int32_t  tow_feature,
int32_t  tow_io_size 
)
static

Definition at line 319 of file ocs_xport.c.

static int32_t ocs_tow_setup ( ocs_t *  ocs)
static

Setup AXR/FB optimized write parameters. Must be called after sli_setup.

Parameters
halPointer to HAL context
Returns
0 on success, otherwise a negative value.

Definition at line 371 of file ocs_xport.c.

ocs_xport_t* ocs_xport_alloc ( ocs_t *  ocs)

Allocate a transport object.

Description
A transport object is allocated, and associated with a device instance.
Parameters
ocsPointer to device instance.
Returns
Returns the pointer to the allocated transport object, or NULL if failed.

Definition at line 71 of file ocs_xport.c.

static void ocs_xport_async_host_stats_cb ( int32_t  status,
uint32_t  num_counters,
ocs_hal_host_stat_counts_t *  counters,
void *  arg 
)
static

Definition at line 1292 of file ocs_xport.c.

static void ocs_xport_async_link_stats_cb ( int32_t  status,
uint32_t  num_counters,
ocs_hal_link_stat_counts_t *  counters,
void *  arg 
)
static

Definition at line 1256 of file ocs_xport.c.

int32_t ocs_xport_attach ( ocs_xport_t *  xport)

Do as much allocation as possible, but do not initialization the device.

Description
Performs the functions required to get a device ready to run.
Parameters
xportPointer to transport object.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 193 of file ocs_xport.c.

int32_t ocs_xport_cb ( void *  arg,
ocs_hal_xport_event_e  event 
)

callback function for xport from HAL.

Description
Handling XPORT event
Parameters
OCScontext.
Returns
status.

Definition at line 1428 of file ocs_xport.c.

void ocs_xport_config_stats_timer ( void *  arg)

Get FC link and host Statistics periodically.

Parameters
halHardware context.
Returns
NONE.

Definition at line 1354 of file ocs_xport.c.

int32_t ocs_xport_control ( ocs_xport_t *  xport,
ocs_xport_ctrl_e  cmd,
  ... 
)

Perform transport attach function.

Description
Perform the attach function, which for the FC transport makes a HAL call to bring up the link.
Parameters
xportpointer to transport object.
cmdcommand to execute.

ocs_xport_control(ocs_xport_t *xport, OCS_XPORT_PORT_ONLINE) ocs_xport_control(ocs_xport_t *xport, OCS_XPORT_PORT_OFFLINE) ocs_xport_control(ocs_xport_t *xport, OCS_XPORT_PORT_SHUTDOWN) ocs_xport_control(ocs_xport_t *xport, OCS_XPORT_POST_NODE_EVENT, ocs_node_t *node, ocs_sm_event_t, void *context)

Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 866 of file ocs_xport.c.

int32_t ocs_xport_detach ( ocs_xport_t *  xport)

Detaches the transport from the device.

Description
Performs the functions required to shut down a device.
Parameters
xportPointer to transport object.
Returns
Returns 0 on success or a non-zero value on failure.

Definition at line 735 of file ocs_xport.c.

void ocs_xport_domain_list_empty_cb ( ocs_t *  ocs,
void *  arg 
)

domain list empty callback

Description
Function is invoked when the device domain list goes empty. By convention arg points to an ocs_sem_t instance, that is incremented.
Parameters
ocsPointer to device object.
argPointer to semaphore instance.
Returns
None.

Definition at line 771 of file ocs_xport.c.

static void ocs_xport_force_free ( ocs_xport_t *  xport)
static

Initiate force free.

Description
Perform force free of OCS.
Parameters
xportPointer to transport object.
Returns
None.

Definition at line 825 of file ocs_xport.c.

void ocs_xport_free ( ocs_xport_t *  xport)

Free a transport object.

Description
The transport object is freed.
Parameters
xportPointer to transport object.
Returns
None.

Definition at line 1394 of file ocs_xport.c.

static void ocs_xport_host_stats_cb ( int32_t  status,
uint32_t  num_counters,
ocs_hal_host_stat_counts_t *  counters,
void *  arg 
)
static

Definition at line 1243 of file ocs_xport.c.

int32_t ocs_xport_initialize ( ocs_xport_t *  xport)

Initializes the device.

Description
Performs the functions required to make a device functional.
Parameters
xportPointer to transport object.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 509 of file ocs_xport.c.

static void ocs_xport_link_stats_cb ( int32_t  status,
uint32_t  num_counters,
ocs_hal_link_stat_counts_t *  counters,
void *  arg 
)
static

Definition at line 1228 of file ocs_xport.c.

static int32_t ocs_xport_post_node_event_cb ( ocs_hal_t *  hal,
int32_t  status,
uint8_t *  mqe,
void *  arg 
)
static

post node event callback

Description
This function is called from the mailbox completion interrupt context to post an event to a node object. By doing this in the interrupt context, it has the benefit of only posting events in the interrupt context, deferring the need to create a per event node lock.
Parameters
halPointer to HAL structure.
statusCompletion status for mailbox command.
mqeMailbox queue completion entry.
argCallback argument.
Returns
Returns 0 on success, a negative error code value on failure.

Definition at line 799 of file ocs_xport.c.

static int32_t ocs_xport_rq_threads_create ( ocs_xport_t *  xport,
uint32_t  num_rq_threads 
)
static

Create the RQ threads and the circular buffers used to pass sequences.

Description
Creates the circular buffers and the servicing threads for RQ processing.
Parameters
xportPointer to transport object.
num_rq_threadsNumber of RQ processing threads that the driver creates.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 135 of file ocs_xport.c.

static void ocs_xport_rq_threads_teardown ( ocs_xport_t *  xport)
static

Create the RQ threads and the circular buffers used to pass sequences.

Description
Creates the circular buffers and the servicing threads for RQ processing.
Parameters
xportPointer to transport object
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 94 of file ocs_xport.c.

static int32_t ocs_xport_stats_timer_cb ( ocs_hal_t *  hal,
int32_t  status,
uint8_t *  mqe,
void *  arg 
)
static

Definition at line 1303 of file ocs_xport.c.

int32_t ocs_xport_status ( ocs_xport_t *  xport,
ocs_xport_status_e  cmd,
ocs_xport_stats_t *  result 
)

Return status on a link.

Description
Returns status information about a link.
Parameters
xportPointer to transport object.
cmdCommand to execute.
resultPointer to result value.

ocs_xport_status(ocs_xport_t *xport, OCS_XPORT_PORT_STATUS) ocs_xport_status(ocs_xport_t *xport, OCS_XPORT_LINK_SPEED, ocs_xport_stats_t *result) return link speed in MB/sec ocs_xport_status(ocs_xport_t *xport, OCS_XPORT_IS_SUPPORTED_LINK_SPEED, ocs_xport_stats_t *result) [in] *result is speed to check in MB/s returns 1 if supported, 0 if not ocs_xport_status(ocs_xport_t *xport, OCS_XPORT_LINK_STATISTICS, ocs_xport_stats_t *result) return link/host port stats ocs_xport_status(ocs_xport_t *xport, OCS_XPORT_LINK_STAT_RESET, ocs_xport_stats_t *result) resets link/host stats

Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 1073 of file ocs_xport.c.