]>
Commit | Line | Data |
---|---|---|
19528057 SW |
1 | /* |
2 | * Copyright (C) 2010 - 2015 UNISYS CORPORATION | |
12e364b9 KC |
3 | * All rights reserved. |
4 | * | |
6f14cc18 BR |
5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms and conditions of the GNU General Public License, | |
7 | * version 2, as published by the Free Software Foundation. | |
12e364b9 KC |
8 | * |
9 | * This program is distributed in the hope that it will be useful, but | |
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | |
12 | * NON INFRINGEMENT. See the GNU General Public License for more | |
13 | * details. | |
14 | */ | |
15 | ||
16 | #ifndef __VBUSCHANNEL_H__ | |
17 | #define __VBUSCHANNEL_H__ | |
18 | ||
19528057 SW |
19 | /* |
20 | * The vbus channel is the channel area provided via the BUS_CREATE controlvm | |
21 | * message for each virtual bus. This channel area is provided to both server | |
22 | * and client ends of the bus. The channel header area is initialized by | |
23 | * the server, and the remaining information is filled in by the client. | |
24 | * We currently use this for the client to provide various information about | |
25 | * the client devices and client drivers for the server end to see. | |
12e364b9 | 26 | */ |
19528057 | 27 | |
90addb02 | 28 | #include <linux/uuid.h> |
8217becc | 29 | #include <linux/ctype.h> |
12e364b9 KC |
30 | #include "channel.h" |
31 | ||
32 | /* {193b331b-c58f-11da-95a9-00e08161165f} */ | |
b32c5cb8 AS |
33 | #define VISOR_VBUS_CHANNEL_GUID \ |
34 | GUID_INIT(0x193b331b, 0xc58f, 0x11da, \ | |
35 | 0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f) | |
12e364b9 | 36 | |
19528057 SW |
37 | /* |
38 | * Must increment this whenever you insert or delete fields within this channel | |
e3f8f77c EA |
39 | * struct. Also increment whenever you change the meaning of fields within this |
40 | * channel struct so as to break pre-existing software. Note that you can | |
41 | * usually add fields to the END of the channel struct withOUT needing to | |
42 | * increment this. | |
43 | */ | |
73472174 | 44 | #define VISOR_VBUS_CHANNEL_VERSIONID 1 |
12e364b9 | 45 | |
19528057 SW |
46 | /* struct visor_vbus_deviceinfo |
47 | * @devtype: Short string identifying the device type. | |
48 | * @drvname: Driver .sys file name. | |
49 | * @infostrs: Kernel vversion. | |
50 | * @reserved: Pad size to 256 bytes. | |
51 | * | |
b6d0fa15 | 52 | * An array of this struct is present in the channel area for each vbus. |
19528057 SW |
53 | * (See vbuschannel.h.). It is filled in by the client side to provide info |
54 | * about the device and driver from the client's perspective. | |
b6d0fa15 | 55 | */ |
55c71eba | 56 | struct visor_vbus_deviceinfo { |
19528057 SW |
57 | u8 devtype[16]; |
58 | u8 drvname[16]; | |
59 | u8 infostrs[96]; | |
60 | u8 reserved[128]; | |
2c97273e | 61 | } __packed; |
b6d0fa15 | 62 | |
19528057 SW |
63 | /* |
64 | * struct visor_vbus_headerinfo | |
65 | * @struct_bytes: Size of this struct in bytes. | |
66 | * @device_info_struct_bytes: Size of VISOR_VBUS_DEVICEINFO. | |
67 | * @dev_info_count: Num of items in DevInfo member. This is the | |
68 | * allocated size. | |
69 | * @chp_info_offset: Byte offset from beginning of this struct to the | |
70 | * ChpInfo struct. | |
71 | * @bus_info_offset: Byte offset from beginning of this struct to the | |
72 | * BusInfo struct. | |
73 | * @dev_info_offset: Byte offset from beginning of this struct to the | |
74 | * DevInfo array. | |
75 | * @reserved: Natural Alignment | |
76 | */ | |
55c71eba | 77 | struct visor_vbus_headerinfo { |
19528057 SW |
78 | u32 struct_bytes; |
79 | u32 device_info_struct_bytes; | |
80 | u32 dev_info_count; | |
81 | u32 chp_info_offset; | |
82 | u32 bus_info_offset; | |
83 | u32 dev_info_offset; | |
c242233e | 84 | u8 reserved[104]; |
2c97273e | 85 | } __packed; |
12e364b9 | 86 | |
19528057 SW |
87 | /* |
88 | * struct visor_vbus_channel | |
89 | * @channel_header: Initialized by server. | |
90 | * @hdr_info: Initialized by server. | |
91 | * @chp_info: Describes client chipset device and driver. | |
92 | * @bus_info: Describes client bus device and driver. | |
93 | * @dev_info: Describes client device and driver for each device on the | |
94 | * bus. | |
95 | */ | |
55c71eba | 96 | struct visor_vbus_channel { |
19528057 SW |
97 | struct channel_header channel_header; |
98 | struct visor_vbus_headerinfo hdr_info; | |
99 | /* The remainder of this channel is filled in by the client */ | |
55c71eba | 100 | struct visor_vbus_deviceinfo chp_info; |
55c71eba | 101 | struct visor_vbus_deviceinfo bus_info; |
55c71eba | 102 | struct visor_vbus_deviceinfo dev_info[0]; |
2c97273e | 103 | } __packed; |
12e364b9 KC |
104 | |
105 | #endif |