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

Go to the source code of this file.

Macros

#define P(type, name, value, desc)   type name = value;
 

Functions

void ocs_mgmt_driver_list (ocs_textbuf_t *textbuf, void *driver)
 
void ocs_mgmt_driver_get_all (ocs_textbuf_t *textbuf, void *driver)
 
int ocs_mgmt_driver_get (ocs_textbuf_t *textbuf, char *parent, char *name, void *driver)
 
int ocs_mgmt_driver_exec (char *parent, char *action, void *arg_in, uint32_t arg_in_length, void *arg_out, uint32_t arg_out_length, void *driver)
 
static void ocs_driver_print_module_params (void)
 Log module parameters. More...
 
PARAM_LIST int32_t ocs_device_init (void)
 
void * ocs_device_alloc (uint32_t nid)
 
void ocs_device_free (ocs_t *ocs)
 free ocs device More...
 
int32_t ocs_device_interrupts_required (ocs_t *ocs)
 return the number of interrupts required per HBA More...
 
int32_t ocs_device_attach (ocs_t *ocs)
 Initialize resources when pci devices attach. More...
 
int32_t ocs_device_detach (ocs_t *ocs)
 free resources when pci device detach More...
 
int32_t ocs_get_property (const char *prop_name, char *buffer, uint32_t buffer_len)
 get driver wide property value More...
 
const char * ocs_display_name (void *os)
 return OCS instance display name More...
 
ocs_t * ocs_get_instance (uint32_t index)
 return pointer to ocs structure given instance index More...
 
uint32_t ocs_instance (void *os)
 Return instance index of an opaque ocs structure. More...
 
int ocs_mgmt_driver_set (char *parent, char *name, char *value)
 
void ocs_device_shutdown_complete (void)
 Perform driver wide shutdown complete actions. More...
 

Variables

char ocs_version [] = "version: ocs_fc_ramd: " DRV_VERSION
 
static ocs_t * ocs_devices [MAX_OCS_DEVICES]
 
static ocs_mgmt_functions_t driver_mgmt_functions
 

Macro Details

#define P (   type,
  name,
  value,
  desc 
)    type name = value;

Definition at line 60 of file uspace/ocs_fc_ramd/ocs_driver.c.

Function Details

void* ocs_device_alloc ( uint32_t  nid)

Definition at line 104 of file uspace/ocs_fc_ramd/ocs_driver.c.

int32_t ocs_device_attach ( ocs_t *  ocs)

Initialize resources when pci devices attach.

Parameters
ocspointer to ocs structure
Returns
0 for success, a negative error code value for failure.

Definition at line 229 of file uspace/ocs_fc_ramd/ocs_driver.c.

int32_t ocs_device_detach ( ocs_t *  ocs)

free resources when pci device detach

Parameters
ocspointer to ocs structure
Returns
0 for success, a negative error code value for failure.

Definition at line 323 of file uspace/ocs_fc_ramd/ocs_driver.c.

void ocs_device_free ( ocs_t *  ocs)

free ocs device

Parameters
ocspointer to ocs structure
Returns
none

Definition at line 174 of file uspace/ocs_fc_ramd/ocs_driver.c.

PARAM_LIST int32_t ocs_device_init ( void  )

Definition at line 65 of file uspace/ocs_fc_ramd/ocs_driver.c.

int32_t ocs_device_interrupts_required ( ocs_t *  ocs)

return the number of interrupts required per HBA

Parameters
ocspointer to ocs structure
Returns
the number of interrupts.

Definition at line 209 of file uspace/ocs_fc_ramd/ocs_driver.c.

void ocs_device_shutdown_complete ( void  )

Perform driver wide shutdown complete actions.

This function is called shutdown for all devices has completed

Returns
none

Definition at line 701 of file uspace/ocs_fc_ramd/ocs_driver.c.

const char* ocs_display_name ( void *  os)

return OCS instance display name

returns const char string of OCS instance display name

Parameters
ospointer to OS (ocs_t) object
Returns
return display name

Definition at line 419 of file uspace/ocs_fc_ramd/ocs_driver.c.

static void ocs_driver_print_module_params ( void  )
static

Log module parameters.

A list of module paramters is gerneated to the driver log

Returns
none

Definition at line 719 of file uspace/ocs_fc_ramd/ocs_driver.c.

ocs_t* ocs_get_instance ( uint32_t  index)

return pointer to ocs structure given instance index

A pointer to an ocs structure is returned given an instance index.

Parameters
indexindex to ocs_devices array
Returns
ocs pointer

Definition at line 436 of file uspace/ocs_fc_ramd/ocs_driver.c.

int32_t ocs_get_property ( const char *  prop_name,
char *  buffer,
uint32_t  buffer_len 
)

get driver wide property value

Return valued driver wide property. All property values using this interface are returned as null terminated text.

Parameters
prop_nameproperty name
bufferpointer to buffer
buffer_lenlength of buffer in bytes
Returns
returns 0 for success, a negative error code value for failure.

Definition at line 368 of file uspace/ocs_fc_ramd/ocs_driver.c.

uint32_t ocs_instance ( void *  os)

Return instance index of an opaque ocs structure.

Returns the ocs instance index

Parameters
ospointer to ocs instance
Returns
pointer to ocs instance index

Definition at line 454 of file uspace/ocs_fc_ramd/ocs_driver.c.

int ocs_mgmt_driver_exec ( char *  parent,
char *  action,
void *  arg_in,
uint32_t  arg_in_length,
void *  arg_out,
uint32_t  arg_out_length,
void *  driver 
)

Definition at line 641 of file uspace/ocs_fc_ramd/ocs_driver.c.

int ocs_mgmt_driver_get ( ocs_textbuf_t *  textbuf,
char *  parent,
char *  name,
void *  driver 
)

Definition at line 493 of file uspace/ocs_fc_ramd/ocs_driver.c.

void ocs_mgmt_driver_get_all ( ocs_textbuf_t *  textbuf,
void *  driver 
)

Definition at line 581 of file uspace/ocs_fc_ramd/ocs_driver.c.

void ocs_mgmt_driver_list ( ocs_textbuf_t *  textbuf,
void *  driver 
)

Definition at line 461 of file uspace/ocs_fc_ramd/ocs_driver.c.

int ocs_mgmt_driver_set ( char *  parent,
char *  name,
char *  value 
)

Definition at line 636 of file uspace/ocs_fc_ramd/ocs_driver.c.

Variable Details

ocs_mgmt_functions_t driver_mgmt_functions
static
Initial value:
= {
.get_list_handler = ocs_mgmt_driver_list,
.get_handler = ocs_mgmt_driver_get,
.get_all_handler = ocs_mgmt_driver_get_all,
.exec_handler = ocs_mgmt_driver_exec,
}
void ocs_mgmt_driver_get_all(ocs_textbuf_t *textbuf, void *driver)
int ocs_mgmt_driver_exec(char *parent, char *action, void *arg_in, uint32_t arg_in_length, void *arg_out, uint32_t arg_out_length, void *driver)
int ocs_mgmt_driver_get(ocs_textbuf_t *textbuf, char *parent, char *name, void *driver)
void ocs_mgmt_driver_list(ocs_textbuf_t *textbuf, void *driver)

Definition at line 52 of file uspace/ocs_fc_ramd/ocs_driver.c.

ocs_t* ocs_devices[MAX_OCS_DEVICES]
static

Definition at line 43 of file uspace/ocs_fc_ramd/ocs_driver.c.

char ocs_version[] = "version: ocs_fc_ramd: " DRV_VERSION

Definition at line 41 of file uspace/ocs_fc_ramd/ocs_driver.c.