Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
usb1401.h File Reference
#include "use1401.h"
#include "ced_ioctl.h"

Go to the source code of this file.

Data Structures

struct  circBlk
 A structure holding information about a block of memory for use in circular transfers. More...
 
struct  transarea
 
struct  dmadesc
 
struct  _DEVICE_EXTENSION
 

Macros

#define UINT   unsigned int
 
#define TYPEUNKNOWN   -1
 
#define TYPE1401   0
 
#define TYPEPLUS   1
 
#define TYPEU1401   2
 
#define TYPEPOWER   3
 
#define TYPEU14012   4
 
#define TYPEPOWER2   5
 
#define TYPEMICRO3   6
 
#define TYPEPOWER3   7
 
#define DRIVERMAJREV   2
 
#define DRIVERMINREV   0
 
#define TM_EXTTOHOST   8
 Definitions of the various block transfer command codes.
 
#define TM_EXTTO1401   9
 
#define H_TO_D   0x00
 Definitions of values in usbReqtype. Used in sorting out setup actions.
 
#define D_TO_H   0x80
 
#define VENDOR   0x40
 
#define DEVREQ   0x00
 
#define INTREQ   0x01
 
#define ENDREQ   0x02
 
#define GET_STATUS   0x00
 Definition of values in usbRequest, again used to sort out setup.
 
#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
 
#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 */
 
#define INBUF_SZ   256 /* input buffer size */
 
#define OUTBUF_SZ   256 /* output buffer size */
 
#define STAGED_SZ   0x10000
 
#define to_DEVICE_EXTENSION(d)   container_of(d, DEVICE_EXTENSION, kref)
 

Typedefs

typedef struct circBlk CIRCBLK
 A structure holding information about a block of memory for use in circular transfers.
 
typedef struct transarea TRANSAREA
 
typedef struct dmadesc DMADESC
 
typedef struct _DEVICE_EXTENSION DEVICE_EXTENSION
 
typedef struct _DEVICE_EXTENSIONPDEVICE_EXTENSION
 

Functions

int Allowi (DEVICE_EXTENSION *pdx, bool bInCallback)
 Definitions of routimes used between compilation object files.
 
int SendChars (DEVICE_EXTENSION *pdx)
 
void ced_draw_down (DEVICE_EXTENSION *pdx)
 
int ReadWriteMem (DEVICE_EXTENSION *pdx, bool Read, unsigned short wIdent, unsigned int dwOffs, unsigned int dwLen)
 
int ClearArea (DEVICE_EXTENSION *pdx, int nArea)
 
int SendString (DEVICE_EXTENSION *pdx, const char __user *pData, unsigned int n)
 
int SendChar (DEVICE_EXTENSION *pdx, char c)
 
int Get1401State (DEVICE_EXTENSION *pdx, __u32 *state, __u32 *error)
 
int ReadWrite_Cancel (DEVICE_EXTENSION *pdx)
 
bool Is1401 (DEVICE_EXTENSION *pdx)
 
bool QuickCheck (DEVICE_EXTENSION *pdx, bool bTestBuff, bool bCanReset)
 
int Reset1401 (DEVICE_EXTENSION *pdx)
 
int GetChar (DEVICE_EXTENSION *pdx)
 
int GetString (DEVICE_EXTENSION *pdx, char __user *pUser, int n)
 
int SetTransfer (DEVICE_EXTENSION *pdx, TRANSFERDESC __user *pTD)
 
int UnsetTransfer (DEVICE_EXTENSION *pdx, int nArea)
 
int SetEvent (DEVICE_EXTENSION *pdx, TRANSFEREVENT __user *pTE)
 
int Stat1401 (DEVICE_EXTENSION *pdx)
 
int LineCount (DEVICE_EXTENSION *pdx)
 
int GetOutBufSpace (DEVICE_EXTENSION *pdx)
 
int GetTransfer (DEVICE_EXTENSION *pdx, TGET_TX_BLOCK __user *pGTB)
 
int KillIO1401 (DEVICE_EXTENSION *pdx)
 
int BlkTransState (DEVICE_EXTENSION *pdx)
 
int StateOf1401 (DEVICE_EXTENSION *pdx)
 
int StartSelfTest (DEVICE_EXTENSION *pdx)
 
int CheckSelfTest (DEVICE_EXTENSION *pdx, TGET_SELFTEST __user *pGST)
 
int TypeOf1401 (DEVICE_EXTENSION *pdx)
 
int TransferFlags (DEVICE_EXTENSION *pdx)
 
int DbgPeek (DEVICE_EXTENSION *pdx, TDBGBLOCK __user *pDB)
 
int DbgPoke (DEVICE_EXTENSION *pdx, TDBGBLOCK __user *pDB)
 
int DbgRampData (DEVICE_EXTENSION *pdx, TDBGBLOCK __user *pDB)
 
int DbgRampAddr (DEVICE_EXTENSION *pdx, TDBGBLOCK __user *pDB)
 
int DbgGetData (DEVICE_EXTENSION *pdx, TDBGBLOCK __user *pDB)
 
int DbgStopLoop (DEVICE_EXTENSION *pdx)
 
int SetCircular (DEVICE_EXTENSION *pdx, TRANSFERDESC __user *pTD)
 
int GetCircBlock (DEVICE_EXTENSION *pdx, TCIRCBLOCK __user *pCB)
 
int FreeCircBlock (DEVICE_EXTENSION *pdx, TCIRCBLOCK __user *pCB)
 
int WaitEvent (DEVICE_EXTENSION *pdx, int nArea, int msTimeOut)
 
int TestEvent (DEVICE_EXTENSION *pdx, int nArea)
 

Macro Definition Documentation

#define CLEAR_FEATURE   0x01

Definition at line 63 of file usb1401.h.

#define CR_CHAR   0x0D /* The carriage return character */

Definition at line 91 of file usb1401.h.

#define CR_CHAR_80   0x8d /* and with bit 7 set */

Definition at line 92 of file usb1401.h.

#define D_TO_H   0x80

Definition at line 55 of file usb1401.h.

#define DB_CHARS   0x5D /* Send chars via EP0 control write */

Definition at line 89 of file usb1401.h.

#define DB_DATA   0x5C /* Get 4-byte data read by PEEK */

Definition at line 88 of file usb1401.h.

#define DB_FREE   0x51 /* Free is a NOP for the USB */

Definition at line 77 of file usb1401.h.

#define DB_GRAB   0x50 /* Grab is a NOP for USB */

Definitions of the various debug command codes understood by the 1401. These are used in various vendor-specific commands to achieve the desired effect

Definition at line 76 of file usb1401.h.

#define DB_PEEK   0x56 /* Peek address, save result */

Definition at line 82 of file usb1401.h.

#define DB_POKE   0x57 /* Poke address with data (double) */

Definition at line 83 of file usb1401.h.

#define DB_RAMPA   0x59 /* Ramp address bus */

Definition at line 85 of file usb1401.h.

#define DB_RAMPD   0x58 /* Ramp data at debug address */

Definition at line 84 of file usb1401.h.

#define DB_REPEATS   0x5A /* Set repeats for operations (double) */

Definition at line 86 of file usb1401.h.

#define DB_SELFTEST   0x53 /* Start self test */

Definition at line 79 of file usb1401.h.

#define DB_SETADD   0x52 /* Set debug address (double) */

Definition at line 78 of file usb1401.h.

#define DB_SETDEF   0x55 /* Set default mask (double) */

Definition at line 81 of file usb1401.h.

#define DB_SETMASK   0x54 /* Set enable mask (double) */

Definition at line 80 of file usb1401.h.

#define DB_WIDTH   0x5B /* Set width for operations (byte) */

Definition at line 87 of file usb1401.h.

#define DEVREQ   0x00

Definition at line 57 of file usb1401.h.

#define DRIVERMAJREV   2

Some useful defines of constants. DONT FORGET to change the version in the resources whenever you change it here!.

Definition at line 46 of file usb1401.h.

#define DRIVERMINREV   0

Definition at line 47 of file usb1401.h.

#define ENDREQ   0x02

Definition at line 59 of file usb1401.h.

#define GET_CONF   0x08

Definition at line 68 of file usb1401.h.

#define GET_DESC   0x06

Definition at line 66 of file usb1401.h.

#define GET_INTERFACE   0x0a

Definition at line 70 of file usb1401.h.

#define GET_STATUS   0x00

Definition of values in usbRequest, again used to sort out setup.

Definition at line 62 of file usb1401.h.

#define H_TO_D   0x00

Definitions of values in usbReqtype. Used in sorting out setup actions.

Definition at line 54 of file usb1401.h.

#define INBUF_SZ   256 /* input buffer size */

Definition at line 132 of file usb1401.h.

#define INTREQ   0x01

Definition at line 58 of file usb1401.h.

#define OUTBUF_SZ   256 /* output buffer size */

Definition at line 133 of file usb1401.h.

#define SET_ADDRESS   0x05

Definition at line 65 of file usb1401.h.

#define SET_CONF   0x09

Definition at line 69 of file usb1401.h.

#define SET_DESC   0x07

Definition at line 67 of file usb1401.h.

#define SET_FEATURE   0x03

Definition at line 64 of file usb1401.h.

#define SET_INTERFACE   0x0b

Definition at line 71 of file usb1401.h.

#define STAGED_SZ   0x10000

Definition at line 134 of file usb1401.h.

#define SYNCH_FRAME   0x0c

Definition at line 72 of file usb1401.h.

#define TM_EXTTO1401   9

Definition at line 51 of file usb1401.h.

#define TM_EXTTOHOST   8

Definitions of the various block transfer command codes.

Definition at line 50 of file usb1401.h.

#define to_DEVICE_EXTENSION (   d)    container_of(d, DEVICE_EXTENSION, kref)

Definition at line 203 of file usb1401.h.

#define TYPE1401   0

Definition at line 35 of file usb1401.h.

#define TYPEMICRO3   6

Definition at line 41 of file usb1401.h.

#define TYPEPLUS   1

Definition at line 36 of file usb1401.h.

#define TYPEPOWER   3

Definition at line 38 of file usb1401.h.

#define TYPEPOWER2   5

Definition at line 40 of file usb1401.h.

#define TYPEPOWER3   7

Definition at line 42 of file usb1401.h.

#define TYPEU1401   2

Definition at line 37 of file usb1401.h.

#define TYPEU14012   4

Definition at line 39 of file usb1401.h.

#define TYPEUNKNOWN   -1

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.

Definition at line 34 of file usb1401.h.

#define UINT   unsigned int

Definition at line 26 of file usb1401.h.

#define VENDOR   0x40

Definition at line 56 of file usb1401.h.

Typedef Documentation

A structure holding information about a block of memory for use in circular 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.

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.

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.

Function Documentation

int Allowi ( DEVICE_EXTENSION pdx,
bool  bInCallback 
)

Definitions of routimes used between compilation object files.

Definition at line 1201 of file usb1401.c.

int BlkTransState ( DEVICE_EXTENSION pdx)

Definition at line 953 of file ced_ioc.c.

void ced_draw_down ( DEVICE_EXTENSION pdx)

Definition at line 1568 of file usb1401.c.

int CheckSelfTest ( DEVICE_EXTENSION pdx,
TGET_SELFTEST __user pGST 
)

Definition at line 1011 of file ced_ioc.c.

int ClearArea ( DEVICE_EXTENSION pdx,
int  nArea 
)

Definition at line 600 of file ced_ioc.c.

int DbgGetData ( DEVICE_EXTENSION pdx,
TDBGBLOCK __user pDB 
)

Definition at line 1278 of file ced_ioc.c.

int DbgPeek ( DEVICE_EXTENSION pdx,
TDBGBLOCK __user pDB 
)

Definition at line 1158 of file ced_ioc.c.

int DbgPoke ( DEVICE_EXTENSION pdx,
TDBGBLOCK __user pDB 
)

Definition at line 1187 of file ced_ioc.c.

int DbgRampAddr ( DEVICE_EXTENSION pdx,
TDBGBLOCK __user pDB 
)

Definition at line 1248 of file ced_ioc.c.

int DbgRampData ( DEVICE_EXTENSION pdx,
TDBGBLOCK __user pDB 
)

Definition at line 1216 of file ced_ioc.c.

int DbgStopLoop ( DEVICE_EXTENSION pdx)

Definition at line 1311 of file ced_ioc.c.

int FreeCircBlock ( DEVICE_EXTENSION pdx,
TCIRCBLOCK __user pCB 
)

Definition at line 1414 of file ced_ioc.c.

int Get1401State ( DEVICE_EXTENSION pdx,
__u32 state,
__u32 error 
)

Definition at line 174 of file ced_ioc.c.

int GetChar ( DEVICE_EXTENSION pdx)

Definition at line 429 of file ced_ioc.c.

int GetCircBlock ( DEVICE_EXTENSION pdx,
TCIRCBLOCK __user pCB 
)

Definition at line 1362 of file ced_ioc.c.

int GetOutBufSpace ( DEVICE_EXTENSION pdx)

Definition at line 582 of file ced_ioc.c.

int GetString ( DEVICE_EXTENSION pdx,
char __user pUser,
int  n 
)

Definition at line 467 of file ced_ioc.c.

int GetTransfer ( DEVICE_EXTENSION pdx,
TGET_TX_BLOCK __user pGTB 
)

Definition at line 905 of file ced_ioc.c.

bool Is1401 ( DEVICE_EXTENSION pdx)

Definition at line 306 of file ced_ioc.c.

int KillIO1401 ( DEVICE_EXTENSION pdx)

Definition at line 938 of file ced_ioc.c.

int LineCount ( DEVICE_EXTENSION pdx)

Definition at line 548 of file ced_ioc.c.

bool QuickCheck ( DEVICE_EXTENSION pdx,
bool  bTestBuff,
bool  bCanReset 
)

Definition at line 366 of file ced_ioc.c.

int ReadWrite_Cancel ( DEVICE_EXTENSION pdx)

Definition at line 222 of file ced_ioc.c.

int ReadWriteMem ( DEVICE_EXTENSION pdx,
bool  Read,
unsigned short  wIdent,
unsigned int  dwOffs,
unsigned int  dwLen 
)

Definition at line 791 of file usb1401.c.

int Reset1401 ( DEVICE_EXTENSION pdx)

Definition at line 415 of file ced_ioc.c.

int SendChar ( DEVICE_EXTENSION pdx,
char  c 
)

Definition at line 137 of file ced_ioc.c.

int SendChars ( DEVICE_EXTENSION pdx)

Definition at line 358 of file usb1401.c.

int SendString ( DEVICE_EXTENSION pdx,
const char __user pData,
unsigned int  n 
)

Definition at line 107 of file ced_ioc.c.

int SetCircular ( DEVICE_EXTENSION pdx,
TRANSFERDESC __user pTD 
)

Definition at line 1332 of file ced_ioc.c.

int SetEvent ( DEVICE_EXTENSION pdx,
TRANSFEREVENT __user pTE 
)

Definition at line 801 of file ced_ioc.c.

int SetTransfer ( DEVICE_EXTENSION pdx,
TRANSFERDESC __user pTD 
)

Definition at line 758 of file ced_ioc.c.

int StartSelfTest ( DEVICE_EXTENSION pdx)

Definition at line 985 of file ced_ioc.c.

int Stat1401 ( DEVICE_EXTENSION pdx)

Definition at line 530 of file ced_ioc.c.

int StateOf1401 ( DEVICE_EXTENSION pdx)

Definition at line 965 of file ced_ioc.c.

int TestEvent ( DEVICE_EXTENSION pdx,
int  nArea 
)

Definition at line 884 of file ced_ioc.c.

int TransferFlags ( DEVICE_EXTENSION pdx)

Definition at line 1122 of file ced_ioc.c.

int TypeOf1401 ( DEVICE_EXTENSION pdx)

Definition at line 1089 of file ced_ioc.c.

int UnsetTransfer ( DEVICE_EXTENSION pdx,
int  nArea 
)

Definition at line 784 of file ced_ioc.c.

int WaitEvent ( DEVICE_EXTENSION pdx,
int  nArea,
int  msTimeOut 
)

Definition at line 837 of file ced_ioc.c.