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

Go to the source code of this file.

Data Structures

struct  memref_t
 
struct  mbox_linkcfg_map_t
 mgmt link config string to CLP string mapping. More...
 

Macros

#define min(x, y)   (((x) < (y)) ? (x) : (y))
 
#define CLP_LINKCFG_4X10G   "ELX_4x10G"
 CLP string used in the DMTF_CLP_CMD mailbox command. More...
 
#define CLP_LINKCFG_1X40G   "ELX_1x40G"
 
#define CLP_LINKCFG_2X16G   "ELX_2x16G"
 
#define CLP_LINKCFG_4X8G   "ELX_4x8G"
 
#define CLP_LINKCFG_4X1G   "ELX_4x1G"
 
#define CLP_LINKCFG_2X10G   "ELX_2x10G"
 
#define CLP_LINKCFG_2X10G_2X8G   "ELX_2x10G_2x8G"
 
#define ENABLE   1
 
#define DISABLE   0
 
#define INTERNAL_LOOPBACK   0x1
 
#define EXTERNAL_LOOPBACK   0x2
 
#define PCI_LOOPBACK   0x3
 
#define LOOPBACK_BUF_SIZE   512
 

Functions

int mbox_common (elxu_device_t *device, mbox_command_t *mbxcmd, uint32_t mbxcmdLength, void *inbuf, uint32_t inbufLength, void *outbuf, uint32_t outbufLength)
 Send a mailbox command. More...
 
int mbox_read_flashrom (elxu_device_t *device, uint32_t opcode, uint32_t optype, uint32_t offset, void *outbuf, uint32_t outbufLength)
 Issue read flashrom mailbox command. More...
 
int mbox_write_flashrom (elxu_device_t *device, uint32_t opcode, uint32_t optype, uint32_t offset, void *outbuf, uint32_t outbufLength)
 Issue write flashrom mailbox command. More...
 
int mbox_read_status (elxu_device_t *device, uint32_t clear_counter)
 Issue read status mailbox command. More...
 
int mbox_read_link_status (elxu_device_t *device, int clof, int clrc)
 Issue read link status mailbox command. More...
 
int mbox_get_dport_stats (elxu_device_t *device)
 Issue Get dport stats mailbox command Create a GET_DPORT_STAT mailbox command. More...
 
int mbox_query_dynamic_dport_status (elxu_device_t *device)
 
int mbox_set_dynamic_dport (elxu_device_t *device, char *state)
 
int mbox_diag_loopback_tests (elxu_device_t *device, int loopback_type, int retry_count)
 Issue set link diag loopback mailbox command. More...
 
int mbox_read_rev (elxu_device_t *device)
 Issue read rev mailbox command. More...
 
int mbox_enable_nagle (elxu_device_t *device, int enable)
 
int mbox_tcp_parameters (elxu_device_t *device, uint32_t request_flags, uint32_t delayedAckValue, uint32_t delayedAckTimerValue)
 Issue the Set TCP Parameters mbox command. More...
 
int mbox_connection_update (elxu_device_t *device, uint32_t request_flags, uint16_t connectionId, uint32_t constrainWindowValue)
 
int mbox_get_connection_info (elxu_device_t *device, uint32_t connectionHandle)
 Get connection info. More...
 
int mbox_soft_assign_mac (elxu_device_t *device, int *macaddr)
 Soft assign MAC. More...
 
int mbox_manage_fat (elxu_device_t *device, uint32_t fat_operation, uint32_t read_log_offset, void *buffer, uint32_t bufferLength)
 Issue COMMON_MANAGE_FAT mailbox commands. More...
 
int mbox_ext_fat (elxu_device_t *device, uint32_t opcode, void *mbox, uint32_t mboxLength)
 Issue EFD mailbox command. More...
 
int create_vport (elxu_device_t *device_p, uint64_t wwnn, uint64_t wwpn, int targetFlag, int initiatorFlag)
 
int remove_vport (elxu_device_t *device_p, uint64_t wwnn, uint64_t wwpn, int targetFlag, int initiatorFlag)
 
memref_t * elx_pt_dma_alloc (elxu_device_t *device, int size)
 Request a DMA allocation through elx_pt. More...
 
void elx_pt_dma_free (memref_t *memref)
 Free a DMA allocation through elx_pt. More...
 
int mbox_fw_reset_pt (elxu_device_t *device, int dd)
 
int mbox_sli4_init_pt (elxu_device_t *device)
 
int mbox_set_nv_mac_pt (elxu_device_t *device, int *macaddr)
 
int mbox_get_serialnum_pt (elxu_device_t *device, char *serial_num, int serial_num_size)
 
int mbox_set_nv_wwn_pt (elxu_device_t *device, char *wwpn_p, char *wwnn_p)
 Issue a set non-volatile WWNN/WWPN. More...
 
void mbox_get_mac_pt (elxu_device_t *device, uint8_t *mac_addr)
 
void mbox_get_wwn_pt (int fd, uint8_t *wwnn, uint8_t *wwpn)
 
int mbox_get_profile_list_pt (elxu_device_t *device, char *result, int result_len)
 
int mbox_get_active_profile_pt (elxu_device_t *device, char *result, int result_len)
 
int mbox_set_active_profile_pt (elxu_device_t *device, char *new_profile_id)
 
char * mbox_get_linkcfg_pt (elxu_device_t *device)
 Get Link configuration. More...
 
int mbox_set_linkcfg_pt (elxu_device_t *device, char *config)
 Set Link configuration. More...
 

Macro Details

#define CLP_LINKCFG_1X40G   "ELX_1x40G"

Definition at line 54 of file elxu_mbox.h.

#define CLP_LINKCFG_2X10G   "ELX_2x10G"

Definition at line 58 of file elxu_mbox.h.

#define CLP_LINKCFG_2X10G_2X8G   "ELX_2x10G_2x8G"

Definition at line 59 of file elxu_mbox.h.

#define CLP_LINKCFG_2X16G   "ELX_2x16G"

Definition at line 55 of file elxu_mbox.h.

#define CLP_LINKCFG_4X10G   "ELX_4x10G"

CLP string used in the DMTF_CLP_CMD mailbox command.

Definition at line 53 of file elxu_mbox.h.

#define CLP_LINKCFG_4X1G   "ELX_4x1G"

Definition at line 57 of file elxu_mbox.h.

#define CLP_LINKCFG_4X8G   "ELX_4x8G"

Definition at line 56 of file elxu_mbox.h.

#define DISABLE   0

Definition at line 74 of file elxu_mbox.h.

#define ENABLE   1

Definition at line 73 of file elxu_mbox.h.

#define EXTERNAL_LOOPBACK   0x2

Definition at line 77 of file elxu_mbox.h.

#define INTERNAL_LOOPBACK   0x1

Definition at line 76 of file elxu_mbox.h.

#define LOOPBACK_BUF_SIZE   512

Definition at line 80 of file elxu_mbox.h.

#define min (   x,
  y 
)    (((x) < (y)) ? (x) : (y))

Definition at line 39 of file elxu_mbox.h.

#define PCI_LOOPBACK   0x3

Definition at line 78 of file elxu_mbox.h.

Function Details

int create_vport ( elxu_device_t *  device_p,
uint64_t  wwnn,
uint64_t  wwpn,
int  targetFlag,
int  initiatorFlag 
)

Definition at line 2319 of file elxu_mbox.c.

memref_t* elx_pt_dma_alloc ( elxu_device_t *  device,
int  size 
)

Request a DMA allocation through elx_pt.

Description
Requests a DMA buffer allocation from the driver.
Parameters
devicedevice structure
sizeSize of the requested buffer in bytes
Returns
a pointer to a new memref_t on success, NULL on failure

Definition at line 2549 of file elxu_mbox.c.

void elx_pt_dma_free ( memref_t *  memref)

Free a DMA allocation through elx_pt.

Description
Sends a DMA free request to the driver.
Parameters
memrefThe memref_t to be freed.
Returns
nothing

Definition at line 2602 of file elxu_mbox.c.

int mbox_common ( elxu_device_t *  device,
mbox_command_t *  mboxcmd,
uint32_t  mboxcmdLength,
void *  inbuf,
uint32_t  inbufLength,
void *  outbuf,
uint32_t  outbufLength 
)

Send a mailbox command.

Populates a mailbox command passing input and output buffer to the device

For SLI_CONFIG commands with non-embedded command, the command should be put in the inbuf, the mboxcmd will point to just the SLI_CONFIG command + buffer descriptor

Parameters
devicedevice descriptor
mboxcmdpointer to mailbox command data
mboxcmdLengthlength of mailbox command in bytes
inbufinput buffer
inbufLengthlength in bytes of input buffer in bytes
outbufoutput buffer
outbufLengthlength in bytes of output buffer in bytes
timeoutthe mailbox timeout for the command to be carried out
Returns
return zero for success, negative error code for error

Definition at line 2418 of file elxu_mbox.c.

int mbox_connection_update ( elxu_device_t *  device,
uint32_t  request_flags,
uint16_t  connectionId,
uint32_t  constrainWindowValue 
)

Definition at line 1719 of file elxu_mbox.c.

int mbox_diag_loopback_tests ( elxu_device_t *  device,
int  loopback_type,
int  retry_count 
)

Issue set link diag loopback mailbox command.

Create a SET_LINK_DIAG_LOOPBACK mailbox command

Parameters
devicedevice descriptor
mqe
typeloopback test type
Returns
return zero for success, negative error code for error

Definition at line 543 of file elxu_mbox.c.

int mbox_enable_nagle ( elxu_device_t *  device,
int  enable 
)
int mbox_ext_fat ( elxu_device_t *  device,
uint32_t  opcode,
void *  mbox,
uint32_t  mboxLength 
)

Issue EFD mailbox command.

Submits the mailbox command given by 'mbox' for 'mboxLength'. Note, that 'mboxLength' will generally include a response payload

Parameters
devicedevice descriptor
opcodecommon mailbox opcode
mboxpointer to common mailbox command + payload
mboxLengthlength of mailbox command + payload
Returns
0 if successful, a negative error code for failure

Definition at line 1604 of file elxu_mbox.c.

int mbox_fw_reset_pt ( elxu_device_t *  device,
int  dd 
)

Definition at line 2625 of file elxu_mbox.c.

int mbox_get_active_profile_pt ( elxu_device_t *  device,
char *  result,
int  result_len 
)

Definition at line 2844 of file elxu_mbox.c.

int mbox_get_connection_info ( elxu_device_t *  device,
uint32_t  connectionHandle 
)

Get connection info.

Parameters
devicedevice descriptor
connectionthe handle of the connection for which info is requested

Only supported on Skyhawk

Returns
0 if successful, a negative error code for failure

Definition at line 1776 of file elxu_mbox.c.

int mbox_get_dport_stats ( elxu_device_t *  device)

Issue Get dport stats mailbox command Create a GET_DPORT_STAT mailbox command.

Returns
return zero for success, negative error code for error

Definition at line 408 of file elxu_mbox.c.

char* mbox_get_linkcfg_pt ( elxu_device_t *  device)

Get Link configuration.

Description
Get Link configuration information via passthrough driver
Parameters
devicedevice descriptor
Returns
0 if successful, a negative error code for failure

Definition at line 2086 of file elxu_mbox.c.

void mbox_get_mac_pt ( elxu_device_t *  device,
uint8_t *  mac_addr 
)

Definition at line 950 of file elxu_mbox.c.

int mbox_get_profile_list_pt ( elxu_device_t *  device,
char *  result,
int  result_len 
)

Definition at line 2771 of file elxu_mbox.c.

int mbox_get_serialnum_pt ( elxu_device_t *  device,
char *  serial_num,
int  serial_num_size 
)

Definition at line 1053 of file elxu_mbox.c.

void mbox_get_wwn_pt ( int  fd,
uint8_t *  wwnn,
uint8_t *  wwpn 
)

Definition at line 1029 of file elxu_mbox.c.

int mbox_manage_fat ( elxu_device_t *  device,
uint32_t  fat_operation,
uint32_t  read_log_offset,
void *  buffer,
uint32_t  bufferLength 
)

Issue COMMON_MANAGE_FAT mailbox commands.

This function issues Manage FAT mailbox commands. There are four supported operations:

FAT_OPERATION_RETRIEVE read the FAT contents FAT_OPERATION_QUERY return the length of the FAT (may be zero) FAT_OPERATION_CLEAR clear the FAT FAT_OPERATION_TRIGGER trigger a UE that will append to FAT

Parameters
devicedevice descriptor
fat_oprationrequested FAT operation
read_log_offsetread offset (for FAT_OPERATION_RETRIEVE)
bufferread buffer (for FAT_OPERATION_RETRIEVE)
bufferLengthread buffer length in bytes (for FAT_OPERATION_RETRIEVE)
Returns
number of bytes read for FAT_OPERATION_RETRIEVE, or negative error code
length of FAT for FAT_OPERATION_QUERY, or negative error code
0, or negative error code for FAT_OPERATION_CLEAR, FAT_OPERATION_TRIGGER

Definition at line 1510 of file elxu_mbox.c.

int mbox_query_dynamic_dport_status ( elxu_device_t *  device)

Definition at line 369 of file elxu_mbox.c.

int mbox_read_flashrom ( elxu_device_t *  device,
uint32_t  opcode,
uint32_t  optype,
uint32_t  offset,
void *  outbuf,
uint32_t  outbufLength 
)

Issue read flashrom mailbox command.

Create a SLI_CONFIG Read Flashrom mailbox command

Parameters
devicedevice descriptor
opcodeREAD/WRITE_FLASHROM opcode value
optypeREAD/WRITE_FLASHROM optype value
optypeREAD/WRITE_FLASHROM offset value
outbufoutput buffer
outbufLengthlength in bytes of output buffer
Returns
return zero for success, negative error code for error

Definition at line 1339 of file elxu_mbox.c.

int mbox_read_link_status ( elxu_device_t *  device,
int  clof,
int  clrc 
)

Issue read link status mailbox command.

Create a READ_LNK_STAT mailbox command

Parameters
devicedevice descriptor
clofclear overflow flag
clrcclear all counters floag
Returns
return zero for success, negative error code for error

Definition at line 666 of file elxu_mbox.c.

int mbox_read_rev ( elxu_device_t *  device)

Issue read rev mailbox command.

Create a READ_REV mailbox command

Parameters
devicedevice descriptor
Returns
return zero for success, negative error code for error

Definition at line 194 of file elxu_mbox.c.

int mbox_read_status ( elxu_device_t *  device,
uint32_t  clear_counter 
)

Issue read status mailbox command.

Create a READ_STATUS mailbox command

Parameters
devicedevice descriptor
clear_counterclear counter flag
Returns
return zero for success, negative error code for error

Definition at line 763 of file elxu_mbox.c.

int mbox_set_active_profile_pt ( elxu_device_t *  device,
char *  new_profile_id 
)

Definition at line 2940 of file elxu_mbox.c.

int mbox_set_dynamic_dport ( elxu_device_t *  device,
char *  state 
)

Definition at line 385 of file elxu_mbox.c.

int mbox_set_linkcfg_pt ( elxu_device_t *  device,
char *  config 
)

Set Link configuration.

Description
Sends a set_linkcfg command via passthrough driver
Parameters
devicedevice descriptor
confignew link configuration string
Returns
0 if successful, a negative error code for failure

Definition at line 2306 of file elxu_mbox.c.

int mbox_set_nv_mac_pt ( elxu_device_t *  device,
int *  macaddr 
)

Definition at line 1098 of file elxu_mbox.c.

int mbox_set_nv_wwn_pt ( elxu_device_t *  device,
char *  wwpn_p,
char *  wwnn_p 
)

Issue a set non-volatile WWNN/WWPN.

Create a WRITE NVPARAMS mailbox command

Parameters
devicedevice descriptor
wwnworld-wide name
nameWWNN/WWPN flag to set
Returns
return zero for success, negative error code for error

Definition at line 1276 of file elxu_mbox.c.

int mbox_sli4_init_pt ( elxu_device_t *  device)

Definition at line 2738 of file elxu_mbox.c.

int mbox_soft_assign_mac ( elxu_device_t *  device,
int *  macaddr 
)

Soft assign MAC.

Definition at line 939 of file elxu_mbox.c.

int mbox_tcp_parameters ( elxu_device_t *  device,
uint32_t  request_flags,
uint32_t  ackFrequency,
uint32_t  delayedAckTimerValue 
)

Issue the Set TCP Parameters mbox command.

Parameters
devicedevice descriptor
request_flagsflags indicating which values should be updated
ackFrequencyACK frequency
delayedAckTimerValuedelayed ACK timer value, in milliseconds
Returns
0 if successful, a negative error code for failure

Definition at line 1663 of file elxu_mbox.c.

int mbox_write_flashrom ( elxu_device_t *  device,
uint32_t  opcode,
uint32_t  optype,
uint32_t  offset,
void *  inbuf,
uint32_t  inbufLength 
)

Issue write flashrom mailbox command.

Parameters
devicedevice descriptor
opcodeREAD/WRITE_FLASHROM opcode value
optypeREAD/WRITE_FLASHROM optype value
optypeREAD/WRITE_FLASHROM offset value
inbufinput buffer
inbufLengthlength in bytes of input buffer
Returns
return zero for success, negative error code for error

Definition at line 1421 of file elxu_mbox.c.

int remove_vport ( elxu_device_t *  device_p,
uint64_t  wwnn,
uint64_t  wwpn,
int  targetFlag,
int  initiatorFlag 
)

Definition at line 2339 of file elxu_mbox.c.