mei.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
  2. /*
  3. * Copyright(c) 2003-2015 Intel Corporation. All rights reserved.
  4. * Intel Management Engine Interface (Intel MEI) Linux driver
  5. * Intel MEI Interface Header
  6. */
  7. #ifndef _LINUX_MEI_H
  8. #define _LINUX_MEI_H
  9. #include <linux/uuid.h>
  10. /*
  11. * This IOCTL is used to associate the current file descriptor with a
  12. * FW Client (given by UUID). This opens a communication channel
  13. * between a host client and a FW client. From this point every read and write
  14. * will communicate with the associated FW client.
  15. * Only in close() (file_operation release()) the communication between
  16. * the clients is disconnected
  17. *
  18. * The IOCTL argument is a struct with a union that contains
  19. * the input parameter and the output parameter for this IOCTL.
  20. *
  21. * The input parameter is UUID of the FW Client.
  22. * The output parameter is the properties of the FW client
  23. * (FW protocol version and max message size).
  24. *
  25. */
  26. #define IOCTL_MEI_CONNECT_CLIENT \
  27. _IOWR('H' , 0x01, struct mei_connect_client_data)
  28. /*
  29. * Intel MEI client information struct
  30. */
  31. struct mei_client {
  32. __u32 max_msg_length;
  33. __u8 protocol_version;
  34. __u8 reserved[3];
  35. };
  36. /*
  37. * IOCTL Connect Client Data structure
  38. */
  39. struct mei_connect_client_data {
  40. union {
  41. uuid_le in_client_uuid;
  42. struct mei_client out_client_properties;
  43. };
  44. };
  45. /**
  46. * DOC: set and unset event notification for a connected client
  47. *
  48. * The IOCTL argument is 1 for enabling event notification and 0 for
  49. * disabling the service
  50. * Return: -EOPNOTSUPP if the devices doesn't support the feature
  51. */
  52. #define IOCTL_MEI_NOTIFY_SET _IOW('H', 0x02, __u32)
  53. /**
  54. * DOC: retrieve notification
  55. *
  56. * The IOCTL output argument is 1 if an event was is pending and 0 otherwise
  57. * the ioctl has to be called in order to acknowledge pending event
  58. *
  59. * Return: -EOPNOTSUPP if the devices doesn't support the feature
  60. */
  61. #define IOCTL_MEI_NOTIFY_GET _IOR('H', 0x03, __u32)
  62. /**
  63. * struct mei_connect_client_vtag - mei client information struct with vtag
  64. *
  65. * @in_client_uuid: UUID of client to connect
  66. * @vtag: virtual tag
  67. * @reserved: reserved for future use
  68. */
  69. struct mei_connect_client_vtag {
  70. uuid_le in_client_uuid;
  71. __u8 vtag;
  72. __u8 reserved[3];
  73. };
  74. /**
  75. * struct mei_connect_client_data_vtag - IOCTL connect data union
  76. *
  77. * @connect: input connect data
  78. * @out_client_properties: output client data
  79. */
  80. struct mei_connect_client_data_vtag {
  81. union {
  82. struct mei_connect_client_vtag connect;
  83. struct mei_client out_client_properties;
  84. };
  85. };
  86. /**
  87. * DOC:
  88. * This IOCTL is used to associate the current file descriptor with a
  89. * FW Client (given by UUID), and virtual tag (vtag).
  90. * The IOCTL opens a communication channel between a host client and
  91. * a FW client on a tagged channel. From this point on, every read
  92. * and write will communicate with the associated FW client with
  93. * on the tagged channel.
  94. * Upone close() the communication is terminated.
  95. *
  96. * The IOCTL argument is a struct with a union that contains
  97. * the input parameter and the output parameter for this IOCTL.
  98. *
  99. * The input parameter is UUID of the FW Client, a vtag [0,255]
  100. * The output parameter is the properties of the FW client
  101. * (FW protocool version and max message size).
  102. *
  103. * Clients that do not support tagged connection
  104. * will respond with -EOPNOTSUPP.
  105. */
  106. #define IOCTL_MEI_CONNECT_CLIENT_VTAG \
  107. _IOWR('H', 0x04, struct mei_connect_client_data_vtag)
  108. #endif /* _LINUX_MEI_H */