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

Go to the source code of this file.

Enumerations

enum  dir_t { DIR_WRITE, DIR_READ }
 

Functions

static int image_load_common (elxu_device_t *device, dir_t direction, uint32_t op_type, uint8_t *buffer, uint32_t bufferLength)
 Read or Write UFI flash image component. More...
 
int ufi_image_download (elxu_device_t *device, uint32_t op_type, uint8_t *buffer, uint32_t bufferLength)
 Download UFI flash image component. More...
 
int ufi_image_upload (elxu_device_t *device, uint32_t op_type, uint8_t *buffer, uint32_t bufferLength)
 Upload UFI flash image component. More...
 
int fat_info (elxu_device_t *device)
 Return length of FAT. More...
 
int fat_read (elxu_device_t *device, uint8_t *buffer, uint32_t bufferLength)
 Read FAT. More...
 
int get_ext_fat_capabilities (elxu_device_t *device, uint32_t parameter_type, ext_fat_config_params_t *params, uint32_t paramsLength)
 Issue EFD get capabilities mailbox command. More...
 
int ext_fat_config_snapshot (elxu_device_t *device)
 Issue configure EFD snapshot mailbox command. More...
 
int ext_fat_retrieve_snapshot (elxu_device_t *device, uint8_t *buf, uint32_t len, uint32_t numlogs)
 Issue retrieve EFD snapshot mailbox command. More...
 
int ext_fat_read_string_table (elxu_device_t *device, mbox_ext_fat_read_string_params_t *tblinfo, uint32_t tbl_info_len, uint32_t bytes_to_read, uint32_t bytes_read)
 Issue EXT_FAT_READ_STRING_TABLE mailbox command. More...
 

Enumeration Details

enum dir_t
Enumerator
DIR_WRITE 
DIR_READ 

Definition at line 42 of file elxu_sky.c.

Function Details

int ext_fat_config_snapshot ( elxu_device_t *  device)

Issue configure EFD snapshot mailbox command.

Description
The OPCODE_COMMON_EXT_FAT_CONFIGURATION_SNAPSHOT mailbox command is issued. The command returns total log entries in the snapshot buffer.
Parameters
deviceDevice descriptor.
Returns
Returns the length of snapshot EFD log entries on success; negative error code on failure.

Definition at line 268 of file elxu_sky.c.

int ext_fat_read_string_table ( elxu_device_t *  device,
mbox_ext_fat_read_string_params_t *  tblinfo,
uint32_t  tbl_info_len,
uint32_t  bytes_to_read,
uint32_t  bytes_read 
)

Issue EXT_FAT_READ_STRING_TABLE mailbox command.

Description
The OPCODE_COMMON_EXT_FAT_READ_STRING_TABLE mailbox command is issued. The upper layer has to provide a number of bytes to be retrieved and the number of bytes already retrieved. The function returns the response param part of ioctl_common_ext_fat_read_string_table_t structure.
Parameters
deviceDevice descriptor.
tblinfoPointer to the param response structure.
tbl_info_lenParam response structure length.
bytes_to_readBytes to read.
bytes_readBytes already read.
Returns
Returns 0 on success; or a negative error code value on failure.

Definition at line 387 of file elxu_sky.c.

int ext_fat_retrieve_snapshot ( elxu_device_t *  device,
uint8_t *  buf,
uint32_t  len,
uint32_t  numlogs 
)

Issue retrieve EFD snapshot mailbox command.

Description
The OPCODE_COMMON_EXT_FAT_RETRIEVE_SHAPSHOT mailbox command is issued. Because of BSG limitations only 32 logs are requested per read. Upper layer executing OPCODE_COMMON_EXT_FAT_CONFIGURATION_SNAPSHOT mailbox command already knows the total number of log entries.
Parameters
deviceDevice descriptor.
bufThe EFD snapshot data buffer.
lenThe buffer length.
numlogsThe number of logs to retrieve.
Returns
Returns 0 on success; or a negative error code value on failure.

Definition at line 304 of file elxu_sky.c.

int fat_info ( elxu_device_t *  device)

Return length of FAT.

Description
Issues MANAGE_FAT mailbox command and returns the length of the FAT.
Parameters
deviceDevice descriptor.
Returns
Returns the length of the FAT on success; negative error code on failure.

Definition at line 156 of file elxu_sky.c.

int fat_read ( elxu_device_t *  device,
uint8_t *  buffer,
uint32_t  bufferLength 
)

Read FAT.

Description
Reads FAT into buffer.
Parameters
deviceDevice descriptor.
bufferRead buffer.
bufferLengthRead buffer length.
Returns
Returns the number of bytes read on success; negative error code on failure.

Definition at line 175 of file elxu_sky.c.

int get_ext_fat_capabilities ( elxu_device_t *  device,
uint32_t  parameter_type,
ext_fat_config_params_t *  params,
uint32_t  paramsLength 
)

Issue EFD get capabilities mailbox command.

Description
The COMMON_GET_EXT_FAT_CAPABILIEIS mailbox command is issued. WARNING: this command will return a variable amount of data based on the configuration. There are BSG limitations that may keep all data from being correctly returned.
Parameters
deviceDevice descriptor.
Parameter_typeparameter type (0 for default, 1 for current set).
paramsPointer to ext_fat_config_params_t structure.
paramsLengthLength of parameters structure.
Returns
Returns 0 on success; or a negative error code value on failure.

Definition at line 236 of file elxu_sky.c.

static int image_load_common ( elxu_device_t *  device,
dir_t  direction,
uint32_t  op_type,
uint8_t *  buffer,
uint32_t  bufferLength 
)
static

Read or Write UFI flash image component.

Description
Read or write UFI flash image. The request is broken up into a series of requests.
Parameters
devicePointer to device descriptor.
directionOf transfer.
op_typeUFI flash component to update.
bufferPointer to memory buffer with flash data.
bufferLengthLength of flash data.
Returns
Returns 0 on success; or a negative error code value on failure.

Definition at line 109 of file elxu_sky.c.

int ufi_image_download ( elxu_device_t *  device,
uint32_t  op_type,
uint8_t *  buffer,
uint32_t  bufferLength 
)

Download UFI flash image component.

Description
The flash image given by 'buffer' for 'bufferLength' is passed to the flash. 'op_type' defines which flash image component is to be written.
Parameters
devicePointer to device descriptor.
op_typeflash component to update.
bufferPointer to memory buffer with flash data.
bufferlengthLength of flash data.
Returns
Returns 0 on success; or a negative error code value on failure.

Definition at line 67 of file elxu_sky.c.

int ufi_image_upload ( elxu_device_t *  device,
uint32_t  op_type,
uint8_t *  buffer,
uint32_t  bufferLength 
)

Upload UFI flash image component.

Description
The flash image 'op_type' is read into 'buffer'
Parameters
devicePointer to device descriptor.
op_typeflash component to update.
bufferPointer to memory buffer with flash data.
bufferLengthLength of flash data.
Returns
Returns 0 on success; or a negative error code value on failure.

Definition at line 87 of file elxu_sky.c.