1 #ifndef _RFID_ISO14443A_H
2 #define _RFID_ISO14443A_H
6 /* protocol definitions */
8 /* ISO 14443-3, Chapter 6.3.1 */
9 enum iso14443a_sf_cmd {
10 ISO14443A_SF_CMD_REQA = 0x26,
11 ISO14443A_SF_CMD_WUPA = 0x52,
12 ISO14443A_SF_CMD_OPT_TIMESLOT = 0x35, /* Annex C */
13 /* 40 to 4f and 78 to 7f: proprietary */
16 struct iso14443a_atqa {
17 u_int8_t bf_anticol:5,
20 u_int8_t proprietary:4,
24 #define ISO14443A_HLTA 0x5000
26 /* ISO 14443-3, Chapter 6.3.2 */
27 struct iso14443a_anticol_cmd {
28 unsigned char sel_code;
30 unsigned char uid_bits[5];
33 enum iso14443a_anticol_sel_code {
34 ISO14443A_AC_SEL_CODE_CL1 = 0x93,
35 ISO14443A_AC_SEL_CODE_CL2 = 0x95,
36 ISO14443A_AC_SEL_CODE_CL3 = 0x97,
39 #define ISO14443A_BITOFCOL_NONE 0xffffffff
41 struct iso14443a_handle;
43 struct iso14443a_transport {
47 int (*init)(struct iso14443a_handle *handle);
48 int (*fini)(struct iso14443a_handle *handle);
50 int (*transcieve_sf)(struct iso14443a_handle *handle,
52 struct iso14443a_atqa *atqa);
53 int (*transcieve_acf)(struct iso14443a_handle *handle,
54 struct iso14443a_anticol_cmd *acf,
55 unsigned int *bit_of_col);
56 int (*transcieve)(struct iso14443a_handle *handle,
57 const unsigned char *tx_buf,
59 unsigned char *rx_buf,
60 unsigned int *rx_len);
67 struct iso14443a_handle {
70 unsigned int tcl_capable;
72 unsigned char uid[10]; /* Triple size UID is 10 bytes */
75 enum iso14443a_level {
82 enum iso14443a_state {
83 ISO14443A_STATE_ERROR,
85 ISO14443A_STATE_REQA_SENT,
86 ISO14443A_STATE_ATQA_RCVD,
87 ISO14443A_STATE_NO_BITFRAME_ANTICOL,
88 ISO14443A_STATE_ANTICOL_RUNNING,
89 ISO14443A_STATE_SELECTED,
92 #include <rfid/rfid_layer2.h>
93 struct rfid_layer2 rfid_layer2_iso14443a;
95 #endif /* _ISO14443A_H */