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