Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
elxu_lancer.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <elxu_sli4.h>
#include <elxu_lancer.h>
#include <elxu_device.h>
#include <elxu_mbox.h>
#include <elxu_common.h>
#include <assert.h>

Go to the source code of this file.

Macros

#define MAX_OBJECT_READ   3840
 
#define MAX_OBJECT_WRITE   3840
 

Functions

static sli4_object_t * sli4_object_scan_directory (elxu_device_t *device, const char *directory)
 Scan an SLI4 object directory returning a list of all objects. More...
 
const char * oft2string (uint32_t oft)
 Return a string associated with an object type. More...
 
sli4_object_t * sli4_object_enumerate (elxu_device_t *device)
 Create a list of all SLI4 objects. More...
 
int sli4_object_delete (elxu_device_t *device, const char *objectName)
 Deletes an SLI4 object. More...
 
int sli4_object_length (elxu_device_t *device, const char *objectName)
 Return an SLI4 object's length in bytes. More...
 
int sli4_object_read (elxu_device_t *device, const char *objectName, void *buffer, uint32_t bufferLength)
 Read data from an object. More...
 
int sli4_object_write (elxu_device_t *device, const char *objectName, int buffer_offset, void *buffer, uint32_t bufferLength, int eofl)
 Write data into an object. More...
 
sli4_object_t * sli4_object_new (const char *name, uint32_t type, uint32_t length)
 Instantiate a new sli4_object_t. More...
 
void sli4_object_free (sli4_object_t *obj)
 Free and sli4_object_t. More...
 
void sli4_object_free_list (sli4_object_t *head)
 Free a list of sli4_object_t's. More...
 

Macro Details

#define MAX_OBJECT_READ   3840
#define MAX_OBJECT_WRITE   3840

Function Details

const char * oft2string ( uint32_t  oft)

Return a string associated with an object type.

Returns a string associated with an object type

Parameters
oftObject type

Definition at line 513 of file elxu_lancer.c.

int sli4_object_delete ( elxu_device_t *  device,
const char *  objectName 
)

Deletes an SLI4 object.

Deletes the SLI4 object.

Parameters
devicepointer to device
objectNamename of object

Definition at line 214 of file elxu_lancer.c.

sli4_object_t* sli4_object_enumerate ( elxu_device_t *  device)

Create a list of all SLI4 objects.

The SLI4 HBA referred to by 'device' is scanned returning a list of all objects

Parameters
devicepointer to device

Definition at line 53 of file elxu_lancer.c.

void sli4_object_free ( sli4_object_t *  obj)

Free and sli4_object_t.

The object given by 'obj' if free'd

Parameters
objObject to free

Definition at line 553 of file elxu_lancer.c.

void sli4_object_free_list ( sli4_object_t *  head)

Free a list of sli4_object_t's.

The elements of list given by 'head' are freed

Parameters
headhead of list

Definition at line 570 of file elxu_lancer.c.

int sli4_object_length ( elxu_device_t *  device,
const char *  objectName 
)

Return an SLI4 object's length in bytes.

Returns the length of an SLI4 normal object, or the number of elements in an SLI4 directory object

Parameters
devicepointer to device
objectNamename of object

Definition at line 271 of file elxu_lancer.c.

sli4_object_t* sli4_object_new ( const char *  name,
uint32_t  type,
uint32_t  length 
)

Instantiate a new sli4_object_t.

An sli4_object_t is allocated and populated with name, type and length;

Parameters
nameName of object
typeType of object
lengthLength of object

Definition at line 533 of file elxu_lancer.c.

int sli4_object_read ( elxu_device_t *  device,
const char *  objectName,
void *  buffer,
uint32_t  bufferLength 
)

Read data from an object.

The data of an SLI4 data object is read.

Parameters
devicepointer to device
objectNamename of object to read
bufferpointer to data buffer
bufferLengthbyte length of data buffer

returns the number of bytes read, or a negative value

Definition at line 333 of file elxu_lancer.c.

static sli4_object_t * sli4_object_scan_directory ( elxu_device_t *  device,
const char *  directory 
)
static

Scan an SLI4 object directory returning a list of all objects.

The SLI4 object directory 'directory' is scanned recursively. A list of all objects is returned

Parameters
devicepointer to device
directoryname of directory

Definition at line 67 of file elxu_lancer.c.

int sli4_object_write ( elxu_device_t *  device,
const char *  objectName,
int  buffer_offset,
void *  buffer,
uint32_t  bufferLength,
int  eofl 
)

Write data into an object.

Write the data into an SLI4 data object.

Parameters
devicepointer to device
objectNamename of object to write
bufferpointer to data buffer
bufferLengthbyte length of data buffer

returns the number of bytes written, or a negative value

Definition at line 429 of file elxu_lancer.c.