kvm_virtio.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * kvm_virtio.h - definition for virtio for kvm on s390
  3. *
  4. * Copyright IBM Corp. 2008
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License (version 2 only)
  8. * as published by the Free Software Foundation.
  9. *
  10. * Author(s): Christian Borntraeger <borntraeger@de.ibm.com>
  11. */
  12. #ifndef __KVM_S390_VIRTIO_H
  13. #define __KVM_S390_VIRTIO_H
  14. #include <linux/types.h>
  15. struct kvm_device_desc {
  16. /* The device type: console, network, disk etc. Type 0 terminates. */
  17. __u8 type;
  18. /* The number of virtqueues (first in config array) */
  19. __u8 num_vq;
  20. /*
  21. * The number of bytes of feature bits. Multiply by 2: one for host
  22. * features and one for guest acknowledgements.
  23. */
  24. __u8 feature_len;
  25. /* The number of bytes of the config array after virtqueues. */
  26. __u8 config_len;
  27. /* A status byte, written by the Guest. */
  28. __u8 status;
  29. __u8 config[0];
  30. };
  31. /*
  32. * This is how we expect the device configuration field for a virtqueue
  33. * to be laid out in config space.
  34. */
  35. struct kvm_vqconfig {
  36. /* The token returned with an interrupt. Set by the guest */
  37. __u64 token;
  38. /* The address of the virtio ring */
  39. __u64 address;
  40. /* The number of entries in the virtio_ring */
  41. __u16 num;
  42. };
  43. #define KVM_S390_VIRTIO_NOTIFY 0
  44. #define KVM_S390_VIRTIO_RESET 1
  45. #define KVM_S390_VIRTIO_SET_STATUS 2
  46. #ifdef __KERNEL__
  47. /* early virtio console setup */
  48. #ifdef CONFIG_VIRTIO_CONSOLE
  49. extern void s390_virtio_console_init(void);
  50. #else
  51. static inline void s390_virtio_console_init(void)
  52. {
  53. }
  54. #endif /* CONFIG_VIRTIO_CONSOLE */
  55. #endif /* __KERNEL__ */
  56. #endif