18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (C) 2010 - 2015 UNISYS CORPORATION
48c2ecf20Sopenharmony_ci * All rights reserved.
58c2ecf20Sopenharmony_ci */
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#ifndef __CONTROLVMCHANNEL_H__
88c2ecf20Sopenharmony_ci#define __CONTROLVMCHANNEL_H__
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#include <linux/uuid.h>
118c2ecf20Sopenharmony_ci#include <linux/visorbus.h>
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci/* {2B3C2D10-7EF5-4ad8-B966-3448B7386B3D} */
148c2ecf20Sopenharmony_ci#define VISOR_CONTROLVM_CHANNEL_GUID \
158c2ecf20Sopenharmony_ci	GUID_INIT(0x2b3c2d10, 0x7ef5, 0x4ad8, \
168c2ecf20Sopenharmony_ci		  0xb9, 0x66, 0x34, 0x48, 0xb7, 0x38, 0x6b, 0x3d)
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#define CONTROLVM_MESSAGE_MAX 64
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci/*
218c2ecf20Sopenharmony_ci * Must increment this whenever you insert or delete fields within this channel
228c2ecf20Sopenharmony_ci * struct.  Also increment whenever you change the meaning of fields within this
238c2ecf20Sopenharmony_ci * channel struct so as to break pre-existing software. Note that you can
248c2ecf20Sopenharmony_ci * usually add fields to the END of the channel struct withOUT needing to
258c2ecf20Sopenharmony_ci * increment this.
268c2ecf20Sopenharmony_ci */
278c2ecf20Sopenharmony_ci#define VISOR_CONTROLVM_CHANNEL_VERSIONID 1
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci/* Defines for various channel queues */
308c2ecf20Sopenharmony_ci#define CONTROLVM_QUEUE_REQUEST		0
318c2ecf20Sopenharmony_ci#define CONTROLVM_QUEUE_RESPONSE	1
328c2ecf20Sopenharmony_ci#define CONTROLVM_QUEUE_EVENT		2
338c2ecf20Sopenharmony_ci#define CONTROLVM_QUEUE_ACK		3
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci/* Max num of messages stored during IOVM creation to be reused after crash */
368c2ecf20Sopenharmony_ci#define CONTROLVM_CRASHMSG_MAX 2
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci/*
398c2ecf20Sopenharmony_ci * struct visor_segment_state
408c2ecf20Sopenharmony_ci * @enabled:   May enter other states.
418c2ecf20Sopenharmony_ci * @active:    Assigned to active partition.
428c2ecf20Sopenharmony_ci * @alive:     Configure message sent to service/server.
438c2ecf20Sopenharmony_ci * @revoked:   Similar to partition state ShuttingDown.
448c2ecf20Sopenharmony_ci * @allocated: Memory (device/port number) has been selected by Command.
458c2ecf20Sopenharmony_ci * @known:     Has been introduced to the service/guest partition.
468c2ecf20Sopenharmony_ci * @ready:     Service/Guest partition has responded to introduction.
478c2ecf20Sopenharmony_ci * @operating: Resource is configured and operating.
488c2ecf20Sopenharmony_ci * @reserved:  Natural alignment.
498c2ecf20Sopenharmony_ci *
508c2ecf20Sopenharmony_ci * Note: Don't use high bit unless we need to switch to ushort which is
518c2ecf20Sopenharmony_ci * non-compliant.
528c2ecf20Sopenharmony_ci */
538c2ecf20Sopenharmony_cistruct visor_segment_state  {
548c2ecf20Sopenharmony_ci	u16 enabled:1;
558c2ecf20Sopenharmony_ci	u16 active:1;
568c2ecf20Sopenharmony_ci	u16 alive:1;
578c2ecf20Sopenharmony_ci	u16 revoked:1;
588c2ecf20Sopenharmony_ci	u16 allocated:1;
598c2ecf20Sopenharmony_ci	u16 known:1;
608c2ecf20Sopenharmony_ci	u16 ready:1;
618c2ecf20Sopenharmony_ci	u16 operating:1;
628c2ecf20Sopenharmony_ci	u16 reserved:8;
638c2ecf20Sopenharmony_ci} __packed;
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_cistatic const struct visor_segment_state segment_state_running = {
668c2ecf20Sopenharmony_ci	1, 1, 1, 0, 1, 1, 1, 1
678c2ecf20Sopenharmony_ci};
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_cistatic const struct visor_segment_state segment_state_paused = {
708c2ecf20Sopenharmony_ci	1, 1, 1, 0, 1, 1, 1, 0
718c2ecf20Sopenharmony_ci};
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_cistatic const struct visor_segment_state segment_state_standby = {
748c2ecf20Sopenharmony_ci	1, 1, 0, 0, 1, 1, 1, 0
758c2ecf20Sopenharmony_ci};
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci/*
788c2ecf20Sopenharmony_ci * enum controlvm_id
798c2ecf20Sopenharmony_ci * @CONTROLVM_INVALID:
808c2ecf20Sopenharmony_ci * @CONTROLVM_BUS_CREATE:		CP --> SP, GP.
818c2ecf20Sopenharmony_ci * @CONTROLVM_BUS_DESTROY:		CP --> SP, GP.
828c2ecf20Sopenharmony_ci * @CONTROLVM_BUS_CONFIGURE:		CP --> SP.
838c2ecf20Sopenharmony_ci * @CONTROLVM_BUS_CHANGESTATE:		CP --> SP, GP.
848c2ecf20Sopenharmony_ci * @CONTROLVM_BUS_CHANGESTATE_EVENT:	SP, GP --> CP.
858c2ecf20Sopenharmony_ci * @CONTROLVM_DEVICE_CREATE:		CP --> SP, GP.
868c2ecf20Sopenharmony_ci * @CONTROLVM_DEVICE_DESTROY:		CP --> SP, GP.
878c2ecf20Sopenharmony_ci * @CONTROLVM_DEVICE_CONFIGURE:		CP --> SP.
888c2ecf20Sopenharmony_ci * @CONTROLVM_DEVICE_CHANGESTATE:	CP --> SP, GP.
898c2ecf20Sopenharmony_ci * @CONTROLVM_DEVICE_CHANGESTATE_EVENT:	SP, GP --> CP.
908c2ecf20Sopenharmony_ci * @CONTROLVM_DEVICE_RECONFIGURE:	CP --> Boot.
918c2ecf20Sopenharmony_ci * @CONTROLVM_CHIPSET_INIT:		CP --> SP, GP.
928c2ecf20Sopenharmony_ci * @CONTROLVM_CHIPSET_STOP:		CP --> SP, GP.
938c2ecf20Sopenharmony_ci * @CONTROLVM_CHIPSET_READY:		CP --> SP.
948c2ecf20Sopenharmony_ci * @CONTROLVM_CHIPSET_SELFTEST:		CP --> SP.
958c2ecf20Sopenharmony_ci *
968c2ecf20Sopenharmony_ci * Ids for commands that may appear in either queue of a ControlVm channel.
978c2ecf20Sopenharmony_ci *
988c2ecf20Sopenharmony_ci * Commands that are initiated by the command partition (CP), by an IO or
998c2ecf20Sopenharmony_ci * console service partition (SP), or by a guest partition (GP) are:
1008c2ecf20Sopenharmony_ci * - issued on the RequestQueue queue (q #0) in the ControlVm channel
1018c2ecf20Sopenharmony_ci * - responded to on the ResponseQueue queue (q #1) in the ControlVm channel
1028c2ecf20Sopenharmony_ci *
1038c2ecf20Sopenharmony_ci * Events that are initiated by an IO or console service partition (SP) or
1048c2ecf20Sopenharmony_ci * by a guest partition (GP) are:
1058c2ecf20Sopenharmony_ci * - issued on the EventQueue queue (q #2) in the ControlVm channel
1068c2ecf20Sopenharmony_ci * - responded to on the EventAckQueue queue (q #3) in the ControlVm channel
1078c2ecf20Sopenharmony_ci */
1088c2ecf20Sopenharmony_cienum controlvm_id {
1098c2ecf20Sopenharmony_ci	CONTROLVM_INVALID = 0,
1108c2ecf20Sopenharmony_ci	/*
1118c2ecf20Sopenharmony_ci	 * SWITCH commands required Parameter: SwitchNumber.
1128c2ecf20Sopenharmony_ci	 * BUS commands required Parameter: BusNumber
1138c2ecf20Sopenharmony_ci	 */
1148c2ecf20Sopenharmony_ci	CONTROLVM_BUS_CREATE = 0x101,
1158c2ecf20Sopenharmony_ci	CONTROLVM_BUS_DESTROY = 0x102,
1168c2ecf20Sopenharmony_ci	CONTROLVM_BUS_CONFIGURE = 0x104,
1178c2ecf20Sopenharmony_ci	CONTROLVM_BUS_CHANGESTATE = 0x105,
1188c2ecf20Sopenharmony_ci	CONTROLVM_BUS_CHANGESTATE_EVENT = 0x106,
1198c2ecf20Sopenharmony_ci	/* DEVICE commands required Parameter: BusNumber, DeviceNumber */
1208c2ecf20Sopenharmony_ci	CONTROLVM_DEVICE_CREATE = 0x201,
1218c2ecf20Sopenharmony_ci	CONTROLVM_DEVICE_DESTROY = 0x202,
1228c2ecf20Sopenharmony_ci	CONTROLVM_DEVICE_CONFIGURE = 0x203,
1238c2ecf20Sopenharmony_ci	CONTROLVM_DEVICE_CHANGESTATE = 0x204,
1248c2ecf20Sopenharmony_ci	CONTROLVM_DEVICE_CHANGESTATE_EVENT = 0x205,
1258c2ecf20Sopenharmony_ci	CONTROLVM_DEVICE_RECONFIGURE = 0x206,
1268c2ecf20Sopenharmony_ci	/* CHIPSET commands */
1278c2ecf20Sopenharmony_ci	CONTROLVM_CHIPSET_INIT = 0x301,
1288c2ecf20Sopenharmony_ci	CONTROLVM_CHIPSET_STOP = 0x302,
1298c2ecf20Sopenharmony_ci	CONTROLVM_CHIPSET_READY = 0x304,
1308c2ecf20Sopenharmony_ci	CONTROLVM_CHIPSET_SELFTEST = 0x305,
1318c2ecf20Sopenharmony_ci};
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci/*
1348c2ecf20Sopenharmony_ci * struct irq_info
1358c2ecf20Sopenharmony_ci * @reserved1:	     Natural alignment purposes
1368c2ecf20Sopenharmony_ci * @recv_irq_handle: Specifies interrupt handle. It is used to retrieve the
1378c2ecf20Sopenharmony_ci *		     corresponding interrupt pin from Monitor; and the interrupt
1388c2ecf20Sopenharmony_ci *		     pin is used to connect to the corresponding interrupt.
1398c2ecf20Sopenharmony_ci *		     Used by IOPart-GP only.
1408c2ecf20Sopenharmony_ci * @recv_irq_vector: Specifies interrupt vector. It, interrupt pin, and shared
1418c2ecf20Sopenharmony_ci *		     are used to connect to the corresponding interrupt.
1428c2ecf20Sopenharmony_ci *		     Used by IOPart-GP only.
1438c2ecf20Sopenharmony_ci * @recv_irq_shared: Specifies if the recvInterrupt is shared.  It, interrupt
1448c2ecf20Sopenharmony_ci *		     pin and vector are used to connect to 0 = not shared;
1458c2ecf20Sopenharmony_ci *		     1 = shared the corresponding interrupt.
1468c2ecf20Sopenharmony_ci *		     Used by IOPart-GP only.
1478c2ecf20Sopenharmony_ci * @reserved:	     Natural alignment purposes
1488c2ecf20Sopenharmony_ci */
1498c2ecf20Sopenharmony_cistruct irq_info {
1508c2ecf20Sopenharmony_ci	u64 reserved1;
1518c2ecf20Sopenharmony_ci	u64 recv_irq_handle;
1528c2ecf20Sopenharmony_ci	u32 recv_irq_vector;
1538c2ecf20Sopenharmony_ci	u8 recv_irq_shared;
1548c2ecf20Sopenharmony_ci	u8 reserved[3];
1558c2ecf20Sopenharmony_ci} __packed;
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci/*
1588c2ecf20Sopenharmony_ci * struct efi_visor_indication
1598c2ecf20Sopenharmony_ci * @boot_to_fw_ui: Stop in UEFI UI
1608c2ecf20Sopenharmony_ci * @clear_nvram:   Clear NVRAM
1618c2ecf20Sopenharmony_ci * @clear_cmos:	   Clear CMOS
1628c2ecf20Sopenharmony_ci * @boot_to_tool:  Run install tool
1638c2ecf20Sopenharmony_ci * @reserved:	   Natural alignment
1648c2ecf20Sopenharmony_ci */
1658c2ecf20Sopenharmony_cistruct efi_visor_indication  {
1668c2ecf20Sopenharmony_ci	u64 boot_to_fw_ui:1;
1678c2ecf20Sopenharmony_ci	u64 clear_nvram:1;
1688c2ecf20Sopenharmony_ci	u64 clear_cmos:1;
1698c2ecf20Sopenharmony_ci	u64 boot_to_tool:1;
1708c2ecf20Sopenharmony_ci	/* Remaining bits are available */
1718c2ecf20Sopenharmony_ci	u64 reserved:60;
1728c2ecf20Sopenharmony_ci} __packed;
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_cienum visor_chipset_feature {
1758c2ecf20Sopenharmony_ci	VISOR_CHIPSET_FEATURE_REPLY = 0x00000001,
1768c2ecf20Sopenharmony_ci	VISOR_CHIPSET_FEATURE_PARA_HOTPLUG = 0x00000002,
1778c2ecf20Sopenharmony_ci};
1788c2ecf20Sopenharmony_ci
1798c2ecf20Sopenharmony_ci/*
1808c2ecf20Sopenharmony_ci * struct controlvm_message_header
1818c2ecf20Sopenharmony_ci * @id:		       See CONTROLVM_ID.
1828c2ecf20Sopenharmony_ci * @message_size:      Includes size of this struct + size of message.
1838c2ecf20Sopenharmony_ci * @segment_index:     Index of segment containing Vm message/information.
1848c2ecf20Sopenharmony_ci * @completion_status: Error status code or result of  message completion.
1858c2ecf20Sopenharmony_ci * @struct flags:
1868c2ecf20Sopenharmony_ci *	@failed:	     =1 in a response to signify failure.
1878c2ecf20Sopenharmony_ci *	@response_expected:  =1 in all messages that expect a response.
1888c2ecf20Sopenharmony_ci *	@server:	     =1 in all bus & device-related messages where the
1898c2ecf20Sopenharmony_ci *			     message receiver is to act as the bus or device
1908c2ecf20Sopenharmony_ci *			     server.
1918c2ecf20Sopenharmony_ci *	@test_message:	     =1 for testing use only (Control and Command
1928c2ecf20Sopenharmony_ci *			     ignore this).
1938c2ecf20Sopenharmony_ci *	@partial_completion: =1 if there are forthcoming responses/acks
1948c2ecf20Sopenharmony_ci *                           associated with this message.
1958c2ecf20Sopenharmony_ci *      @preserve:	     =1 this is to let us know to preserve channel
1968c2ecf20Sopenharmony_ci *			     contents.
1978c2ecf20Sopenharmony_ci *	@writer_in_diag:     =1 the DiagWriter is active in the Diagnostic
1988c2ecf20Sopenharmony_ci *			     Partition.
1998c2ecf20Sopenharmony_ci *	@reserve:	     Natural alignment.
2008c2ecf20Sopenharmony_ci * @reserved:	       Natural alignment.
2018c2ecf20Sopenharmony_ci * @message_handle:    Identifies the particular message instance.
2028c2ecf20Sopenharmony_ci * @payload_vm_offset: Offset of payload area from start of this instance.
2038c2ecf20Sopenharmony_ci * @payload_max_bytes: Maximum bytes allocated in payload area of ControlVm
2048c2ecf20Sopenharmony_ci *		       segment.
2058c2ecf20Sopenharmony_ci * @payload_bytes:     Actual number of bytes of payload area to copy between
2068c2ecf20Sopenharmony_ci *		       IO/Command. If non-zero, there is a payload to copy.
2078c2ecf20Sopenharmony_ci *
2088c2ecf20Sopenharmony_ci * This is the common structure that is at the beginning of every
2098c2ecf20Sopenharmony_ci * ControlVm message (both commands and responses) in any ControlVm
2108c2ecf20Sopenharmony_ci * queue.  Commands are easily distinguished from responses by
2118c2ecf20Sopenharmony_ci * looking at the flags.response field.
2128c2ecf20Sopenharmony_ci */
2138c2ecf20Sopenharmony_cistruct controlvm_message_header  {
2148c2ecf20Sopenharmony_ci	u32 id;
2158c2ecf20Sopenharmony_ci	/*
2168c2ecf20Sopenharmony_ci	 * For requests, indicates the message type. For responses, indicates
2178c2ecf20Sopenharmony_ci	 * the type of message we are responding to.
2188c2ecf20Sopenharmony_ci	 */
2198c2ecf20Sopenharmony_ci	u32 message_size;
2208c2ecf20Sopenharmony_ci	u32 segment_index;
2218c2ecf20Sopenharmony_ci	u32 completion_status;
2228c2ecf20Sopenharmony_ci	struct  {
2238c2ecf20Sopenharmony_ci		u32 failed:1;
2248c2ecf20Sopenharmony_ci		u32 response_expected:1;
2258c2ecf20Sopenharmony_ci		u32 server:1;
2268c2ecf20Sopenharmony_ci		u32 test_message:1;
2278c2ecf20Sopenharmony_ci		u32 partial_completion:1;
2288c2ecf20Sopenharmony_ci		u32 preserve:1;
2298c2ecf20Sopenharmony_ci		u32 writer_in_diag:1;
2308c2ecf20Sopenharmony_ci		u32 reserve:25;
2318c2ecf20Sopenharmony_ci	} __packed flags;
2328c2ecf20Sopenharmony_ci	u32 reserved;
2338c2ecf20Sopenharmony_ci	u64 message_handle;
2348c2ecf20Sopenharmony_ci	u64 payload_vm_offset;
2358c2ecf20Sopenharmony_ci	u32 payload_max_bytes;
2368c2ecf20Sopenharmony_ci	u32 payload_bytes;
2378c2ecf20Sopenharmony_ci} __packed;
2388c2ecf20Sopenharmony_ci
2398c2ecf20Sopenharmony_ci/*
2408c2ecf20Sopenharmony_ci * struct controlvm_packet_device_create - For CONTROLVM_DEVICE_CREATE
2418c2ecf20Sopenharmony_ci * @bus_no:	    Bus # (0..n-1) from the msg receiver's end.
2428c2ecf20Sopenharmony_ci * @dev_no:	    Bus-relative (0..n-1) device number.
2438c2ecf20Sopenharmony_ci * @channel_addr:   Guest physical address of the channel, which can be
2448c2ecf20Sopenharmony_ci *		    dereferenced by the receiver of this ControlVm command.
2458c2ecf20Sopenharmony_ci * @channel_bytes:  Specifies size of the channel in bytes.
2468c2ecf20Sopenharmony_ci * @data_type_uuid: Specifies format of data in channel.
2478c2ecf20Sopenharmony_ci * @dev_inst_uuid:  Instance guid for the device.
2488c2ecf20Sopenharmony_ci * @irq_info intr:  Specifies interrupt information.
2498c2ecf20Sopenharmony_ci */
2508c2ecf20Sopenharmony_cistruct controlvm_packet_device_create  {
2518c2ecf20Sopenharmony_ci	u32 bus_no;
2528c2ecf20Sopenharmony_ci	u32 dev_no;
2538c2ecf20Sopenharmony_ci	u64 channel_addr;
2548c2ecf20Sopenharmony_ci	u64 channel_bytes;
2558c2ecf20Sopenharmony_ci	guid_t data_type_guid;
2568c2ecf20Sopenharmony_ci	guid_t dev_inst_guid;
2578c2ecf20Sopenharmony_ci	struct irq_info intr;
2588c2ecf20Sopenharmony_ci} __packed;
2598c2ecf20Sopenharmony_ci
2608c2ecf20Sopenharmony_ci/*
2618c2ecf20Sopenharmony_ci * struct controlvm_packet_device_configure - For CONTROLVM_DEVICE_CONFIGURE
2628c2ecf20Sopenharmony_ci * @bus_no: Bus number (0..n-1) from the msg receiver's perspective.
2638c2ecf20Sopenharmony_ci * @dev_no: Bus-relative (0..n-1) device number.
2648c2ecf20Sopenharmony_ci */
2658c2ecf20Sopenharmony_cistruct controlvm_packet_device_configure  {
2668c2ecf20Sopenharmony_ci	u32 bus_no;
2678c2ecf20Sopenharmony_ci	u32 dev_no;
2688c2ecf20Sopenharmony_ci} __packed;
2698c2ecf20Sopenharmony_ci
2708c2ecf20Sopenharmony_ci/* Total 128 bytes */
2718c2ecf20Sopenharmony_cistruct controlvm_message_device_create {
2728c2ecf20Sopenharmony_ci	struct controlvm_message_header header;
2738c2ecf20Sopenharmony_ci	struct controlvm_packet_device_create packet;
2748c2ecf20Sopenharmony_ci} __packed;
2758c2ecf20Sopenharmony_ci
2768c2ecf20Sopenharmony_ci/* Total 56 bytes */
2778c2ecf20Sopenharmony_cistruct controlvm_message_device_configure  {
2788c2ecf20Sopenharmony_ci	struct controlvm_message_header header;
2798c2ecf20Sopenharmony_ci	struct controlvm_packet_device_configure packet;
2808c2ecf20Sopenharmony_ci} __packed;
2818c2ecf20Sopenharmony_ci
2828c2ecf20Sopenharmony_ci/*
2838c2ecf20Sopenharmony_ci * struct controlvm_message_packet - This is the format for a message in any
2848c2ecf20Sopenharmony_ci *                                   ControlVm queue.
2858c2ecf20Sopenharmony_ci * @struct create_bus:		For CONTROLVM_BUS_CREATE.
2868c2ecf20Sopenharmony_ci *	@bus_no:	     Bus # (0..n-1) from the msg receiver's perspective.
2878c2ecf20Sopenharmony_ci *	@dev_count:	     Indicates the max number of devices on this bus.
2888c2ecf20Sopenharmony_ci *	@channel_addr:	     Guest physical address of the channel, which can be
2898c2ecf20Sopenharmony_ci *			     dereferenced by the receiver of this ControlVM
2908c2ecf20Sopenharmony_ci *			     command.
2918c2ecf20Sopenharmony_ci *	@channel_bytes:	     Size of the channel.
2928c2ecf20Sopenharmony_ci *	@bus_data_type_uuid: Indicates format of data in bus channel.
2938c2ecf20Sopenharmony_ci *	@bus_inst_uuid:	     Instance uuid for the bus.
2948c2ecf20Sopenharmony_ci *
2958c2ecf20Sopenharmony_ci * @struct destroy_bus:		For CONTROLVM_BUS_DESTROY.
2968c2ecf20Sopenharmony_ci *	@bus_no: Bus # (0..n-1) from the msg receiver's perspective.
2978c2ecf20Sopenharmony_ci *	@reserved: Natural alignment purposes.
2988c2ecf20Sopenharmony_ci *
2998c2ecf20Sopenharmony_ci * @struct configure_bus:	For CONTROLVM_BUS_CONFIGURE.
3008c2ecf20Sopenharmony_ci *	@bus_no:	      Bus # (0..n-1) from the receiver's perspective.
3018c2ecf20Sopenharmony_ci *	@reserved1:	      For alignment purposes.
3028c2ecf20Sopenharmony_ci *	@guest_handle:	      This is used to convert guest physical address to
3038c2ecf20Sopenharmony_ci *			      physical address.
3048c2ecf20Sopenharmony_ci *	@recv_bus_irq_handle: Specifies interrupt info. It is used by SP to
3058c2ecf20Sopenharmony_ci *			      register to receive interrupts from the CP. This
3068c2ecf20Sopenharmony_ci *			      interrupt is used for bus level notifications.
3078c2ecf20Sopenharmony_ci *			      The corresponding sendBusInterruptHandle is kept
3088c2ecf20Sopenharmony_ci *			      in CP.
3098c2ecf20Sopenharmony_ci *
3108c2ecf20Sopenharmony_ci * @struct create_device:	For CONTROLVM_DEVICE_CREATE.
3118c2ecf20Sopenharmony_ci *
3128c2ecf20Sopenharmony_ci * @struct destroy_device:	For CONTROLVM_DEVICE_DESTROY.
3138c2ecf20Sopenharmony_ci *	@bus_no: Bus # (0..n-1) from the msg receiver's perspective.
3148c2ecf20Sopenharmony_ci *	@dev_no: Bus-relative (0..n-1) device number.
3158c2ecf20Sopenharmony_ci *
3168c2ecf20Sopenharmony_ci * @struct configure_device:	For CONTROLVM_DEVICE_CONFIGURE.
3178c2ecf20Sopenharmony_ci *
3188c2ecf20Sopenharmony_ci * @struct reconfigure_device:	For CONTROLVM_DEVICE_RECONFIGURE.
3198c2ecf20Sopenharmony_ci *	@bus_no: Bus # (0..n-1) from the msg receiver's perspective.
3208c2ecf20Sopenharmony_ci *	@dev_no: Bus-relative (0..n-1) device number.
3218c2ecf20Sopenharmony_ci *
3228c2ecf20Sopenharmony_ci * @struct bus_change_state:	For CONTROLVM_BUS_CHANGESTATE.
3238c2ecf20Sopenharmony_ci *	@bus_no:
3248c2ecf20Sopenharmony_ci *	@struct state:
3258c2ecf20Sopenharmony_ci *	@reserved: Natural alignment purposes.
3268c2ecf20Sopenharmony_ci *
3278c2ecf20Sopenharmony_ci * @struct device_change_state:	For CONTROLVM_DEVICE_CHANGESTATE.
3288c2ecf20Sopenharmony_ci *	@bus_no:
3298c2ecf20Sopenharmony_ci *	@dev_no:
3308c2ecf20Sopenharmony_ci *	@struct state:
3318c2ecf20Sopenharmony_ci *	@struct flags:
3328c2ecf20Sopenharmony_ci *		@phys_device: =1 if message is for a physical device.
3338c2ecf20Sopenharmony_ci *		@reserved:    Natural alignment.
3348c2ecf20Sopenharmony_ci *		@reserved1:   Natural alignment.
3358c2ecf20Sopenharmony_ci *	@reserved:    Natural alignment purposes.
3368c2ecf20Sopenharmony_ci *
3378c2ecf20Sopenharmony_ci * @struct device_change_state_event:	For CONTROLVM_DEVICE_CHANGESTATE_EVENT.
3388c2ecf20Sopenharmony_ci *	@bus_no:
3398c2ecf20Sopenharmony_ci *	@dev_no:
3408c2ecf20Sopenharmony_ci *	@struct state:
3418c2ecf20Sopenharmony_ci *	@reserved:     Natural alignment purposes.
3428c2ecf20Sopenharmony_ci *
3438c2ecf20Sopenharmony_ci * @struct init_chipset:	For CONTROLVM_CHIPSET_INIT.
3448c2ecf20Sopenharmony_ci *	@bus_count:	  Indicates the max number of busses.
3458c2ecf20Sopenharmony_ci *	@switch_count:    Indicates the max number of switches.
3468c2ecf20Sopenharmony_ci *	@enum features:
3478c2ecf20Sopenharmony_ci *	@platform_number:
3488c2ecf20Sopenharmony_ci *
3498c2ecf20Sopenharmony_ci * @struct chipset_selftest:	For CONTROLVM_CHIPSET_SELFTEST.
3508c2ecf20Sopenharmony_ci *      @options: Reserved.
3518c2ecf20Sopenharmony_ci *      @test:	  Bit 0 set to run embedded selftest.
3528c2ecf20Sopenharmony_ci *
3538c2ecf20Sopenharmony_ci * @addr:   A physical address of something, that can be dereferenced by the
3548c2ecf20Sopenharmony_ci *	    receiver of this ControlVm command.
3558c2ecf20Sopenharmony_ci *
3568c2ecf20Sopenharmony_ci * @handle: A handle of something (depends on command id).
3578c2ecf20Sopenharmony_ci */
3588c2ecf20Sopenharmony_cistruct controlvm_message_packet  {
3598c2ecf20Sopenharmony_ci	union  {
3608c2ecf20Sopenharmony_ci		struct  {
3618c2ecf20Sopenharmony_ci			u32 bus_no;
3628c2ecf20Sopenharmony_ci			u32 dev_count;
3638c2ecf20Sopenharmony_ci			u64 channel_addr;
3648c2ecf20Sopenharmony_ci			u64 channel_bytes;
3658c2ecf20Sopenharmony_ci			guid_t bus_data_type_guid;
3668c2ecf20Sopenharmony_ci			guid_t bus_inst_guid;
3678c2ecf20Sopenharmony_ci		} __packed create_bus;
3688c2ecf20Sopenharmony_ci		struct  {
3698c2ecf20Sopenharmony_ci			u32 bus_no;
3708c2ecf20Sopenharmony_ci			u32 reserved;
3718c2ecf20Sopenharmony_ci		} __packed destroy_bus;
3728c2ecf20Sopenharmony_ci		struct  {
3738c2ecf20Sopenharmony_ci			u32 bus_no;
3748c2ecf20Sopenharmony_ci			u32 reserved1;
3758c2ecf20Sopenharmony_ci			u64 guest_handle;
3768c2ecf20Sopenharmony_ci			u64 recv_bus_irq_handle;
3778c2ecf20Sopenharmony_ci		} __packed configure_bus;
3788c2ecf20Sopenharmony_ci		struct controlvm_packet_device_create create_device;
3798c2ecf20Sopenharmony_ci		struct  {
3808c2ecf20Sopenharmony_ci			u32 bus_no;
3818c2ecf20Sopenharmony_ci			u32 dev_no;
3828c2ecf20Sopenharmony_ci		} __packed destroy_device;
3838c2ecf20Sopenharmony_ci		struct controlvm_packet_device_configure configure_device;
3848c2ecf20Sopenharmony_ci		struct  {
3858c2ecf20Sopenharmony_ci			u32 bus_no;
3868c2ecf20Sopenharmony_ci			u32 dev_no;
3878c2ecf20Sopenharmony_ci		} __packed reconfigure_device;
3888c2ecf20Sopenharmony_ci		struct  {
3898c2ecf20Sopenharmony_ci			u32 bus_no;
3908c2ecf20Sopenharmony_ci			struct visor_segment_state state;
3918c2ecf20Sopenharmony_ci			u8 reserved[2];
3928c2ecf20Sopenharmony_ci		} __packed bus_change_state;
3938c2ecf20Sopenharmony_ci		struct  {
3948c2ecf20Sopenharmony_ci			u32 bus_no;
3958c2ecf20Sopenharmony_ci			u32 dev_no;
3968c2ecf20Sopenharmony_ci			struct visor_segment_state state;
3978c2ecf20Sopenharmony_ci			struct  {
3988c2ecf20Sopenharmony_ci				u32 phys_device:1;
3998c2ecf20Sopenharmony_ci				u32 reserved:31;
4008c2ecf20Sopenharmony_ci				u32 reserved1;
4018c2ecf20Sopenharmony_ci			} __packed flags;
4028c2ecf20Sopenharmony_ci			u8 reserved[2];
4038c2ecf20Sopenharmony_ci		} __packed device_change_state;
4048c2ecf20Sopenharmony_ci		struct  {
4058c2ecf20Sopenharmony_ci			u32 bus_no;
4068c2ecf20Sopenharmony_ci			u32 dev_no;
4078c2ecf20Sopenharmony_ci			struct visor_segment_state state;
4088c2ecf20Sopenharmony_ci			u8 reserved[6];
4098c2ecf20Sopenharmony_ci		} __packed device_change_state_event;
4108c2ecf20Sopenharmony_ci		struct  {
4118c2ecf20Sopenharmony_ci			u32 bus_count;
4128c2ecf20Sopenharmony_ci			u32 switch_count;
4138c2ecf20Sopenharmony_ci			enum visor_chipset_feature features;
4148c2ecf20Sopenharmony_ci			u32 platform_number;
4158c2ecf20Sopenharmony_ci		} __packed init_chipset;
4168c2ecf20Sopenharmony_ci		struct  {
4178c2ecf20Sopenharmony_ci			u32 options;
4188c2ecf20Sopenharmony_ci			u32 test;
4198c2ecf20Sopenharmony_ci		} __packed chipset_selftest;
4208c2ecf20Sopenharmony_ci		u64 addr;
4218c2ecf20Sopenharmony_ci		u64 handle;
4228c2ecf20Sopenharmony_ci	};
4238c2ecf20Sopenharmony_ci} __packed;
4248c2ecf20Sopenharmony_ci
4258c2ecf20Sopenharmony_ci/* All messages in any ControlVm queue have this layout. */
4268c2ecf20Sopenharmony_cistruct controlvm_message {
4278c2ecf20Sopenharmony_ci	struct controlvm_message_header hdr;
4288c2ecf20Sopenharmony_ci	struct controlvm_message_packet cmd;
4298c2ecf20Sopenharmony_ci} __packed;
4308c2ecf20Sopenharmony_ci
4318c2ecf20Sopenharmony_ci/*
4328c2ecf20Sopenharmony_ci * struct visor_controlvm_channel
4338c2ecf20Sopenharmony_ci * @struct header:
4348c2ecf20Sopenharmony_ci * @gp_controlvm:			Guest phys addr of this channel.
4358c2ecf20Sopenharmony_ci * @gp_partition_tables:		Guest phys addr of partition tables.
4368c2ecf20Sopenharmony_ci * @gp_diag_guest:			Guest phys addr of diagnostic channel.
4378c2ecf20Sopenharmony_ci * @gp_boot_romdisk:			Guest phys addr of (read* only) Boot
4388c2ecf20Sopenharmony_ci *					ROM disk.
4398c2ecf20Sopenharmony_ci * @gp_boot_ramdisk:			Guest phys addr of writable Boot RAM
4408c2ecf20Sopenharmony_ci *					disk.
4418c2ecf20Sopenharmony_ci * @gp_acpi_table:			Guest phys addr of acpi table.
4428c2ecf20Sopenharmony_ci * @gp_control_channel:			Guest phys addr of control channel.
4438c2ecf20Sopenharmony_ci * @gp_diag_romdisk:			Guest phys addr of diagnostic ROM disk.
4448c2ecf20Sopenharmony_ci * @gp_nvram:				Guest phys addr of NVRAM channel.
4458c2ecf20Sopenharmony_ci * @request_payload_offset:		Offset to request payload area.
4468c2ecf20Sopenharmony_ci * @event_payload_offset:		Offset to event payload area.
4478c2ecf20Sopenharmony_ci * @request_payload_bytes:		Bytes available in request payload area.
4488c2ecf20Sopenharmony_ci * @event_payload_bytes:		Bytes available in event payload area.
4498c2ecf20Sopenharmony_ci * @control_channel_bytes:
4508c2ecf20Sopenharmony_ci * @nvram_channel_bytes:		Bytes in PartitionNvram segment.
4518c2ecf20Sopenharmony_ci * @message_bytes:			sizeof(CONTROLVM_MESSAGE).
4528c2ecf20Sopenharmony_ci * @message_count:			CONTROLVM_MESSAGE_MAX.
4538c2ecf20Sopenharmony_ci * @gp_smbios_table:			Guest phys addr of SMBIOS tables.
4548c2ecf20Sopenharmony_ci * @gp_physical_smbios_table:		Guest phys addr of SMBIOS table.
4558c2ecf20Sopenharmony_ci * @gp_reserved:			VISOR_MAX_GUESTS_PER_SERVICE.
4568c2ecf20Sopenharmony_ci * @virtual_guest_firmware_image_base:	Guest physical address of EFI firmware
4578c2ecf20Sopenharmony_ci *					image base.
4588c2ecf20Sopenharmony_ci * @virtual_guest_firmware_entry_point:	Guest physical address of EFI firmware
4598c2ecf20Sopenharmony_ci *					entry point.
4608c2ecf20Sopenharmony_ci * @virtual_guest_firmware_image_size:	Guest EFI firmware image size.
4618c2ecf20Sopenharmony_ci * @virtual_guest_firmware_boot_base:	GPA = 1MB where EFI firmware image is
4628c2ecf20Sopenharmony_ci *					copied to.
4638c2ecf20Sopenharmony_ci * @virtual_guest_image_base:
4648c2ecf20Sopenharmony_ci * @virtual_guest_image_size:
4658c2ecf20Sopenharmony_ci * @prototype_control_channel_offset:
4668c2ecf20Sopenharmony_ci * @virtual_guest_partition_handle:
4678c2ecf20Sopenharmony_ci * @restore_action:			Restore Action field to restore the
4688c2ecf20Sopenharmony_ci *					guest partition.
4698c2ecf20Sopenharmony_ci * @dump_action:			For Windows guests it shows if the
4708c2ecf20Sopenharmony_ci *					visordisk is in dump mode.
4718c2ecf20Sopenharmony_ci * @nvram_fail_count:
4728c2ecf20Sopenharmony_ci * @saved_crash_message_count:		= CONTROLVM_CRASHMSG_MAX.
4738c2ecf20Sopenharmony_ci * @saved_crash_message_offset:		Offset to request payload area needed
4748c2ecf20Sopenharmony_ci *					for crash dump.
4758c2ecf20Sopenharmony_ci * @installation_error:			Type of error encountered during
4768c2ecf20Sopenharmony_ci *					installation.
4778c2ecf20Sopenharmony_ci * @installation_text_id:		Id of string to display.
4788c2ecf20Sopenharmony_ci * @installation_remaining_steps:	Number of remaining installation steps
4798c2ecf20Sopenharmony_ci *					(for progress bars).
4808c2ecf20Sopenharmony_ci * @tool_action:			VISOR_TOOL_ACTIONS Installation Action
4818c2ecf20Sopenharmony_ci *					field.
4828c2ecf20Sopenharmony_ci * @reserved: Alignment.
4838c2ecf20Sopenharmony_ci * @struct efi_visor_ind:
4848c2ecf20Sopenharmony_ci * @sp_reserved:
4858c2ecf20Sopenharmony_ci * @reserved2:				Force signals to begin on 128-byte
4868c2ecf20Sopenharmony_ci *					cache line.
4878c2ecf20Sopenharmony_ci * @struct request_queue:		Guest partition uses this queue to send
4888c2ecf20Sopenharmony_ci *					requests to Control.
4898c2ecf20Sopenharmony_ci * @struct response_queue:		Control uses this queue to respond to
4908c2ecf20Sopenharmony_ci *					service or guest partition request.
4918c2ecf20Sopenharmony_ci * @struct event_queue:			Control uses this queue to send events
4928c2ecf20Sopenharmony_ci *					to guest partition.
4938c2ecf20Sopenharmony_ci * @struct event_ack_queue:		Service or guest partition uses this
4948c2ecf20Sopenharmony_ci *					queue to ack Control events.
4958c2ecf20Sopenharmony_ci * @struct request_msg:			Request fixed-size message pool -
4968c2ecf20Sopenharmony_ci *					does not include payload.
4978c2ecf20Sopenharmony_ci * @struct response_msg:		Response fixed-size message pool -
4988c2ecf20Sopenharmony_ci *					does not include payload.
4998c2ecf20Sopenharmony_ci * @struct event_msg:			Event fixed-size message pool -
5008c2ecf20Sopenharmony_ci *					does not include payload.
5018c2ecf20Sopenharmony_ci * @struct event_ack_msg:		Ack fixed-size message pool -
5028c2ecf20Sopenharmony_ci *					does not include payload.
5038c2ecf20Sopenharmony_ci * @struct saved_crash_msg:		Message stored during IOVM creation to
5048c2ecf20Sopenharmony_ci *					be reused after crash.
5058c2ecf20Sopenharmony_ci */
5068c2ecf20Sopenharmony_cistruct visor_controlvm_channel {
5078c2ecf20Sopenharmony_ci	struct channel_header header;
5088c2ecf20Sopenharmony_ci	u64 gp_controlvm;
5098c2ecf20Sopenharmony_ci	u64 gp_partition_tables;
5108c2ecf20Sopenharmony_ci	u64 gp_diag_guest;
5118c2ecf20Sopenharmony_ci	u64 gp_boot_romdisk;
5128c2ecf20Sopenharmony_ci	u64 gp_boot_ramdisk;
5138c2ecf20Sopenharmony_ci	u64 gp_acpi_table;
5148c2ecf20Sopenharmony_ci	u64 gp_control_channel;
5158c2ecf20Sopenharmony_ci	u64 gp_diag_romdisk;
5168c2ecf20Sopenharmony_ci	u64 gp_nvram;
5178c2ecf20Sopenharmony_ci	u64 request_payload_offset;
5188c2ecf20Sopenharmony_ci	u64 event_payload_offset;
5198c2ecf20Sopenharmony_ci	u32 request_payload_bytes;
5208c2ecf20Sopenharmony_ci	u32 event_payload_bytes;
5218c2ecf20Sopenharmony_ci	u32 control_channel_bytes;
5228c2ecf20Sopenharmony_ci	u32 nvram_channel_bytes;
5238c2ecf20Sopenharmony_ci	u32 message_bytes;
5248c2ecf20Sopenharmony_ci	u32 message_count;
5258c2ecf20Sopenharmony_ci	u64 gp_smbios_table;
5268c2ecf20Sopenharmony_ci	u64 gp_physical_smbios_table;
5278c2ecf20Sopenharmony_ci	char gp_reserved[2688];
5288c2ecf20Sopenharmony_ci	u64 virtual_guest_firmware_image_base;
5298c2ecf20Sopenharmony_ci	u64 virtual_guest_firmware_entry_point;
5308c2ecf20Sopenharmony_ci	u64 virtual_guest_firmware_image_size;
5318c2ecf20Sopenharmony_ci	u64 virtual_guest_firmware_boot_base;
5328c2ecf20Sopenharmony_ci	u64 virtual_guest_image_base;
5338c2ecf20Sopenharmony_ci	u64 virtual_guest_image_size;
5348c2ecf20Sopenharmony_ci	u64 prototype_control_channel_offset;
5358c2ecf20Sopenharmony_ci	u64 virtual_guest_partition_handle;
5368c2ecf20Sopenharmony_ci	u16 restore_action;
5378c2ecf20Sopenharmony_ci	u16 dump_action;
5388c2ecf20Sopenharmony_ci	u16 nvram_fail_count;
5398c2ecf20Sopenharmony_ci	u16 saved_crash_message_count;
5408c2ecf20Sopenharmony_ci	u32 saved_crash_message_offset;
5418c2ecf20Sopenharmony_ci	u32 installation_error;
5428c2ecf20Sopenharmony_ci	u32 installation_text_id;
5438c2ecf20Sopenharmony_ci	u16 installation_remaining_steps;
5448c2ecf20Sopenharmony_ci	u8 tool_action;
5458c2ecf20Sopenharmony_ci	u8 reserved;
5468c2ecf20Sopenharmony_ci	struct efi_visor_indication efi_visor_ind;
5478c2ecf20Sopenharmony_ci	u32 sp_reserved;
5488c2ecf20Sopenharmony_ci	u8 reserved2[28];
5498c2ecf20Sopenharmony_ci	struct signal_queue_header request_queue;
5508c2ecf20Sopenharmony_ci	struct signal_queue_header response_queue;
5518c2ecf20Sopenharmony_ci	struct signal_queue_header event_queue;
5528c2ecf20Sopenharmony_ci	struct signal_queue_header event_ack_queue;
5538c2ecf20Sopenharmony_ci	struct controlvm_message request_msg[CONTROLVM_MESSAGE_MAX];
5548c2ecf20Sopenharmony_ci	struct controlvm_message response_msg[CONTROLVM_MESSAGE_MAX];
5558c2ecf20Sopenharmony_ci	struct controlvm_message event_msg[CONTROLVM_MESSAGE_MAX];
5568c2ecf20Sopenharmony_ci	struct controlvm_message event_ack_msg[CONTROLVM_MESSAGE_MAX];
5578c2ecf20Sopenharmony_ci	struct controlvm_message saved_crash_msg[CONTROLVM_CRASHMSG_MAX];
5588c2ecf20Sopenharmony_ci} __packed;
5598c2ecf20Sopenharmony_ci
5608c2ecf20Sopenharmony_ci/*
5618c2ecf20Sopenharmony_ci * struct visor_controlvm_parameters_header
5628c2ecf20Sopenharmony_ci *
5638c2ecf20Sopenharmony_ci * The following header will be located at the beginning of PayloadVmOffset for
5648c2ecf20Sopenharmony_ci * various ControlVm commands. The receiver of a ControlVm command with a
5658c2ecf20Sopenharmony_ci * PayloadVmOffset will dereference this address and then use connection_offset,
5668c2ecf20Sopenharmony_ci * initiator_offset, and target_offset to get the location of UTF-8 formatted
5678c2ecf20Sopenharmony_ci * strings that can be parsed to obtain command-specific information. The value
5688c2ecf20Sopenharmony_ci * of total_length should equal PayloadBytes. The format of the strings at
5698c2ecf20Sopenharmony_ci * PayloadVmOffset will take different forms depending on the message.
5708c2ecf20Sopenharmony_ci */
5718c2ecf20Sopenharmony_cistruct visor_controlvm_parameters_header {
5728c2ecf20Sopenharmony_ci	u32 total_length;
5738c2ecf20Sopenharmony_ci	u32 header_length;
5748c2ecf20Sopenharmony_ci	u32 connection_offset;
5758c2ecf20Sopenharmony_ci	u32 connection_length;
5768c2ecf20Sopenharmony_ci	u32 initiator_offset;
5778c2ecf20Sopenharmony_ci	u32 initiator_length;
5788c2ecf20Sopenharmony_ci	u32 target_offset;
5798c2ecf20Sopenharmony_ci	u32 target_length;
5808c2ecf20Sopenharmony_ci	u32 client_offset;
5818c2ecf20Sopenharmony_ci	u32 client_length;
5828c2ecf20Sopenharmony_ci	u32 name_offset;
5838c2ecf20Sopenharmony_ci	u32 name_length;
5848c2ecf20Sopenharmony_ci	guid_t id;
5858c2ecf20Sopenharmony_ci	u32 revision;
5868c2ecf20Sopenharmony_ci	/* Natural alignment */
5878c2ecf20Sopenharmony_ci	u32 reserved;
5888c2ecf20Sopenharmony_ci} __packed;
5898c2ecf20Sopenharmony_ci
5908c2ecf20Sopenharmony_ci/* General Errors------------------------------------------------------[0-99] */
5918c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_SUCCESS			   0
5928c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_ALREADY_DONE		   1
5938c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_IOREMAP_FAILED		   2
5948c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_KMALLOC_FAILED		   3
5958c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_ID_UNKNOWN		   4
5968c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_ID_INVALID_FOR_CLIENT	   5
5978c2ecf20Sopenharmony_ci/* CONTROLVM_INIT_CHIPSET-------------------------------------------[100-199] */
5988c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_CLIENT_SWITCHCOUNT_NONZERO  100
5998c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_EXPECTED_CHIPSET_INIT	   101
6008c2ecf20Sopenharmony_ci/* Maximum Limit----------------------------------------------------[200-299] */
6018c2ecf20Sopenharmony_ci/* BUS_CREATE */
6028c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_ERROR_MAX_BUSES		   201
6038c2ecf20Sopenharmony_ci/* DEVICE_CREATE */
6048c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_ERROR_MAX_DEVICES	   202
6058c2ecf20Sopenharmony_ci/* Payload and Parameter Related------------------------------------[400-499] */
6068c2ecf20Sopenharmony_ci/* SWITCH_ATTACHEXTPORT, DEVICE_CONFIGURE */
6078c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_PAYLOAD_INVALID		   400
6088c2ecf20Sopenharmony_ci/* Multiple */
6098c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_INITIATOR_PARAMETER_INVALID 401
6108c2ecf20Sopenharmony_ci/* DEVICE_CONFIGURE */
6118c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_TARGET_PARAMETER_INVALID	   402
6128c2ecf20Sopenharmony_ci/* DEVICE_CONFIGURE */
6138c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_CLIENT_PARAMETER_INVALID	   403
6148c2ecf20Sopenharmony_ci/* Specified[Packet Structure] Value--------------------------------[500-599] */
6158c2ecf20Sopenharmony_ci/* SWITCH_ATTACHINTPORT */
6168c2ecf20Sopenharmony_ci/* BUS_CONFIGURE, DEVICE_CREATE, DEVICE_CONFIG, DEVICE_DESTROY */
6178c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_BUS_INVALID		   500
6188c2ecf20Sopenharmony_ci/* SWITCH_ATTACHINTPORT*/
6198c2ecf20Sopenharmony_ci/* DEVICE_CREATE, DEVICE_CONFIGURE, DEVICE_DESTROY */
6208c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_DEVICE_INVALID		   501
6218c2ecf20Sopenharmony_ci/* DEVICE_CREATE, DEVICE_CONFIGURE */
6228c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_CHANNEL_INVALID		   502
6238c2ecf20Sopenharmony_ci/* Partition Driver Callback Interface------------------------------[600-699] */
6248c2ecf20Sopenharmony_ci/* BUS_CREATE, BUS_DESTROY, DEVICE_CREATE, DEVICE_DESTROY */
6258c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_VIRTPCI_DRIVER_FAILURE	   604
6268c2ecf20Sopenharmony_ci/* Unable to invoke VIRTPCI callback. VIRTPCI Callback returned error. */
6278c2ecf20Sopenharmony_ci/* BUS_CREATE, BUS_DESTROY, DEVICE_CREATE, DEVICE_DESTROY */
6288c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_VIRTPCI_DRIVER_CALLBACK_ERROR   605
6298c2ecf20Sopenharmony_ci/* Generic device callback returned error. */
6308c2ecf20Sopenharmony_ci/* SWITCH_ATTACHEXTPORT, SWITCH_DETACHEXTPORT, DEVICE_CONFIGURE */
6318c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_GENERIC_DRIVER_CALLBACK_ERROR   606
6328c2ecf20Sopenharmony_ci/* Bus Related------------------------------------------------------[700-799] */
6338c2ecf20Sopenharmony_ci/* BUS_DESTROY */
6348c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_ERROR_BUS_DEVICE_ATTACHED       700
6358c2ecf20Sopenharmony_ci/* Channel Related--------------------------------------------------[800-899] */
6368c2ecf20Sopenharmony_ci/* GET_CHANNELINFO, DEVICE_DESTROY */
6378c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_CHANNEL_TYPE_UNKNOWN	       800
6388c2ecf20Sopenharmony_ci/* DEVICE_CREATE */
6398c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_CHANNEL_SIZE_TOO_SMALL	       801
6408c2ecf20Sopenharmony_ci/* Chipset Shutdown Related---------------------------------------[1000-1099] */
6418c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_CHIPSET_SHUTDOWN_FAILED	       1000
6428c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_CHIPSET_SHUTDOWN_ALREADY_ACTIVE 1001
6438c2ecf20Sopenharmony_ci/* Chipset Stop Related-------------------------------------------[1100-1199] */
6448c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_CHIPSET_STOP_FAILED_BUS	       1100
6458c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_CHIPSET_STOP_FAILED_SWITCH      1101
6468c2ecf20Sopenharmony_ci/* Device Related-------------------------------------------------[1400-1499] */
6478c2ecf20Sopenharmony_ci#define CONTROLVM_RESP_DEVICE_UDEV_TIMEOUT	       1400
6488c2ecf20Sopenharmony_ci
6498c2ecf20Sopenharmony_ci/* __CONTROLVMCHANNEL_H__ */
6508c2ecf20Sopenharmony_ci#endif
651