Remove old lguest I/O infrrasructure.
[safe/jmp/linux-2.6] / include / linux / lguest_launcher.h
1 #ifndef _ASM_LGUEST_USER
2 #define _ASM_LGUEST_USER
3 /* Everything the "lguest" userspace program needs to know. */
4 #include <linux/types.h>
5 /* They can register up to 32 arrays of lguest_dma. */
6 #define LGUEST_MAX_DMA          32
7 /* At most we can dma 16 lguest_dma in one op. */
8 #define LGUEST_MAX_DMA_SECTIONS 16
9
10 /* How many devices?  Assume each one wants up to two dma arrays per device. */
11 #define LGUEST_MAX_DEVICES (LGUEST_MAX_DMA/2)
12
13 /* Where the Host expects the Guest to SEND_DMA console output to. */
14 #define LGUEST_CONSOLE_DMA_KEY 0
15
16 /*D:010
17  * Drivers
18  *
19  * The Guest needs devices to do anything useful.  Since we don't let it touch
20  * real devices (think of the damage it could do!) we provide virtual devices.
21  * We could emulate a PCI bus with various devices on it, but that is a fairly
22  * complex burden for the Host and suboptimal for the Guest, so we have our own
23  * "lguest" bus and simple drivers.
24  *
25  * Devices are described by an array of LGUEST_MAX_DEVICES of these structs,
26  * placed by the Launcher just above the top of physical memory:
27  */
28 struct lguest_device_desc {
29         /* The device type: console, network, disk etc. */
30         __u16 type;
31 #define LGUEST_DEVICE_T_CONSOLE 1
32 #define LGUEST_DEVICE_T_NET     2
33 #define LGUEST_DEVICE_T_BLOCK   3
34
35         /* The specific features of this device: these depends on device type
36          * except for LGUEST_DEVICE_F_RANDOMNESS. */
37         __u16 features;
38 #define LGUEST_NET_F_NOCSUM             0x4000 /* Don't bother checksumming */
39 #define LGUEST_DEVICE_F_RANDOMNESS      0x8000 /* IRQ is fairly random */
40
41         /* This is how the Guest reports status of the device: the Host can set
42          * LGUEST_DEVICE_S_REMOVED to indicate removal, but the rest are only
43          * ever manipulated by the Guest, and only ever set. */
44         __u16 status;
45 /* 256 and above are device specific. */
46 #define LGUEST_DEVICE_S_ACKNOWLEDGE     1 /* We have seen device. */
47 #define LGUEST_DEVICE_S_DRIVER          2 /* We have found a driver */
48 #define LGUEST_DEVICE_S_DRIVER_OK       4 /* Driver says OK! */
49 #define LGUEST_DEVICE_S_REMOVED         8 /* Device has gone away. */
50 #define LGUEST_DEVICE_S_REMOVED_ACK     16 /* Driver has been told. */
51 #define LGUEST_DEVICE_S_FAILED          128 /* Something actually failed */
52
53         /* Each device exists somewhere in Guest physical memory, over some
54          * number of pages. */
55         __u16 num_pages;
56         __u32 pfn;
57 };
58 /*:*/
59
60 /* Write command first word is a request. */
61 enum lguest_req
62 {
63         LHREQ_INITIALIZE, /* + pfnlimit, pgdir, start, pageoffset */
64         LHREQ_GETDMA, /* No longer used */
65         LHREQ_IRQ, /* + irq */
66         LHREQ_BREAK, /* + on/off flag (on blocks until someone does off) */
67 };
68 #endif /* _ASM_LGUEST_USER */