mic_ioctl.h 2.3 KB

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