1 #ifndef _ASM_LGUEST_USER
2 #define _ASM_LGUEST_USER
3 /* Everything the "lguest" userspace program needs to know. */
4 /* They can register up to 32 arrays of lguest_dma. */
5 #define LGUEST_MAX_DMA 32
6 /* At most we can dma 16 lguest_dma in one op. */
7 #define LGUEST_MAX_DMA_SECTIONS 16
9 /* How many devices? Assume each one wants up to two dma arrays per device. */
10 #define LGUEST_MAX_DEVICES (LGUEST_MAX_DMA/2)
14 /* 0 if free to be used, filled by hypervisor. */
16 unsigned long addr[LGUEST_MAX_DMA_SECTIONS];
17 u16 len[LGUEST_MAX_DMA_SECTIONS];
20 struct lguest_block_page
22 /* 0 is a read, 1 is a write. */
24 u32 sector; /* Offset in device = sector * 512. */
25 u32 bytes; /* Length expected to be read/written in bytes */
26 /* 0 = pending, 1 = done, 2 = done, error */
28 u32 num_sectors; /* Disk length = num_sectors * 512 */
31 /* There is a shared page of these. */
34 /* Simply the mac address (with multicast bit meaning promisc). */
38 /* Where the Host expects the Guest to SEND_DMA console output to. */
39 #define LGUEST_CONSOLE_DMA_KEY 0
41 /* We have a page of these descriptors in the lguest_device page. */
42 struct lguest_device_desc {
44 #define LGUEST_DEVICE_T_CONSOLE 1
45 #define LGUEST_DEVICE_T_NET 2
46 #define LGUEST_DEVICE_T_BLOCK 3
49 #define LGUEST_NET_F_NOCSUM 0x4000 /* Don't bother checksumming */
50 #define LGUEST_DEVICE_F_RANDOMNESS 0x8000 /* IRQ is fairly random */
53 /* 256 and above are device specific. */
54 #define LGUEST_DEVICE_S_ACKNOWLEDGE 1 /* We have seen device. */
55 #define LGUEST_DEVICE_S_DRIVER 2 /* We have found a driver */
56 #define LGUEST_DEVICE_S_DRIVER_OK 4 /* Driver says OK! */
57 #define LGUEST_DEVICE_S_REMOVED 8 /* Device has gone away. */
58 #define LGUEST_DEVICE_S_REMOVED_ACK 16 /* Driver has been told. */
59 #define LGUEST_DEVICE_S_FAILED 128 /* Something actually failed */
65 /* Write command first word is a request. */
68 LHREQ_INITIALIZE, /* + pfnlimit, pgdir, start, pageoffset */
69 LHREQ_GETDMA, /* + addr (returns &lguest_dma, irq in ->used_len) */
70 LHREQ_IRQ, /* + irq */
71 LHREQ_BREAK, /* + on/off flag (on blocks until someone does off) */
73 #endif /* _ASM_LGUEST_USER */