Commit d9f8374b authored by Elena Ufimtseva's avatar Elena Ufimtseva Committed by Greg Kroah-Hartman

Staging: ced1401: Fixes white spaces and indentations.

Fixes white spaces and indentations warnings from checkpatch.
Signed-off-by: default avatarElena Ufimtseva <ufimtseva@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d1cc1b86
...@@ -77,20 +77,20 @@ ...@@ -77,20 +77,20 @@
#endif #endif
#if defined(LINUX) || defined(MAXOSX) #if defined(LINUX) || defined(MAXOSX)
#define FAR #define FAR
typedef int BOOL; /* To match Windows */ typedef int BOOL; /* To match Windows */
typedef char *LPSTR; typedef char *LPSTR;
typedef const char *LPCSTR; typedef const char *LPCSTR;
typedef unsigned short WORD; typedef unsigned short WORD;
typedef unsigned int DWORD; typedef unsigned int DWORD;
typedef unsigned char BYTE; typedef unsigned char BYTE;
typedef BYTE BOOLEAN; typedef BYTE BOOLEAN;
typedef unsigned char UCHAR; typedef unsigned char UCHAR;
#define __packed __attribute__((packed)) #define __packed __attribute__((packed))
typedef BYTE *LPBYTE; typedef BYTE *LPBYTE;
#define HIWORD(x) (WORD)(((x)>>16) & 0xffff) #define HIWORD(x) (WORD)(((x)>>16) & 0xffff)
#define LOWORD(x) (WORD)((x) & 0xffff) #define LOWORD(x) (WORD)((x) & 0xffff)
#endif #endif
#ifdef _IS_WINDOWS_ #ifdef _IS_WINDOWS_
...@@ -104,21 +104,20 @@ ...@@ -104,21 +104,20 @@
** a synonym. ** a synonym.
*/ */
#ifdef GNUC #ifdef GNUC
#define DllExport __attribute__((dllexport)) #define DllExport __attribute__((dllexport))
#define DllImport __attribute__((dllimport)) #define DllImport __attribute__((dllimport))
#endif #endif
#ifndef DllExport #ifndef DllExport
#ifdef _IS_WINDOWS_ #ifdef _IS_WINDOWS_
#define DllExport __declspec(dllexport) #define DllExport __declspec(dllexport)
#define DllImport __declspec(dllimport) #define DllImport __declspec(dllimport)
#else #else
#define DllExport #define DllExport
#define DllImport #define DllImport
#endif #endif
#endif /* _IS_WINDOWS_ */ #endif /* _IS_WINDOWS_ */
#ifndef TRUE #ifndef TRUE
#define TRUE 1 #define TRUE 1
#define FALSE 0 #define FALSE 0
......
...@@ -95,39 +95,39 @@ ...@@ -95,39 +95,39 @@
/* A structure holding information about a block of memory for use in circular transfers */ /* A structure holding information about a block of memory for use in circular transfers */
typedef struct circBlk typedef struct circBlk
{ {
volatile UINT dwOffset; /* Offset within area of block start */ volatile UINT dwOffset; /* Offset within area of block start */
volatile UINT dwSize; /* Size of the block, in bytes (0 = unused) */ volatile UINT dwSize; /* Size of the block, in bytes (0 = unused) */
} CIRCBLK; } CIRCBLK;
/* A structure holding all of the information about a transfer area - an area of */ /* A structure holding all of the information about a transfer area - an area of */
/* memory set up for use either as a source or destination in DMA transfers. */ /* memory set up for use either as a source or destination in DMA transfers. */
typedef struct transarea typedef struct transarea
{ {
void *lpvBuff; /* User address of xfer area saved for completeness */ void *lpvBuff; /* User address of xfer area saved for completeness */
UINT dwBaseOffset; /* offset to start of xfer area in first page */ UINT dwBaseOffset; /* offset to start of xfer area in first page */
UINT dwLength; /* Length of xfer area, in bytes */ UINT dwLength; /* Length of xfer area, in bytes */
struct page **pPages; /* Points at array of locked down pages */ struct page **pPages; /* Points at array of locked down pages */
int nPages; /* number of pages that are locked down */ int nPages; /* number of pages that are locked down */
bool bUsed; /* Is this structure in use? */ bool bUsed; /* Is this structure in use? */
bool bCircular; /* Is this area for circular transfers? */ bool bCircular; /* Is this area for circular transfers? */
bool bCircToHost; /* Flag for direction of circular transfer */ bool bCircToHost; /* Flag for direction of circular transfer */
bool bEventToHost; /* Set event on transfer to host? */ bool bEventToHost; /* Set event on transfer to host? */
int iWakeUp; /* Set 1 on event, cleared by TestEvent() */ int iWakeUp; /* Set 1 on event, cleared by TestEvent() */
UINT dwEventSt; /* Defines section within xfer area for... */ UINT dwEventSt; /* Defines section within xfer area for... */
UINT dwEventSz; /* ...notification by the event SZ is 0 if unset */ UINT dwEventSz; /* ...notification by the event SZ is 0 if unset */
CIRCBLK aBlocks[2]; /* Info on a pair of circular blocks */ CIRCBLK aBlocks[2]; /* Info on a pair of circular blocks */
wait_queue_head_t wqEvent; /* The wait queue for events in this area MUST BE LAST */ wait_queue_head_t wqEvent; /* The wait queue for events in this area MUST BE LAST */
} TRANSAREA; } TRANSAREA;
/* The DMADESC structure is used to hold information on the transfer in progress. It */ /* The DMADESC structure is used to hold information on the transfer in progress. It */
/* is set up by ReadDMAInfo, using information sent by the 1401 in an escape sequence. */ /* is set up by ReadDMAInfo, using information sent by the 1401 in an escape sequence. */
typedef struct dmadesc typedef struct dmadesc
{ {
unsigned short wTransType; /* transfer type as TM_xxx above */ unsigned short wTransType; /* transfer type as TM_xxx above */
unsigned short wIdent; /* identifier word */ unsigned short wIdent; /* identifier word */
unsigned int dwSize; /* bytes to transfer */ unsigned int dwSize; /* bytes to transfer */
unsigned int dwOffset; /* offset into transfer area for trans */ unsigned int dwOffset; /* offset into transfer area for trans */
bool bOutWard; /* true when data is going TO 1401 */ bool bOutWard; /* true when data is going TO 1401 */
} DMADESC; } DMADESC;
#define INBUF_SZ 256 /* input buffer size */ #define INBUF_SZ 256 /* input buffer size */
...@@ -138,69 +138,69 @@ typedef struct dmadesc ...@@ -138,69 +138,69 @@ typedef struct dmadesc
/* can to the Windows driver to help in our understanding of what is going on. */ /* can to the Windows driver to help in our understanding of what is going on. */
typedef struct _DEVICE_EXTENSION typedef struct _DEVICE_EXTENSION
{ {
char inputBuffer[INBUF_SZ]; /* The two buffers */ char inputBuffer[INBUF_SZ]; /* The two buffers */
char outputBuffer[OUTBUF_SZ]; /* accessed by the host functions */ char outputBuffer[OUTBUF_SZ]; /* accessed by the host functions */
volatile unsigned int dwNumInput; /* num of chars in input buffer */ volatile unsigned int dwNumInput; /* num of chars in input buffer */
volatile unsigned int dwInBuffGet; /* where to get from input buffer */ volatile unsigned int dwInBuffGet; /* where to get from input buffer */
volatile unsigned int dwInBuffPut; /* where to put into input buffer */ volatile unsigned int dwInBuffPut; /* where to put into input buffer */
volatile unsigned int dwNumOutput; /* num of chars in output buffer */ volatile unsigned int dwNumOutput; /* num of chars in output buffer */
volatile unsigned int dwOutBuffGet; /* where to get from output buffer*/ volatile unsigned int dwOutBuffGet; /* where to get from output buffer*/
volatile unsigned int dwOutBuffPut; /* where to put into output buffer*/ volatile unsigned int dwOutBuffPut; /* where to put into output buffer*/
volatile bool bSendCharsPending; /* Flag to indicate sendchar active */ volatile bool bSendCharsPending; /* Flag to indicate sendchar active */
volatile bool bReadCharsPending; /* Flag to indicate a read is primed */ volatile bool bReadCharsPending; /* Flag to indicate a read is primed */
char *pCoherCharOut; /* special aligned buffer for chars to 1401 */ char *pCoherCharOut; /* special aligned buffer for chars to 1401 */
struct urb *pUrbCharOut; /* urb used for chars to 1401 */ struct urb *pUrbCharOut; /* urb used for chars to 1401 */
char *pCoherCharIn; /* special aligned buffer for chars to host */ char *pCoherCharIn; /* special aligned buffer for chars to host */
struct urb *pUrbCharIn; /* urb used for chars to host */ struct urb *pUrbCharIn; /* urb used for chars to host */
spinlock_t charOutLock; /* to protect the outputBuffer and outputting */ spinlock_t charOutLock; /* to protect the outputBuffer and outputting */
spinlock_t charInLock; /* to protect the inputBuffer and char reads */ spinlock_t charInLock; /* to protect the inputBuffer and char reads */
__u8 bInterval; /* Interrupt end point interval */ __u8 bInterval; /* Interrupt end point interval */
volatile unsigned int dwDMAFlag; /* state of DMA */ volatile unsigned int dwDMAFlag; /* state of DMA */
TRANSAREA rTransDef[MAX_TRANSAREAS];/* transfer area info */ TRANSAREA rTransDef[MAX_TRANSAREAS];/* transfer area info */
volatile DMADESC rDMAInfo; /* info on current DMA transfer */ volatile DMADESC rDMAInfo; /* info on current DMA transfer */
volatile bool bXFerWaiting; /* Flag set if DMA transfer stalled */ volatile bool bXFerWaiting; /* Flag set if DMA transfer stalled */
volatile bool bInDrawDown; /* Flag that we want to halt transfers */ volatile bool bInDrawDown; /* Flag that we want to halt transfers */
/* Parameters relating to a block read\write that is in progress. Some of these values */ /* Parameters relating to a block read\write that is in progress. Some of these values */
/* are equivalent to values in rDMAInfo. The values here are those in use, while those */ /* are equivalent to values in rDMAInfo. The values here are those in use, while those */
/* in rDMAInfo are those received from the 1401 via an escape sequence. If another */ /* in rDMAInfo are those received from the 1401 via an escape sequence. If another */
/* escape sequence arrives before the previous xfer ends, rDMAInfo values are updated while these */ /* escape sequence arrives before the previous xfer ends, rDMAInfo values are updated while these */
/* are used to finish off the current transfer. */ /* are used to finish off the current transfer. */
volatile short StagedId; /* The transfer area id for this transfer */ volatile short StagedId; /* The transfer area id for this transfer */
volatile bool StagedRead; /* Flag TRUE for read from 1401, FALSE for write */ volatile bool StagedRead; /* Flag TRUE for read from 1401, FALSE for write */
volatile unsigned int StagedLength; /* Total length of this transfer */ volatile unsigned int StagedLength; /* Total length of this transfer */
volatile unsigned int StagedOffset; /* Offset within memory area for transfer start */ volatile unsigned int StagedOffset; /* Offset within memory area for transfer start */
volatile unsigned int StagedDone; /* Bytes transferred so far */ volatile unsigned int StagedDone; /* Bytes transferred so far */
volatile bool bStagedUrbPending; /* Flag to indicate active */ volatile bool bStagedUrbPending; /* Flag to indicate active */
char *pCoherStagedIO; /* buffer used for block transfers */ char *pCoherStagedIO; /* buffer used for block transfers */
struct urb *pStagedUrb; /* The URB to use */ struct urb *pStagedUrb; /* The URB to use */
spinlock_t stagedLock; /* protects ReadWriteMem() and circular buffer stuff */ spinlock_t stagedLock; /* protects ReadWriteMem() and circular buffer stuff */
short s1401Type; /* type of 1401 attached */ short s1401Type; /* type of 1401 attached */
short sCurrentState; /* current error state */ short sCurrentState; /* current error state */
bool bIsUSB2; /* type of the interface we connect to */ bool bIsUSB2; /* type of the interface we connect to */
bool bForceReset; /* Flag to make sure we get a real reset */ bool bForceReset; /* Flag to make sure we get a real reset */
__u32 statBuf[2]; /* buffer for 1401 state info */ __u32 statBuf[2]; /* buffer for 1401 state info */
unsigned long ulSelfTestTime; /* used to timeout self test */ unsigned long ulSelfTestTime; /* used to timeout self test */
int nPipes; /* Should be 3 or 4 depending on 1401 usb chip */ int nPipes; /* Should be 3 or 4 depending on 1401 usb chip */
int bPipeError[4]; /* set non-zero if an error on one of the pipe */ int bPipeError[4]; /* set non-zero if an error on one of the pipe */
__u8 epAddr[4]; /* addresses of the 3/4 end points */ __u8 epAddr[4]; /* addresses of the 3/4 end points */
struct usb_device *udev; /* the usb device for this device */ struct usb_device *udev; /* the usb device for this device */
struct usb_interface *interface; /* the interface for this device, NULL if removed */ struct usb_interface *interface; /* the interface for this device, NULL if removed */
struct usb_anchor submitted; /* in case we need to retract our submissions */ struct usb_anchor submitted; /* in case we need to retract our submissions */
struct mutex io_mutex; /* synchronize I/O with disconnect, one user-mode caller at a time */ struct mutex io_mutex; /* synchronize I/O with disconnect, one user-mode caller at a time */
int errors; /* the last request tanked */ int errors; /* the last request tanked */
int open_count; /* count the number of openers */ int open_count; /* count the number of openers */
spinlock_t err_lock; /* lock for errors */ spinlock_t err_lock; /* lock for errors */
struct kref kref; struct kref kref;
}DEVICE_EXTENSION, *PDEVICE_EXTENSION; } DEVICE_EXTENSION, *PDEVICE_EXTENSION;
#define to_DEVICE_EXTENSION(d) container_of(d, DEVICE_EXTENSION, kref) #define to_DEVICE_EXTENSION(d) container_of(d, DEVICE_EXTENSION, kref)
/* Definitions of routimes used between compilation object files */ /* Definitions of routimes used between compilation object files */
...@@ -209,7 +209,7 @@ extern int Allowi(DEVICE_EXTENSION *pdx); ...@@ -209,7 +209,7 @@ extern int Allowi(DEVICE_EXTENSION *pdx);
extern int SendChars(DEVICE_EXTENSION *pdx); extern int SendChars(DEVICE_EXTENSION *pdx);
extern void ced_draw_down(DEVICE_EXTENSION *pdx); extern void ced_draw_down(DEVICE_EXTENSION *pdx);
extern int ReadWriteMem(DEVICE_EXTENSION *pdx, bool Read, unsigned short wIdent, extern int ReadWriteMem(DEVICE_EXTENSION *pdx, bool Read, unsigned short wIdent,
unsigned int dwOffs, unsigned int dwLen); unsigned int dwOffs, unsigned int dwLen);
/* in ced_ioc.c */ /* in ced_ioc.c */
extern int ClearArea(DEVICE_EXTENSION *pdx, int nArea); extern int ClearArea(DEVICE_EXTENSION *pdx, int nArea);
......
...@@ -157,19 +157,19 @@ ...@@ -157,19 +157,19 @@
typedef struct /* used for U14_GetTransfer results */ typedef struct /* used for U14_GetTransfer results */
{ /* Info on a single mapped block */ { /* Info on a single mapped block */
U14LONG physical; U14LONG physical;
U14LONG size; U14LONG size;
} TXENTRY; } TXENTRY;
typedef struct TGetTxBlock /* used for U14_GetTransfer results */ typedef struct TGetTxBlock /* used for U14_GetTransfer results */
{ /* matches structure in VXD */ { /* matches structure in VXD */
U14LONG size; U14LONG size;
U14LONG linear; U14LONG linear;
short seg; short seg;
short reserved; short reserved;
short avail; /* number of available entries */ short avail; /* number of available entries */
short used; /* number of used entries */ short used; /* number of used entries */
TXENTRY entries[GET_TX_MAXENTRIES]; /* Array of mapped block info */ TXENTRY entries[GET_TX_MAXENTRIES]; /* Array of mapped block info */
} TGET_TX_BLOCK; } TGET_TX_BLOCK;
typedef TGET_TX_BLOCK *LPGET_TX_BLOCK; typedef TGET_TX_BLOCK *LPGET_TX_BLOCK;
...@@ -180,19 +180,19 @@ typedef TGET_TX_BLOCK *LPGET_TX_BLOCK; ...@@ -180,19 +180,19 @@ typedef TGET_TX_BLOCK *LPGET_TX_BLOCK;
#ifdef LINUX #ifdef LINUX
typedef struct /* used for U14_GetTransfer results */ typedef struct /* used for U14_GetTransfer results */
{ /* Info on a single mapped block */ { /* Info on a single mapped block */
long long physical; long long physical;
long size; long size;
} TXENTRY; } TXENTRY;
typedef struct TGetTxBlock /* used for U14_GetTransfer results */ typedef struct TGetTxBlock /* used for U14_GetTransfer results */
{ /* matches structure in VXD */ { /* matches structure in VXD */
long long linear; /* linear address */ long long linear; /* linear address */
long size; /* total size of the mapped area, holds id when called */ long size; /* total size of the mapped area, holds id when called */
short seg; /* segment of the address for Win16 */ short seg; /* segment of the address for Win16 */
short reserved; short reserved;
short avail; /* number of available entries */ short avail; /* number of available entries */
short used; /* number of used entries */ short used; /* number of used entries */
TXENTRY entries[GET_TX_MAXENTRIES]; /* Array of mapped block info */ TXENTRY entries[GET_TX_MAXENTRIES]; /* Array of mapped block info */
} TGET_TX_BLOCK; } TGET_TX_BLOCK;
#endif #endif
...@@ -201,83 +201,83 @@ extern "C" { ...@@ -201,83 +201,83 @@ extern "C" {
#endif #endif
U14API(int) U14WhenToTimeOut(short hand); /* when to timeout in ms */ U14API(int) U14WhenToTimeOut(short hand); /* when to timeout in ms */
U14API(short) U14PassedTime(int iTime); /* non-zero if iTime passed */ 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) U14Open1401(short n1401);
U14API(short) U14Close1401(short hand); U14API(short) U14Close1401(short hand);
U14API(short) U14Reset1401(short hand); U14API(short) U14Reset1401(short hand);
U14API(short) U14ForceReset(short hand); U14API(short) U14ForceReset(short hand);
U14API(short) U14TypeOf1401(short hand); U14API(short) U14TypeOf1401(short hand);
U14API(short) U14NameOf1401(short hand, char *pBuf, WORD wMax); U14API(short) U14NameOf1401(short hand, char *pBuf, WORD wMax);
U14API(short) U14Stat1401(short hand); U14API(short) U14Stat1401(short hand);
U14API(short) U14CharCount(short hand); U14API(short) U14CharCount(short hand);
U14API(short) U14LineCount(short hand); U14API(short) U14LineCount(short hand);
U14API(short) U14SendString(short hand, const char *pString); U14API(short) U14SendString(short hand, const char *pString);
U14API(short) U14GetString(short hand, char *pBuffer, WORD wMaxLen); U14API(short) U14GetString(short hand, char *pBuffer, WORD wMaxLen);
U14API(short) U14SendChar(short hand, char cChar); U14API(short) U14SendChar(short hand, char cChar);
U14API(short) U14GetChar(short hand, char *pcChar); U14API(short) U14GetChar(short hand, char *pcChar);
U14API(short) U14LdCmd(short hand, const char *command); U14API(short) U14LdCmd(short hand, const char *command);
U14API(DWORD) U14Ld(short hand, const char *vl, const char *str); U14API(DWORD) U14Ld(short hand, const char *vl, const char *str);
U14API(short) U14SetTransArea(short hand, WORD wArea, void *pvBuff, U14API(short) U14SetTransArea(short hand, WORD wArea, void *pvBuff,
DWORD dwLength, short eSz); DWORD dwLength, short eSz);
U14API(short) U14UnSetTransfer(short hand, WORD wArea); U14API(short) U14UnSetTransfer(short hand, WORD wArea);
U14API(short) U14SetTransferEvent(short hand, WORD wArea, BOOL bEvent, U14API(short) U14SetTransferEvent(short hand, WORD wArea, BOOL bEvent,
BOOL bToHost, DWORD dwStart, DWORD dwLength); BOOL bToHost, DWORD dwStart, DWORD dwLength);
U14API(int) U14TestTransferEvent(short hand, WORD wArea); U14API(int) U14TestTransferEvent(short hand, WORD wArea);
U14API(int) U14WaitTransferEvent(short hand, WORD wArea, int msTimeOut); U14API(int) U14WaitTransferEvent(short hand, WORD wArea, int msTimeOut);
U14API(short) U14GetTransfer(short hand, TGET_TX_BLOCK *pTransBlock); U14API(short) U14GetTransfer(short hand, TGET_TX_BLOCK *pTransBlock);
U14API(short) U14ToHost(short hand, char *pAddrHost,DWORD dwSize,DWORD dw1401, U14API(short) U14ToHost(short hand, char *pAddrHost, DWORD dwSize, DWORD dw1401,
short eSz); short eSz);
U14API(short) U14To1401(short hand, const char *pAddrHost,DWORD dwSize,DWORD dw1401, U14API(short) U14To1401(short hand, const char *pAddrHost, DWORD dwSize, DWORD dw1401,
short eSz); short eSz);
U14API(short) U14SetCircular(short hand, WORD wArea, BOOL bToHost, void *pvBuff, U14API(short) U14SetCircular(short hand, WORD wArea, BOOL bToHost, void *pvBuff,
DWORD dwLength); DWORD dwLength);
U14API(int) U14GetCircBlk(short hand, WORD wArea, DWORD *pdwOffs); U14API(int) U14GetCircBlk(short hand, WORD wArea, DWORD *pdwOffs);
U14API(int) U14FreeCircBlk(short hand, WORD wArea, DWORD dwOffs, DWORD dwSize, U14API(int) U14FreeCircBlk(short hand, WORD wArea, DWORD dwOffs, DWORD dwSize,
DWORD *pdwOffs); DWORD *pdwOffs);
U14API(short) U14StrToLongs(const char *pszBuff, U14LONG *palNums, short sMaxLongs); U14API(short) U14StrToLongs(const char *pszBuff, U14LONG *palNums, short sMaxLongs);
U14API(short) U14LongsFrom1401(short hand, U14LONG *palBuff, short sMaxLongs); U14API(short) U14LongsFrom1401(short hand, U14LONG *palBuff, short sMaxLongs);
U14API(void) U14SetTimeout(short hand, int lTimeout); U14API(void) U14SetTimeout(short hand, int lTimeout);
U14API(int) U14GetTimeout(short hand); U14API(int) U14GetTimeout(short hand);
U14API(short) U14OutBufSpace(short hand); U14API(short) U14OutBufSpace(short hand);
U14API(int) U14BaseAddr1401(short hand); U14API(int) U14BaseAddr1401(short hand);
U14API(int) U14DriverVersion(short hand); U14API(int) U14DriverVersion(short hand);
U14API(int) U14DriverType(short hand); U14API(int) U14DriverType(short hand);
U14API(short) U14DriverName(short hand, char *pBuf, WORD wMax); U14API(short) U14DriverName(short hand, char *pBuf, WORD wMax);
U14API(short) U14GetUserMemorySize(short hand, DWORD *pMemorySize); U14API(short) U14GetUserMemorySize(short hand, DWORD *pMemorySize);
U14API(short) U14KillIO1401(short hand); U14API(short) U14KillIO1401(short hand);
U14API(short) U14BlkTransState(short hand); U14API(short) U14BlkTransState(short hand);
U14API(short) U14StateOf1401(short hand); U14API(short) U14StateOf1401(short hand);
U14API(short) U14Grab1401(short hand); U14API(short) U14Grab1401(short hand);
U14API(short) U14Free1401(short hand); U14API(short) U14Free1401(short hand);
U14API(short) U14Peek1401(short hand, DWORD dwAddr, int nSize, int nRepeats); 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) 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) 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) U14RampAddr(short hand, DWORD dwDef, DWORD dwEnable, int nSize, int nRepeats);
U14API(short) U14StopDebugLoop(short hand); U14API(short) U14StopDebugLoop(short hand);
U14API(short) U14GetDebugData(short hand, U14LONG *plValue); U14API(short) U14GetDebugData(short hand, U14LONG *plValue);
U14API(short) U14StartSelfTest(short hand); U14API(short) U14StartSelfTest(short hand);
U14API(short) U14CheckSelfTest(short hand, U14LONG *pData); U14API(short) U14CheckSelfTest(short hand, U14LONG *pData);
U14API(short) U14TransferFlags(short hand); U14API(short) U14TransferFlags(short hand);
U14API(void) U14GetErrorString(short nErr, char *pStr, WORD wMax); U14API(void) U14GetErrorString(short nErr, char *pStr, WORD wMax);
U14API(int) U14MonitorRev(short hand); U14API(int) U14MonitorRev(short hand);
U14API(void) U14CloseAll(void); U14API(void) U14CloseAll(void);
U14API(short) U14WorkingSet(DWORD dwMinKb, DWORD dwMaxKb); U14API(short) U14WorkingSet(DWORD dwMinKb, DWORD dwMaxKb);
U14API(int) U14InitLib(void); U14API(int) U14InitLib(void);
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -19,270 +19,270 @@ ...@@ -19,270 +19,270 @@
** The IOCTL function codes from 0x80 to 0xFF are for developer use. ** The IOCTL function codes from 0x80 to 0xFF are for developer use.
*/ */
#define FILE_DEVICE_CED1401 0x8001 #define FILE_DEVICE_CED1401 0x8001
#define FNNUMBASE 0x800 FNNUMBASE 0x800
#define U14_OPEN1401 CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_OPEN1401 CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE, \ FNNUMBASE, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_CLOSE1401 CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_CLOSE1401 CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+1, \ FNNUMBASE+1, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_SENDSTRING CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_SENDSTRING CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+2, \ FNNUMBASE+2, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS
#define U14_RESET1401 CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_RESET1401 CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+3, \ FNNUMBASE+3, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_GETCHAR CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_GETCHAR CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+4, \ FNNUMBASE+4, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_SENDCHAR CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_SENDCHAR CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+5, \ FNNUMBASE+5, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_STAT1401 CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_STAT1401 CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+6, \ FNNUMBASE+6, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_LINECOUNT CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_LINECOUNT CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+7, \ FNNUMBASE+7, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_GETSTRING CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_GETSTRING CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+8, \ FNNUMBASE+8, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_REGCALLBACK CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_REGCALLBACK CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+9, \ FNNUMBASE+9, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_GETMONITORBUF CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_GETMONITORBUF CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+10, \ FNNUMBASE+10, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_SETTRANSFER CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_SETTRANSFER CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+11, \ FNNUMBASE+11, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_UNSETTRANSFER CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_UNSETTRANSFER CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+12, \ FNNUMBASE+12, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_SETTRANSEVENT CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_SETTRANSEVENT CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+13, \ FNNUMBASE+13, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_GETOUTBUFSPACE CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_GETOUTBUFSPACE CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+14, \ FNNUMBASE+14, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_GETBASEADDRESS CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_GETBASEADDRESS CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+15, \ FNNUMBASE+15, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_GETDRIVERREVISION CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_GETDRIVERREVISION CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+16, \ FNNUMBASE+16, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_GETTRANSFER CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_GETTRANSFER CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+17, \ FNNUMBASE+17, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_KILLIO1401 CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_KILLIO1401 CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+18, \ FNNUMBASE+18, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_BLKTRANSSTATE CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_BLKTRANSSTATE CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+19, \ FNNUMBASE+19, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_BYTECOUNT CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_BYTECOUNT CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+20, \ FNNUMBASE+20, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_ZEROBLOCKCOUNT CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_ZEROBLOCKCOUNT CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+21, \ FNNUMBASE+21, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_STOPCIRCULAR CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_STOPCIRCULAR CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+22, \ FNNUMBASE+22, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_STATEOF1401 CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_STATEOF1401 CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+23, \ FNNUMBASE+23, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_REGISTERS1401 CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_REGISTERS1401 CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+24, \ FNNUMBASE+24, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_GRAB1401 CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_GRAB1401 CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+25, \ FNNUMBASE+25, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_FREE1401 CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_FREE1401 CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+26, \ FNNUMBASE+26, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_STEP1401 CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_STEP1401 CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+27, \ FNNUMBASE+27, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_SET1401REGISTERS CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_SET1401REGISTERS CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+28, \ FNNUMBASE+28, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_STEPTILL1401 CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_STEPTILL1401 CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+29, \ FNNUMBASE+29, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_SETORIN CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_SETORIN CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+30, \ FNNUMBASE+30, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_STARTSELFTEST CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_STARTSELFTEST CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+31, \ FNNUMBASE+31, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_CHECKSELFTEST CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_CHECKSELFTEST CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+32, \ FNNUMBASE+32, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_TYPEOF1401 CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_TYPEOF1401 CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+33, \ FNNUMBASE+33, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_TRANSFERFLAGS CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_TRANSFERFLAGS CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+34, \ FNNUMBASE+34, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_DBGPEEK CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_DBGPEEK CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+35, \ FNNUMBASE+35, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_DBGPOKE CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_DBGPOKE CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+36, \ FNNUMBASE+36, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_DBGRAMPDATA CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_DBGRAMPDATA CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+37, \ FNNUMBASE+37, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_DBGRAMPADDR CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_DBGRAMPADDR CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+38, \ FNNUMBASE+38, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_DBGGETDATA CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_DBGGETDATA CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+39, \ FNNUMBASE+39, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_DBGSTOPLOOP CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_DBGSTOPLOOP CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+40, \ FNNUMBASE+40, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_FULLRESET CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_FULLRESET CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+41, \ FNNUMBASE+41, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_SETCIRCULAR CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_SETCIRCULAR CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+42, \ FNNUMBASE+42, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_GETCIRCBLK CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_GETCIRCBLK CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+43, \ FNNUMBASE+43, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
#define U14_FREECIRCBLK CTL_CODE( FILE_DEVICE_CED1401, \ #define U14_FREECIRCBLK CTL_CODE(FILE_DEVICE_CED1401, \
FNNUMBASE+44, \ FNNUMBASE+44, \
METHOD_BUFFERED, \ METHOD_BUFFERED, \
FILE_ANY_ACCESS) FILE_ANY_ACCESS)
/*--------------- Structures that are shared with the driver ------------- */ /*--------------- Structures that are shared with the driver ------------- */
#pragma pack(1) #pragma pack(1)
typedef struct /* used for get/set standard 1401 registers */ typedef struct /* used for get/set standard 1401 registers */
{ {
short sPC; short sPC;
char A; char A;
char X; char X;
char Y; char Y;
char stat; char stat;
char rubbish; char rubbish;
} T1401REGISTERS; } T1401REGISTERS;
typedef union /* to communicate with 1401 driver status & control funcs */ typedef union /* to communicate with 1401 driver status & control funcs */
{ {
char chrs[22]; char chrs[22];
short ints[11]; short ints[11];
long longs[5]; long longs[5];
T1401REGISTERS registers; T1401REGISTERS registers;
} TCSBLOCK; } TCSBLOCK;
typedef TCSBLOCK* LPTCSBLOCK; typedef TCSBLOCK* LPTCSBLOCK;
typedef struct paramBlk typedef struct paramBlk
{ {
short sState; short sState;
TCSBLOCK csBlock; TCSBLOCK csBlock;
} PARAMBLK; } PARAMBLK;
typedef PARAMBLK* PPARAMBLK; typedef PARAMBLK* PPARAMBLK;
typedef struct TransferDesc /* Structure and type for SetTransArea */ typedef struct TransferDesc /* Structure and type for SetTransArea */
{ {
WORD wArea; /* number of transfer area to set up */ WORD wArea; /* number of transfer area to set up */
void FAR *lpvBuff; /* address of transfer area */ void FAR *lpvBuff; /* address of transfer area */
DWORD dwLength; /* length of area to set up */ DWORD dwLength; /* length of area to set up */
short eSize; /* size to move (for swapping on MAC) */ short eSize; /* size to move (for swapping on MAC) */
} TRANSFERDESC; } TRANSFERDESC;
typedef TRANSFERDESC FAR *LPTRANSFERDESC; typedef TRANSFERDESC FAR *LPTRANSFERDESC;
...@@ -290,10 +290,10 @@ typedef TRANSFERDESC FAR *LPTRANSFERDESC; ...@@ -290,10 +290,10 @@ typedef TRANSFERDESC FAR *LPTRANSFERDESC;
/* This is the structure used to set up a transfer area */ /* This is the structure used to set up a transfer area */
typedef struct VXTransferDesc /* use1401.c and use1432x.x use only */ typedef struct VXTransferDesc /* use1401.c and use1432x.x use only */
{ {
WORD wArea; /* number of transfer area to set up */ WORD wArea; /* number of transfer area to set up */
WORD wAddrSel; /* 16 bit selector for area */ WORD wAddrSel; /* 16 bit selector for area */
DWORD dwAddrOfs; /* 32 bit offset for area start */ DWORD dwAddrOfs; /* 32 bit offset for area start */
DWORD dwLength; /* length of area to set up */ DWORD dwLength; /* length of area to set up */
} VXTRANSFERDESC; } VXTRANSFERDESC;
#pragma pack() #pragma pack()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment