staging: unisys: refactor SPAR_CONTROLVM_CHANNEL_PROTOCOL
[deliverable/linux.git] / drivers / staging / unisys / common-spar / include / channels / controlvmchannel.h
CommitLineData
f6d0c1e6 1/* Copyright (C) 2010 - 2013 UNISYS CORPORATION
12e364b9
KC
2 * All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or (at
7 * your option) any later version.
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 __CONTROLVMCHANNEL_H__
17#define __CONTROLVMCHANNEL_H__
18
90addb02 19#include <linux/uuid.h>
12e364b9
KC
20#include "channel.h"
21#include "controlframework.h"
af96e9c0
BR
22
23typedef u64 GUEST_PHYSICAL_ADDRESS;
24
12e364b9
KC
25enum { INVALID_GUEST_FIRMWARE, SAMPLE_GUEST_FIRMWARE,
26 TIANO32_GUEST_FIRMWARE, TIANO64_GUEST_FIRMWARE
27};
28
29/* {2B3C2D10-7EF5-4ad8-B966-3448B7386B3D} */
5fbaa4b3 30#define SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID \
90addb02
BR
31 UUID_LE(0x2b3c2d10, 0x7ef5, 0x4ad8, \
32 0xb9, 0x66, 0x34, 0x48, 0xb7, 0x38, 0x6b, 0x3d)
12e364b9 33
5fbaa4b3
BR
34static const uuid_le spar_controlvm_channel_protocol_uuid =
35 SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID;
12e364b9
KC
36
37#define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE \
38 ULTRA_CHANNEL_PROTOCOL_SIGNATURE
39#define CONTROLVM_MESSAGE_MAX 64
40
41/* Must increment this whenever you insert or delete fields within
42* this channel struct. Also increment whenever you change the meaning
43* of fields within this channel struct so as to break pre-existing
44* software. Note that you can usually add fields to the END of the
45* channel struct withOUT needing to increment this. */
46#define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID 1
47
600832fd
BR
48#define SPAR_CONTROLVM_CHANNEL_OK_CLIENT(ch) \
49 spar_check_channel_client(ch, \
d19642f6
BR
50 spar_controlvm_channel_protocol_uuid, \
51 "controlvm", \
52 sizeof(struct spar_controlvm_channel_protocol), \
53 ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID, \
54 ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE)
12e364b9
KC
55
56#define MY_DEVICE_INDEX 0
57#define MAX_MACDATA_LEN 8 /* number of bytes for MAC address in config packet */
58#define MAX_SERIAL_NUM 32
59
60#define DISK_ZERO_PUN_NUMBER 1 /* Target ID on the SCSI bus for LUN 0 */
61#define DISK_ZERO_LUN_NUMBER 3 /* Logical Unit Number */
62
63/* Defines for various channel queues... */
64#define CONTROLVM_QUEUE_REQUEST 0
65#define CONTROLVM_QUEUE_RESPONSE 1
66#define CONTROLVM_QUEUE_EVENT 2
67#define CONTROLVM_QUEUE_ACK 3
68
69/* Max number of messages stored during IOVM creation to be reused
70 * after crash */
71#define CONTROLVM_CRASHMSG_MAX 2
72
73/** Ids for commands that may appear in either queue of a ControlVm channel.
74 *
75 * Commands that are initiated by the command partition (CP), by an IO or
76 * console service partition (SP), or by a guest partition (GP)are:
77 * - issued on the RequestQueue queue (q #0) in the ControlVm channel
78 * - responded to on the ResponseQueue queue (q #1) in the ControlVm channel
79 *
80 * Events that are initiated by an IO or console service partition (SP) or
81 * by a guest partition (GP) are:
82 * - issued on the EventQueue queue (q #2) in the ControlVm channel
83 * - responded to on the EventAckQueue queue (q #3) in the ControlVm channel
84 */
53bebb13 85enum controlvm_id {
12e364b9
KC
86 CONTROLVM_INVALID = 0,
87 /* SWITCH commands required Parameter: SwitchNumber */
88 /* BUS commands required Parameter: BusNumber */
89 CONTROLVM_BUS_CREATE = 0x101, /* CP --> SP, GP */
90 CONTROLVM_BUS_DESTROY = 0x102, /* CP --> SP, GP */
91 CONTROLVM_BUS_CONFIGURE = 0x104, /* CP --> SP */
92 CONTROLVM_BUS_CHANGESTATE = 0x105, /* CP --> SP, GP */
93 CONTROLVM_BUS_CHANGESTATE_EVENT = 0x106, /* SP, GP --> CP */
94/* DEVICE commands required Parameter: BusNumber, DeviceNumber */
95
96 CONTROLVM_DEVICE_CREATE = 0x201, /* CP --> SP, GP */
97 CONTROLVM_DEVICE_DESTROY = 0x202, /* CP --> SP, GP */
98 CONTROLVM_DEVICE_CONFIGURE = 0x203, /* CP --> SP */
99 CONTROLVM_DEVICE_CHANGESTATE = 0x204, /* CP --> SP, GP */
100 CONTROLVM_DEVICE_CHANGESTATE_EVENT = 0x205, /* SP, GP --> CP */
101 CONTROLVM_DEVICE_RECONFIGURE = 0x206, /* CP --> Boot */
102/* DISK commands required Parameter: BusNumber, DeviceNumber */
103 CONTROLVM_DISK_CREATE = 0x221, /* CP --> SP */
104 CONTROLVM_DISK_DESTROY = 0x222, /* CP --> SP */
105 CONTROLVM_DISK_CONFIGURE = 0x223, /* CP --> SP */
106 CONTROLVM_DISK_CHANGESTATE = 0x224, /* CP --> SP */
107/* CHIPSET commands */
108 CONTROLVM_CHIPSET_INIT = 0x301, /* CP --> SP, GP */
109 CONTROLVM_CHIPSET_STOP = 0x302, /* CP --> SP, GP */
110 CONTROLVM_CHIPSET_SHUTDOWN = 0x303, /* CP --> SP */
111 CONTROLVM_CHIPSET_READY = 0x304, /* CP --> SP */
112 CONTROLVM_CHIPSET_SELFTEST = 0x305, /* CP --> SP */
113
d8ad8b0c 114};
12e364b9 115
4eddbf13 116struct irq_info {
12e364b9
KC
117 /**< specifies interrupt info. It is used to send interrupts
118 * for this channel. The peer at the end of this channel
119 * who has registered an interrupt (using recv fields
120 * above) will receive the interrupt. Passed as a parameter
121 * to Issue_VMCALL_IO_QUEUE_TRANSITION, which generates the
122 * interrupt. Currently this is used by IOPart-SP to wake
123 * up GP when Data Channel transitions from empty to
124 * non-empty.*/
af3286bd 125 u64 send_irq_handle;
12e364b9
KC
126
127 /**< specifies interrupt handle. It is used to retrieve the
128 * corresponding interrupt pin from Monitor; and the
129 * interrupt pin is used to connect to the corresponding
130 * intrrupt. Used by IOPart-GP only. */
af3286bd 131 u64 recv_irq_handle;
12e364b9
KC
132
133 /**< specifies interrupt vector. It, interrupt pin, and shared are
134 * used to connect to the corresponding interrupt. Used by
135 * IOPart-GP only. */
af3286bd 136 u32 recv_irq_vector;
12e364b9
KC
137
138 /**< specifies if the recvInterrupt is shared. It, interrupt pin
139 * and vector are used to connect to 0 = not shared; 1 = shared.
140 * the corresponding interrupt. Used by IOPart-GP only. */
af3286bd 141 u8 recv_irq_shared;
c242233e 142 u8 reserved[3]; /* Natural alignment purposes */
12e364b9
KC
143};
144
c12ad837 145struct pci_id {
6822f736
BR
146 u16 domain;
147 u8 bus;
148 u8 slot;
149 u8 func;
150 u8 reserved[3]; /* Natural alignment purposes */
12e364b9
KC
151};
152
755e2ecc 153struct efi_spar_indication {
2450301a
BR
154 u64 boot_to_fw_ui:1; /* Bit 0: Stop in uefi ui */
155 u64 clear_nvram:1; /* Bit 1: Clear NVRAM */
156 u64 clear_cmos:1; /* Bit 2: Clear CMOS */
157 u64 boot_to_tool:1; /* Bit 3: Run install tool */
12e364b9 158 /* remaining bits are available */
755e2ecc 159};
12e364b9 160
b9b141e8 161enum ultra_chipset_feature {
12e364b9
KC
162 ULTRA_CHIPSET_FEATURE_REPLY = 0x00000001,
163 ULTRA_CHIPSET_FEATURE_PARA_HOTPLUG = 0x00000002,
164 ULTRA_CHIPSET_FEATURE_PCIVBUS = 0x00000004
b9b141e8 165};
12e364b9
KC
166
167/** This is the common structure that is at the beginning of every
168 * ControlVm message (both commands and responses) in any ControlVm
169 * queue. Commands are easily distinguished from responses by
170 * looking at the flags.response field.
171 */
98d7b594
BR
172struct controlvm_message_header {
173 u32 id; /* See CONTROLVM_ID. */
12e364b9
KC
174 /* For requests, indicates the message type. */
175 /* For responses, indicates the type of message we are responding to. */
176
98d7b594 177 u32 message_size; /* Includes size of this struct + size
12e364b9 178 * of message */
98d7b594 179 u32 segment_index; /* Index of segment containing Vm
12e364b9 180 * message/information */
98d7b594 181 u32 completion_status; /* Error status code or result of
12e364b9
KC
182 * message completion */
183 struct {
b3c55b13 184 u32 failed:1; /**< =1 in a response to * signify
12e364b9 185 * failure */
98d7b594 186 u32 response_expected:1; /**< =1 in all messages that expect a
12e364b9
KC
187 * response (Control ignores this
188 * bit) */
b3c55b13 189 u32 server:1; /**< =1 in all bus & device-related
12e364b9
KC
190 * messages where the message
191 * receiver is to act as the bus or
192 * device server */
98d7b594 193 u32 test_message:1; /**< =1 for testing use only
12e364b9
KC
194 * (Control and Command ignore this
195 * bit) */
98d7b594 196 u32 partial_completion:1; /**< =1 if there are forthcoming
12e364b9
KC
197 * responses/acks associated
198 * with this message */
b3c55b13 199 u32 preserve:1; /**< =1 this is to let us know to
12e364b9
KC
200 * preserve channel contents
201 * (for running guests)*/
98d7b594 202 u32 writer_in_diag:1; /**< =1 the DiagWriter is active in the
12e364b9 203 * Diagnostic Partition*/
98d7b594
BR
204 } flags;
205 u32 reserved; /* Natural alignment */
206 u64 message_handle; /* Identifies the particular message instance,
12e364b9
KC
207 * and is used to match particular */
208 /* request instances with the corresponding response instance. */
98d7b594 209 u64 payload_vm_offset; /* Offset of payload area from start of this
12e364b9 210 * instance of ControlVm segment */
98d7b594 211 u32 payload_max_bytes; /* Maximum bytes allocated in payload
12e364b9 212 * area of ControlVm segment */
98d7b594 213 u32 payload_bytes; /* Actual number of bytes of payload
12e364b9
KC
214 * area to copy between IO/Command; */
215 /* if non-zero, there is a payload to copy. */
98d7b594 216};
12e364b9 217
f91b9262
BR
218struct controlvm_packet_device_create {
219 u32 bus_no; /* bus # (0..n-1) from the msg receiver's end */
220 u32 dev_no; /* bus-relative (0..n-1) device number */
221 u64 channel_addr; /* Guest physical address of the channel, which
222 * can be dereferenced by the receiver of this
223 * ControlVm command */
224 u64 channel_bytes; /* specifies size of the channel in bytes */
225 uuid_le data_type_uuid; /* specifies format of data in channel */
226 uuid_le dev_inst_uuid; /* instance guid for the device */
227 struct irq_info intr; /* specifies interrupt information */
228}; /* for CONTROLVM_DEVICE_CREATE */
12e364b9 229
e6ad00bb
BR
230struct controlvm_packet_device_configure {
231 u32 bus_no; /**< bus # (0..n-1) from the msg
12e364b9
KC
232 * receiver's perspective */
233
234 /* Control uses header SegmentIndex field to access bus number... */
e6ad00bb
BR
235 u32 dev_no; /**< bus-relative (0..n-1) device number */
236} ; /* for CONTROLVM_DEVICE_CONFIGURE */
12e364b9 237
c36acb55
BR
238struct controlvm_message_device_create {
239 struct controlvm_message_header header;
240 struct controlvm_packet_device_create packet;
241}; /* total 128 bytes */
12e364b9 242
f676054d
BR
243struct controlvm_message_device_configure {
244 struct controlvm_message_header header;
245 struct controlvm_packet_device_configure packet;
246}; /* total 56 bytes */
12e364b9
KC
247
248/* This is the format for a message in any ControlVm queue. */
2ea5117b 249struct controlvm_message_packet {
12e364b9 250 union {
12e364b9 251 struct {
2ea5117b
BR
252 u32 bus_no; /* bus # (0..n-1) from the msg
253 * receiver's perspective */
254 u32 dev_count; /* indicates the max number of
255 * devices on this bus */
256 u64 channel_addr; /* Guest physical address of
257 * the channel, which can be
258 * dereferenced by the receiver
259 * of this ControlVm command */
260 u64 channel_bytes; /* size of the channel */
261 uuid_le bus_data_type_uuid; /* indicates format of
262 * data in bus channel*/
263 uuid_le bus_inst_uuid; /* instance uuid for the bus */
264 } create_bus; /* for CONTROLVM_BUS_CREATE */
12e364b9 265 struct {
2ea5117b
BR
266 u32 bus_no; /* bus # (0..n-1) from the msg
267 * receiver's perspective */
b3c55b13 268 u32 reserved; /* Natural alignment purposes */
2ea5117b 269 } destroy_bus; /* for CONTROLVM_BUS_DESTROY */
12e364b9 270 struct {
2ea5117b
BR
271 u32 bus_no; /* bus # (0..n-1) from the receiver's
272 * perspective */
273 u32 reserved1; /* for alignment purposes */
274 u64 guest_handle; /* This is used to convert
275 * guest physical address to
276 * physical address */
277 u64 recv_bus_irq_handle;
278 /* specifies interrupt info. It is used by SP
279 * to register to receive interrupts from the
280 * CP. This interrupt is used for bus level
281 * notifications. The corresponding
282 * sendBusInterruptHandle is kept in CP. */
283 } configure_bus; /* for CONTROLVM_BUS_CONFIGURE */
12e364b9 284 /* for CONTROLVM_DEVICE_CREATE */
f91b9262 285 struct controlvm_packet_device_create create_device;
12e364b9 286 struct {
2ea5117b
BR
287 u32 bus_no; /* bus # (0..n-1) from the msg
288 * receiver's perspective */
289 u32 dev_no; /* bus-relative (0..n-1) device # */
290 } destroy_device; /* for CONTROLVM_DEVICE_DESTROY */
12e364b9 291 /* for CONTROLVM_DEVICE_CONFIGURE */
e6ad00bb 292 struct controlvm_packet_device_configure configure_device;
12e364b9 293 struct {
2ea5117b
BR
294 u32 bus_no; /* bus # (0..n-1) from the msg
295 * receiver's perspective */
296 u32 dev_no; /* bus-relative (0..n-1) device # */
297 } reconfigure_device; /* for CONTROLVM_DEVICE_RECONFIGURE */
12e364b9 298 struct {
2ea5117b 299 u32 bus_no;
3f833b54 300 struct spar_segment_state state;
c242233e 301 u8 reserved[2]; /* Natural alignment purposes */
2ea5117b 302 } bus_change_state; /* for CONTROLVM_BUS_CHANGESTATE */
12e364b9 303 struct {
2ea5117b
BR
304 u32 bus_no;
305 u32 dev_no;
3f833b54 306 struct spar_segment_state state;
12e364b9 307 struct {
2ea5117b 308 u32 phys_device:1; /* =1 if message is for
12e364b9 309 * a physical device */
12e364b9 310 } flags;
c242233e 311 u8 reserved[2]; /* Natural alignment purposes */
2ea5117b 312 } device_change_state; /* for CONTROLVM_DEVICE_CHANGESTATE */
12e364b9 313 struct {
2ea5117b
BR
314 u32 bus_no;
315 u32 dev_no;
3f833b54 316 struct spar_segment_state state;
c242233e 317 u8 reserved[6]; /* Natural alignment purposes */
2ea5117b
BR
318 } device_change_state_event;
319 /* for CONTROLVM_DEVICE_CHANGESTATE_EVENT */
12e364b9 320 struct {
2ea5117b
BR
321 u32 bus_count; /* indicates the max number of busses */
322 u32 switch_count; /* indicates the max number of
323 * switches if a service partition */
b9b141e8 324 enum ultra_chipset_feature features;
2ea5117b
BR
325 u32 platform_number; /* Platform Number */
326 } init_chipset; /* for CONTROLVM_CHIPSET_INIT */
12e364b9 327 struct {
2ea5117b
BR
328 u32 options; /* reserved */
329 u32 test; /* bit 0 set to run embedded selftest */
330 } chipset_selftest; /* for CONTROLVM_CHIPSET_SELFTEST */
331 u64 addr; /* a physical address of something, that can be
332 * dereferenced by the receiver of this
333 * ControlVm command (depends on command id) */
334 u64 handle; /* a handle of something (depends on command
335 * id) */
12e364b9 336 };
2ea5117b 337};
12e364b9
KC
338
339/* All messages in any ControlVm queue have this layout. */
3ab47701 340struct controlvm_message {
98d7b594 341 struct controlvm_message_header hdr;
2ea5117b 342 struct controlvm_message_packet cmd;
3ab47701 343};
12e364b9 344
a348e0dc
BR
345struct device_map {
346 GUEST_PHYSICAL_ADDRESS device_channel_address;
347 u64 device_channel_size;
348 u32 ca_index;
349 u32 reserved; /* natural alignment */
350 u64 reserved2; /* Align structure on 32-byte boundary */
351};
12e364b9 352
6f5a5b7b
BR
353struct guest_devices {
354 struct device_map video_channel;
355 struct device_map keyboard_channel;
356 struct device_map network_channel;
357 struct device_map storage_channel;
358 struct device_map console_channel;
359 u32 partition_index;
360 u32 pad;
361};
12e364b9 362
d19642f6
BR
363struct spar_controlvm_channel_protocol {
364 struct channel_header header;
365 GUEST_PHYSICAL_ADDRESS gp_controlvm; /* guest physical address of
12e364b9 366 * this channel */
d19642f6
BR
367 GUEST_PHYSICAL_ADDRESS gp_partition_tables;/* guest physical address of
368 * partition tables */
369 GUEST_PHYSICAL_ADDRESS gp_diag_guest; /* guest physical address of
12e364b9 370 * diagnostic channel */
d19642f6 371 GUEST_PHYSICAL_ADDRESS gp_boot_romdisk;/* guest phys addr of (read
12e364b9 372 * only) Boot ROM disk */
d19642f6 373 GUEST_PHYSICAL_ADDRESS gp_boot_ramdisk;/* guest phys addr of writable
12e364b9 374 * Boot RAM disk */
d19642f6 375 GUEST_PHYSICAL_ADDRESS gp_acpi_table; /* guest phys addr of acpi
12e364b9 376 * table */
d19642f6
BR
377 GUEST_PHYSICAL_ADDRESS gp_control_channel;/* guest phys addr of control
378 * channel */
379 GUEST_PHYSICAL_ADDRESS gp_diag_romdisk;/* guest phys addr of diagnostic
12e364b9 380 * ROM disk */
d19642f6 381 GUEST_PHYSICAL_ADDRESS gp_nvram; /* guest phys addr of NVRAM
12e364b9 382 * channel */
d19642f6
BR
383 u64 request_payload_offset; /* Offset to request payload area */
384 u64 event_payload_offset; /* Offset to event payload area */
385 u32 request_payload_bytes; /* Bytes available in request payload
12e364b9 386 * area */
d19642f6
BR
387 u32 event_payload_bytes;/* Bytes available in event payload area */
388 u32 control_channel_bytes;
389 u32 nvram_channel_bytes; /* Bytes in PartitionNvram segment */
390 u32 message_bytes; /* sizeof(CONTROLVM_MESSAGE) */
391 u32 message_count; /* CONTROLVM_MESSAGE_MAX */
392 GUEST_PHYSICAL_ADDRESS gp_smbios_table;/* guest phys addr of SMBIOS
12e364b9 393 * tables */
d19642f6
BR
394 GUEST_PHYSICAL_ADDRESS gp_physical_smbios_table;/* guest phys addr of
395 * SMBIOS table */
12e364b9 396 /* ULTRA_MAX_GUESTS_PER_SERVICE */
d19642f6 397 struct guest_devices gp_obsolete_guest_devices[16];
12e364b9
KC
398
399 /* guest physical address of EFI firmware image base */
d19642f6 400 GUEST_PHYSICAL_ADDRESS virtual_guest_firmware_image_base;
12e364b9
KC
401
402 /* guest physical address of EFI firmware entry point */
d19642f6 403 GUEST_PHYSICAL_ADDRESS virtual_guest_firmware_entry_point;
12e364b9
KC
404
405 /* guest EFI firmware image size */
d19642f6 406 u64 virtual_guest_firmware_image_size;
12e364b9
KC
407
408 /* GPA = 1MB where EFI firmware image is copied to */
d19642f6
BR
409 GUEST_PHYSICAL_ADDRESS virtual_guest_firmware_boot_base;
410 GUEST_PHYSICAL_ADDRESS virtual_guest_image_base;
411 GUEST_PHYSICAL_ADDRESS virtual_guest_image_size;
412 u64 prototype_control_channel_offset;
413 GUEST_PHYSICAL_ADDRESS virtual_guest_partition_handle;
12e364b9 414
d19642f6 415 u16 restore_action; /* Restore Action field to restore the guest
12e364b9 416 * partition */
d19642f6 417 u16 dump_action; /* For Windows guests it shows if the visordisk
12e364b9 418 * is running in dump mode */
d19642f6
BR
419 u16 nvram_fail_count;
420 u16 saved_crash_message_count; /* = CONTROLVM_CRASHMSG_MAX */
421 u32 saved_crash_message_offset; /* Offset to request payload area needed
12e364b9 422 * for crash dump */
d19642f6 423 u32 installation_error; /* Type of error encountered during
12e364b9 424 * installation */
d19642f6
BR
425 u32 installation_text_id; /* Id of string to display */
426 u16 installation_remaining_steps;/* Number of remaining installation
427 * steps (for progress bars) */
428 u8 tool_action; /* ULTRA_TOOL_ACTIONS Installation Action
12e364b9 429 * field */
d19642f6
BR
430 u8 reserved; /* alignment */
431 struct efi_spar_indication efi_spar_ind;
432 struct efi_spar_indication efi_spar_ind_supported;
433 u32 sp_reserved;
434 u8 reserved2[28]; /* Force signals to begin on 128-byte cache
12e364b9 435 * line */
d19642f6
BR
436 struct signal_queue_header request_queue;/* Service or guest partition
437 * uses this queue to send
438 * requests to Control */
439 struct signal_queue_header response_queue;/* Control uses this queue to
440 * respond to service or guest
441 * partition requests */
442 struct signal_queue_header event_queue; /* Control uses this queue to
12e364b9
KC
443 * send events to service or
444 * guest partition */
d19642f6
BR
445 struct signal_queue_header event_ack_queue;/* Service or guest partition
446 * uses this queue to ack
447 * Control events */
12e364b9
KC
448
449 /* Request fixed-size message pool - does not include payload */
d19642f6 450 struct controlvm_message request_msg[CONTROLVM_MESSAGE_MAX];
12e364b9
KC
451
452 /* Response fixed-size message pool - does not include payload */
d19642f6 453 struct controlvm_message response_msg[CONTROLVM_MESSAGE_MAX];
12e364b9
KC
454
455 /* Event fixed-size message pool - does not include payload */
d19642f6 456 struct controlvm_message event_msg[CONTROLVM_MESSAGE_MAX];
12e364b9
KC
457
458 /* Ack fixed-size message pool - does not include payload */
d19642f6 459 struct controlvm_message event_ack_msg[CONTROLVM_MESSAGE_MAX];
12e364b9
KC
460
461 /* Message stored during IOVM creation to be reused after crash */
d19642f6
BR
462 struct controlvm_message saved_crash_msg[CONTROLVM_CRASHMSG_MAX];
463};
12e364b9
KC
464
465/* Offsets for VM channel attributes... */
466#define VM_CH_REQ_QUEUE_OFFSET \
d19642f6 467 offsetof(struct spar_controlvm_channel_protocol, request_queue)
12e364b9 468#define VM_CH_RESP_QUEUE_OFFSET \
d19642f6 469 offsetof(struct spar_controlvm_channel_protocol, response_queue)
12e364b9 470#define VM_CH_EVENT_QUEUE_OFFSET \
d19642f6 471 offsetof(struct spar_controlvm_channel_protocol, event_queue)
12e364b9 472#define VM_CH_ACK_QUEUE_OFFSET \
d19642f6 473 offsetof(struct spar_controlvm_channel_protocol, event_ack_queue)
12e364b9 474#define VM_CH_REQ_MSG_OFFSET \
d19642f6 475 offsetof(struct spar_controlvm_channel_protocol, request_msg)
12e364b9 476#define VM_CH_RESP_MSG_OFFSET \
d19642f6 477 offsetof(struct spar_controlvm_channel_protocol, response_msg)
12e364b9 478#define VM_CH_EVENT_MSG_OFFSET \
d19642f6 479 offsetof(struct spar_controlvm_channel_protocol, event_msg)
12e364b9 480#define VM_CH_ACK_MSG_OFFSET \
d19642f6 481 offsetof(struct spar_controlvm_channel_protocol, event_ack_msg)
12e364b9 482#define VM_CH_CRASH_MSG_OFFSET \
d19642f6 483 offsetof(struct spar_controlvm_channel_protocol, saved_crash_msg)
12e364b9
KC
484
485/* The following header will be located at the beginning of PayloadVmOffset for
486 * various ControlVm commands. The receiver of a ControlVm command with a
487 * PayloadVmOffset will dereference this address and then use ConnectionOffset,
488 * InitiatorOffset, and TargetOffset to get the location of UTF-8 formatted
489 * strings that can be parsed to obtain command-specific information. The value
490 * of TotalLength should equal PayloadBytes. The format of the strings at
491 * PayloadVmOffset will take different forms depending on the message. See the
492 * following Wiki page for more information:
493 * https://ustr-linux-1.na.uis.unisys.com/spar/index.php/ControlVm_Parameters_Area
494 */
495typedef struct _ULTRA_CONTROLVM_PARAMETERS_HEADER {
b3c55b13
BR
496 u32 TotalLength;
497 u32 HeaderLength;
498 u32 ConnectionOffset;
499 u32 ConnectionLength;
500 u32 InitiatorOffset;
501 u32 InitiatorLength;
502 u32 TargetOffset;
503 u32 TargetLength;
504 u32 ClientOffset;
505 u32 ClientLength;
506 u32 NameOffset;
507 u32 NameLength;
90addb02 508 uuid_le Id;
b3c55b13
BR
509 u32 Revision;
510 u32 Reserved; /* Natural alignment */
12e364b9
KC
511} ULTRA_CONTROLVM_PARAMETERS_HEADER;
512
513#endif /* __CONTROLVMCHANNEL_H__ */
This page took 0.210651 seconds and 5 git commands to generate.