4470
|
1 /*
|
|
2 Direct Hardware Access kernel helper
|
|
3
|
10416
|
4 (C) 2002 Alex Beregszaszi <alex@fsn.hu>
|
4470
|
5 */
|
|
6
|
|
7 #ifndef DHAHELPER_H
|
|
8 #define DHAHELPER_H
|
|
9
|
|
10 #include <linux/ioctl.h>
|
|
11
|
|
12 /* feel free to change */
|
|
13 #define DEFAULT_MAJOR 180
|
|
14
|
|
15 #define API_VERSION 0x1
|
|
16
|
|
17 typedef struct dhahelper_port_s
|
|
18 {
|
|
19 #define PORT_OP_READ 1
|
|
20 #define PORT_OP_WRITE 2
|
|
21 int operation;
|
|
22 int size;
|
|
23 int addr;
|
|
24 int value;
|
|
25 } dhahelper_port_t;
|
|
26
|
|
27 typedef struct dhahelper_memory_s
|
|
28 {
|
|
29 #define MEMORY_OP_MAP 1
|
|
30 #define MEMORY_OP_UNMAP 2
|
|
31 int operation;
|
|
32 int start;
|
|
33 int offset;
|
|
34 int size;
|
|
35 int ret;
|
|
36 #define MEMORY_FLAG_NOCACHE 1
|
|
37 int flags;
|
|
38 } dhahelper_memory_t;
|
|
39
|
|
40 typedef struct dhahelper_mtrr_s
|
|
41 {
|
|
42 #define MTRR_OP_ADD 1
|
|
43 #define MTRR_OP_DEL 2
|
|
44 int operation;
|
|
45 int start;
|
|
46 int size;
|
|
47 int type;
|
|
48 } dhahelper_mtrr_t;
|
|
49
|
|
50 typedef struct dhahelper_pci_s
|
|
51 {
|
|
52 #define PCI_OP_READ 1
|
|
53 #define PCI_OP_WRITE 1
|
|
54 int operation;
|
|
55 int bus;
|
|
56 int dev;
|
|
57 int func;
|
|
58 int cmd;
|
|
59 int size;
|
|
60 int ret;
|
|
61 } dhahelper_pci_t;
|
|
62
|
|
63 #define DHAHELPER_GET_VERSION _IOW('D', 0, int)
|
|
64 #define DHAHELPER_PORT _IOWR('D', 1, dhahelper_port_t)
|
|
65 #define DHAHELPER_MEMORY _IOWR('D', 2, dhahelper_memory_t)
|
|
66 #define DHAHELPER_MTRR _IOWR('D', 3, dhahelper_mtrr_t)
|
|
67 #define DHAHELPER_PCI _IOWR('D', 4, dhahelper_pci_t)
|
|
68
|
|
69 #endif /* DHAHELPER_H */
|