1#ifndef _UAPI_CM4000_H_
2#define _UAPI_CM4000_H_
3
4#include <linux/types.h>
5
6#define MAX_ATR 33
7
8#define CM4000_MAX_DEV 4
9
10
11
12
13
14typedef struct atreq {
15 __s32 atr_len;
16 unsigned char atr[64];
17 __s32 power_act;
18 unsigned char bIFSD;
19 unsigned char bIFSC;
20} atreq_t;
21
22
23
24
25
26
27
28
29
30
31
32typedef struct ptsreq {
33 __u32 protocol;
34 unsigned char flags;
35 unsigned char pts1;
36 unsigned char pts2;
37 unsigned char pts3;
38} ptsreq_t;
39
40#define CM_IOC_MAGIC 'c'
41#define CM_IOC_MAXNR 255
42
43#define CM_IOCGSTATUS _IOR (CM_IOC_MAGIC, 0, unsigned char *)
44#define CM_IOCGATR _IOWR(CM_IOC_MAGIC, 1, atreq_t *)
45#define CM_IOCSPTS _IOW (CM_IOC_MAGIC, 2, ptsreq_t *)
46#define CM_IOCSRDR _IO (CM_IOC_MAGIC, 3)
47#define CM_IOCARDOFF _IO (CM_IOC_MAGIC, 4)
48
49#define CM_IOSDBGLVL _IOW(CM_IOC_MAGIC, 250, int*)
50
51
52#define CM_CARD_INSERTED 0x01
53#define CM_CARD_POWERED 0x02
54#define CM_ATR_PRESENT 0x04
55#define CM_ATR_VALID 0x08
56#define CM_STATE_VALID 0x0f
57
58#define CM_NO_READER 0x10
59#define CM_BAD_CARD 0x20
60
61
62#endif
63