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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1260 by rousseau, Thu Sep 30 14:05:54 2004 UTC revision 2084 by rousseau, Mon Jul 3 12:56:13 2006 UTC
# Line 2  Line 2 
2      ccid.h: CCID structures      ccid.h: CCID structures
3      Copyright (C) 2003   Ludovic Rousseau      Copyright (C) 2003   Ludovic Rousseau
4    
5      This program is free software; you can redistribute it and/or modify      This library is free software; you can redistribute it and/or
6      it under the terms of the GNU General Public License as published by      modify it under the terms of the GNU Lesser General Public
7      the Free Software Foundation; either version 2 of the License, or      License as published by the Free Software Foundation; either
8      (at your option) any later version.      version 2.1 of the License, or (at your option) any later version.
9    
10      This program is distributed in the hope that it will be useful,      This library is distributed in the hope that it will be useful,
11      but WITHOUT ANY WARRANTY; without even the implied warranty of      but WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13      GNU General Public License for more details.      Lesser General Public License for more details.
14    
15      You should have received a copy of the GNU General Public License      You should have received a copy of the GNU Lesser General Public
16      along with this program; if not, write to the Free Software      License along with this library; if not, write to the Free Software
17      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
18  */  */
19    
20  /*  /*
# Line 37  typedef struct Line 37  typedef struct
37          /*          /*
38           * Maximum message length           * Maximum message length
39           */           */
40          int dwMaxCCIDMessageLength;          unsigned int dwMaxCCIDMessageLength;
41    
42          /*          /*
43           * Maximum IFSD           * Maximum IFSD
# Line 62  typedef struct Line 62  typedef struct
62          /*          /*
63           * Max Data Rate           * Max Data Rate
64           */           */
65          int dwMaxDataRate;          unsigned int dwMaxDataRate;
66    
67          /*          /*
68           * Number of available slots           * Number of available slots
# Line 74  typedef struct Line 74  typedef struct
74           */           */
75          char bCurrentSlotIndex;          char bCurrentSlotIndex;
76    
77            /*
78             * The array of data rates supported by the reader
79             */
80            unsigned int *arrayOfSupportedDataRates;
81    
82            /*
83             * Read communication port timeout
84             * value is seconds
85             * this value can evolve dynamically if card request it (time processing).
86             */
87            unsigned int readTimeout;
88    
89            /*
90             * Card protocol
91             */
92            int cardProtocol;
93  } _ccid_descriptor;  } _ccid_descriptor;
94    
95  /* Features from dwFeatures */  /* Features from dwFeatures */
96  #define CCID_CLASS_AUTO_CONF_ATR        0x00000002  #define CCID_CLASS_AUTO_CONF_ATR        0x00000002
97  #define CCID_CLASS_AUTO_VOLTAGE         0x00000008  #define CCID_CLASS_AUTO_VOLTAGE         0x00000008
98  #define CCID_CLASS_AUTO_BAUD            0x00000020  #define CCID_CLASS_AUTO_BAUD            0x00000020
99    #define CCID_CLASS_AUTO_PPS_PROP        0x00000040
100  #define CCID_CLASS_AUTO_PPS_CUR         0x00000080  #define CCID_CLASS_AUTO_PPS_CUR         0x00000080
101  #define CCID_CLASS_AUTO_IFSD            0x00000400  #define CCID_CLASS_AUTO_IFSD            0x00000400
102  #define CCID_CLASS_CHARACTER            0x00000000  #define CCID_CLASS_CHARACTER            0x00000000
# Line 95  typedef struct Line 112  typedef struct
112  /* See CCID specs ch. 4.2.1 */  /* See CCID specs ch. 4.2.1 */
113  #define CCID_ICC_PRESENT_ACTIVE         0x00    /* 00 0000 00 */  #define CCID_ICC_PRESENT_ACTIVE         0x00    /* 00 0000 00 */
114  #define CCID_ICC_PRESENT_INACTIVE       0x01    /* 00 0000 01 */  #define CCID_ICC_PRESENT_INACTIVE       0x01    /* 00 0000 01 */
115  #define CCID_ICC_ABSENT                         0x02    /* 00 0000 20 */  #define CCID_ICC_ABSENT                         0x02    /* 00 0000 10 */
116  #define CCID_ICC_STATUS_MASK            0x03    /* 00 0000 11 */  #define CCID_ICC_STATUS_MASK            0x03    /* 00 0000 11 */
117    
118  #define CCID_COMMAND_FAILED                     0x40    /* 01 0000 00 */  #define CCID_COMMAND_FAILED                     0x40    /* 01 0000 00 */
# Line 105  typedef struct Line 122  typedef struct
122  #define GEMPC433        0x08E64433  #define GEMPC433        0x08E64433
123  #define GEMPCKEY        0x08E63438  #define GEMPCKEY        0x08E63438
124  #define GEMPCTWIN       0x08E63437  #define GEMPCTWIN       0x08E63437
125    #define GEMPCPINPAD 0x08E63478
126    #define GEMCORESIMPRO 0x08E63480
127    #define GEMCOREPOSPRO 0x08E63479
128  #define CARDMAN3121     0x076B3021  #define CARDMAN3121     0x076B3021
129  #define LTC31           0x07830003  #define LTC31           0x07830003
130  #define SCR331DI        0x04E65111  #define SCR331DI        0x04E65111
131    #define SCR331DINTTCOM  0x04E65120
132    #define SDI010          0x04E65121
133  #define CHERRYXX33      0x046A0005  #define CHERRYXX33      0x046A0005
134    #define CHERRYST2000    0x046A003E
135  #define OZ776           0x0B977762  #define OZ776           0x0B977762
136    #define SPR532          0x04E6E003
137    #define MYSMARTPAD      0x09BE0002
138    #define CHERRYXX44      0x046a0010
139    #define CL1356D         0x0B810200
140    
141  /* Escape sequence codes */  /* Escape sequence codes */
142  #define ESC_GEMPC_SET_ISO_MODE          1  #define ESC_GEMPC_SET_ISO_MODE          1
143  #define ESC_GEMPC_SET_APDU_MODE         2  #define ESC_GEMPC_SET_APDU_MODE         2
144    
145    /*
146     * Possible values :
147     * 3 -> 1.8V, 3V, 5V
148     * 2 -> 3V, 5V
149     * 1 -> 5V only
150     * 0 -> automatic (selection made by the reader)
151     */
152    /*
153     * To be safe we default to 5V
154     * otherwise we would have to parse the ATR and get the value of TAi (i>2) when
155     * in T=15
156     */
157    #define VOLTAGE_AUTO 0
158    #define VOLTAGE_5V 1
159    #define VOLTAGE_3V 2
160    #define VOLTAGE_1_8V 3
161    
162  int ccid_open_hack(unsigned int reader_index);  int ccid_open_hack(unsigned int reader_index);
163  void ccid_error(int error, char *file, int line, char *function);  void ccid_error(int error, char *file, int line, const char *function);
164  _ccid_descriptor *get_ccid_descriptor(unsigned int reader_index);  _ccid_descriptor *get_ccid_descriptor(unsigned int reader_index);
165    
166  /* convert a 4 byte integer in USB format into an int */  /* convert a 4 byte integer in USB format into an int */
167  #define dw2i(a, x) ((((((a[x+3] << 8) + a[x+2]) << 8) + a[x+1]) << 8) + a[x])  #define dw2i(a, x) ((((((a[x+3] << 8) + a[x+2]) << 8) + a[x+1]) << 8) + a[x])
168    
169    /* all the data rates specified by ISO 7816-3 Fi/Di tables */
170    #define ISO_DATA_RATES 10753, 14337, 15625, 17204, \
171                    20833, 21505, 23438, 25806, 28674, \
172                    31250, 32258, 34409, 39063, 41667, \
173                    43011, 46875, 52083, 53763, 57348, \
174                    62500, 64516, 68817, 71685, 78125, \
175                    83333, 86022, 93750, 104167, 107527, \
176                    114695, 125000, 129032, 143369, 156250, \
177                    166667, 172043, 215054, 229391, 250000, \
178                    344086
179    
180    /* data rates supported by the secondary slots on the GemCore Pos Pro & SIM Pro */
181    #define GEMPLUS_CUSTOM_DATA_RATES 10753, 21505, 43011, 125000
182    

Legend:
Removed from v.1260  
changed lines
  Added in v.2084

  ViewVC Help
Powered by ViewVC 1.1.5