diff options
Diffstat (limited to 'drivers/staging/ced1401/use1401.h')
-rw-r--r-- | drivers/staging/ced1401/use1401.h | 201 |
1 files changed, 101 insertions, 100 deletions
diff --git a/drivers/staging/ced1401/use1401.h b/drivers/staging/ced1401/use1401.h index 86294e21db0..b7997c9835c 100644 --- a/drivers/staging/ced1401/use1401.h +++ b/drivers/staging/ced1401/use1401.h @@ -11,16 +11,16 @@ #define __USE1401_H__ #include "machine.h" -// Some definitions to make things compatible. If you want to use Use1401 directly -// from a Windows program you should define U14_NOT_DLL, in which case you also -// MUST make sure that your application startup code calls U14InitLib(). -// DLL_USE1401 is defined when you are building the Use1401 dll, not otherwise. +/* Some definitions to make things compatible. If you want to use Use1401 directly */ +/* from a Windows program you should define U14_NOT_DLL, in which case you also */ +/* MUST make sure that your application startup code calls U14InitLib(). */ +/* DLL_USE1401 is defined when you are building the Use1401 dll, not otherwise. */ #ifdef _IS_WINDOWS_ #ifndef U14_NOT_DLL #ifdef DLL_USE1401 -#define U14API(retType) retType DllExport __stdcall +#define U14API(retType) (retType DllExport __stdcall) #else -#define U14API(retType) retType DllImport __stdcall +#define U14API(retType) (retType DllImport __stdcall) #endif #endif @@ -36,7 +36,7 @@ #ifdef _QT #ifndef U14_NOT_DLL #undef U14API -#define U14API(retType) retType __declspec(dllimport) __stdcall +#define U14API(retType) (retType __declspec(dllimport) __stdcall) #endif #undef U14LONG #define U14LONG int @@ -50,20 +50,20 @@ #define U14LONG long #endif -/// Error codes: We need them here as user space can see them. -#define U14ERR_NOERROR 0 // no problems +/* Error codes: We need them here as user space can see them. */ +#define U14ERR_NOERROR 0 /* no problems */ -/// Device error codes, but these don't need to be extended - a succession is assumed -#define U14ERR_STD 4 // standard 1401 connected -#define U14ERR_U1401 5 // u1401 connected -#define U14ERR_PLUS 6 // 1401 plus connected -#define U14ERR_POWER 7 // Power1401 connected -#define U14ERR_U14012 8 // u1401 mkII connected +/* Device error codes, but these don't need to be extended - a succession is assumed */ +#define U14ERR_STD 4 /* standard 1401 connected */ +#define U14ERR_U1401 5 /* u1401 connected */ +#define U14ERR_PLUS 6 /* 1401 plus connected */ +#define U14ERR_POWER 7 /* Power1401 connected */ +#define U14ERR_U14012 8 /* u1401 mkII connected */ #define U14ERR_POWER2 9 #define U14ERR_U14013 10 #define U14ERR_POWER3 11 -/// NBNB Error numbers need shifting as some linux error codes start at 512 +/* NBNB Error numbers need shifting as some linux error codes start at 512 */ #define U14ERR(n) (n+U14ERRBASE) #define U14ERR_OFF U14ERR(0) /* 1401 there but switched off */ #define U14ERR_NC U14ERR(-1) /* 1401 not connected */ @@ -113,7 +113,7 @@ #define U14ERR_DRIVCOMMS U14ERR(-110) /* failed talking to driver */ #define U14ERR_OUTOFMEMORY U14ERR(-111) /* needed memory and couldnt get it*/ -/// 1401 type codes. +/* / 1401 type codes. */ #define U14TYPE1401 0 /* standard 1401 */ #define U14TYPEPLUS 1 /* 1401 plus */ #define U14TYPEU1401 2 /* u1401 */ @@ -124,9 +124,9 @@ #define U14TYPEPOWER3 7 /* power1401-3 */ #define U14TYPEUNKNOWN -1 /* dont know */ -/// Transfer flags to allow driver capabilities to be interrogated +/* Transfer flags to allow driver capabilities to be interrogated */ -/// Constants for transfer flags +/* Constants for transfer flags */ #define U14TF_USEDMA 1 /* Transfer flag for use DMA */ #define U14TF_MULTIA 2 /* Transfer flag for multi areas */ #define U14TF_FIFO 4 /* for FIFO interface card */ @@ -138,18 +138,18 @@ #define U14TF_DIAG 256 /* Diagnostics/debug functions */ #define U14TF_CIRC14 512 /* Circular-mode to 1401 */ -/// Definitions of element sizes for DMA transfers - to allow byte-swapping +/* Definitions of element sizes for DMA transfers - to allow byte-swapping */ #define ESZBYTES 0 /* BYTE element size value */ -#define ESZWORDS 1 /* WORD element size value */ +#define ESZWORDS 1 /* unsigned short element size value */ #define ESZLONGS 2 /* long element size value */ #define ESZUNKNOWN 0 /* unknown element size value */ -/// These define required access types for the debug/diagnostics function +/* These define required access types for the debug/diagnostics function */ #define BYTE_SIZE 1 /* 8-bit access */ #define WORD_SIZE 2 /* 16-bit access */ #define LONG_SIZE 3 /* 32-bit access */ -/// Stuff used by U14_GetTransfer +/* Stuff used by U14_GetTransfer */ #define GET_TX_MAXENTRIES 257 /* (max length / page size + 1) */ #ifdef _IS_WINDOWS_ @@ -157,19 +157,19 @@ typedef struct /* used for U14_GetTransfer results */ { /* Info on a single mapped block */ - U14LONG physical; - U14LONG size; + U14LONG physical; + U14LONG size; } TXENTRY; typedef struct TGetTxBlock /* used for U14_GetTransfer results */ { /* matches structure in VXD */ - U14LONG size; - U14LONG linear; - short seg; - short reserved; - short avail; /* number of available entries */ - short used; /* number of used entries */ - TXENTRY entries[GET_TX_MAXENTRIES]; /* Array of mapped block info */ + U14LONG size; + U14LONG linear; + short seg; + short reserved; + short avail; /* number of available entries */ + short used; /* number of used entries */ + TXENTRY entries[GET_TX_MAXENTRIES]; /* Array of mapped block info */ } TGET_TX_BLOCK; typedef TGET_TX_BLOCK *LPGET_TX_BLOCK; @@ -180,19 +180,19 @@ typedef TGET_TX_BLOCK *LPGET_TX_BLOCK; #ifdef LINUX typedef struct /* used for U14_GetTransfer results */ { /* Info on a single mapped block */ - long long physical; - long size; + long long physical; + long size; } TXENTRY; typedef struct TGetTxBlock /* used for U14_GetTransfer results */ { /* matches structure in VXD */ - long long linear; /* linear address */ - long size; /* total size of the mapped area, holds id when called */ - short seg; /* segment of the address for Win16 */ - short reserved; - short avail; /* number of available entries */ - short used; /* number of used entries */ - TXENTRY entries[GET_TX_MAXENTRIES]; /* Array of mapped block info */ + long long linear; /* linear address */ + long size; /* total size of the mapped area, holds id when called */ + short seg; /* segment of the address for Win16 */ + short reserved; + short avail; /* number of available entries */ + short used; /* number of used entries */ + TXENTRY entries[GET_TX_MAXENTRIES]; /* Array of mapped block info */ } TGET_TX_BLOCK; #endif @@ -200,84 +200,84 @@ typedef struct TGetTxBlock /* used for U14_GetTransfer results */ extern "C" { #endif -U14API(int) U14WhenToTimeOut(short hand); // when to timeout in ms -U14API(short) U14PassedTime(int iTime); // non-zero if iTime passed +U14API(int) U14WhenToTimeOut(short hand); /* when to timeout in ms */ +U14API(short) U14PassedTime(int iTime); /* non-zero if iTime passed */ -U14API(short) U14LastErrCode(short hand); +U14API(short) U14LastErrCode(short hand); -U14API(short) U14Open1401(short n1401); -U14API(short) U14Close1401(short hand); -U14API(short) U14Reset1401(short hand); -U14API(short) U14ForceReset(short hand); -U14API(short) U14TypeOf1401(short hand); -U14API(short) U14NameOf1401(short hand, char* pBuf, WORD wMax); +U14API(short) U14Open1401(short n1401); +U14API(short) U14Close1401(short hand); +U14API(short) U14Reset1401(short hand); +U14API(short) U14ForceReset(short hand); +U14API(short) U14TypeOf1401(short hand); +U14API(short) U14NameOf1401(short hand, char *pBuf, unsigned short wMax); -U14API(short) U14Stat1401(short hand); -U14API(short) U14CharCount(short hand); -U14API(short) U14LineCount(short hand); +U14API(short) U14Stat1401(short hand); +U14API(short) U14CharCount(short hand); +U14API(short) U14LineCount(short hand); -U14API(short) U14SendString(short hand, const char* pString); -U14API(short) U14GetString(short hand, char* pBuffer, WORD wMaxLen); -U14API(short) U14SendChar(short hand, char cChar); -U14API(short) U14GetChar(short hand, char* pcChar); +U14API(short) U14SendString(short hand, const char *pString); +U14API(short) U14GetString(short hand, char *pBuffer, unsigned short wMaxLen); +U14API(short) U14SendChar(short hand, char cChar); +U14API(short) U14GetChar(short hand, char *pcChar); -U14API(short) U14LdCmd(short hand, const char* command); -U14API(DWORD) U14Ld(short hand, const char* vl, const char* str); +U14API(short) U14LdCmd(short hand, const char *command); +U14API(unsigned int) U14Ld(short hand, const char *vl, const char *str); -U14API(short) U14SetTransArea(short hand, WORD wArea, void *pvBuff, - DWORD dwLength, short eSz); -U14API(short) U14UnSetTransfer(short hand, WORD wArea); -U14API(short) U14SetTransferEvent(short hand, WORD wArea, BOOL bEvent, - BOOL bToHost, DWORD dwStart, DWORD dwLength); -U14API(int) U14TestTransferEvent(short hand, WORD wArea); -U14API(int) U14WaitTransferEvent(short hand, WORD wArea, int msTimeOut); -U14API(short) U14GetTransfer(short hand, TGET_TX_BLOCK *pTransBlock); +U14API(short) U14SetTransArea(short hand, unsigned short wArea, void *pvBuff, + unsigned int dwLength, short eSz); +U14API(short) U14UnSetTransfer(short hand, unsigned short wArea); +U14API(short) U14SetTransferEvent(short hand, unsigned short wArea, BOOL bEvent, + BOOL bToHost, unsigned int dwStart, unsigned int dwLength); +U14API(int) U14TestTransferEvent(short hand, unsigned short wArea); +U14API(int) U14WaitTransferEvent(short hand, unsigned short wArea, int msTimeOut); +U14API(short) U14GetTransfer(short hand, TGET_TX_BLOCK *pTransBlock); -U14API(short) U14ToHost(short hand, char* pAddrHost,DWORD dwSize,DWORD dw1401, - short eSz); -U14API(short) U14To1401(short hand, const char* pAddrHost,DWORD dwSize,DWORD dw1401, - short eSz); +U14API(short) U14ToHost(short hand, char *pAddrHost, unsigned int dwSize, unsigned int dw1401, + short eSz); +U14API(short) U14To1401(short hand, const char *pAddrHost, unsigned int dwSize, unsigned int dw1401, + short eSz); -U14API(short) U14SetCircular(short hand, WORD wArea, BOOL bToHost, void *pvBuff, - DWORD dwLength); +U14API(short) U14SetCircular(short hand, unsigned short wArea, BOOL bToHost, void *pvBuff, + unsigned int dwLength); -U14API(int) U14GetCircBlk(short hand, WORD wArea, DWORD *pdwOffs); -U14API(int) U14FreeCircBlk(short hand, WORD wArea, DWORD dwOffs, DWORD dwSize, - DWORD *pdwOffs); +U14API(int) U14GetCircBlk(short hand, unsigned short wArea, unsigned int *pdwOffs); +U14API(int) U14FreeCircBlk(short hand, unsigned short wArea, unsigned int dwOffs, unsigned int dwSize, + unsigned int *pdwOffs); -U14API(short) U14StrToLongs(const char* pszBuff, U14LONG *palNums, short sMaxLongs); -U14API(short) U14LongsFrom1401(short hand, U14LONG *palBuff, short sMaxLongs); +U14API(short) U14StrToLongs(const char *pszBuff, U14LONG *palNums, short sMaxLongs); +U14API(short) U14LongsFrom1401(short hand, U14LONG *palBuff, short sMaxLongs); U14API(void) U14SetTimeout(short hand, int lTimeout); U14API(int) U14GetTimeout(short hand); -U14API(short) U14OutBufSpace(short hand); +U14API(short) U14OutBufSpace(short hand); U14API(int) U14BaseAddr1401(short hand); U14API(int) U14DriverVersion(short hand); U14API(int) U14DriverType(short hand); -U14API(short) U14DriverName(short hand, char* pBuf, WORD wMax); -U14API(short) U14GetUserMemorySize(short hand, DWORD *pMemorySize); -U14API(short) U14KillIO1401(short hand); - -U14API(short) U14BlkTransState(short hand); -U14API(short) U14StateOf1401(short hand); - -U14API(short) U14Grab1401(short hand); -U14API(short) U14Free1401(short hand); -U14API(short) U14Peek1401(short hand, DWORD dwAddr, int nSize, int nRepeats); -U14API(short) U14Poke1401(short hand, DWORD dwAddr, DWORD dwValue, int nSize, int nRepeats); -U14API(short) U14Ramp1401(short hand, DWORD dwAddr, DWORD dwDef, DWORD dwEnable, int nSize, int nRepeats); -U14API(short) U14RampAddr(short hand, DWORD dwDef, DWORD dwEnable, int nSize, int nRepeats); -U14API(short) U14StopDebugLoop(short hand); -U14API(short) U14GetDebugData(short hand, U14LONG *plValue); - -U14API(short) U14StartSelfTest(short hand); -U14API(short) U14CheckSelfTest(short hand, U14LONG *pData); -U14API(short) U14TransferFlags(short hand); -U14API(void) U14GetErrorString(short nErr, char* pStr, WORD wMax); +U14API(short) U14DriverName(short hand, char *pBuf, unsigned short wMax); +U14API(short) U14GetUserMemorySize(short hand, unsigned int *pMemorySize); +U14API(short) U14KillIO1401(short hand); + +U14API(short) U14BlkTransState(short hand); +U14API(short) U14StateOf1401(short hand); + +U14API(short) U14Grab1401(short hand); +U14API(short) U14Free1401(short hand); +U14API(short) U14Peek1401(short hand, unsigned int dwAddr, int nSize, int nRepeats); +U14API(short) U14Poke1401(short hand, unsigned int dwAddr, unsigned int dwValue, int nSize, int nRepeats); +U14API(short) U14Ramp1401(short hand, unsigned int dwAddr, unsigned int dwDef, unsigned int dwEnable, int nSize, int nRepeats); +U14API(short) U14RampAddr(short hand, unsigned int dwDef, unsigned int dwEnable, int nSize, int nRepeats); +U14API(short) U14StopDebugLoop(short hand); +U14API(short) U14GetDebugData(short hand, U14LONG *plValue); + +U14API(short) U14StartSelfTest(short hand); +U14API(short) U14CheckSelfTest(short hand, U14LONG *pData); +U14API(short) U14TransferFlags(short hand); +U14API(void) U14GetErrorString(short nErr, char *pStr, unsigned short wMax); U14API(int) U14MonitorRev(short hand); U14API(void) U14CloseAll(void); -U14API(short) U14WorkingSet(DWORD dwMinKb, DWORD dwMaxKb); +U14API(short) U14WorkingSet(unsigned int dwMinKb, unsigned int dwMaxKb); U14API(int) U14InitLib(void); #ifdef __cplusplus @@ -285,3 +285,4 @@ U14API(int) U14InitLib(void); #endif #endif /* End of ifndef __USE1401_H__ */ + |