/[pcsclite]/trunk/Drivers/ccid/src/ccid.h
ViewVC logotype

Contents of /trunk/Drivers/ccid/src/ccid.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1260 - (show annotations) (download)
Thu Sep 30 14:05:54 2004 UTC (8 years, 8 months ago) by rousseau
File MIME type: text/plain
File size: 3102 byte(s)
 #define CCID_CLASS_CHARACTER
1 /*
2 ccid.h: CCID structures
3 Copyright (C) 2003 Ludovic Rousseau
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20 /*
21 * $Id$
22 */
23
24 typedef struct
25 {
26 /*
27 * CCID Sequence number
28 */
29 unsigned char *pbSeq;
30 unsigned char real_bSeq;
31
32 /*
33 * VendorID << 16 + ProductID
34 */
35 int readerID;
36
37 /*
38 * Maximum message length
39 */
40 int dwMaxCCIDMessageLength;
41
42 /*
43 * Maximum IFSD
44 */
45 int dwMaxIFSD;
46
47 /*
48 * Features supported by the reader (directly from Class Descriptor)
49 */
50 int dwFeatures;
51
52 /*
53 * PIN support of the reader (directly from Class Descriptor)
54 */
55 char bPINSupport;
56
57 /*
58 * Default Clock
59 */
60 int dwDefaultClock;
61
62 /*
63 * Max Data Rate
64 */
65 int dwMaxDataRate;
66
67 /*
68 * Number of available slots
69 */
70 char bMaxSlotIndex;
71
72 /*
73 * Slot in use
74 */
75 char bCurrentSlotIndex;
76
77 } _ccid_descriptor;
78
79 /* Features from dwFeatures */
80 #define CCID_CLASS_AUTO_CONF_ATR 0x00000002
81 #define CCID_CLASS_AUTO_VOLTAGE 0x00000008
82 #define CCID_CLASS_AUTO_BAUD 0x00000020
83 #define CCID_CLASS_AUTO_PPS_CUR 0x00000080
84 #define CCID_CLASS_AUTO_IFSD 0x00000400
85 #define CCID_CLASS_CHARACTER 0x00000000
86 #define CCID_CLASS_TPDU 0x00010000
87 #define CCID_CLASS_SHORT_APDU 0x00020000
88 #define CCID_CLASS_EXTENDED_APDU 0x00040000
89 #define CCID_CLASS_EXCHANGE_MASK 0x00070000
90
91 /* Features from bPINSupport */
92 #define CCID_CLASS_PIN_VERIFY 0x01
93 #define CCID_CLASS_PIN_MODIFY 0x02
94
95 /* See CCID specs ch. 4.2.1 */
96 #define CCID_ICC_PRESENT_ACTIVE 0x00 /* 00 0000 00 */
97 #define CCID_ICC_PRESENT_INACTIVE 0x01 /* 00 0000 01 */
98 #define CCID_ICC_ABSENT 0x02 /* 00 0000 20 */
99 #define CCID_ICC_STATUS_MASK 0x03 /* 00 0000 11 */
100
101 #define CCID_COMMAND_FAILED 0x40 /* 01 0000 00 */
102 #define CCID_TIME_EXTENSION 0x80 /* 10 0000 00 */
103
104 /* Product identification for special treatments */
105 #define GEMPC433 0x08E64433
106 #define GEMPCKEY 0x08E63438
107 #define GEMPCTWIN 0x08E63437
108 #define CARDMAN3121 0x076B3021
109 #define LTC31 0x07830003
110 #define SCR331DI 0x04E65111
111 #define CHERRYXX33 0x046A0005
112 #define OZ776 0x0B977762
113
114 /* Escape sequence codes */
115 #define ESC_GEMPC_SET_ISO_MODE 1
116 #define ESC_GEMPC_SET_APDU_MODE 2
117
118
119 int ccid_open_hack(unsigned int reader_index);
120 void ccid_error(int error, char *file, int line, char *function);
121 _ccid_descriptor *get_ccid_descriptor(unsigned int reader_index);
122
123 /* convert a 4 byte integer in USB format into an int */
124 #define dw2i(a, x) ((((((a[x+3] << 8) + a[x+2]) << 8) + a[x+1]) << 8) + a[x])
125

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.5