mic_ioctl.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Intel MIC Platform Software Stack (MPSS)
  3. *
  4. * Copyright(c) 2013 Intel Corporation.
  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, as
  8. * published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * The full GNU General Public License is included in this distribution in
  16. * the file called "COPYING".
  17. *
  18. * Intel MIC Host driver.
  19. *
  20. */
  21. #ifndef _MIC_IOCTL_H_
  22. #define _MIC_IOCTL_H_
  23. /*
  24. * mic_copy - MIC virtio descriptor copy.
  25. *
  26. * @iov: An array of IOVEC structures containing user space buffers.
  27. * @iovcnt: Number of IOVEC structures in iov.
  28. * @vr_idx: The vring index.
  29. * @update_used: A non zero value results in used index being updated.
  30. * @out_len: The aggregate of the total length written to or read from
  31. * the virtio device.
  32. */
  33. struct mic_copy_desc {
  34. #ifdef __KERNEL__
  35. struct iovec __user *iov;
  36. #else
  37. struct iovec *iov;
  38. #endif
  39. int iovcnt;
  40. __u8 vr_idx;
  41. __u8 update_used;
  42. __u32 out_len;
  43. };
  44. /*
  45. * Add a new virtio device
  46. * The (struct mic_device_desc *) pointer points to a device page entry
  47. * for the virtio device consisting of:
  48. * - struct mic_device_desc
  49. * - struct mic_vqconfig (num_vq of these)
  50. * - host and guest features
  51. * - virtio device config space
  52. * The total size referenced by the pointer should equal the size returned
  53. * by desc_size() in mic_common.h
  54. */
  55. #define MIC_VIRTIO_ADD_DEVICE _IOWR('s', 1, struct mic_device_desc *)
  56. /*
  57. * Copy the number of entries in the iovec and update the used index
  58. * if requested by the user.
  59. */
  60. #define MIC_VIRTIO_COPY_DESC _IOWR('s', 2, struct mic_copy_desc *)
  61. /*
  62. * Notify virtio device of a config change
  63. * The (__u8 *) pointer points to config space values for the device
  64. * as they should be written into the device page. The total size
  65. * referenced by the pointer should equal the config_len field of struct
  66. * mic_device_desc.
  67. */
  68. #define MIC_VIRTIO_CONFIG_CHANGE _IOWR('s', 5, __u8 *)
  69. #endif