staging: ced1401: remove driver
The state of the driver hasn't improved much since it was added to staging, and no one with the hardware is currently working on it, so remove it. This commit can be reverted if someone wants to clean the driver up and move it to its proper place in the kernel. Signed-off-by: Kristina Martšenko <kristina.martsenko@gmail.com> Cc: Greg Smith <greg@ced.co.uk> Cc: Alois Schlögl <alois.schloegl@ist.ac.at> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
64f488fb1c
commit
53b903093b
|
@ -106,8 +106,6 @@ source "drivers/staging/gdm724x/Kconfig"
|
|||
|
||||
source "drivers/staging/silicom/Kconfig"
|
||||
|
||||
source "drivers/staging/ced1401/Kconfig"
|
||||
|
||||
source "drivers/staging/imx-drm/Kconfig"
|
||||
|
||||
source "drivers/staging/fwserial/Kconfig"
|
||||
|
|
|
@ -46,7 +46,6 @@ obj-$(CONFIG_USB_WPAN_HCD) += ozwpan/
|
|||
obj-$(CONFIG_WIMAX_GDM72XX) += gdm72xx/
|
||||
obj-$(CONFIG_LTE_GDM724X) += gdm724x/
|
||||
obj-$(CONFIG_NET_VENDOR_SILICOM) += silicom/
|
||||
obj-$(CONFIG_CED1401) += ced1401/
|
||||
obj-$(CONFIG_DRM_IMX) += imx-drm/
|
||||
obj-$(CONFIG_FIREWIRE_SERIAL) += fwserial/
|
||||
obj-$(CONFIG_GOLDFISH) += goldfish/
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
config CED1401
|
||||
tristate "Cambridge Electronic Design 1401 USB support"
|
||||
depends on USB
|
||||
help
|
||||
This driver supports the Cambridge Electronic Design 1401 USB device
|
||||
(whatever that is.)
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
obj-$(CONFIG_CED1401) := cedusb.o
|
||||
cedusb-objs := usb1401.o ced_ioc.o
|
|
@ -1,10 +0,0 @@
|
|||
TODO:
|
||||
- coding syle fixes
|
||||
- build warning fixups
|
||||
- ioctl auditing
|
||||
- usb api auditing
|
||||
- proper USB minor number (it's stomping on an existing one right now.)
|
||||
|
||||
Please send patches to Greg Kroah-Hartman <gregkh@linuxfoundation.org> and Cc:
|
||||
Alois Schlögl <alois.schloegl@ist.ac.at>
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,336 +0,0 @@
|
|||
/*
|
||||
* IOCTL calls for the CED1401 driver
|
||||
* Copyright (C) 2010 Cambridge Electronic Design Ltd
|
||||
* Author Greg P Smith (greg@ced.co.uk)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
#ifndef __CED_IOCTL_H__
|
||||
#define __CED_IOCTL_H__
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
/* dma modes, only MODE_CHAR and MODE_LINEAR are used in this driver */
|
||||
#define MODE_CHAR 0
|
||||
#define MODE_LINEAR 1
|
||||
|
||||
/****************************************************************************
|
||||
** TypeDefs
|
||||
*****************************************************************************/
|
||||
|
||||
struct transfer_area_desc {
|
||||
long long lpvBuff; /* address of transfer area (for 64 or 32 bit) */
|
||||
unsigned int dwLength; /* length of the area */
|
||||
unsigned short wAreaNum; /* number of transfer area to set up */
|
||||
short eSize; /* element size - is tohost flag for circular */
|
||||
};
|
||||
|
||||
|
||||
struct transfer_event {
|
||||
unsigned int dwStart; /* offset into the area */
|
||||
unsigned int dwLength; /* length of the region */
|
||||
unsigned short wAreaNum; /* the area number */
|
||||
unsigned short wFlags; /* bit 0 set for toHost */
|
||||
int iSetEvent; /* could be dummy in LINUX */
|
||||
};
|
||||
|
||||
#define MAX_TRANSFER_SIZE 0x4000 /* Maximum data bytes per IRP */
|
||||
#define MAX_AREA_LENGTH 0x100000 /* Maximum size of transfer area */
|
||||
#define MAX_TRANSAREAS 8 /* definitions for dma set up */
|
||||
|
||||
typedef struct TGetSelfTest {
|
||||
int code; /* self-test error code */
|
||||
int x, y; /* additional information */
|
||||
} TGET_SELFTEST;
|
||||
|
||||
/* Debug block used for several commands. Not all fields are used for all commands. */
|
||||
typedef struct TDbgBlock {
|
||||
int iAddr; /* the address in the 1401 */
|
||||
int iRepeats; /* number of repeats */
|
||||
int iWidth; /* width in bytes 1, 2, 4 */
|
||||
int iDefault; /* default value */
|
||||
int iMask; /* mask to apply */
|
||||
int iData; /* data for poke, result for peek */
|
||||
} TDBGBLOCK;
|
||||
|
||||
/* Used to collect information about a circular block from the device driver */
|
||||
typedef struct TCircBlock {
|
||||
unsigned int nArea; /* the area to collect information from */
|
||||
unsigned int dwOffset; /* offset into the area to the available block */
|
||||
unsigned int dwSize; /* size of the area */
|
||||
} TCIRCBLOCK;
|
||||
|
||||
/* Used to clollect the 1401 status */
|
||||
typedef struct TCSBlock {
|
||||
unsigned int uiState;
|
||||
unsigned int uiError;
|
||||
} TCSBLOCK;
|
||||
|
||||
/*
|
||||
* As seen by the user, an ioctl call looks like: int ioctl(int fd, unsigned
|
||||
* long cmd, char* argp); We will then have all sorts of variants on this that
|
||||
* can be used to pass stuff to our driver. We will generate macros for each
|
||||
* type of call so as to provide some sort of type safety in the calling:
|
||||
*/
|
||||
#define CED_MAGIC_IOC 0xce
|
||||
|
||||
#define IOCTL_CED_SENDSTRING(n) _IOC(_IOC_WRITE, CED_MAGIC_IOC, 2, n)
|
||||
|
||||
#define IOCTL_CED_RESET1401 _IO(CED_MAGIC_IOC, 3)
|
||||
#define IOCTL_CED_GETCHAR _IO(CED_MAGIC_IOC, 4)
|
||||
#define IOCTL_CED_SENDCHAR _IO(CED_MAGIC_IOC, 5)
|
||||
#define IOCTL_CED_STAT1401 _IO(CED_MAGIC_IOC, 6)
|
||||
#define IOCTL_CED_LINECOUNT _IO(CED_MAGIC_IOC, 7)
|
||||
#define IOCTL_CED_GETSTRING(nMax) _IOC(_IOC_READ, CED_MAGIC_IOC, 8, nMax)
|
||||
|
||||
#define IOCTL_CED_SETTRANSFER _IOW(CED_MAGIC_IOC, 11, struct transfer_area_desc)
|
||||
#define IOCTL_CED_UNSETTRANSFER _IO(CED_MAGIC_IOC, 12)
|
||||
#define IOCTL_CED_SETEVENT _IOW(CED_MAGIC_IOC, 13, struct transfer_event)
|
||||
#define IOCTL_CED_GETOUTBUFSPACE _IO(CED_MAGIC_IOC, 14)
|
||||
#define IOCTL_CED_GETBASEADDRESS _IO(CED_MAGIC_IOC, 15)
|
||||
#define IOCTL_CED_GETDRIVERREVISION _IO(CED_MAGIC_IOC, 16)
|
||||
|
||||
#define IOCTL_CED_GETTRANSFER _IOR(CED_MAGIC_IOC, 17, TGET_TX_BLOCK)
|
||||
#define IOCTL_CED_KILLIO1401 _IO(CED_MAGIC_IOC, 18)
|
||||
#define IOCTL_CED_BLKTRANSSTATE _IO(CED_MAGIC_IOC, 19)
|
||||
|
||||
#define IOCTL_CED_STATEOF1401 _IO(CED_MAGIC_IOC, 23)
|
||||
#define IOCTL_CED_GRAB1401 _IO(CED_MAGIC_IOC, 25)
|
||||
#define IOCTL_CED_FREE1401 _IO(CED_MAGIC_IOC, 26)
|
||||
#define IOCTL_CED_STARTSELFTEST _IO(CED_MAGIC_IOC, 31)
|
||||
#define IOCTL_CED_CHECKSELFTEST _IOR(CED_MAGIC_IOC, 32, TGET_SELFTEST)
|
||||
#define IOCTL_CED_TYPEOF1401 _IO(CED_MAGIC_IOC, 33)
|
||||
#define IOCTL_CED_TRANSFERFLAGS _IO(CED_MAGIC_IOC, 34)
|
||||
|
||||
#define IOCTL_CED_DBGPEEK _IOW(CED_MAGIC_IOC, 35, TDBGBLOCK)
|
||||
#define IOCTL_CED_DBGPOKE _IOW(CED_MAGIC_IOC, 36, TDBGBLOCK)
|
||||
#define IOCTL_CED_DBGRAMPDATA _IOW(CED_MAGIC_IOC, 37, TDBGBLOCK)
|
||||
#define IOCTL_CED_DBGRAMPADDR _IOW(CED_MAGIC_IOC, 38, TDBGBLOCK)
|
||||
#define IOCTL_CED_DBGGETDATA _IOR(CED_MAGIC_IOC, 39, TDBGBLOCK)
|
||||
#define IOCTL_CED_DBGSTOPLOOP _IO(CED_MAGIC_IOC, 40)
|
||||
#define IOCTL_CED_FULLRESET _IO(CED_MAGIC_IOC, 41)
|
||||
#define IOCTL_CED_SETCIRCULAR _IOW(CED_MAGIC_IOC, 42, struct transfer_area_desc)
|
||||
#define IOCTL_CED_GETCIRCBLOCK _IOWR(CED_MAGIC_IOC, 43, TCIRCBLOCK)
|
||||
#define IOCTL_CED_FREECIRCBLOCK _IOWR(CED_MAGIC_IOC, 44, TCIRCBLOCK)
|
||||
#define IOCTL_CED_WAITEVENT _IO(CED_MAGIC_IOC, 45)
|
||||
#define IOCTL_CED_TESTEVENT _IO(CED_MAGIC_IOC, 46)
|
||||
|
||||
#ifndef __KERNEL__
|
||||
/*
|
||||
* If nothing said about return value, it is a U14ERR_... error code
|
||||
* (U14ERR_NOERROR for none)
|
||||
*/
|
||||
inline int CED_SendString(int fh, const char *szText, int n)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_SENDSTRING(n), szText);
|
||||
}
|
||||
|
||||
inline int CED_Reset1401(int fh)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_RESET1401);
|
||||
}
|
||||
|
||||
/* Return the singe character or a -ve error code. */
|
||||
inline int CED_GetChar(int fh)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_GETCHAR);
|
||||
}
|
||||
|
||||
/* Return character count in input buffer */
|
||||
inline int CED_Stat1401(int fh)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_STAT1401);
|
||||
}
|
||||
|
||||
inline int CED_SendChar(int fh, char c)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_SENDCHAR, c);
|
||||
}
|
||||
|
||||
inline int CED_LineCount(int fh)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_LINECOUNT);
|
||||
}
|
||||
|
||||
/*
|
||||
* return the count of characters returned. If the string was terminated by CR
|
||||
* or 0, then the 0 is part of the count. Otherwise, we will add a zero if
|
||||
* there is room, but it is not included in the count. The return value is 0
|
||||
* if there was nothing to read.
|
||||
*/
|
||||
inline int CED_GetString(int fh, char *szText, int nMax)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_GETSTRING(nMax), szText);
|
||||
}
|
||||
|
||||
/* returns space in the output buffer. */
|
||||
inline int CED_GetOutBufSpace(int fh)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_GETOUTBUFSPACE);
|
||||
}
|
||||
|
||||
/* This always returns -1 as not implemented. */
|
||||
inline int CED_GetBaseAddress(int fh)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_GETBASEADDRESS);
|
||||
}
|
||||
|
||||
/* returns the major revision <<16 | minor revision. */
|
||||
inline int CED_GetDriverRevision(int fh)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_GETDRIVERREVISION);
|
||||
}
|
||||
|
||||
inline int CED_SetTransfer(int fh, struct transfer_area_desc *pTD)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_SETTRANSFER, pTD);
|
||||
}
|
||||
|
||||
inline int CED_UnsetTransfer(int fh, int nArea)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_UNSETTRANSFER, nArea);
|
||||
}
|
||||
|
||||
inline int CED_SetEvent(int fh, struct transfer_event *pTE)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_SETEVENT, pTE);
|
||||
}
|
||||
|
||||
inline int CED_GetTransfer(int fh, TGET_TX_BLOCK *pTX)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_GETTRANSFER, pTX);
|
||||
}
|
||||
|
||||
inline int CED_KillIO1401(int fh)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_KILLIO1401);
|
||||
}
|
||||
|
||||
/* returns 0 if no active DMA, 1 if active */
|
||||
inline int CED_BlkTransState(int fh)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_BLKTRANSSTATE);
|
||||
}
|
||||
|
||||
inline int CED_StateOf1401(int fh)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_STATEOF1401);
|
||||
}
|
||||
|
||||
inline int CED_Grab1401(int fh)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_GRAB1401);
|
||||
}
|
||||
|
||||
inline int CED_Free1401(int fh)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_FREE1401);
|
||||
}
|
||||
|
||||
inline int CED_StartSelfTest(int fh)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_STARTSELFTEST);
|
||||
}
|
||||
|
||||
inline int CED_CheckSelfTest(int fh, TGET_SELFTEST *pGST)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_CHECKSELFTEST, pGST);
|
||||
}
|
||||
|
||||
inline int CED_TypeOf1401(int fh)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_TYPEOF1401);
|
||||
}
|
||||
|
||||
inline int CED_TransferFlags(int fh)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_TRANSFERFLAGS);
|
||||
}
|
||||
|
||||
inline int CED_DbgPeek(int fh, TDBGBLOCK *pDB)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_DBGPEEK, pDB);
|
||||
}
|
||||
|
||||
inline int CED_DbgPoke(int fh, TDBGBLOCK *pDB)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_DBGPOKE, pDB);
|
||||
}
|
||||
|
||||
inline int CED_DbgRampData(int fh, TDBGBLOCK *pDB)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_DBGRAMPDATA, pDB);
|
||||
}
|
||||
|
||||
inline int CED_DbgRampAddr(int fh, TDBGBLOCK *pDB)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_DBGRAMPADDR, pDB);
|
||||
}
|
||||
|
||||
inline int CED_DbgGetData(int fh, TDBGBLOCK *pDB)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_DBGGETDATA, pDB);
|
||||
}
|
||||
|
||||
inline int CED_DbgStopLoop(int fh)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_DBGSTOPLOOP);
|
||||
}
|
||||
|
||||
inline int CED_FullReset(int fh)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_FULLRESET);
|
||||
}
|
||||
|
||||
inline int CED_SetCircular(int fh, struct transfer_area_desc *pTD)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_SETCIRCULAR, pTD);
|
||||
}
|
||||
|
||||
inline int CED_GetCircBlock(int fh, TCIRCBLOCK *pCB)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_GETCIRCBLOCK, pCB);
|
||||
}
|
||||
|
||||
inline int CED_FreeCircBlock(int fh, TCIRCBLOCK *pCB)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_FREECIRCBLOCK, pCB);
|
||||
}
|
||||
|
||||
inline int CED_WaitEvent(int fh, int nArea, int msTimeOut)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_WAITEVENT, (nArea & 0xff)|(msTimeOut << 8));
|
||||
}
|
||||
|
||||
inline int CED_TestEvent(int fh, int nArea)
|
||||
{
|
||||
return ioctl(fh, IOCTL_CED_TESTEVENT, nArea);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef NOTWANTEDYET
|
||||
#define IOCTL_CED_REGCALLBACK _IO(CED_MAGIC_IOC, 9) /* Not used */
|
||||
#define IOCTL_CED_GETMONITORBUF _IO(CED_MAGIC_IOC, 10) /* Not used */
|
||||
|
||||
#define IOCTL_CED_BYTECOUNT _IO(CED_MAGIC_IOC, 20) /* Not used */
|
||||
#define IOCTL_CED_ZEROBLOCKCOUNT _IO(CED_MAGIC_IOC, 21) /* Not used */
|
||||
#define IOCTL_CED_STOPCIRCULAR _IO(CED_MAGIC_IOC, 22) /* Not used */
|
||||
|
||||
#define IOCTL_CED_REGISTERS1401 _IO(CED_MAGIC_IOC, 24) /* Not used */
|
||||
#define IOCTL_CED_STEP1401 _IO(CED_MAGIC_IOC, 27) /* Not used */
|
||||
#define IOCTL_CED_SET1401REGISTERS _IO(CED_MAGIC_IOC, 28) /* Not used */
|
||||
#define IOCTL_CED_STEPTILL1401 _IO(CED_MAGIC_IOC, 29) /* Not used */
|
||||
#define IOCTL_CED_SETORIN _IO(CED_MAGIC_IOC, 30) /* Not used */
|
||||
|
||||
#endif
|
||||
|
||||
/* __CED_IOCTL_H__ */
|
||||
#endif
|
|
@ -1,119 +0,0 @@
|
|||
/*****************************************************************************
|
||||
**
|
||||
** machine.h
|
||||
**
|
||||
** Copyright (c) Cambridge Electronic Design Limited 1991,1992,2010
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or
|
||||
** modify it under the terms of the GNU General Public License
|
||||
** as published by the Free Software Foundation; either version 2
|
||||
** of the License, or (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program; if not, write to the Free Software
|
||||
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
**
|
||||
** Contact CED: Cambridge Electronic Design Limited, Science Park, Milton Road
|
||||
** Cambridge, CB6 0FE.
|
||||
** www.ced.co.uk
|
||||
** greg@ced.co.uk
|
||||
**
|
||||
** This file is included at the start of 'C' or 'C++' source file to define
|
||||
** things for cross-platform/compiler interoperability. This used to deal with
|
||||
** MSDOS/16-bit stuff, but this was all removed in Decemeber 2010. There are
|
||||
** three things to consider: Windows, LINUX, mac OSX (BSD Unix) and 32 vs 64
|
||||
** bit. At the time of writing (DEC 2010) there is a consensus on the following
|
||||
** and their unsigned equivalents:
|
||||
**
|
||||
** type bits
|
||||
** char 8
|
||||
** short 16
|
||||
** int 32
|
||||
** long long 64
|
||||
**
|
||||
** long is a problem as it is always 64 bits on linux/unix and is always 32 bits
|
||||
** on windows.
|
||||
** On windows, we define _IS_WINDOWS_ and one of WIN32 or WIN64.
|
||||
** On linux we define LINUX
|
||||
** On Max OSX we define MACOSX
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef __MACHINE_H__
|
||||
#define __MACHINE_H__
|
||||
#ifndef __KERNEL__
|
||||
#include <float.h>
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
** The initial section is to identify the operating system
|
||||
*/
|
||||
#if (defined(__linux__) || defined(_linux) || defined(__linux)) && !defined(LINUX)
|
||||
#define LINUX 1
|
||||
#endif
|
||||
|
||||
#if (defined(__WIN32__) || defined(_WIN32)) && !defined(WIN32)
|
||||
#define WIN32 1
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#define MACOSX
|
||||
#endif
|
||||
|
||||
#if defined(_WIN64)
|
||||
#undef WIN32
|
||||
#undef WIN64
|
||||
#define WIN64 1
|
||||
#endif
|
||||
|
||||
#if defined(WIN32) || defined(WIN64)
|
||||
#define _IS_WINDOWS_ 1
|
||||
#endif
|
||||
|
||||
#if defined(LINUX) || defined(MAXOSX)
|
||||
#define FAR
|
||||
|
||||
typedef int BOOL; /* To match Windows */
|
||||
typedef unsigned char BYTE;
|
||||
#define __packed __attribute__((packed))
|
||||
#define HIWORD(x) (unsigned short)(((x)>>16) & 0xffff)
|
||||
#define LOWORD(x) (unsigned short)((x) & 0xffff)
|
||||
#endif
|
||||
|
||||
#ifdef _IS_WINDOWS_
|
||||
#include <windows.h>
|
||||
#define __packed
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Sort out the DllExport and DllImport macros. The GCC compiler has its own
|
||||
** syntax for this, though it also supports the MS specific __declspec() as
|
||||
** a synonym.
|
||||
*/
|
||||
#ifdef GNUC
|
||||
#define DllExport __attribute__((dllexport))
|
||||
#define DllImport __attribute__((dllimport))
|
||||
#endif
|
||||
|
||||
#ifndef DllExport
|
||||
#ifdef _IS_WINDOWS_
|
||||
#define DllExport __declspec(dllexport)
|
||||
#define DllImport __declspec(dllimport)
|
||||
#else
|
||||
#define DllExport
|
||||
#define DllImport
|
||||
#endif
|
||||
#endif /* _IS_WINDOWS_ */
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -1,260 +0,0 @@
|
|||
/* usb1401.h
|
||||
Header file for the CED 1401 USB device driver for Linux
|
||||
Copyright (C) 2010 Cambridge Electronic Design Ltd
|
||||
Author Greg P Smith (greg@ced.co.uk)
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#ifndef __USB1401_H__
|
||||
#define __USB1401_H__
|
||||
#include "use1401.h"
|
||||
#include "ced_ioctl.h"
|
||||
|
||||
#ifndef UINT
|
||||
#define UINT unsigned int
|
||||
#endif
|
||||
|
||||
/** Device type codes, but these don't need to be extended - a succession is assumed
|
||||
** These are set for usb from the bcdDevice field (suitably mangled). Future devices
|
||||
** will be added in order of device creation to the list, so the names here are just
|
||||
** to help use remember which device is which. The U14ERR_... values follow the same
|
||||
** pattern for modern devices.a
|
||||
**/
|
||||
#define TYPEUNKNOWN -1 /* dont know */
|
||||
#define TYPE1401 0 /* standard 1401 */
|
||||
#define TYPEPLUS 1 /* 1401 plus */
|
||||
#define TYPEU1401 2 /* u1401 */
|
||||
#define TYPEPOWER 3 /* Power1401 */
|
||||
#define TYPEU14012 4 /* u1401 mkII */
|
||||
#define TYPEPOWER2 5 /* Power1401 mk II */
|
||||
#define TYPEMICRO3 6 /* Micro1401-3 */
|
||||
#define TYPEPOWER3 7 /* Power1401-3 */
|
||||
|
||||
/* Some useful defines of constants. DONT FORGET to change the version in the */
|
||||
/* resources whenever you change it here!. */
|
||||
#define DRIVERMAJREV 2 /* driver revision level major (match windows) */
|
||||
#define DRIVERMINREV 0 /* driver revision level minor */
|
||||
|
||||
/* Definitions of the various block transfer command codes */
|
||||
#define TM_EXTTOHOST 8 /* extended tohost */
|
||||
#define TM_EXTTO1401 9 /* extended to1401 */
|
||||
|
||||
/* Definitions of values in usbReqtype. Used in sorting out setup actions */
|
||||
#define H_TO_D 0x00
|
||||
#define D_TO_H 0x80
|
||||
#define VENDOR 0x40
|
||||
#define DEVREQ 0x00
|
||||
#define INTREQ 0x01
|
||||
#define ENDREQ 0x02
|
||||
|
||||
/* Definition of values in usbRequest, again used to sort out setup */
|
||||
#define GET_STATUS 0x00
|
||||
#define CLEAR_FEATURE 0x01
|
||||
#define SET_FEATURE 0x03
|
||||
#define SET_ADDRESS 0x05
|
||||
#define GET_DESC 0x06
|
||||
#define SET_DESC 0x07
|
||||
#define GET_CONF 0x08
|
||||
#define SET_CONF 0x09
|
||||
#define GET_INTERFACE 0x0a
|
||||
#define SET_INTERFACE 0x0b
|
||||
#define SYNCH_FRAME 0x0c
|
||||
|
||||
/* Definitions of the various debug command codes understood by the 1401. These */
|
||||
/* are used in various vendor-specific commands to achieve the desired effect */
|
||||
#define DB_GRAB 0x50 /* Grab is a NOP for USB */
|
||||
#define DB_FREE 0x51 /* Free is a NOP for the USB */
|
||||
#define DB_SETADD 0x52 /* Set debug address (double) */
|
||||
#define DB_SELFTEST 0x53 /* Start self test */
|
||||
#define DB_SETMASK 0x54 /* Set enable mask (double) */
|
||||
#define DB_SETDEF 0x55 /* Set default mask (double) */
|
||||
#define DB_PEEK 0x56 /* Peek address, save result */
|
||||
#define DB_POKE 0x57 /* Poke address with data (double) */
|
||||
#define DB_RAMPD 0x58 /* Ramp data at debug address */
|
||||
#define DB_RAMPA 0x59 /* Ramp address bus */
|
||||
#define DB_REPEATS 0x5A /* Set repeats for operations (double) */
|
||||
#define DB_WIDTH 0x5B /* Set width for operations (byte) */
|
||||
#define DB_DATA 0x5C /* Get 4-byte data read by PEEK */
|
||||
#define DB_CHARS 0x5D /* Send chars via EP0 control write */
|
||||
|
||||
#define CR_CHAR 0x0D /* The carriage return character */
|
||||
#define CR_CHAR_80 0x8d /* and with bit 7 set */
|
||||
|
||||
/* A structure holding information about a block */
|
||||
/* of memory for use in circular transfers */
|
||||
struct circ_blk {
|
||||
volatile UINT offset; /* Offset within area of block start */
|
||||
volatile UINT size; /* Size of the block, in bytes (0 = unused) */
|
||||
};
|
||||
|
||||
/* 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. */
|
||||
struct transarea {
|
||||
/* User address of xfer area saved for completeness */
|
||||
void __user *buff;
|
||||
|
||||
/* offset to start of xfer area in first page */
|
||||
UINT base_offset;
|
||||
|
||||
UINT length; /* Length of xfer area, in bytes */
|
||||
struct page **pages; /* Points at array of locked down pages */
|
||||
int n_pages; /* number of pages that are locked down */
|
||||
bool used; /* Is this structure in use? */
|
||||
bool circular; /* Is this area for circular transfers? */
|
||||
bool circ_to_host; /* Flag for direction of circular transfer */
|
||||
bool event_to_host; /* Set event on transfer to host? */
|
||||
int wake_up; /* Set 1 on event, cleared by TestEvent() */
|
||||
UINT event_st; /* Defines section within xfer area for... */
|
||||
UINT event_sz; /* notification by the event SZ is 0 if unset */
|
||||
struct circ_blk blocks[2]; /* Info on a pair of circular blocks */
|
||||
|
||||
wait_queue_head_t event; /* The wait queue for events in this */
|
||||
/* area MUST BE LAST */
|
||||
};
|
||||
|
||||
/* 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. */
|
||||
struct dmadesc {
|
||||
unsigned short trans_type; /* transfer type as TM_xxx above */
|
||||
unsigned short ident; /* identifier word */
|
||||
unsigned int size; /* bytes to transfer */
|
||||
unsigned int offset; /* offset into transfer area for trans */
|
||||
bool outward; /* true when data is going TO 1401 */
|
||||
};
|
||||
|
||||
#define INBUF_SZ 256 /* input buffer size */
|
||||
#define OUTBUF_SZ 256 /* output buffer size */
|
||||
#define STAGED_SZ 0x10000 /* size of coherent buffer for staged transfers */
|
||||
|
||||
/* Structure to hold all of our device specific stuff. We are making this as */
|
||||
/* similar as we can to the Windows driver to help in our understanding of */
|
||||
/* what is going on. */
|
||||
struct ced_data {
|
||||
char input_buffer[INBUF_SZ]; /* The two buffers */
|
||||
char output_buffer[OUTBUF_SZ]; /* accessed by the host functions */
|
||||
volatile unsigned int num_input; /* num of chars in input buffer */
|
||||
volatile unsigned int in_buff_get; /* where to get from input buffer */
|
||||
volatile unsigned int in_buff_put; /* where to put into input buffer */
|
||||
volatile unsigned int num_output; /* num of chars in output buffer */
|
||||
volatile unsigned int out_buff_get; /* where to get from output buffer*/
|
||||
volatile unsigned int out_buff_put; /* where to put into output buffer*/
|
||||
|
||||
volatile bool send_chars_pending; /* Flag to indicate sendchar active */
|
||||
volatile bool read_chars_pending; /* Flag to indicate a read is primed*/
|
||||
char *coher_char_out; /* special aligned buffer for chars to 1401 */
|
||||
struct urb *urb_char_out; /* urb used for chars to 1401 */
|
||||
char *coher_char_in; /* special aligned buffer for chars to host */
|
||||
struct urb *urb_char_in; /* urb used for chars to host */
|
||||
|
||||
spinlock_t char_out_lock; /* protect the output_buffer and outputting */
|
||||
spinlock_t char_in_lock; /* protect the input_buffer and char reads */
|
||||
__u8 interval; /* Interrupt end point interval */
|
||||
|
||||
volatile unsigned int dma_flag; /* state of DMA */
|
||||
struct transarea trans_def[MAX_TRANSAREAS]; /* transfer area info */
|
||||
volatile struct dmadesc dma_info; /* info on current DMA transfer */
|
||||
volatile bool xfer_waiting; /* Flag set if DMA transfer stalled */
|
||||
volatile bool in_draw_down; /* Flag that we want to halt transfers */
|
||||
|
||||
/* Parameters relating to a block read\write that is in progress. Some of these values */
|
||||
/* are equivalent to values in dma_info. The values here are those in use, while those */
|
||||
/* in dma_info are those received from the 1401 via an escape sequence. If another */
|
||||
/* escape sequence arrives before the previous xfer ends, dma_info values are updated while these */
|
||||
/* are used to finish off the current transfer. */
|
||||
volatile short staged_id; /* The transfer area id for this transfer */
|
||||
volatile bool staged_read; /* Flag TRUE for read from 1401, FALSE for write */
|
||||
volatile unsigned int staged_length; /* Total length of this transfer */
|
||||
volatile unsigned int staged_offset; /* Offset within memory area for transfer start */
|
||||
volatile unsigned int staged_done; /* Bytes transferred so far */
|
||||
volatile bool staged_urb_pending; /* Flag to indicate active */
|
||||
char *coher_staged_io; /* buffer used for block transfers */
|
||||
struct urb *staged_urb; /* The URB to use */
|
||||
spinlock_t staged_lock; /* protects ReadWriteMem() and */
|
||||
/* circular buffer stuff */
|
||||
|
||||
short type; /* type of 1401 attached */
|
||||
short current_state; /* current error state */
|
||||
bool is_usb2; /* type of the interface we connect to */
|
||||
bool force_reset; /* Flag to make sure we get a real reset */
|
||||
__u32 stat_buf[2]; /* buffer for 1401 state info */
|
||||
|
||||
unsigned long self_test_time; /* used to timeout self test */
|
||||
|
||||
int n_pipes; /* Should be 3 or 4 depending on 1401 usb chip */
|
||||
int pipe_error[4]; /* set non-zero if an error on one of the pipe */
|
||||
__u8 ep_addr[4]; /* addresses of the 3/4 end points */
|
||||
|
||||
struct usb_device *udev; /* the usb device for this device */
|
||||
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 mutex io_mutex; /* synchronize I/O with disconnect, one user-mode caller at a time */
|
||||
|
||||
int errors; /* the last request tanked */
|
||||
int open_count; /* count the number of openers */
|
||||
spinlock_t err_lock; /* lock for errors */
|
||||
struct kref kref;
|
||||
};
|
||||
|
||||
#define to_ced_data(d) container_of(d, struct ced_data, kref)
|
||||
|
||||
/* Definitions of routimes used between compilation object files */
|
||||
/* in usb1401.c */
|
||||
extern int ced_allowi(struct ced_data *ced);
|
||||
extern int ced_send_chars(struct ced_data *ced);
|
||||
extern void ced_draw_down(struct ced_data *ced);
|
||||
extern int ced_read_write_mem(struct ced_data *ced, bool read,
|
||||
unsigned short ident, unsigned int offs,
|
||||
unsigned int len);
|
||||
|
||||
/* in ced_ioc.c */
|
||||
extern int ced_clear_area(struct ced_data *ced, int area);
|
||||
extern int ced_send_string(struct ced_data *ced, const char __user *data, unsigned int n);
|
||||
extern int ced_send_char(struct ced_data *ced, char c);
|
||||
extern int ced_get_state(struct ced_data *ced, __u32 *state, __u32 *error);
|
||||
extern int ced_read_write_cancel(struct ced_data *ced);
|
||||
extern int ced_reset(struct ced_data *ced);
|
||||
extern int ced_get_char(struct ced_data *ced);
|
||||
extern int ced_get_string(struct ced_data *ced, char __user *user, int n);
|
||||
extern int ced_set_transfer(struct ced_data *ced,
|
||||
struct transfer_area_desc __user *utd);
|
||||
extern int ced_unset_transfer(struct ced_data *ced, int area);
|
||||
extern int ced_set_event(struct ced_data *ced,
|
||||
struct transfer_event __user *ute);
|
||||
extern int ced_stat_1401(struct ced_data *ced);
|
||||
extern int ced_line_count(struct ced_data *ced);
|
||||
extern int ced_get_out_buf_space(struct ced_data *ced);
|
||||
extern int ced_get_transfer(struct ced_data *ced, TGET_TX_BLOCK __user *utx);
|
||||
extern int ced_kill_io(struct ced_data *ced);
|
||||
extern int ced_state_of_1401(struct ced_data *ced);
|
||||
extern int ced_start_self_test(struct ced_data *ced);
|
||||
extern int ced_check_self_test(struct ced_data *ced,
|
||||
TGET_SELFTEST __user *ugst);
|
||||
extern int ced_type_of_1401(struct ced_data *ced);
|
||||
extern int ced_transfer_flags(struct ced_data *ced);
|
||||
extern int ced_dbg_peek(struct ced_data *ced, TDBGBLOCK __user *udb);
|
||||
extern int ced_dbg_poke(struct ced_data *ced, TDBGBLOCK __user *udb);
|
||||
extern int ced_dbg_ramp_data(struct ced_data *ced, TDBGBLOCK __user *udb);
|
||||
extern int ced_dbg_ramp_addr(struct ced_data *ced, TDBGBLOCK __user *udb);
|
||||
extern int ced_dbg_get_data(struct ced_data *ced, TDBGBLOCK __user *udb);
|
||||
extern int ced_dbg_stop_loop(struct ced_data *ced);
|
||||
extern int ced_set_circular(struct ced_data *ced,
|
||||
struct transfer_area_desc __user *utd);
|
||||
extern int ced_get_circ_block(struct ced_data *ced, TCIRCBLOCK __user *ucb);
|
||||
extern int ced_free_circ_block(struct ced_data *ced, TCIRCBLOCK __user *ucb);
|
||||
extern int ced_wait_event(struct ced_data *ced, int area, int time_out);
|
||||
extern int ced_test_event(struct ced_data *ced, int area);
|
||||
#endif
|
|
@ -1,288 +0,0 @@
|
|||
/****************************************************************************
|
||||
** use1401.h
|
||||
** Copyright (C) Cambridge Electronic Design Ltd, 1992-2010
|
||||
** Authors: Paul Cox, Tim Bergel, Greg Smith
|
||||
** See CVS for revisions.
|
||||
**
|
||||
** Because the size of a long is different between 32-bit and 64-bit on some
|
||||
** systems, we avoid this in this interface.
|
||||
****************************************************************************/
|
||||
#ifndef __USE1401_H__
|
||||
#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. */
|
||||
#ifdef _IS_WINDOWS_
|
||||
#ifndef U14_NOT_DLL
|
||||
#ifdef DLL_USE1401
|
||||
#define U14API(retType) (retType DllExport __stdcall)
|
||||
#else
|
||||
#define U14API(retType) (retType DllImport __stdcall)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define U14ERRBASE -500
|
||||
#define U14LONG long
|
||||
#endif
|
||||
|
||||
#ifdef LINUX
|
||||
#define U14ERRBASE -1000
|
||||
#define U14LONG int
|
||||
#endif
|
||||
|
||||
#ifdef _QT
|
||||
#ifndef U14_NOT_DLL
|
||||
#undef U14API
|
||||
#define U14API(retType) (retType __declspec(dllimport) __stdcall)
|
||||
#endif
|
||||
#undef U14LONG
|
||||
#define U14LONG int
|
||||
#endif
|
||||
|
||||
#ifndef U14API
|
||||
#define U14API(retType) retType
|
||||
#endif
|
||||
|
||||
#ifndef U14LONG
|
||||
#define U14LONG long
|
||||
#endif
|
||||
|
||||
/* 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 */
|
||||
#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 */
|
||||
#define U14ERR(n) (n+U14ERRBASE)
|
||||
#define U14ERR_OFF U14ERR(0) /* 1401 there but switched off */
|
||||
#define U14ERR_NC U14ERR(-1) /* 1401 not connected */
|
||||
#define U14ERR_ILL U14ERR(-2) /* if present it is ill */
|
||||
#define U14ERR_NOIF U14ERR(-3) /* I/F card missing */
|
||||
#define U14ERR_TIME U14ERR(-4) /* 1401 failed to come ready */
|
||||
#define U14ERR_BADSW U14ERR(-5) /* I/F card bad switches */
|
||||
#define U14ERR_PTIME U14ERR(-6) /* 1401plus failed to come ready */
|
||||
#define U14ERR_NOINT U14ERR(-7) /* couldn't grab the int vector */
|
||||
#define U14ERR_INUSE U14ERR(-8) /* 1401 is already in use */
|
||||
#define U14ERR_NODMA U14ERR(-9) /* couldn't get DMA channel */
|
||||
#define U14ERR_BADHAND U14ERR(-10) /* handle provided was bad */
|
||||
#define U14ERR_BAD1401NUM U14ERR(-11) /* 1401 number provided was bad */
|
||||
|
||||
#define U14ERR_NO_SUCH_FN U14ERR(-20) /* no such function */
|
||||
#define U14ERR_NO_SUCH_SUBFN U14ERR(-21) /* no such sub function */
|
||||
#define U14ERR_NOOUT U14ERR(-22) /* no room in output buffer */
|
||||
#define U14ERR_NOIN U14ERR(-23) /* no input in buffer */
|
||||
#define U14ERR_STRLEN U14ERR(-24) /* string longer than buffer */
|
||||
#define U14ERR_ERR_STRLEN U14ERR(-24) /* string longer than buffer */
|
||||
#define U14ERR_LOCKFAIL U14ERR(-25) /* failed to lock memory */
|
||||
#define U14ERR_UNLOCKFAIL U14ERR(-26) /* failed to unlock memory */
|
||||
#define U14ERR_ALREADYSET U14ERR(-27) /* area already set up */
|
||||
#define U14ERR_NOTSET U14ERR(-28) /* area not set up */
|
||||
#define U14ERR_BADAREA U14ERR(-29) /* illegal area number */
|
||||
#define U14ERR_FAIL U14ERR(-30) /* we failed for some other reason*/
|
||||
|
||||
#define U14ERR_NOFILE U14ERR(-40) /* command file not found */
|
||||
#define U14ERR_READERR U14ERR(-41) /* error reading command file */
|
||||
#define U14ERR_UNKNOWN U14ERR(-42) /* unknown command */
|
||||
#define U14ERR_HOSTSPACE U14ERR(-43) /* not enough host space to load */
|
||||
#define U14ERR_LOCKERR U14ERR(-44) /* could not lock resource/command*/
|
||||
#define U14ERR_CLOADERR U14ERR(-45) /* CLOAD command failed */
|
||||
|
||||
#define U14ERR_TOXXXERR U14ERR(-60) /* tohost/1401 failed */
|
||||
#define U14ERR_NO386ENH U14ERR(-80) /* not 386 enhanced mode */
|
||||
#define U14ERR_NO1401DRIV U14ERR(-81) /* no device driver */
|
||||
#define U14ERR_DRIVTOOOLD U14ERR(-82) /* device driver too old */
|
||||
|
||||
#define U14ERR_TIMEOUT U14ERR(-90) /* timeout occurred */
|
||||
|
||||
#define U14ERR_BUFF_SMALL U14ERR(-100) /* buffer for getstring too small */
|
||||
#define U14ERR_CBALREADY U14ERR(-101) /* there is already a callback */
|
||||
#define U14ERR_BADDEREG U14ERR(-102) /* bad parameter to deregcallback */
|
||||
#define U14ERR_NOMEMORY U14ERR(-103) /* no memory for allocation */
|
||||
|
||||
#define U14ERR_DRIVCOMMS U14ERR(-110) /* failed talking to driver */
|
||||
#define U14ERR_OUTOFMEMORY U14ERR(-111) /* needed memory and couldnt get it*/
|
||||
|
||||
/* / 1401 type codes. */
|
||||
#define U14TYPE1401 0 /* standard 1401 */
|
||||
#define U14TYPEPLUS 1 /* 1401 plus */
|
||||
#define U14TYPEU1401 2 /* u1401 */
|
||||
#define U14TYPEPOWER 3 /* power1401 */
|
||||
#define U14TYPEU14012 4 /* u1401 mk II */
|
||||
#define U14TYPEPOWER2 5 /* power1401 mk II */
|
||||
#define U14TYPEU14013 6 /* u1401-3 */
|
||||
#define U14TYPEPOWER3 7 /* power1401-3 */
|
||||
#define U14TYPEUNKNOWN -1 /* dont know */
|
||||
|
||||
/* Transfer flags to allow driver capabilities to be interrogated */
|
||||
|
||||
/* 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 */
|
||||
#define U14TF_USB2 8 /* for USB2 interface and 1401 */
|
||||
#define U14TF_NOTIFY 16 /* for event notifications */
|
||||
#define U14TF_SHORT 32 /* for PCI can short cycle */
|
||||
#define U14TF_PCI2 64 /* for new PCI card 1401-70 */
|
||||
#define U14TF_CIRCTH 128 /* Circular-mode to host */
|
||||
#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 */
|
||||
#define ESZBYTES 0 /* BYTE 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 */
|
||||
#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 */
|
||||
#define GET_TX_MAXENTRIES 257 /* (max length / page size + 1) */
|
||||
|
||||
#ifdef _IS_WINDOWS_
|
||||
#pragma pack(1)
|
||||
|
||||
typedef struct /* used for U14_GetTransfer results */
|
||||
{ /* Info on a single mapped block */
|
||||
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 */
|
||||
} TGET_TX_BLOCK;
|
||||
|
||||
typedef TGET_TX_BLOCK *LPGET_TX_BLOCK;
|
||||
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef LINUX
|
||||
typedef struct /* used for U14_GetTransfer results */
|
||||
{ /* Info on a single mapped block */
|
||||
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 */
|
||||
} TGET_TX_BLOCK;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
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) 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) 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(unsigned int) U14Ld(short hand, const char *vl, const char *str);
|
||||
|
||||
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, 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, unsigned short wArea, BOOL bToHost, void *pvBuff,
|
||||
unsigned int dwLength);
|
||||
|
||||
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(void) U14SetTimeout(short hand, int lTimeout);
|
||||
U14API(int) U14GetTimeout(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, 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(unsigned int dwMinKb, unsigned int dwMaxKb);
|
||||
U14API(int) U14InitLib(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* End of ifndef __USE1401_H__ */
|
||||
|
|
@ -1,299 +0,0 @@
|
|||
/* 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
|
||||
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;
|
||||
|
||||
struct transfer_area_desc /* Structure and type for SetTransArea */
|
||||
{
|
||||
unsigned short wArea; /* number of transfer area to set up */
|
||||
void FAR *lpvBuff; /* address of transfer area */
|
||||
unsigned int dwLength; /* length of area to set up */
|
||||
short eSize; /* size to move (for swapping on MAC) */
|
||||
};
|
||||
|
||||
|
||||
/* This is the structure used to set up a transfer area */
|
||||
typedef struct VXTransferDesc /* use1401.c and use1432x.x use only */
|
||||
{
|
||||
unsigned short wArea; /* number of transfer area to set up */
|
||||
unsigned short wAddrSel; /* 16 bit selector for area */
|
||||
unsigned int dwAddrOfs; /* 32 bit offset for area start */
|
||||
unsigned int dwLength; /* length of area to set up */
|
||||
} VXTRANSFERDESC;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue