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