source: trunk/csctapi/sci_global.h@ 1

Last change on this file since 1 was 1, checked in by root, 14 years ago

initial import

File size: 2.5 KB
Line 
1#if defined(SCI_DEV) && !defined(_sci_global_h_)
2#define _sci_global_h_
3
4#define INT int
5#define UCHAR unsigned char
6#define ULONG unsigned long
7
8#define SCI_CLASS_A 1 /* only 5V Vcc to Smart Card */
9#define SCI_CLASS_B 2 /* only 3V Vcc to Smart Card */
10#define SCI_CLASS_AB 3 /* 5V or 3V Vcc to Smart Card */
11#define SCI_NUMBER_OF_CONTROLLERS 2 /* number of SCI controllers */
12
13#define SCI_BUFFER_SIZE 512
14
15#define SCI_CLOCK_STOP_DISABLED 0
16#define SCI_CLOCK_STOP_LOW 1
17#define SCI_CLOCK_STOP_HIGH 2
18
19#define SCI_MAX_ATR_SIZE 33
20
21#define SCI_MAX_F 80000000
22#define SCI_MAX_ETU 0xFFF
23#define SCI_MAX_WWT 0xFFFFFFFF
24#define SCI_MAX_CWT 0xFFFF
25#define SCI_MAX_BWT 0xFFFFFFFF
26#define SCI_MAX_EGT 0xFF
27
28#define SCI_MIN_F 1000000
29#define SCI_MIN_ETU 8
30#define SCI_MIN_WWT 12
31#define SCI_MIN_CWT 12
32#define SCI_MIN_BWT 971
33#define SCI_MIN_EGT 0
34
35#define SCI_SYNC 0x00000001
36#define SCI_DATA_ANY 0x00000002
37
38/* Reserved for Future Use defined as 0 */
39#define RFU 0
40
41/* error codes */
42typedef enum
43{
44 SCI_ERROR_OK = 0,
45 SCI_ERROR_DRIVER_NOT_INITIALIZED = -1691,
46 SCI_ERROR_FAIL,
47 SCI_ERROR_KERNEL_FAIL,
48 SCI_ERROR_NO_ATR,
49 SCI_ERROR_TS_CHARACTER_INVALID,
50 SCI_ERROR_LRC_FAIL,
51 SCI_ERROR_CRC_FAIL,
52 SCI_ERROR_LENGTH_FAIL,
53 SCI_ERROR_PARITY_FAIL,
54 SCI_ERROR_RX_OVERFLOW_FAIL,
55 SCI_ERROR_TX_OVERFLOW_FAIL,
56 SCI_ERROR_TX_UNDERRUN_FAIL,
57 SCI_ERROR_CARD_NOT_PRESENT,
58 SCI_ERROR_CARD_NOT_ACTIVATED,
59 SCI_ERROR_AWT_TIMEOUT,
60 SCI_ERROR_WWT_TIMEOUT,
61 SCI_ERROR_CWT_TIMEOUT,
62 SCI_ERROR_BWT_TIMEOUT,
63 SCI_ERROR_PARAMETER_OUT_OF_RANGE,
64 SCI_ERROR_TRANSACTION_ABORTED,
65 SCI_ERROR_CLOCK_STOP_DISABLED,
66 SCI_ERROR_TX_PENDING,
67 SCI_ERROR_ATR_PENDING
68}
69SCI_ERROR;
70
71/* SCI driver modes */
72typedef struct sci_modes
73{
74 INT emv2000;
75 INT dma;
76 INT man_act;
77 INT rw_mode;
78}
79SCI_MODES;
80
81/* SCI communication parameters */
82typedef struct sci_parameters
83{
84 UCHAR T;
85 ULONG f;
86 ULONG ETU;
87 ULONG WWT;
88 ULONG CWT;
89 ULONG BWT;
90 ULONG EGT;
91 ULONG clock_stop_polarity;
92 UCHAR check;
93 UCHAR P;
94 UCHAR I;
95 UCHAR U;
96}
97SCI_PARAMETERS;
98
99/* SCI ATR status */
100typedef enum
101{
102 SCI_WITHOUT_ATR = 0,
103 SCI_ATR_READY
104}
105SCI_ATR_STATUS;
106
107#endif /* _sci_global_h_ */
Note: See TracBrowser for help on using the repository browser.