4 // This is the data structure that is passed back and forth with user-land
6 #define V3_VM_FB_INPUT 256+1
8 enum { V3_FB_KEY, V3_FB_MOUSE, V3_FB_BOTH} data_type;
10 uint8_t mouse_data[3];
13 #define V3_VM_FB_QUERY 256+2
15 struct v3_fb_query_response {
16 enum e { V3_FB_DATA_ALL, V3_FB_DATA_BOX, V3_FB_UPDATE, V3_FB_SPEC } request_type;
17 struct v3_frame_buffer_spec spec; // in: desired spec; out: actual spec
18 uint32_t x, y, w, h; // region to copy (0s = all) in/out args
19 int updated; // whether this region has been updated or not
20 void __user *data; // user space pointer to copy data to
23 int v3_send_key(int fd, uint8_t scan_code)
27 e.data_type=V3_FB_KEY;
28 e.scan_code=scan_code;
30 if (ioctl(fd,V3_VM_FB_INPUT,&e)<0) {
31 perror("v3_send_key");
39 int v3_send_mouse(int fd, uint8_t mx, uint8_t my, uint8_t button)
43 e.data_type=V3_FB_MOUSE;
46 e.mouse_data[2]=button;
48 if (ioctl(fd,V3_VM_FB_INPUT,&e)<0) {
49 perror("v3_send_mouse");
56 int v3_get_fb_spec(int fd, struct v3_frame_buffer_spec *spec)
58 struct v3_fb_query_response q;
60 q.request_type=V3_FB_SPEC;
62 if (ioctl(fd,V3_VM_FB_QUERY,&q)<0) {
63 perror("v3_get_fb_spec");
73 int v3_get_fb_data(int fd, struct v3_frame_buffer_spec *spec, void *data)
75 struct v3_fb_query_response q;
77 q.request_type=V3_FB_DATA_ALL;
81 if (ioctl(fd,V3_VM_FB_QUERY,&q)<0) {
82 perror("v3_get_fb_data");
92 int v3_have_update(int fd)
94 struct v3_fb_query_response q;
97 q.request_type=V3_FB_UPDATE;
103 if (ioctl(fd,V3_VM_FB_QUERY,&q)<0) {
104 perror("v3_get_fb_data");