virtio_console.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef _LINUX_VIRTIO_CONSOLE_H
  2. #define _LINUX_VIRTIO_CONSOLE_H
  3. #include <linux/types.h>
  4. #include <linux/virtio_ids.h>
  5. #include <linux/virtio_config.h>
  6. /*
  7. * This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
  8. * anyone can use the definitions to implement compatible drivers/servers.
  9. *
  10. * Copyright (C) Red Hat, Inc., 2009, 2010
  11. */
  12. /* Feature bits */
  13. #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */
  14. #define VIRTIO_CONSOLE_F_MULTIPORT 1 /* Does host provide multiple ports? */
  15. struct virtio_console_config {
  16. /* colums of the screens */
  17. __u16 cols;
  18. /* rows of the screens */
  19. __u16 rows;
  20. /* max. number of ports this device can hold */
  21. __u32 max_nr_ports;
  22. /* number of ports added so far */
  23. __u32 nr_ports;
  24. } __attribute__((packed));
  25. /*
  26. * A message that's passed between the Host and the Guest for a
  27. * particular port.
  28. */
  29. struct virtio_console_control {
  30. __u32 id; /* Port number */
  31. __u16 event; /* The kind of control event (see below) */
  32. __u16 value; /* Extra information for the key */
  33. };
  34. /* Some events for control messages */
  35. #define VIRTIO_CONSOLE_PORT_READY 0
  36. #define VIRTIO_CONSOLE_CONSOLE_PORT 1
  37. #define VIRTIO_CONSOLE_RESIZE 2
  38. #define VIRTIO_CONSOLE_PORT_OPEN 3
  39. #define VIRTIO_CONSOLE_PORT_NAME 4
  40. #define VIRTIO_CONSOLE_PORT_REMOVE 5
  41. #ifdef __KERNEL__
  42. int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int));
  43. #endif /* __KERNEL__ */
  44. #endif /* _LINUX_VIRTIO_CONSOLE_H */