Turnstone Operating System
Loading...
Searching...
No Matches
console_virtio.h File Reference

Virtio console header. More...

#include <types.h>
#include <pci.h>
#include <driver/virtio.h>

Classes

struct  virtio_console_config_t
 
struct  virtio_console_control_t
 
struct  virtio_console_resize_t
 
struct  vdi_chunk_header_t
 
struct  vdagent_message_t
 
struct  vdagent_cap_announce_t
 
struct  vdagent_clipboard_t
 
struct  vdagent_clipboard_grab_t
 
struct  vdagent_clipboard_request_t
 
struct  vdagent_clipboard_release_t
 
struct  vdagent_max_clipboard_t
 

Macros

#define ___CONSOLE_VIRTIO_H   0
 
#define VIRTIO_CONSOLE_VENDOR_ID   0x1AF4
 
#define VIRTIO_CONSOLE_DEVICE_ID   0x1003
 
#define VIRTIO_CONSOLE_F_SIZE   (1ULL << 0)
 
#define VIRTIO_CONSOLE_F_MULTIPORT   (1ULL << 1)
 
#define VIRTIO_CONSOLE_F_EMERG_WRITE   (1ULL << 2)
 
#define VIRTIO_CONSOLE_DEVICE_READY   0
 
#define VIRTIO_CONSOLE_DEVICE_ADD   1
 
#define VIRTIO_CONSOLE_DEVICE_REMOVE   2
 
#define VIRTIO_CONSOLE_PORT_READY   3
 
#define VIRTIO_CONSOLE_CONSOLE_PORT   4
 
#define VIRTIO_CONSOLE_RESIZE   5
 
#define VIRTIO_CONSOLE_PORT_OPEN   6
 
#define VIRTIO_CONSOLE_PORT_NAME   7
 
#define VIRTIO_CONSOLE_MAX_PORT_NAME   63
 
#define VIRTIO_CONSOLE_CONTROL_VQ_SIZE   (sizeof(virtio_console_control_t) + VIRTIO_CONSOLE_MAX_PORT_NAME + 1)
 
#define VIRTIO_CONSOLE_DATA_VQ_SIZE   4096
 
#define VIRTIO_CONSOLE_VDAGENT_PORT_NAME   "com.turnstoneos.clipboard.0"
 
#define VD_AGENT_PROTOCOL   1
 
#define VD_AGENT_MAX_DATA_SIZE   2048
 
#define VD_AGENT_CLIPBOARD_MAX_DATA_SIZE   (1 << 20)
 

Typedefs

typedef struct virtio_console_config_t virtio_console_config_t
 
typedef struct virtio_console_control_t virtio_console_control_t
 
typedef struct virtio_console_resize_t virtio_console_resize_t
 
typedef enum vdp_port_t vdp_port_t
 
typedef struct vdi_chunk_header_t vdi_chunk_header_t
 
typedef enum vdagent_message_type_t vdagent_message_type_t
 
typedef struct vdagent_message_t vdagent_message_t
 
typedef enum vdagent_cap_t vdagent_cap_t
 
typedef struct vdagent_cap_announce_t vdagent_cap_announce_t
 
typedef enum vdagent_clipboard_selection_t vdagent_clipboard_selection_t
 
typedef enum vdagent_clipboard_type_t vdagent_clipboard_type_t
 
typedef struct vdagent_clipboard_t vdagent_clipboard_t
 
typedef struct vdagent_clipboard_grab_t vdagent_clipboard_grab_t
 
typedef struct vdagent_clipboard_request_t vdagent_clipboard_request_t
 
typedef struct vdagent_clipboard_release_t vdagent_clipboard_release_t
 
typedef struct vdagent_max_clipboard_t vdagent_max_clipboard_t
 

Enumerations

enum  vdp_port_t { VDP_CLIENT_PORT = 1 , VDP_SERVER_PORT = 2 }
 
enum  vdagent_message_type_t {
  VD_AGENT_MOUSE_STATE = 1 , VD_AGENT_MONITORS_CONFIG , VD_AGENT_REPLY , VD_AGENT_CLIPBOARD ,
  VD_AGENT_DISPLAY_CONFIG , VD_AGENT_ANNOUNCE_CAPABILITIES , VD_AGENT_CLIPBOARD_GRAB , VD_AGENT_CLIPBOARD_REQUEST ,
  VD_AGENT_CLIPBOARD_RELEASE , VD_AGENT_FILE_XFER_START , VD_AGENT_FILE_XFER_STATUS , VD_AGENT_FILE_XFER_DATA ,
  VD_AGENT_CLIENT_DISCONNECTED , VD_AGENT_MAX_CLIPBOARD , VD_AGENT_AUDIO_VOLUME_SYNC , VD_AGENT_GRAPHICS_DEVICE_INFO ,
  VD_AGENT_END_MESSAGE
}
 
enum  vdagent_cap_t {
  VD_AGENT_CAP_MOUSE_STATE = 0 , VD_AGENT_CAP_MONITORS_CONFIG , VD_AGENT_CAP_REPLY , VD_AGENT_CAP_CLIPBOARD ,
  VD_AGENT_CAP_DISPLAY_CONFIG , VD_AGENT_CAP_CLIPBOARD_BY_DEMAND , VD_AGENT_CAP_CLIPBOARD_SELECTION , VD_AGENT_CAP_SPARSE_MONITORS_CONFIG ,
  VD_AGENT_CAP_GUEST_LINEEND_LF , VD_AGENT_CAP_GUEST_LINEEND_CRLF , VD_AGENT_CAP_MAX_CLIPBOARD , VD_AGENT_CAP_AUDIO_VOLUME_SYNC ,
  VD_AGENT_CAP_MONITORS_CONFIG_POSITION , VD_AGENT_CAP_FILE_XFER_DISABLED , VD_AGENT_CAP_FILE_XFER_DETAILED_ERRORS , VD_AGENT_CAP_GRAPHICS_DEVICE_INFO ,
  VD_AGENT_CAP_CLIPBOARD_NO_RELEASE_ON_REGRAB , VD_AGENT_CAP_CLIPBOARD_GRAB_SERIAL , VD_AGENT_END_CAP
}
 
enum  vdagent_clipboard_selection_t { VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD = 0 , VD_AGENT_CLIPBOARD_SELECTION_PRIMARY , VD_AGENT_CLIPBOARD_SELECTION_SECONDARY }
 
enum  vdagent_clipboard_type_t {
  VD_AGENT_CLIPBOARD_NONE = 0 , VD_AGENT_CLIPBOARD_UTF8_TEXT , VD_AGENT_CLIPBOARD_IMAGE_PNG , VD_AGENT_CLIPBOARD_IMAGE_BMP ,
  VD_AGENT_CLIPBOARD_IMAGE_TIFF , VD_AGENT_CLIPBOARD_IMAGE_JPG , VD_AGENT_CLIPBOARD_FILE_LIST
}
 

Functions

int8_t console_virtio_init (void)
 
int8_t clipboard_send_text (const char_t *text_message)
 

Detailed Description

Virtio console header.

This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.

Enumeration Type Documentation

◆ vdagent_cap_t

Enumerator
VD_AGENT_CAP_CLIPBOARD 

3

VD_AGENT_CAP_CLIPBOARD_BY_DEMAND 

5

VD_AGENT_CAP_CLIPBOARD_SELECTION 

6

VD_AGENT_CAP_GUEST_LINEEND_LF 

8

VD_AGENT_CAP_MAX_CLIPBOARD 

10

VD_AGENT_CAP_CLIPBOARD_NO_RELEASE_ON_REGRAB 

16

VD_AGENT_CAP_CLIPBOARD_GRAB_SERIAL 

17

◆ vdagent_message_type_t

Enumerator
VD_AGENT_CLIPBOARD 

4

VD_AGENT_ANNOUNCE_CAPABILITIES 

6

VD_AGENT_CLIPBOARD_GRAB 

7

VD_AGENT_CLIPBOARD_REQUEST 

8

VD_AGENT_CLIPBOARD_RELEASE 

9

VD_AGENT_MAX_CLIPBOARD 

14