Debian Codegraph @

drivers/libdha/kernelhelper/dhahelper.h

raw
1 /*
2 Direct Hardware Access kernel helper
3
4 (C) 2002 Alex Beregszaszi <[email protected]>
5 (C) 2002-2003 Nick Kurshev <[email protected]>
6 */
7
8 #ifndef DHAHELPER_H
9 #define DHAHELPER_H
10
11 #include <linux/ioctl.h>
12
13 /* feel free to change */
14 #define DEFAULT_MAJOR 252 /* 240-254 LOCAL/EXPERIMENTAL USE */
15
16 #define API_VERSION 0x30 /* 3.0*/
17
18 typedef struct dhahelper_port_s
19 {
20 #define PORT_OP_READ 1
21 #define PORT_OP_WRITE 2
22 int operation;
23 int size;
24 int addr; // FIXME - switch to void* (64bit)
25 int value;
26 } dhahelper_port_t;
27
28 typedef struct dhahelper_mtrr_s
29 {
30 #define MTRR_OP_ADD 1
31 #define MTRR_OP_DEL 2
32 int operation;
33 long start;
34 long size;
35 int type;
36 int privat;
37 } dhahelper_mtrr_t;
38
39 typedef struct dhahelper_pci_config_s
40 {
41 #define PCI_OP_READ 0
42 #define PCI_OP_WRITE 1
43 int operation;
44 int bus;
45 int dev;
46 int func;
47 int cmd;
48 int size;
49 long ret;
50 } dhahelper_pci_config_t;
51
52 typedef struct dhahelper_vmi_s
53 {
54 void * virtaddr;
55 unsigned long length;
56 unsigned long *realaddr;
57 }dhahelper_vmi_t;
58
59 typedef struct dhahelper_mem_s
60 {
61 void * addr;
62 unsigned long length;
63 }dhahelper_mem_t;
64
65 typedef struct dhahelper_irq_s
66 {
67 unsigned num;
68 int bus, dev, func;
69 int ack_region;
70 unsigned long ack_offset;
71 unsigned int ack_data;
72 }dhahelper_irq_t;
73
74 typedef struct dhahelper_cpu_flush_s
75 {
76 void *va;
77 unsigned long length;
78 }dhahelper_cpu_flush_t;
79
80 typedef struct dhahelper_pci_device_s
81 {
82 int bus,card,func; /* PCI/AGP bus:card:func */
83 unsigned short vendor,device; /* Card vendor+device ID */
84 unsigned long base0,base1,base2,baserom; /* Memory and I/O base addresses */
85 unsigned long base3,base4,base5; /* Memory and I/O base addresses */
86 unsigned char irq,ipin,gnt,lat; /* assigned IRQ parameters for this card */
87 }dhahelper_pci_device_t;
88
89 #define DHAHELPER_GET_VERSION _IOW('D', 0, int)
90 #define DHAHELPER_PORT _IOWR('D', 1, dhahelper_port_t)
91 #define DHAHELPER_MTRR _IOWR('D', 2, dhahelper_mtrr_t)
92 #define DHAHELPER_PCI_CONFIG _IOWR('D', 3, dhahelper_pci_config_t)
93 #define DHAHELPER_VIRT_TO_PHYS _IOWR('D', 4, dhahelper_vmi_t)
94 #define DHAHELPER_VIRT_TO_BUS _IOWR('D', 5, dhahelper_vmi_t)
95 #define DHAHELPER_ALLOC_PA _IOWR('D', 6, dhahelper_mem_t)
96 #define DHAHELPER_FREE_PA _IOWR('D', 7, dhahelper_mem_t)
97 #define DHAHELPER_LOCK_MEM _IOWR('D', 8, dhahelper_mem_t)
98 #define DHAHELPER_UNLOCK_MEM _IOWR('D', 9, dhahelper_mem_t)
99 #define DHAHELPER_INSTALL_IRQ _IOWR('D', 10, dhahelper_irq_t)
100 #define DHAHELPER_ACK_IRQ _IOWR('D', 11, dhahelper_irq_t)
101 #define DHAHELPER_FREE_IRQ _IOWR('D', 12, dhahelper_irq_t)
102 #define DHAHELPER_CPU_FLUSH _IOWR('D', 13, dhahelper_cpu_flush_t)
103 #define DHAHELPER_PCI_FIND _IOWR('D', 14, dhahelper_pci_device_t)
104
105 #endif /* DHAHELPER_H */