| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | #ifndef _CTBCS_ |
|---|
| 24 | #define _CTBCS_ |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | #define CTBCS_MIN_COMMAND_SIZE 2 |
|---|
| 30 | #define CTBCS_MIN_RESPONSE_SIZE 2 |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | #define CTBCS_CLA 0x20 |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | #define CTBCS_INS_RESET 0x11 |
|---|
| 41 | #define CTBCS_INS_REQUEST 0x12 |
|---|
| 42 | #define CTBCS_INS_STATUS 0x13 |
|---|
| 43 | #define CTBCS_INS_EJECT 0x15 |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | |
|---|
| 48 | #define CTBCS_INS_INPUT 0x16 |
|---|
| 49 | #define CTBCS_INS_OUTPUT 0x17 |
|---|
| 50 | #define CTBCS_INS_PERFORM_VERIFICATION 0x18 |
|---|
| 51 | #define CTBCS_INS_MODIFY_VERIFICATION 0x19 |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | #define CTBCS_P1_CT_KERNEL 0x00 |
|---|
| 58 | #define CTBCS_P1_INTERFACE1 0x01 |
|---|
| 59 | #define CTBCS_P1_INTERFACE2 0x02 |
|---|
| 60 | #define CTBCS_P1_INTERFACE3 0x03 |
|---|
| 61 | #define CTBCS_P1_INTERFACE4 0x04 |
|---|
| 62 | #define CTBCS_P1_INTERFACE5 0x05 |
|---|
| 63 | #define CTBCS_P1_INTERFACE6 0x06 |
|---|
| 64 | #define CTBCS_P1_INTERFACE7 0x07 |
|---|
| 65 | #define CTBCS_P1_INTERFACE8 0x08 |
|---|
| 66 | #define CTBCS_P1_INTERFACE9 0x09 |
|---|
| 67 | #define CTBCS_P1_INTERFACE10 0x0A |
|---|
| 68 | #define CTBCS_P1_INTERFACE11 0x0B |
|---|
| 69 | #define CTBCS_P1_INTERFACE12 0x0C |
|---|
| 70 | #define CTBCS_P1_INTERFACE13 0x0D |
|---|
| 71 | #define CTBCS_P1_INTERFACE14 0x0E |
|---|
| 72 | #define CTBCS_P1_DISPLAY 0x40 |
|---|
| 73 | #define CTBCS_P1_KEYPAD 0x50 |
|---|
| 74 | #define CTBCS_P1_PRINTER 0x60 |
|---|
| 75 | #define CTBCS_P1_FINGERPRINT 0x70 |
|---|
| 76 | #define CTBCS_P1_VOICEPRINT 0x71 |
|---|
| 77 | #define CTBCS_P1_DSV 0x72 |
|---|
| 78 | #define CTBCS_P1_FACE_RECOGNITION 0x73 |
|---|
| 79 | #define CTBCS_P1_IRISSCAN 0x74 |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | |
|---|
| 83 | |
|---|
| 84 | |
|---|
| 85 | #define CTBCS_P2_RESET_NO_RESP 0x00 |
|---|
| 86 | #define CTBCS_P2_RESET_GET_ATR 0x01 |
|---|
| 87 | #define CTBCS_P2_RESET_GET_HIST 0x02 |
|---|
| 88 | |
|---|
| 89 | |
|---|
| 90 | |
|---|
| 91 | |
|---|
| 92 | #define CTBCS_P2_REQUEST_NO_RESP 0x00 |
|---|
| 93 | #define CTBCS_P2_REQUEST_GET_ATR 0x01 |
|---|
| 94 | #define CTBCS_P2_REQUEST_GET_HIST 0x02 |
|---|
| 95 | |
|---|
| 96 | |
|---|
| 97 | |
|---|
| 98 | |
|---|
| 99 | #define CTBCS_P2_STATUS_MANUFACTURER 0x46 |
|---|
| 100 | #define CTBCS_P2_STATUS_ICC 0x80 |
|---|
| 101 | #define CTBCS_P2_STATUS_TFU 0x81 |
|---|
| 102 | |
|---|
| 103 | |
|---|
| 104 | |
|---|
| 105 | |
|---|
| 106 | #define CTBCS_P2_INPUT_ECHO 0x01 |
|---|
| 107 | #define CTBCS_P2_INPUT_ASTERISKS 0x02 |
|---|
| 108 | |
|---|
| 109 | |
|---|
| 110 | |
|---|
| 111 | |
|---|
| 112 | #define CTBCS_TAG_PROMPT 0x50 |
|---|
| 113 | #define CTBCS_TAG_VERIFY_CMD 0x52 |
|---|
| 114 | #define CTBCS_TAG_TIMEOUT 0x80 |
|---|
| 115 | |
|---|
| 116 | |
|---|
| 117 | |
|---|
| 118 | |
|---|
| 119 | #define CTBCS_PIN_CONTROL_LEN_SHIFT 4 |
|---|
| 120 | #define CTBCS_PIN_CONTROL_LEN_MASK 0x0F |
|---|
| 121 | #define CTBCS_PIN_CONTROL_ENCODE_ASCII 0x01 |
|---|
| 122 | |
|---|
| 123 | |
|---|
| 124 | |
|---|
| 125 | |
|---|
| 126 | #define CTBCS_SW1_OK 0x90 |
|---|
| 127 | #define CTBCS_SW2_OK 0x00 |
|---|
| 128 | #define CTBCS_SW1_WRONG_LENGTH 0x67 |
|---|
| 129 | #define CTBCS_SW2_WRONG_LENGTH 0x00 |
|---|
| 130 | #define CTBCS_SW1_COMMAND_NOT_ALLOWED 0x69 |
|---|
| 131 | #define CTBCS_SW2_COMMAND_NOT_ALLOWED 0x00 |
|---|
| 132 | #define CTBCS_SW1_WRONG_PARAM 0x6A |
|---|
| 133 | #define CTBCS_SW2_WRONG_PARAM 0x00 |
|---|
| 134 | #define CTBCS_SW1_WRONG_INS 0x6D |
|---|
| 135 | #define CTBCS_SW2_WRONG_INS 0x00 |
|---|
| 136 | #define CTBCS_SW1_WRONG_CLA 0x6E |
|---|
| 137 | #define CTBCS_SW2_WRONG_CLA 0x00 |
|---|
| 138 | #define CTBCS_SW1_ICC_ERROR 0x6F |
|---|
| 139 | #define CTBCS_SW2_ICC_ERROR 0x00 |
|---|
| 140 | |
|---|
| 141 | |
|---|
| 142 | |
|---|
| 143 | |
|---|
| 144 | #define CTBCS_SW1_RESET_CT_OK 0x90 |
|---|
| 145 | #define CTBCS_SW2_RESET_CT_OK 0x00 |
|---|
| 146 | #define CTBCS_SW1_RESET_SYNC_OK 0x90 |
|---|
| 147 | #define CTBCS_SW2_RESET_SYNC_OK 0x00 |
|---|
| 148 | #define CTBCS_SW1_RESET_ASYNC_OK 0x90 |
|---|
| 149 | #define CTBCS_SW2_RESET_ASYNC_OK 0x01 |
|---|
| 150 | #define CTBCS_SW1_RESET_ERROR 0x64 |
|---|
| 151 | #define CTBCS_SW2_RESET_ERROR 0x00 |
|---|
| 152 | |
|---|
| 153 | |
|---|
| 154 | |
|---|
| 155 | |
|---|
| 156 | #define CTBCS_SW1_REQUEST_SYNC_OK 0x90 |
|---|
| 157 | #define CTBCS_SW2_REQUEST_SYNC_OK 0x00 |
|---|
| 158 | #define CTBCS_SW1_REQUEST_ASYNC_OK 0x90 |
|---|
| 159 | #define CTBCS_SW2_REQUEST_ASYNC_OK 0x01 |
|---|
| 160 | #define CTBCS_SW1_REQUEST_NO_CARD 0x62 |
|---|
| 161 | #define CTBCS_SW2_REQUEST_NO_CARD 0x00 |
|---|
| 162 | #define CTBCS_SW1_REQUEST_CARD_PRESENT 0x62 |
|---|
| 163 | #define CTBCS_SW2_REQUEST_CARD_PRESENT 0x01 |
|---|
| 164 | #define CTBCS_SW1_REQUEST_ERROR 0x64 |
|---|
| 165 | #define CTBCS_SW2_REQUEST_ERROR 0x00 |
|---|
| 166 | #define CTBCS_SW1_REQUEST_TIMER_ERROR 0x69 |
|---|
| 167 | #define CTBCS_SW2_REQUEST_TIMER_ERROR 0x00 |
|---|
| 168 | |
|---|
| 169 | |
|---|
| 170 | |
|---|
| 171 | |
|---|
| 172 | #define CTBCS_SW1_EJECT_OK 0x90 |
|---|
| 173 | #define CTBCS_SW2_EJECT_OK 0x00 |
|---|
| 174 | #define CTBCS_SW1_EJECT_REMOVED 0x90 |
|---|
| 175 | #define CTBCS_SW2_EJECT_REMOVED 0x01 |
|---|
| 176 | #define CTBCS_SW1_EJECT_NOT_REMOVED 0x62 |
|---|
| 177 | #define CTBCS_SW2_EJECT_NOT_REMOVED 0x00 |
|---|
| 178 | |
|---|
| 179 | |
|---|
| 180 | |
|---|
| 181 | |
|---|
| 182 | #define CTBCS_DATA_STATUS_NOCARD 0x00 |
|---|
| 183 | #define CTBCS_DATA_STATUS_CARD 0x01 |
|---|
| 184 | #define CTBCS_DATA_STATUS_CARD_CONNECT 0x05 |
|---|
| 185 | |
|---|
| 186 | |
|---|
| 187 | |
|---|
| 188 | |
|---|
| 189 | int ctbcs_pin_cmd(struct sc_reader *, sc_slot_info_t *, struct sc_pin_cmd_data *); |
|---|
| 190 | |
|---|
| 191 | #endif |
|---|