| 1 | /**************************************************************************** |
|---|
| 2 | * Copyright (c) 2006 DST Technologies Inc. All Rights Reserved. |
|---|
| 3 | * |
|---|
| 4 | * Module: DSTMODULE |
|---|
| 5 | * |
|---|
| 6 | * Description: This file contains module interface definitions that are |
|---|
| 7 | * shared between kernel and user mode |
|---|
| 8 | * |
|---|
| 9 | * Notes: |
|---|
| 10 | * |
|---|
| 11 | ***************************************************************************/ |
|---|
| 12 | #ifndef _DSTMODULE_H |
|---|
| 13 | #define _DSTMODULE_H |
|---|
| 14 | |
|---|
| 15 | /*========================== |
|---|
| 16 | * OS include |
|---|
| 17 | *=========================*/ |
|---|
| 18 | #include "dsthallocal.h" |
|---|
| 19 | #include "oem_opt.h" |
|---|
| 20 | |
|---|
| 21 | #define DSTMOD_VERSION_NUMBER 0x0010 |
|---|
| 22 | |
|---|
| 23 | /*=========================================================================== |
|---|
| 24 | * Number of devices that are supported |
|---|
| 25 | *===========================================================================*/ |
|---|
| 26 | #define MAX_DEVICES 1 |
|---|
| 27 | #define DST_DEV_NAME "dstmod" |
|---|
| 28 | |
|---|
| 29 | /*=========================================================================== |
|---|
| 30 | * DST Module Version String |
|---|
| 31 | *===========================================================================*/ |
|---|
| 32 | #define DSTMOD_VERSION_STRING "D1.00" |
|---|
| 33 | |
|---|
| 34 | /*=========================================================================== |
|---|
| 35 | * DST_IOC_MAGIC is an arbitrary IOCTL magic |
|---|
| 36 | * number that was pulled out of thin air. |
|---|
| 37 | *===========================================================================*/ |
|---|
| 38 | #define DST_IOC_MAGIC 0xD7 |
|---|
| 39 | |
|---|
| 40 | #define DSTHWIOC_TIME_STAMP _IOWR (DST_IOC_MAGIC, 7, DS_S64 *) |
|---|
| 41 | #define DSTHWIOC_SET_DBG_LEVEL _IOR (DST_IOC_MAGIC, 22, DST_SET_DBG_LEVEL_MESSAGE_PARAMS *) |
|---|
| 42 | #define DSTHWIOC_SEM_OP _IOR (DST_IOC_MAGIC, 25, DS_U32) |
|---|
| 43 | #define DSTHWIOC_EVENT_OP _IOR (DST_IOC_MAGIC, 26, DS_U32) |
|---|
| 44 | #define DSTHWIOC_ATOMIC_REG_ACCESS _IOWR (DST_IOC_MAGIC, 27, DS_U32) |
|---|
| 45 | #define DSTHWIOC_GET_VERSION _IOR (DST_IOC_MAGIC, 39, DS_U32) |
|---|
| 46 | #define DSTHWIOC_GET_LOADER_VER _IOR (DST_IOC_MAGIC, 40, DS_U32) |
|---|
| 47 | #define DSTHWIOC_IRQ_DISABLE _IOWR (DST_IOC_MAGIC, 67, DS_U32) |
|---|
| 48 | #define DSTHWIOC_IRQ_ENABLE _IOWR (DST_IOC_MAGIC, 68, DS_U32) |
|---|
| 49 | #define DSTHWIOC_IRQ_RESTORE _IOWR (DST_IOC_MAGIC, 69, DS_U32) |
|---|
| 50 | |
|---|
| 51 | /*=========================================================================== |
|---|
| 52 | * Types and defines PCI bus |
|---|
| 53 | *==========================================================================*/ |
|---|
| 54 | typedef struct |
|---|
| 55 | { |
|---|
| 56 | DS_U32 Offset; /* Offset in PCI config Space */ |
|---|
| 57 | DS_U32 Data; /* Data to r/w */ |
|---|
| 58 | DS_U32 Size; /* R/W size. 1, 2 or 4. */ |
|---|
| 59 | DS_U32 ChipIndex; /* Required chip index */ |
|---|
| 60 | DS_U32 DevId; /* Device PCI ID */ |
|---|
| 61 | } PCI_DATA; |
|---|
| 62 | |
|---|
| 63 | /*=========================================================================== |
|---|
| 64 | * Types and defines for semaphores and events library |
|---|
| 65 | *==========================================================================*/ |
|---|
| 66 | typedef enum |
|---|
| 67 | { |
|---|
| 68 | OBJ_OPCODE_CREATE = 0, |
|---|
| 69 | OBJ_OPCODE_DELETE, |
|---|
| 70 | OBJ_OPCODE_LOCK, |
|---|
| 71 | OBJ_OPCODE_UNLOCK, |
|---|
| 72 | OBJ_OPCODE_WAIT, |
|---|
| 73 | OBJ_OPCODE_SET, |
|---|
| 74 | OBJ_OPCODE_RESET, |
|---|
| 75 | OBJ_OPCODE_INFO, |
|---|
| 76 | OBJ_OPCODE_READ, |
|---|
| 77 | OBJ_OPCODE_WRITE |
|---|
| 78 | }OBJ_OPCODE; |
|---|
| 79 | |
|---|
| 80 | typedef enum |
|---|
| 81 | { |
|---|
| 82 | OBJ_OK = 0, |
|---|
| 83 | OBJ_INVALID_OP, |
|---|
| 84 | OBJ_INVALID_ID, |
|---|
| 85 | OBJ_TIMEOUT, |
|---|
| 86 | OBJ_MAX_PROCS, |
|---|
| 87 | OBJ_MAX_OBJS, |
|---|
| 88 | OBJ_SIGNAL_RCV, |
|---|
| 89 | OBJ_BAD_COUNT, |
|---|
| 90 | OBJ_COUNT_MISMATCH |
|---|
| 91 | }OBJ_ERR_CODE; |
|---|
| 92 | |
|---|
| 93 | typedef struct |
|---|
| 94 | { |
|---|
| 95 | DS_U32 Opcode; |
|---|
| 96 | DS_U32 Prm1; |
|---|
| 97 | DS_U32 Prm2; |
|---|
| 98 | DS_U32 RetCode; |
|---|
| 99 | }OBJ_OPER; |
|---|
| 100 | |
|---|
| 101 | typedef struct _msg_set_dbg_level_params |
|---|
| 102 | { |
|---|
| 103 | DS_U32 qh; |
|---|
| 104 | DS_U32 level; |
|---|
| 105 | } DST_SET_DBG_LEVEL_MESSAGE_PARAMS; |
|---|
| 106 | |
|---|
| 107 | #endif /* _DSTMODULE_H */ |
|---|