annotate libdha/kernelhelper/dhahelper.h @ 4470:2d28c737ed13

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