vbuschannel.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2010 - 2015 UNISYS CORPORATION
  4. * All rights reserved.
  5. */
  6. #ifndef __VBUSCHANNEL_H__
  7. #define __VBUSCHANNEL_H__
  8. /*
  9. * The vbus channel is the channel area provided via the BUS_CREATE controlvm
  10. * message for each virtual bus. This channel area is provided to both server
  11. * and client ends of the bus. The channel header area is initialized by
  12. * the server, and the remaining information is filled in by the client.
  13. * We currently use this for the client to provide various information about
  14. * the client devices and client drivers for the server end to see.
  15. */
  16. #include <linux/uuid.h>
  17. #include <linux/visorbus.h>
  18. /* {193b331b-c58f-11da-95a9-00e08161165f} */
  19. #define VISOR_VBUS_CHANNEL_GUID \
  20. GUID_INIT(0x193b331b, 0xc58f, 0x11da, \
  21. 0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f)
  22. /*
  23. * Must increment this whenever you insert or delete fields within this channel
  24. * struct. Also increment whenever you change the meaning of fields within this
  25. * channel struct so as to break pre-existing software. Note that you can
  26. * usually add fields to the END of the channel struct withOUT needing to
  27. * increment this.
  28. */
  29. #define VISOR_VBUS_CHANNEL_VERSIONID 1
  30. /*
  31. * struct visor_vbus_deviceinfo
  32. * @devtype: Short string identifying the device type.
  33. * @drvname: Driver .sys file name.
  34. * @infostrs: Kernel vversion.
  35. * @reserved: Pad size to 256 bytes.
  36. *
  37. * An array of this struct is present in the channel area for each vbus. It is
  38. * filled in by the client side to provide info about the device and driver from
  39. * the client's perspective.
  40. */
  41. struct visor_vbus_deviceinfo {
  42. u8 devtype[16];
  43. u8 drvname[16];
  44. u8 infostrs[96];
  45. u8 reserved[128];
  46. } __packed;
  47. /*
  48. * struct visor_vbus_headerinfo
  49. * @struct_bytes: Size of this struct in bytes.
  50. * @device_info_struct_bytes: Size of VISOR_VBUS_DEVICEINFO.
  51. * @dev_info_count: Num of items in DevInfo member. This is the
  52. * allocated size.
  53. * @chp_info_offset: Byte offset from beginning of this struct to the
  54. * ChpInfo struct.
  55. * @bus_info_offset: Byte offset from beginning of this struct to the
  56. * BusInfo struct.
  57. * @dev_info_offset: Byte offset from beginning of this struct to the
  58. * DevInfo array.
  59. * @reserved: Natural alignment.
  60. */
  61. struct visor_vbus_headerinfo {
  62. u32 struct_bytes;
  63. u32 device_info_struct_bytes;
  64. u32 dev_info_count;
  65. u32 chp_info_offset;
  66. u32 bus_info_offset;
  67. u32 dev_info_offset;
  68. u8 reserved[104];
  69. } __packed;
  70. /*
  71. * struct visor_vbus_channel
  72. * @channel_header: Initialized by server.
  73. * @hdr_info: Initialized by server.
  74. * @chp_info: Describes client chipset device and driver.
  75. * @bus_info: Describes client bus device and driver.
  76. * @dev_info: Describes client device and driver for each device on the
  77. * bus.
  78. */
  79. struct visor_vbus_channel {
  80. struct channel_header channel_header;
  81. struct visor_vbus_headerinfo hdr_info;
  82. struct visor_vbus_deviceinfo chp_info;
  83. struct visor_vbus_deviceinfo bus_info;
  84. struct visor_vbus_deviceinfo dev_info[0];
  85. } __packed;
  86. #endif