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 "version.h"
#include "ocs_vpd.h"
#include "ocs_params.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)
 
PARAM_LIST int32_t ocs_device_init (void)
 Perform driver-wide initialization. More...
 
int32_t ocs_device_init_complete (void)
 Perform device initialization complete. More...
 
void ocs_device_shutdown (void)
 Perform driver-wide shut down actions. More...
 
ocs_t * ocs_get_instance (uint32_t index)
 Returns a pointer to the ocs structure given the instance index. More...
 
uint32_t ocs_instance (void *os)
 Return the instance index of an opaque ocs structure. More...
 
void * ocs_device_alloc (uint32_t nid)
 Instantiate the PCI device. More...
 
void ocs_device_free (ocs_t *ocs)
 
int32_t ocs_device_interrupts_required (ocs_t *ocs)
 Returns the number of interrupts required per HBA. More...
 
int32_t ocs_device_attach (ocs_t *ocs)
 
int32_t ocs_device_detach (ocs_t *ocs)
 Remove the PCI device instance. More...
 
int32_t ocs_get_property (const char *prop_name, char *buffer, uint32_t buffer_len)
 
const char * ocs_display_name (void *os)
 
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_iscsi_ramd: " DRV_VERSION
 
ocs_t * ocs_devices [MAX_OCS_DEVICES]
 
uint32_t ocs_instance_count = 0
 
static ocs_mgmt_functions_t driver_mgmt_functions
 

Macro Details

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

Definition at line 59 of file ocs_driver.c.

Function Details

void* ocs_device_alloc ( uint32_t  nid)

Instantiate the PCI device.

This is the PCI device probe entry point, called by the Linux PCI subsystem once for each matching device/function.

The ocs structure is allocated, and initialized
Parameters
nidNUMA node ID.
Returns
Returns the pointer to the allocated OCS structure.

Definition at line 181 of file ocs_driver.c.

int32_t ocs_device_attach ( ocs_t *  ocs)

Definition at line 271 of file ocs_driver.c.

int32_t ocs_device_detach ( ocs_t *  ocs)

Remove the PCI device instance.

Called when the driver is unloaded, once for each PCI device/function instance.
Parameters
ocsPointer to the ocs structure.
Returns
None.

Definition at line 334 of file ocs_driver.c.

void ocs_device_free ( ocs_t *  ocs)

Definition at line 227 of file ocs_driver.c.

PARAM_LIST int32_t ocs_device_init ( void  )

Perform driver-wide initialization.

This function is called prior to enumerating PCI devices, with subsequent calls to ocs_device_attach. For OCS, this function invokes the back end functions ocs_scsi_tgt_driver_init() and ocs_scsi_ini_driver_init()
Returns
Returns 0 for success, or a negative error code value for failure.

Definition at line 74 of file ocs_driver.c.

int32_t ocs_device_init_complete ( void  )

Perform device initialization complete.

This function is called after all PCI device/functions have been enumerated.
Returns
returns 0 for success, a negative error code value for failure.

Definition at line 110 of file ocs_driver.c.

int32_t ocs_device_interrupts_required ( ocs_t *  ocs)

Returns the number of interrupts required per HBA.

Parameters
ocsPointer to the ocs structure.
Returns
Returns the number of interrupts.

Definition at line 261 of file ocs_driver.c.

void ocs_device_shutdown ( void  )

Perform driver-wide shut down actions.

This function is called prior to detaching devices during a driver unload.
Returns
None.

Definition at line 125 of file 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 568 of file ocs_driver.c.

const char* ocs_display_name ( void *  os)

Definition at line 385 of file ocs_driver.c.

ocs_t* ocs_get_instance ( uint32_t  index)

Returns a pointer to the ocs structure given the instance index.

A pointer to an ocs structure is returned given an instance index.
Parameters
indexIndex to ocs_devices array.
Returns
Returns ocs pointer.

Definition at line 141 of file ocs_driver.c.

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

Definition at line 357 of file ocs_driver.c.

uint32_t ocs_instance ( void *  os)

Return the instance index of an opaque ocs structure.

Returns the ocs instance index.
Parameters
osPointer to the ocs instance.
Returns
Pointer to the ocs instance index.

Definition at line 160 of file 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 553 of file ocs_driver.c.

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

Definition at line 425 of file ocs_driver.c.

void ocs_mgmt_driver_get_all ( ocs_textbuf_t *  textbuf,
void *  driver 
)

Definition at line 516 of file ocs_driver.c.

void ocs_mgmt_driver_list ( ocs_textbuf_t *  textbuf,
void *  driver 
)

Definition at line 392 of file ocs_driver.c.

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

Definition at line 547 of file 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,
}
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: ocs_driver.c:553
void ocs_mgmt_driver_list(ocs_textbuf_t *textbuf, void *driver)
Definition: ocs_driver.c:392
void ocs_mgmt_driver_get_all(ocs_textbuf_t *textbuf, void *driver)
Definition: ocs_driver.c:516
int ocs_mgmt_driver_get(ocs_textbuf_t *textbuf, char *parent, char *name, void *driver)
Definition: ocs_driver.c:425

Definition at line 49 of file ocs_driver.c.

ocs_t* ocs_devices[MAX_OCS_DEVICES]

Definition at line 40 of file ocs_driver.c.

uint32_t ocs_instance_count = 0

Definition at line 41 of file ocs_driver.c.

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

Definition at line 38 of file ocs_driver.c.