diff options
author | Alois Schlögl <alois.schloegl@ist.ac.at> | 2012-09-17 19:22:52 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-17 19:45:28 -0700 |
commit | 2eae6bdc12f4e49b7f94f032b82d664dcf3881bc (patch) | |
tree | 15158b8c45927f10f964b11b538725bcf8e1a695 /drivers/staging/ced1401/use14_ioc.h | |
parent | 57991b6bfc2b0faafb7d42edbd1673903d76b853 (diff) | |
download | kernel_goldelico_gta04-2eae6bdc12f4e49b7f94f032b82d664dcf3881bc.zip kernel_goldelico_gta04-2eae6bdc12f4e49b7f94f032b82d664dcf3881bc.tar.gz kernel_goldelico_gta04-2eae6bdc12f4e49b7f94f032b82d664dcf3881bc.tar.bz2 |
Staging: add ced1401 USB driver
This was imported from the
http://pub.ist.ac.at/~schloegl/src/ced1401/.git git repo at the request
of Alois. The driver originally came from Cambridge Electronic Design
Ltd and was authored by Greg P Smith and others, but Alois did the
maintance work to get it into a semi-building state and pushed to get it
into the main kernel tree here.
Cc: Alois Schlögl <alois.schloegl@ist.ac.at>
Cc: Greg P. Smith <greg@ced.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ced1401/use14_ioc.h')
-rw-r--r-- | drivers/staging/ced1401/use14_ioc.h | 301 |
1 files changed, 301 insertions, 0 deletions
diff --git a/drivers/staging/ced1401/use14_ioc.h b/drivers/staging/ced1401/use14_ioc.h new file mode 100644 index 0000000..15ca638 --- /dev/null +++ b/drivers/staging/ced1401/use14_ioc.h @@ -0,0 +1,301 @@ +/* use14_ioc.h +** definitions of use1401 module stuff that is shared between use1401 and the driver. +** Copyright (C) Cambridge Electronic Design Limited 2010 +** Author Greg P Smith +************************************************************************************/ +#ifndef __USE14_IOC_H__ +#define __USE14_IOC_H__ + +#define MAX_TRANSAREAS 8 /* The number of transfer areas supported by driver */ + +#define i386 +#include "winioctl.h" /* needed so we can access driver */ + +/* +** Defines for IOCTL functions to ask driver to perform. These must be matched +** in both use1401 and in the driver. The IOCTL code contains a command +** identifier, plus other information about the device, the type of access +** with which the file must have been opened, and the type of buffering. +** The IOCTL function codes from 0x80 to 0xFF are for developer use. +*/ +#define FILE_DEVICE_CED1401 0x8001 +#define FNNUMBASE 0x800 + +#define U14_OPEN1401 CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_CLOSE1401 CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+1, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_SENDSTRING CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+2, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_RESET1401 CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+3, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_GETCHAR CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+4, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_SENDCHAR CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+5, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_STAT1401 CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+6, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_LINECOUNT CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+7, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_GETSTRING CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+8, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_REGCALLBACK CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+9, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_GETMONITORBUF CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+10, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_SETTRANSFER CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+11, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_UNSETTRANSFER CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+12, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_SETTRANSEVENT CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+13, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_GETOUTBUFSPACE CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+14, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_GETBASEADDRESS CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+15, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_GETDRIVERREVISION CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+16, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_GETTRANSFER CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+17, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_KILLIO1401 CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+18, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_BLKTRANSSTATE CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+19, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_BYTECOUNT CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+20, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_ZEROBLOCKCOUNT CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+21, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_STOPCIRCULAR CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+22, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_STATEOF1401 CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+23, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_REGISTERS1401 CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+24, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_GRAB1401 CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+25, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_FREE1401 CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+26, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_STEP1401 CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+27, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_SET1401REGISTERS CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+28, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_STEPTILL1401 CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+29, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_SETORIN CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+30, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_STARTSELFTEST CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+31, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_CHECKSELFTEST CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+32, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_TYPEOF1401 CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+33, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_TRANSFERFLAGS CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+34, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_DBGPEEK CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+35, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_DBGPOKE CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+36, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_DBGRAMPDATA CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+37, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_DBGRAMPADDR CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+38, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_DBGGETDATA CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+39, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_DBGSTOPLOOP CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+40, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_FULLRESET CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+41, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_SETCIRCULAR CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+42, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_GETCIRCBLK CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+43, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +#define U14_FREECIRCBLK CTL_CODE( FILE_DEVICE_CED1401, \ + FNNUMBASE+44, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) + +//--------------- Structures that are shared with the driver ------------- +#pragma pack(1) + +typedef struct /* used for get/set standard 1401 registers */ +{ + short sPC; + char A; + char X; + char Y; + char stat; + char rubbish; +} T1401REGISTERS; + +typedef union /* to communicate with 1401 driver status & control funcs */ +{ + char chrs[22]; + short ints[11]; + long longs[5]; + T1401REGISTERS registers; +} TCSBLOCK; + +typedef TCSBLOCK* LPTCSBLOCK; + +typedef struct paramBlk +{ + short sState; + TCSBLOCK csBlock; +} PARAMBLK; + +typedef PARAMBLK* PPARAMBLK; + +typedef struct TransferDesc /* Structure and type for SetTransArea */ +{ + WORD wArea; /* number of transfer area to set up */ + void FAR * lpvBuff; /* address of transfer area */ + DWORD dwLength; /* length of area to set up */ + short eSize; /* size to move (for swapping on MAC) */ +} TRANSFERDESC; + +typedef TRANSFERDESC FAR * LPTRANSFERDESC; + +/* This is the structure used to set up a transfer area */ +typedef struct VXTransferDesc /* use1401.c and use1432x.x use only */ +{ + WORD wArea; /* number of transfer area to set up */ + WORD wAddrSel; /* 16 bit selector for area */ + DWORD dwAddrOfs; /* 32 bit offset for area start */ + DWORD dwLength; /* length of area to set up */ +} VXTRANSFERDESC; + +#pragma pack() + +#endif
\ No newline at end of file |