Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
iSCSI API

Functions

int32_t ocs_iscsi_interrupts_required (ocs_os_handle_t os, ocs_hal_t *hal)
 Returns the number of interrupts needed for this adapter. More...
 
int32_t ocs_iscsi_initialize (ocs_os_handle_t os, ocs_iscsi_t *iscsi, ocs_hal_t *hal, uint32_t device_instance)
 Initialize the iSCSI device by setting up the chip. More...
 
void ocs_iscsi_uninitialize (ocs_iscsi_t *iscsi)
 Indicate that HAL is not initialized. More...
 
int32_t ocs_iscsi_teardown (ocs_iscsi_t *iscsi)
 Shut down the device. More...
 
void ocs_iscsi_tracker_init (ocs_iscsi_mem_tracker_t *tracker)
 Initialize the memory tracker. More...
 
void ocs_iscsi_tracker_free (ocs_iscsi_t *iscsi, ocs_iscsi_mem_tracker_t *tracker)
 Free the memory associated with a memory tracker. More...
 
int32_t ocs_iscsi_tracker_alloc (ocs_iscsi_t *iscsi, ocs_iscsi_mem_tracker_t *tracker, uint8_t zero, uint32_t object_size, uint32_t alignment, uint32_t num_objects)
 Allocate a group of objects uses pages to minimize waste. More...
 
ocs_dma_t * ocs_iscsi_tracker_calc (ocs_iscsi_mem_tracker_t *tracker, uint32_t obj_offset)
 Helper to return the pointers for a specific object in the group. More...
 

Function Details

int32_t ocs_iscsi_initialize ( ocs_os_handle_t  os,
ocs_iscsi_t *  iscsi,
ocs_hal_t *  hal,
uint32_t  device_instance 
)

Initialize the iSCSI device by setting up the chip.

Description
This function initializes the chip and creates the necessary queues and buffers.
Parameters
osPointer to the os structure that represents this device.
iscsiPointer to the iSCSI structure that represents this device.
halPointer to the hal structure. Allocated in the OS specific code due to ties to the hardware interrupt.
device_instanceCounter of the number of devices. Used to build target names when non-global ramdisk is used.
Returns
Returns 0 on success.

Definition at line 1505 of file ocs_iscsi.c.

int32_t ocs_iscsi_interrupts_required ( ocs_os_handle_t  os,
ocs_hal_t *  hal 
)

Returns the number of interrupts needed for this adapter.

Description
This function queries the chip and determine the number of chutes. An interrupt will be requested for each chute.
Parameters
osPointer to the os structure that represents this device.
halPointer to the hal structure. Allocated in the OS specific code due to ties to the hardware interrupt.
Returns
Returns the number of interrupts required, or a negative value on failure.

Definition at line 1459 of file ocs_iscsi.c.

int32_t ocs_iscsi_teardown ( ocs_iscsi_t *  iscsi)

Shut down the device.

Description
This function will shut down the PCI device and release all resources allocated to it.
Parameters
iscsiPointer to the iSCSI structure that represents this device.
Returns
Returns 0 on success.

Definition at line 1921 of file ocs_iscsi.c.

int32_t ocs_iscsi_tracker_alloc ( ocs_iscsi_t *  iscsi,
ocs_iscsi_mem_tracker_t *  tracker,
uint8_t  zero,
uint32_t  object_size,
uint32_t  alignment,
uint32_t  num_objects 
)

Allocate a group of objects uses pages to minimize waste.

Description
Used to allocate groups of objects into pages and then pull them out. This is done because DMA memory is allocated on page boundaries, which causes wasted space. By grouping the structures together, we attempt to consolidate as many per page as possible.
Parameters
iscsiPointer to the iSCSI object.
trackerPointer to the tracker.
zeroIf non-zero, then the memory will be zeroed.
object_sizeThe size of the objects in bytes.
alignmentMinimum byte alignment.
num_objectsNumber of object to allocate.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 4331 of file ocs_iscsi.c.

ocs_dma_t* ocs_iscsi_tracker_calc ( ocs_iscsi_mem_tracker_t *  tracker,
uint32_t  obj_offset 
)

Helper to return the pointers for a specific object in the group.

Parameters
trackerPointer to the tracker.
obj_offsetNumber of the object to retrieve.
Returns
Returns the pointer on success, NULL otherwise.

Definition at line 4429 of file ocs_iscsi.c.

void ocs_iscsi_tracker_free ( ocs_iscsi_t *  iscsi,
ocs_iscsi_mem_tracker_t *  tracker 
)

Free the memory associated with a memory tracker.

Parameters
iscsiPointer to the iSCSI object.
trackerPointer to the tracker.

Definition at line 4293 of file ocs_iscsi.c.

void ocs_iscsi_tracker_init ( ocs_iscsi_mem_tracker_t *  tracker)

Initialize the memory tracker.

Parameters
trackerPointer to the tracker to initialize.

Definition at line 4275 of file ocs_iscsi.c.

void ocs_iscsi_uninitialize ( ocs_iscsi_t *  iscsi)

Indicate that HAL is not initialized.

Description
This function clears the is_hal_initialized flag for the given iSCSI structure. This is to be used following a reset which causes the HAL structures to no longer be valid. Clearing this bit prevents the driver from trying to delete structures in the chip that are no longer there.
Parameters
iscsiPointer to the iSCSI structure that represents this device.
Returns
None.

Definition at line 1904 of file ocs_iscsi.c.