Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ecdtest.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/utsname.h>
#include <ecd_api.h>

Go to the source code of this file.

Data Structures

struct  ecdtest_context_t
 user provided context passed to the helper functions More...
 
struct  ocs_ioctl_driver_info_t
 DRIVER_INFO ioctl structure. More...
 
struct  ocs_ioctl_ecd_helper_t
 OCS_IOCTL_CMD_ECD_HELPER ioctl structure. More...
 

Macros

#define DEFAULT_OFNAME   "out.core"
 
#define DEVNAME_TEMPLATE   "/dev/ocs_%d"
 
#define OCS_IOCTL_CMD_BASE   'o'
 
#define OCS_IOCTL_CMD_DRIVER_INFO   _IOWR(OCS_IOCTL_CMD_BASE, 4, ocs_ioctl_driver_info_t)
 
#define OCS_IOCTL_CMD_ECD_HELPER   _IOWR(OCS_IOCTL_CMD_BASE, 5, ocs_ioctl_ecd_helper_t)
 
#define ARRAY_SIZE(x)   (sizeof(x) / sizeof(x[0]))
 
#define helper_trace(fmt,...)
 

Enumerations

enum  ocs_ecd_helper_cmd_t {
  OCS_ECD_HELPER_CFG_READ8, OCS_ECD_HELPER_CFG_READ16, OCS_ECD_HELPER_CFG_READ32, OCS_ECD_HELPER_CFG_WRITE8,
  OCS_ECD_HELPER_CFG_WRITE16, OCS_ECD_HELPER_CFG_WRITE32, OCS_ECD_HELPER_BAR_READ8, OCS_ECD_HELPER_BAR_READ16,
  OCS_ECD_HELPER_BAR_READ32, OCS_ECD_HELPER_BAR_WRITE8, OCS_ECD_HELPER_BAR_WRITE16, OCS_ECD_HELPER_BAR_WRITE32,
  OCS_ECD_HELPER_CFG_READ8, OCS_ECD_HELPER_CFG_READ16, OCS_ECD_HELPER_CFG_READ32, OCS_ECD_HELPER_CFG_WRITE8,
  OCS_ECD_HELPER_CFG_WRITE16, OCS_ECD_HELPER_CFG_WRITE32, OCS_ECD_HELPER_BAR_READ8, OCS_ECD_HELPER_BAR_READ16,
  OCS_ECD_HELPER_BAR_READ32, OCS_ECD_HELPER_BAR_WRITE8, OCS_ECD_HELPER_BAR_WRITE16, OCS_ECD_HELPER_BAR_WRITE32
}
 

Functions

static void usage (void)
 
int main (int argc, char *argv[])
 
void ecd_log (char *fmt,...)
 
void os_assert (char *message, uint32_t Line, char *File)
 
void os_stall (void *ctx, uint32_t usecTime)
 
void os_cfg_read8 (void *ctx, uint32_t offset, uint32_t *pdata)
 
void os_cfg_read16 (void *ctx, uint32_t offset, uint32_t *pdata)
 
void os_cfg_read32 (void *ctx, uint32_t offset, uint32_t *pdata)
 
void os_cfg_write8 (void *ctx, uint32_t offset, uint32_t data)
 
void os_cfg_write16 (void *ctx, uint32_t offset, uint32_t data)
 
void os_cfg_write32 (void *ctx, uint32_t offset, uint32_t data)
 
void os_bar_read8 (void *ctx, uint32_t bar, uint32_t offset, uint32_t *pdata)
 
void os_bar_read16 (void *ctx, uint32_t bar, uint32_t offset, uint32_t *pdata)
 
void os_bar_read32 (void *ctx, uint32_t bar, uint32_t offset, uint32_t *pdata)
 
void os_bar_write8 (void *ctx, uint32_t bar, uint32_t offset, uint32_t data)
 
void os_bar_write16 (void *ctx, uint32_t bar, uint32_t offset, uint32_t data)
 
void os_bar_write32 (void *ctx, uint32_t bar, uint32_t offset, uint32_t data)
 
void * os_malloc (void *ctx, uint32_t size)
 
void os_free (void *ctx, void *ptr)
 

Variables

static int enable_helper_trace = 0
 

Macro Details

#define ARRAY_SIZE (   x)    (sizeof(x) / sizeof(x[0]))

Definition at line 113 of file ecdtest.c.

#define DEFAULT_OFNAME   "out.core"

Definition at line 57 of file ecdtest.c.

#define DEVNAME_TEMPLATE   "/dev/ocs_%d"

Definition at line 58 of file ecdtest.c.

#define helper_trace (   fmt,
  ... 
)
Value:
do { \
printf(fmt, ##__VA_ARGS__); \
} while(0)
static int enable_helper_trace
Definition: ecdtest.c:116

Definition at line 118 of file ecdtest.c.

#define OCS_IOCTL_CMD_BASE   'o'

Definition at line 108 of file ecdtest.c.

#define OCS_IOCTL_CMD_DRIVER_INFO   _IOWR(OCS_IOCTL_CMD_BASE, 4, ocs_ioctl_driver_info_t)

Definition at line 109 of file ecdtest.c.

#define OCS_IOCTL_CMD_ECD_HELPER   _IOWR(OCS_IOCTL_CMD_BASE, 5, ocs_ioctl_ecd_helper_t)

Definition at line 110 of file ecdtest.c.

Enumeration Details

Enumerator
OCS_ECD_HELPER_CFG_READ8 
OCS_ECD_HELPER_CFG_READ16 
OCS_ECD_HELPER_CFG_READ32 
OCS_ECD_HELPER_CFG_WRITE8 
OCS_ECD_HELPER_CFG_WRITE16 
OCS_ECD_HELPER_CFG_WRITE32 
OCS_ECD_HELPER_BAR_READ8 
OCS_ECD_HELPER_BAR_READ16 
OCS_ECD_HELPER_BAR_READ32 
OCS_ECD_HELPER_BAR_WRITE8 
OCS_ECD_HELPER_BAR_WRITE16 
OCS_ECD_HELPER_BAR_WRITE32 
OCS_ECD_HELPER_CFG_READ8 
OCS_ECD_HELPER_CFG_READ16 
OCS_ECD_HELPER_CFG_READ32 
OCS_ECD_HELPER_CFG_WRITE8 
OCS_ECD_HELPER_CFG_WRITE16 
OCS_ECD_HELPER_CFG_WRITE32 
OCS_ECD_HELPER_BAR_READ8 
OCS_ECD_HELPER_BAR_READ16 
OCS_ECD_HELPER_BAR_READ32 
OCS_ECD_HELPER_BAR_WRITE8 
OCS_ECD_HELPER_BAR_WRITE16 
OCS_ECD_HELPER_BAR_WRITE32 

Definition at line 85 of file ecdtest.c.

Function Details

void ecd_log ( char *  fmt,
  ... 
)

Definition at line 278 of file ecdtest.c.

int main ( int  argc,
char *  argv[] 
)

Definition at line 126 of file ecdtest.c.

void os_assert ( char *  message,
uint32_t  Line,
char *  File 
)

Definition at line 286 of file ecdtest.c.

void os_bar_read16 ( void *  ctx,
uint32_t  bar,
uint32_t  offset,
uint32_t *  pdata 
)

Definition at line 405 of file ecdtest.c.

void os_bar_read32 ( void *  ctx,
uint32_t  bar,
uint32_t  offset,
uint32_t *  pdata 
)

Definition at line 422 of file ecdtest.c.

void os_bar_read8 ( void *  ctx,
uint32_t  bar,
uint32_t  offset,
uint32_t *  pdata 
)

Definition at line 388 of file ecdtest.c.

void os_bar_write16 ( void *  ctx,
uint32_t  bar,
uint32_t  offset,
uint32_t  data 
)

Definition at line 454 of file ecdtest.c.

void os_bar_write32 ( void *  ctx,
uint32_t  bar,
uint32_t  offset,
uint32_t  data 
)

Definition at line 470 of file ecdtest.c.

void os_bar_write8 ( void *  ctx,
uint32_t  bar,
uint32_t  offset,
uint32_t  data 
)

Definition at line 439 of file ecdtest.c.

void os_cfg_read16 ( void *  ctx,
uint32_t  offset,
uint32_t *  pdata 
)

Definition at line 314 of file ecdtest.c.

void os_cfg_read32 ( void *  ctx,
uint32_t  offset,
uint32_t *  pdata 
)

Definition at line 330 of file ecdtest.c.

void os_cfg_read8 ( void *  ctx,
uint32_t  offset,
uint32_t *  pdata 
)

Definition at line 297 of file ecdtest.c.

void os_cfg_write16 ( void *  ctx,
uint32_t  offset,
uint32_t  data 
)

Definition at line 360 of file ecdtest.c.

void os_cfg_write32 ( void *  ctx,
uint32_t  offset,
uint32_t  data 
)

Definition at line 374 of file ecdtest.c.

void os_cfg_write8 ( void *  ctx,
uint32_t  offset,
uint32_t  data 
)

Definition at line 346 of file ecdtest.c.

void os_free ( void *  ctx,
void *  ptr 
)

Definition at line 490 of file ecdtest.c.

void* os_malloc ( void *  ctx,
uint32_t  size 
)

Definition at line 486 of file ecdtest.c.

void os_stall ( void *  ctx,
uint32_t  usecTime 
)

Definition at line 292 of file ecdtest.c.

static void usage ( void  )
static

Variable Details

int enable_helper_trace = 0
static

Definition at line 116 of file ecdtest.c.