remove unused 'next' pointers
[librfid] / include / librfid / rfid_protocol_tcl.h
1 #ifndef _RFID_PROTOCOL_TCL_H
2 #define _RFID_PROTOCOL_TCL_H
3
4 enum rfid_proto_tcl_opt {
5         RFID_OPT_P_TCL_ATS      =       0x00010001,
6         RFID_OPT_P_TCL_ATS_LEN  =       0x00010002,
7 };
8
9 #ifdef __LIBRFID__
10
11 enum tcl_transport_rate {
12         TCL_RATE_106    = 0x01,
13         TCL_RATE_212    = 0x02,
14         TCL_RATE_424    = 0x04,
15         TCL_RATE_848    = 0x08,
16 };
17
18 enum tcl_transport_transceive_flags {
19         TCL_TRANSP_F_TX_CRC     = 0x01, /* transport adds TX CRC */
20         TCL_TRANSP_F_RX_CRC     = 0x02, 
21 };
22
23 struct tcl_handle {
24         /* derived from ats */
25         unsigned char *historical_bytes; /* points into ats */
26         unsigned int historical_len;
27
28         unsigned int fsc;       /* max frame size accepted by card */
29         unsigned int fsd;       /* max frame size accepted by reader */
30         unsigned int fwt;       /* frame waiting time (in usec)*/
31         unsigned char ta;       /* divisor information */
32         unsigned char sfgt;     /* start-up frame guard time (in usec) */
33
34         /* otherwise determined */
35         unsigned int cid;       /* Card ID */
36         unsigned int nad;       /* Node Address */
37
38         unsigned int flags;
39         unsigned int state;     /* protocol state */
40
41         unsigned int toggle;    /* send toggle with next frame */
42
43         unsigned int ats_len;
44         unsigned char ats[256]; /* ATS cannot be bigger than FSD-2 bytes,
45                                    according to ISO 14443-4 5.2.2 */
46 };
47
48 enum tcl_handle_flags {
49         TCL_HANDLE_F_NAD_SUPPORTED      = 0x0001,
50         TCL_HANDLE_F_CID_SUPPORTED      = 0x0002,
51         TCL_HANDLE_F_NAD_USED           = 0x0010,
52         TCL_HANDLE_F_CID_USED           = 0x0020,
53 };
54
55
56 enum tcl_pcb_bits {
57         TCL_PCB_CID_FOLLOWING           = 0x08,
58         TCL_PCB_NAD_FOLLOWING           = 0x04,
59 };
60
61 enum tcl_pcd_state {
62         TCL_STATE_NONE = 0x00,
63         TCL_STATE_INITIAL,
64         TCL_STATE_RATS_SENT,            /* waiting for ATS */
65         TCL_STATE_ATS_RCVD,             /* ATS received */
66         TCL_STATE_PPS_SENT,             /* waiting for PPS response */
67         TCL_STATE_ESTABLISHED,          /* xchg transparent data */
68         TCL_STATE_DESELECT_SENT,        /* waiting for DESELECT response */
69         TCL_STATE_DESELECTED,           /* card deselected or HLTA'd */
70 };
71
72 extern const struct rfid_protocol rfid_protocol_tcl;
73
74 #endif /* __LIBRFID__ */
75
76 #endif