debuggers.hg

annotate xen/include/public/io/domain_controller.h @ 3639:ef59b38283a5

bitkeeper revision 1.1159.212.64 (42000361XrdUoEK_vD6RMga2eLmwZg)

Allow specification of backend vif MAC addresses. If a backend
MAC is not provided, generate one as before

Signed-off-by: Jody Belka <knew-xen@pimb.org>
Signed-off-by: ian.pratt@cl.cam.ac.uk
author iap10@labyrinth.cl.cam.ac.uk
date Tue Feb 01 22:32:01 2005 +0000 (2005-02-01)
parents 3ced9b0f4dab
children bbe8541361dd
rev   line source
kaf24@2827 1 /******************************************************************************
kaf24@2827 2 * domain_controller.h
kaf24@2827 3 *
kaf24@2827 4 * Interface to server controller (e.g., 'xend'). This header file defines the
kaf24@2827 5 * interface that is shared with guest OSes.
kaf24@2827 6 *
kaf24@2827 7 * Copyright (c) 2004, K A Fraser
kaf24@2827 8 */
kaf24@2827 9
kaf24@2827 10 #ifndef __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__
kaf24@2827 11 #define __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__
kaf24@2827 12
kaf24@3404 13 #include "ring.h"
kaf24@2827 14
kaf24@2827 15 /*
kaf24@2827 16 * Reason codes for SCHEDOP_shutdown. These are opaque to Xen but may be
kaf24@2827 17 * interpreted by control software to determine the appropriate action. These
kaf24@2827 18 * are only really advisories: the controller can actually do as it likes.
kaf24@2827 19 */
kaf24@2827 20 #define SHUTDOWN_poweroff 0 /* Domain exited normally. Clean up and kill. */
kaf24@2827 21 #define SHUTDOWN_reboot 1 /* Clean up, kill, and then restart. */
kaf24@2827 22 #define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */
kaf24@2827 23
kaf24@2827 24
kaf24@2827 25 /*
kaf24@2827 26 * CONTROLLER MESSAGING INTERFACE.
kaf24@2827 27 */
kaf24@2827 28
kaf24@2827 29 typedef struct {
kaf24@2827 30 u8 type; /* 0: echoed in response */
kaf24@2827 31 u8 subtype; /* 1: echoed in response */
kaf24@2827 32 u8 id; /* 2: echoed in response */
kaf24@2827 33 u8 length; /* 3: number of bytes in 'msg' */
kaf24@2827 34 u8 msg[60]; /* 4: type-specific message data */
kaf24@2827 35 } PACKED control_msg_t; /* 64 bytes */
kaf24@2827 36
kaf24@3404 37 /* These are used by the control message deferred ring. */
kaf24@2827 38 #define CONTROL_RING_SIZE 8
kaf24@2827 39 typedef u32 CONTROL_RING_IDX;
kaf24@2827 40 #define MASK_CONTROL_IDX(_i) ((_i)&(CONTROL_RING_SIZE-1))
kaf24@2827 41
kaf24@3404 42 /*
kaf24@3404 43 * Generate control ring structures and types.
kaf24@3404 44 *
kaf24@3404 45 * CONTROL_RING_MEM is currently an 8-slot ring of ctrl_msg_t structs and
kaf24@3404 46 * two 32-bit counters: (64 * 8) + (2 * 4) = 520
kaf24@3404 47 */
kaf24@3404 48 #define CONTROL_RING_MEM 520
kaf24@3404 49 #define CTRL_RING RING_PARAMS(control_msg_t, control_msg_t, CONTROL_RING_MEM)
kaf24@3404 50 DEFINE_RING_TYPES(ctrl, CTRL_RING);
kaf24@3404 51
kaf24@2827 52 typedef struct {
kaf24@3404 53 ctrl_sring_t tx_ring; /* 0: guest -> controller */
kaf24@3404 54 ctrl_sring_t rx_ring; /* 520: controller -> guest */
kaf24@2827 55 } PACKED control_if_t; /* 1040 bytes */
kaf24@2827 56
kaf24@2827 57 /*
kaf24@2827 58 * Top-level command types.
kaf24@2827 59 */
kaf24@2827 60 #define CMSG_CONSOLE 0 /* Console */
kaf24@2827 61 #define CMSG_BLKIF_BE 1 /* Block-device backend */
kaf24@2827 62 #define CMSG_BLKIF_FE 2 /* Block-device frontend */
kaf24@2827 63 #define CMSG_NETIF_BE 3 /* Network-device backend */
kaf24@2827 64 #define CMSG_NETIF_FE 4 /* Network-device frontend */
kaf24@2827 65 #define CMSG_SHUTDOWN 6 /* Shutdown messages */
kaf24@2827 66 #define CMSG_MEM_REQUEST 7 /* Memory reservation reqs */
mwilli2@3501 67 #define CMSG_USBIF_BE 8 /* USB controller backend */
mwilli2@3501 68 #define CMSG_USBIF_FE 9 /* USB controller frontend */
kaf24@2827 69
kaf24@2827 70 /******************************************************************************
kaf24@2827 71 * CONSOLE DEFINITIONS
kaf24@2827 72 */
kaf24@2827 73
kaf24@2827 74 /*
kaf24@2827 75 * Subtypes for console messages.
kaf24@2827 76 */
kaf24@2827 77 #define CMSG_CONSOLE_DATA 0
kaf24@2827 78
kaf24@2827 79
kaf24@2827 80 /******************************************************************************
kaf24@2827 81 * BLOCK-INTERFACE FRONTEND DEFINITIONS
kaf24@2827 82 */
kaf24@2827 83
kaf24@2827 84 /* Messages from domain controller to guest. */
kaf24@2827 85 #define CMSG_BLKIF_FE_INTERFACE_STATUS 0
kaf24@2827 86
kaf24@2827 87 /* Messages from guest to domain controller. */
kaf24@2827 88 #define CMSG_BLKIF_FE_DRIVER_STATUS 32
kaf24@2827 89 #define CMSG_BLKIF_FE_INTERFACE_CONNECT 33
kaf24@2827 90 #define CMSG_BLKIF_FE_INTERFACE_DISCONNECT 34
kaf24@2827 91 #define CMSG_BLKIF_FE_INTERFACE_QUERY 35
kaf24@2827 92
kaf24@2827 93 /* These are used by both front-end and back-end drivers. */
kaf24@2827 94 #define blkif_vdev_t u16
kaf24@2827 95 #define blkif_pdev_t u16
kaf24@2827 96 #define blkif_sector_t u64
kaf24@2827 97
kaf24@2827 98 /*
kaf24@2827 99 * CMSG_BLKIF_FE_INTERFACE_STATUS:
kaf24@2827 100 * Notify a guest about a status change on one of its block interfaces.
kaf24@2827 101 * If the interface is DESTROYED or DOWN then the interface is disconnected:
kaf24@2827 102 * 1. The shared-memory frame is available for reuse.
kaf24@2827 103 * 2. Any unacknowledged messages pending on the interface were dropped.
kaf24@2827 104 */
kaf24@2827 105 #define BLKIF_INTERFACE_STATUS_CLOSED 0 /* Interface doesn't exist. */
kaf24@2827 106 #define BLKIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
kaf24@2827 107 #define BLKIF_INTERFACE_STATUS_CONNECTED 2 /* Exists and is connected. */
kaf24@2827 108 #define BLKIF_INTERFACE_STATUS_CHANGED 3 /* A device has been added or removed. */
kaf24@2827 109 typedef struct {
kaf24@2827 110 u32 handle; /* 0 */
kaf24@2827 111 u32 status; /* 4 */
kaf24@2827 112 u16 evtchn; /* 8: (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
kaf24@2827 113 domid_t domid; /* 10: status != BLKIF_INTERFACE_STATUS_DESTROYED */
kaf24@2827 114 } PACKED blkif_fe_interface_status_t; /* 12 bytes */
kaf24@2827 115
kaf24@2827 116 /*
kaf24@2827 117 * CMSG_BLKIF_FE_DRIVER_STATUS:
kaf24@2827 118 * Notify the domain controller that the front-end driver is DOWN or UP.
kaf24@2827 119 * When the driver goes DOWN then the controller will send no more
kaf24@2827 120 * status-change notifications.
kaf24@2827 121 * If the driver goes DOWN while interfaces are still UP, the domain
kaf24@2827 122 * will automatically take the interfaces DOWN.
kaf24@2827 123 *
kaf24@2827 124 * NB. The controller should not send an INTERFACE_STATUS_CHANGED message
kaf24@2827 125 * for interfaces that are active when it receives an UP notification. We
kaf24@2827 126 * expect that the frontend driver will query those interfaces itself.
kaf24@2827 127 */
kaf24@2827 128 #define BLKIF_DRIVER_STATUS_DOWN 0
kaf24@2827 129 #define BLKIF_DRIVER_STATUS_UP 1
kaf24@2827 130 typedef struct {
kaf24@2827 131 /* IN */
kaf24@2827 132 u32 status; /* 0: BLKIF_DRIVER_STATUS_??? */
kaf24@2827 133 /* OUT */
kaf24@2827 134 /* Driver should query interfaces [0..max_handle]. */
kaf24@2827 135 u32 max_handle; /* 4 */
kaf24@2827 136 } PACKED blkif_fe_driver_status_t; /* 8 bytes */
kaf24@2827 137
kaf24@2827 138 /*
kaf24@2827 139 * CMSG_BLKIF_FE_INTERFACE_CONNECT:
kaf24@2827 140 * If successful, the domain controller will acknowledge with a
kaf24@2827 141 * STATUS_CONNECTED message.
kaf24@2827 142 */
kaf24@2827 143 typedef struct {
kaf24@2827 144 u32 handle; /* 0 */
kaf24@2827 145 u32 __pad;
kaf24@2827 146 memory_t shmem_frame; /* 8 */
kaf24@2827 147 MEMORY_PADDING;
kaf24@2827 148 } PACKED blkif_fe_interface_connect_t; /* 16 bytes */
kaf24@2827 149
kaf24@2827 150 /*
kaf24@2827 151 * CMSG_BLKIF_FE_INTERFACE_DISCONNECT:
kaf24@2827 152 * If successful, the domain controller will acknowledge with a
kaf24@2827 153 * STATUS_DISCONNECTED message.
kaf24@2827 154 */
kaf24@2827 155 typedef struct {
kaf24@2827 156 u32 handle; /* 0 */
kaf24@2827 157 } PACKED blkif_fe_interface_disconnect_t; /* 4 bytes */
kaf24@2827 158
kaf24@2827 159 /*
kaf24@2827 160 * CMSG_BLKIF_FE_INTERFACE_QUERY:
kaf24@2827 161 */
kaf24@2827 162 typedef struct {
kaf24@2827 163 /* IN */
kaf24@2827 164 u32 handle; /* 0 */
kaf24@2827 165 /* OUT */
kaf24@2827 166 u32 status; /* 4 */
kaf24@2827 167 u16 evtchn; /* 8: (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
kaf24@2827 168 domid_t domid; /* 10: status != BLKIF_INTERFACE_STATUS_DESTROYED */
kaf24@2827 169 } PACKED blkif_fe_interface_query_t; /* 12 bytes */
kaf24@2827 170
kaf24@2827 171
kaf24@2827 172 /******************************************************************************
kaf24@2827 173 * BLOCK-INTERFACE BACKEND DEFINITIONS
kaf24@2827 174 */
kaf24@2827 175
kaf24@2827 176 /* Messages from domain controller. */
kaf24@2827 177 #define CMSG_BLKIF_BE_CREATE 0 /* Create a new block-device interface. */
kaf24@2827 178 #define CMSG_BLKIF_BE_DESTROY 1 /* Destroy a block-device interface. */
kaf24@2827 179 #define CMSG_BLKIF_BE_CONNECT 2 /* Connect i/f to remote driver. */
kaf24@2827 180 #define CMSG_BLKIF_BE_DISCONNECT 3 /* Disconnect i/f from remote driver. */
kaf24@2827 181 #define CMSG_BLKIF_BE_VBD_CREATE 4 /* Create a new VBD for an interface. */
kaf24@2827 182 #define CMSG_BLKIF_BE_VBD_DESTROY 5 /* Delete a VBD from an interface. */
kaf24@2827 183 #define CMSG_BLKIF_BE_VBD_GROW 6 /* Append an extent to a given VBD. */
kaf24@2827 184 #define CMSG_BLKIF_BE_VBD_SHRINK 7 /* Remove last extent from a given VBD. */
kaf24@2827 185
kaf24@2827 186 /* Messages to domain controller. */
kaf24@2827 187 #define CMSG_BLKIF_BE_DRIVER_STATUS 32
kaf24@2827 188
kaf24@2827 189 /*
kaf24@2827 190 * Message request/response definitions for block-device messages.
kaf24@2827 191 */
kaf24@2827 192
kaf24@2827 193 typedef struct {
kaf24@2827 194 blkif_sector_t sector_start; /* 0 */
kaf24@2827 195 blkif_sector_t sector_length; /* 8 */
kaf24@2827 196 blkif_pdev_t device; /* 16 */
kaf24@2827 197 u16 __pad; /* 18 */
kaf24@2827 198 } PACKED blkif_extent_t; /* 20 bytes */
kaf24@2827 199
kaf24@2827 200 /* Non-specific 'okay' return. */
kaf24@2827 201 #define BLKIF_BE_STATUS_OKAY 0
kaf24@2827 202 /* Non-specific 'error' return. */
kaf24@2827 203 #define BLKIF_BE_STATUS_ERROR 1
kaf24@2827 204 /* The following are specific error returns. */
kaf24@2827 205 #define BLKIF_BE_STATUS_INTERFACE_EXISTS 2
kaf24@2827 206 #define BLKIF_BE_STATUS_INTERFACE_NOT_FOUND 3
kaf24@2827 207 #define BLKIF_BE_STATUS_INTERFACE_CONNECTED 4
kaf24@2827 208 #define BLKIF_BE_STATUS_VBD_EXISTS 5
kaf24@2827 209 #define BLKIF_BE_STATUS_VBD_NOT_FOUND 6
kaf24@2827 210 #define BLKIF_BE_STATUS_OUT_OF_MEMORY 7
kaf24@2827 211 #define BLKIF_BE_STATUS_EXTENT_NOT_FOUND 8
kaf24@2827 212 #define BLKIF_BE_STATUS_MAPPING_ERROR 9
kaf24@2827 213
kaf24@2827 214 /* This macro can be used to create an array of descriptive error strings. */
kaf24@2827 215 #define BLKIF_BE_STATUS_ERRORS { \
kaf24@2827 216 "Okay", \
kaf24@2827 217 "Non-specific error", \
kaf24@2827 218 "Interface already exists", \
kaf24@2827 219 "Interface not found", \
kaf24@2827 220 "Interface is still connected", \
kaf24@2827 221 "VBD already exists", \
kaf24@2827 222 "VBD not found", \
kaf24@2827 223 "Out of memory", \
kaf24@2827 224 "Extent not found for VBD", \
kaf24@2827 225 "Could not map domain memory" }
kaf24@2827 226
kaf24@2827 227 /*
kaf24@2827 228 * CMSG_BLKIF_BE_CREATE:
kaf24@2827 229 * When the driver sends a successful response then the interface is fully
kaf24@2827 230 * created. The controller will send a DOWN notification to the front-end
kaf24@2827 231 * driver.
kaf24@2827 232 */
kaf24@2827 233 typedef struct {
kaf24@2827 234 /* IN */
kaf24@2827 235 domid_t domid; /* 0: Domain attached to new interface. */
kaf24@2827 236 u16 __pad;
kaf24@2827 237 u32 blkif_handle; /* 4: Domain-specific interface handle. */
kaf24@2827 238 /* OUT */
kaf24@2827 239 u32 status; /* 8 */
kaf24@2827 240 } PACKED blkif_be_create_t; /* 12 bytes */
kaf24@2827 241
kaf24@2827 242 /*
kaf24@2827 243 * CMSG_BLKIF_BE_DESTROY:
kaf24@2827 244 * When the driver sends a successful response then the interface is fully
kaf24@2827 245 * torn down. The controller will send a DESTROYED notification to the
kaf24@2827 246 * front-end driver.
kaf24@2827 247 */
kaf24@2827 248 typedef struct {
kaf24@2827 249 /* IN */
kaf24@2827 250 domid_t domid; /* 0: Identify interface to be destroyed. */
kaf24@2827 251 u16 __pad;
kaf24@2827 252 u32 blkif_handle; /* 4: ...ditto... */
kaf24@2827 253 /* OUT */
kaf24@2827 254 u32 status; /* 8 */
kaf24@2827 255 } PACKED blkif_be_destroy_t; /* 12 bytes */
kaf24@2827 256
kaf24@2827 257 /*
kaf24@2827 258 * CMSG_BLKIF_BE_CONNECT:
kaf24@2827 259 * When the driver sends a successful response then the interface is fully
kaf24@2827 260 * connected. The controller will send a CONNECTED notification to the
kaf24@2827 261 * front-end driver.
kaf24@2827 262 */
kaf24@2827 263 typedef struct {
kaf24@2827 264 /* IN */
kaf24@2827 265 domid_t domid; /* 0: Domain attached to new interface. */
kaf24@2827 266 u16 __pad;
kaf24@2827 267 u32 blkif_handle; /* 4: Domain-specific interface handle. */
kaf24@2827 268 memory_t shmem_frame; /* 8: Page cont. shared comms window. */
kaf24@2827 269 MEMORY_PADDING;
kaf24@2827 270 u32 evtchn; /* 16: Event channel for notifications. */
kaf24@2827 271 /* OUT */
kaf24@2827 272 u32 status; /* 20 */
kaf24@2827 273 } PACKED blkif_be_connect_t; /* 24 bytes */
kaf24@2827 274
kaf24@2827 275 /*
kaf24@2827 276 * CMSG_BLKIF_BE_DISCONNECT:
kaf24@2827 277 * When the driver sends a successful response then the interface is fully
kaf24@2827 278 * disconnected. The controller will send a DOWN notification to the front-end
kaf24@2827 279 * driver.
kaf24@2827 280 */
kaf24@2827 281 typedef struct {
kaf24@2827 282 /* IN */
kaf24@2827 283 domid_t domid; /* 0: Domain attached to new interface. */
kaf24@2827 284 u16 __pad;
kaf24@2827 285 u32 blkif_handle; /* 4: Domain-specific interface handle. */
kaf24@2827 286 /* OUT */
kaf24@2827 287 u32 status; /* 8 */
kaf24@2827 288 } PACKED blkif_be_disconnect_t; /* 12 bytes */
kaf24@2827 289
kaf24@2827 290 /* CMSG_BLKIF_BE_VBD_CREATE */
kaf24@2827 291 typedef struct {
kaf24@2827 292 /* IN */
kaf24@2827 293 domid_t domid; /* 0: Identify blkdev interface. */
kaf24@2827 294 u16 __pad;
kaf24@2827 295 u32 blkif_handle; /* 4: ...ditto... */
kaf24@2827 296 blkif_vdev_t vdevice; /* 8: Interface-specific id for this VBD. */
kaf24@2827 297 u16 readonly; /* 10: Non-zero -> VBD isn't writable. */
kaf24@2827 298 /* OUT */
kaf24@2827 299 u32 status; /* 12 */
kaf24@2827 300 } PACKED blkif_be_vbd_create_t; /* 16 bytes */
kaf24@2827 301
kaf24@2827 302 /* CMSG_BLKIF_BE_VBD_DESTROY */
kaf24@2827 303 typedef struct {
kaf24@2827 304 /* IN */
kaf24@2827 305 domid_t domid; /* 0: Identify blkdev interface. */
kaf24@2827 306 u16 __pad0; /* 2 */
kaf24@2827 307 u32 blkif_handle; /* 4: ...ditto... */
kaf24@2827 308 blkif_vdev_t vdevice; /* 8: Interface-specific id of the VBD. */
kaf24@2827 309 u16 __pad1; /* 10 */
kaf24@2827 310 /* OUT */
kaf24@2827 311 u32 status; /* 12 */
kaf24@2827 312 } PACKED blkif_be_vbd_destroy_t; /* 16 bytes */
kaf24@2827 313
kaf24@2827 314 /* CMSG_BLKIF_BE_VBD_GROW */
kaf24@2827 315 typedef struct {
kaf24@2827 316 /* IN */
kaf24@2827 317 domid_t domid; /* 0: Identify blkdev interface. */
kaf24@2827 318 u16 __pad0; /* 2 */
kaf24@2827 319 u32 blkif_handle; /* 4: ...ditto... */
kaf24@2827 320 blkif_extent_t extent; /* 8: Physical extent to append to VBD. */
kaf24@2827 321 blkif_vdev_t vdevice; /* 28: Interface-specific id of the VBD. */
kaf24@2827 322 u16 __pad1; /* 30 */
kaf24@2827 323 /* OUT */
kaf24@2827 324 u32 status; /* 32 */
kaf24@2827 325 } PACKED blkif_be_vbd_grow_t; /* 36 bytes */
kaf24@2827 326
kaf24@2827 327 /* CMSG_BLKIF_BE_VBD_SHRINK */
kaf24@2827 328 typedef struct {
kaf24@2827 329 /* IN */
kaf24@2827 330 domid_t domid; /* 0: Identify blkdev interface. */
kaf24@2827 331 u16 __pad0; /* 2 */
kaf24@2827 332 u32 blkif_handle; /* 4: ...ditto... */
kaf24@2827 333 blkif_vdev_t vdevice; /* 8: Interface-specific id of the VBD. */
kaf24@2827 334 u16 __pad1; /* 10 */
kaf24@2827 335 /* OUT */
kaf24@2827 336 u32 status; /* 12 */
kaf24@2827 337 } PACKED blkif_be_vbd_shrink_t; /* 16 bytes */
kaf24@2827 338
kaf24@2827 339 /*
kaf24@2827 340 * CMSG_BLKIF_BE_DRIVER_STATUS:
kaf24@2827 341 * Notify the domain controller that the back-end driver is DOWN or UP.
kaf24@2827 342 * If the driver goes DOWN while interfaces are still UP, the controller
kaf24@2827 343 * will automatically send DOWN notifications.
kaf24@2827 344 */
kaf24@2827 345 typedef struct {
kaf24@2827 346 u32 status; /* 0: BLKIF_DRIVER_STATUS_??? */
kaf24@2827 347 } PACKED blkif_be_driver_status_t; /* 4 bytes */
kaf24@2827 348
kaf24@2827 349
kaf24@2827 350 /******************************************************************************
kaf24@2827 351 * NETWORK-INTERFACE FRONTEND DEFINITIONS
kaf24@2827 352 */
kaf24@2827 353
kaf24@2827 354 /* Messages from domain controller to guest. */
kaf24@2827 355 #define CMSG_NETIF_FE_INTERFACE_STATUS 0
kaf24@2827 356
kaf24@2827 357 /* Messages from guest to domain controller. */
kaf24@2827 358 #define CMSG_NETIF_FE_DRIVER_STATUS 32
kaf24@2827 359 #define CMSG_NETIF_FE_INTERFACE_CONNECT 33
kaf24@2827 360 #define CMSG_NETIF_FE_INTERFACE_DISCONNECT 34
kaf24@2827 361 #define CMSG_NETIF_FE_INTERFACE_QUERY 35
kaf24@2827 362
kaf24@2827 363 /*
kaf24@2827 364 * CMSG_NETIF_FE_INTERFACE_STATUS:
kaf24@2827 365 * Notify a guest about a status change on one of its network interfaces.
kaf24@2827 366 * If the interface is CLOSED or DOWN then the interface is disconnected:
kaf24@2827 367 * 1. The shared-memory frame is available for reuse.
kaf24@2827 368 * 2. Any unacknowledged messgaes pending on the interface were dropped.
kaf24@2827 369 */
kaf24@2827 370 #define NETIF_INTERFACE_STATUS_CLOSED 0 /* Interface doesn't exist. */
kaf24@2827 371 #define NETIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
kaf24@2827 372 #define NETIF_INTERFACE_STATUS_CONNECTED 2 /* Exists and is connected. */
kaf24@2827 373 #define NETIF_INTERFACE_STATUS_CHANGED 3 /* A device has been added or removed. */
kaf24@2827 374 typedef struct {
kaf24@2827 375 u32 handle; /* 0 */
kaf24@2827 376 u32 status; /* 4 */
kaf24@2827 377 u16 evtchn; /* 8: status == NETIF_INTERFACE_STATUS_CONNECTED */
kaf24@2827 378 u8 mac[6]; /* 10: status == NETIF_INTERFACE_STATUS_CONNECTED */
kaf24@2827 379 domid_t domid; /* 16: status != NETIF_INTERFACE_STATUS_DESTROYED */
kaf24@2827 380 } PACKED netif_fe_interface_status_t; /* 18 bytes */
kaf24@2827 381
kaf24@2827 382 /*
kaf24@2827 383 * CMSG_NETIF_FE_DRIVER_STATUS:
kaf24@2827 384 * Notify the domain controller that the front-end driver is DOWN or UP.
kaf24@2827 385 * When the driver goes DOWN then the controller will send no more
kaf24@2827 386 * status-change notifications.
kaf24@2827 387 * If the driver goes DOWN while interfaces are still UP, the domain
kaf24@2827 388 * will automatically take the interfaces DOWN.
kaf24@2827 389 *
kaf24@2827 390 * NB. The controller should not send an INTERFACE_STATUS message
kaf24@2827 391 * for interfaces that are active when it receives an UP notification. We
kaf24@2827 392 * expect that the frontend driver will query those interfaces itself.
kaf24@2827 393 */
kaf24@2827 394 #define NETIF_DRIVER_STATUS_DOWN 0
kaf24@2827 395 #define NETIF_DRIVER_STATUS_UP 1
kaf24@2827 396 typedef struct {
kaf24@2827 397 /* IN */
kaf24@2827 398 u32 status; /* 0: NETIF_DRIVER_STATUS_??? */
kaf24@2827 399 /* OUT */
kaf24@2827 400 /* Driver should query interfaces [0..max_handle]. */
kaf24@2827 401 u32 max_handle; /* 4 */
kaf24@2827 402 } PACKED netif_fe_driver_status_t; /* 8 bytes */
kaf24@2827 403
kaf24@2827 404 /*
kaf24@2827 405 * CMSG_NETIF_FE_INTERFACE_CONNECT:
kaf24@2827 406 * If successful, the domain controller will acknowledge with a
kaf24@2827 407 * STATUS_CONNECTED message.
kaf24@2827 408 */
kaf24@2827 409 typedef struct {
kaf24@2827 410 u32 handle; /* 0 */
kaf24@2827 411 u32 __pad; /* 4 */
kaf24@2827 412 memory_t tx_shmem_frame; /* 8 */
kaf24@2827 413 MEMORY_PADDING;
kaf24@2827 414 memory_t rx_shmem_frame; /* 16 */
kaf24@2827 415 MEMORY_PADDING;
kaf24@2827 416 } PACKED netif_fe_interface_connect_t; /* 24 bytes */
kaf24@2827 417
kaf24@2827 418 /*
kaf24@2827 419 * CMSG_NETIF_FE_INTERFACE_DISCONNECT:
kaf24@2827 420 * If successful, the domain controller will acknowledge with a
kaf24@2827 421 * STATUS_DISCONNECTED message.
kaf24@2827 422 */
kaf24@2827 423 typedef struct {
kaf24@2827 424 u32 handle; /* 0 */
kaf24@2827 425 } PACKED netif_fe_interface_disconnect_t; /* 4 bytes */
kaf24@2827 426
kaf24@2827 427 /*
kaf24@2827 428 * CMSG_NETIF_FE_INTERFACE_QUERY:
kaf24@2827 429 */
kaf24@2827 430 typedef struct {
kaf24@2827 431 /* IN */
kaf24@2827 432 u32 handle; /* 0 */
kaf24@2827 433 /* OUT */
kaf24@2827 434 u32 status; /* 4 */
kaf24@2827 435 u16 evtchn; /* 8: status == NETIF_INTERFACE_STATUS_CONNECTED */
kaf24@2827 436 u8 mac[6]; /* 10: status == NETIF_INTERFACE_STATUS_CONNECTED */
kaf24@2827 437 domid_t domid; /* 16: status != NETIF_INTERFACE_STATUS_DESTROYED */
kaf24@2827 438 } PACKED netif_fe_interface_query_t; /* 18 bytes */
kaf24@2827 439
kaf24@2827 440
kaf24@2827 441 /******************************************************************************
kaf24@2827 442 * NETWORK-INTERFACE BACKEND DEFINITIONS
kaf24@2827 443 */
kaf24@2827 444
kaf24@2827 445 /* Messages from domain controller. */
kaf24@2827 446 #define CMSG_NETIF_BE_CREATE 0 /* Create a new net-device interface. */
kaf24@2827 447 #define CMSG_NETIF_BE_DESTROY 1 /* Destroy a net-device interface. */
kaf24@2827 448 #define CMSG_NETIF_BE_CONNECT 2 /* Connect i/f to remote driver. */
kaf24@2827 449 #define CMSG_NETIF_BE_DISCONNECT 3 /* Disconnect i/f from remote driver. */
kaf24@2827 450
kaf24@2827 451 /* Messages to domain controller. */
kaf24@2827 452 #define CMSG_NETIF_BE_DRIVER_STATUS 32
kaf24@2827 453
kaf24@2827 454 /*
kaf24@2827 455 * Message request/response definitions for net-device messages.
kaf24@2827 456 */
kaf24@2827 457
kaf24@2827 458 /* Non-specific 'okay' return. */
kaf24@2827 459 #define NETIF_BE_STATUS_OKAY 0
kaf24@2827 460 /* Non-specific 'error' return. */
kaf24@2827 461 #define NETIF_BE_STATUS_ERROR 1
kaf24@2827 462 /* The following are specific error returns. */
kaf24@2827 463 #define NETIF_BE_STATUS_INTERFACE_EXISTS 2
kaf24@2827 464 #define NETIF_BE_STATUS_INTERFACE_NOT_FOUND 3
kaf24@2827 465 #define NETIF_BE_STATUS_INTERFACE_CONNECTED 4
kaf24@2827 466 #define NETIF_BE_STATUS_OUT_OF_MEMORY 5
kaf24@2827 467 #define NETIF_BE_STATUS_MAPPING_ERROR 6
kaf24@2827 468
kaf24@2827 469 /* This macro can be used to create an array of descriptive error strings. */
kaf24@2827 470 #define NETIF_BE_STATUS_ERRORS { \
kaf24@2827 471 "Okay", \
kaf24@2827 472 "Non-specific error", \
kaf24@2827 473 "Interface already exists", \
kaf24@2827 474 "Interface not found", \
kaf24@2827 475 "Interface is still connected", \
kaf24@2827 476 "Out of memory", \
kaf24@2827 477 "Could not map domain memory" }
kaf24@2827 478
kaf24@2827 479 /*
kaf24@2827 480 * CMSG_NETIF_BE_CREATE:
kaf24@2827 481 * When the driver sends a successful response then the interface is fully
kaf24@2827 482 * created. The controller will send a DOWN notification to the front-end
kaf24@2827 483 * driver.
kaf24@2827 484 */
kaf24@2827 485 typedef struct {
kaf24@2827 486 /* IN */
kaf24@2827 487 domid_t domid; /* 0: Domain attached to new interface. */
kaf24@2827 488 u16 __pad0; /* 2 */
kaf24@2827 489 u32 netif_handle; /* 4: Domain-specific interface handle. */
kaf24@2827 490 u8 mac[6]; /* 8 */
kaf24@2827 491 u16 __pad1; /* 14 */
iap10@3639 492 u8 be_mac[6]; /* 16 */
iap10@3639 493 u16 __pad2; /* 22 */
kaf24@2827 494 /* OUT */
iap10@3639 495 u32 status; /* 24 */
iap10@3639 496 } PACKED netif_be_create_t; /* 28 bytes */
kaf24@2827 497
kaf24@2827 498 /*
kaf24@2827 499 * CMSG_NETIF_BE_DESTROY:
kaf24@2827 500 * When the driver sends a successful response then the interface is fully
kaf24@2827 501 * torn down. The controller will send a DESTROYED notification to the
kaf24@2827 502 * front-end driver.
kaf24@2827 503 */
kaf24@2827 504 typedef struct {
kaf24@2827 505 /* IN */
kaf24@2827 506 domid_t domid; /* 0: Identify interface to be destroyed. */
kaf24@2827 507 u16 __pad;
kaf24@2827 508 u32 netif_handle; /* 4: ...ditto... */
kaf24@2827 509 /* OUT */
kaf24@2827 510 u32 status; /* 8 */
kaf24@2827 511 } PACKED netif_be_destroy_t; /* 12 bytes */
kaf24@2827 512
kaf24@2827 513 /*
kaf24@2827 514 * CMSG_NETIF_BE_CONNECT:
kaf24@2827 515 * When the driver sends a successful response then the interface is fully
kaf24@2827 516 * connected. The controller will send a CONNECTED notification to the
kaf24@2827 517 * front-end driver.
kaf24@2827 518 */
kaf24@2827 519 typedef struct {
kaf24@2827 520 /* IN */
kaf24@2827 521 domid_t domid; /* 0: Domain attached to new interface. */
kaf24@2827 522 u16 __pad0; /* 2 */
kaf24@2827 523 u32 netif_handle; /* 4: Domain-specific interface handle. */
kaf24@2827 524 memory_t tx_shmem_frame; /* 8: Page cont. tx shared comms window. */
kaf24@2827 525 MEMORY_PADDING;
kaf24@2827 526 memory_t rx_shmem_frame; /* 16: Page cont. rx shared comms window. */
kaf24@2827 527 MEMORY_PADDING;
kaf24@2827 528 u16 evtchn; /* 24: Event channel for notifications. */
kaf24@2827 529 u16 __pad1; /* 26 */
kaf24@2827 530 /* OUT */
kaf24@2827 531 u32 status; /* 28 */
kaf24@2827 532 } PACKED netif_be_connect_t; /* 32 bytes */
kaf24@2827 533
kaf24@2827 534 /*
kaf24@2827 535 * CMSG_NETIF_BE_DISCONNECT:
kaf24@2827 536 * When the driver sends a successful response then the interface is fully
kaf24@2827 537 * disconnected. The controller will send a DOWN notification to the front-end
kaf24@2827 538 * driver.
kaf24@2827 539 */
kaf24@2827 540 typedef struct {
kaf24@2827 541 /* IN */
kaf24@2827 542 domid_t domid; /* 0: Domain attached to new interface. */
kaf24@2827 543 u16 __pad;
kaf24@2827 544 u32 netif_handle; /* 4: Domain-specific interface handle. */
kaf24@2827 545 /* OUT */
kaf24@2827 546 u32 status; /* 8 */
kaf24@2827 547 } PACKED netif_be_disconnect_t; /* 12 bytes */
kaf24@2827 548
kaf24@2827 549 /*
kaf24@2827 550 * CMSG_NETIF_BE_DRIVER_STATUS:
kaf24@2827 551 * Notify the domain controller that the back-end driver is DOWN or UP.
kaf24@2827 552 * If the driver goes DOWN while interfaces are still UP, the domain
kaf24@2827 553 * will automatically send DOWN notifications.
kaf24@2827 554 */
kaf24@2827 555 typedef struct {
kaf24@2827 556 u32 status; /* 0: NETIF_DRIVER_STATUS_??? */
kaf24@2827 557 } PACKED netif_be_driver_status_t; /* 4 bytes */
kaf24@2827 558
kaf24@2827 559
mwilli2@3501 560
mwilli2@3501 561 /******************************************************************************
mwilli2@3501 562 * USB-INTERFACE FRONTEND DEFINITIONS
mwilli2@3501 563 */
mwilli2@3501 564
mwilli2@3501 565 /* Messages from domain controller to guest. */
mwilli2@3501 566 #define CMSG_USBIF_FE_INTERFACE_STATUS_CHANGED 0
mwilli2@3501 567
mwilli2@3501 568 /* Messages from guest to domain controller. */
mwilli2@3501 569 #define CMSG_USBIF_FE_DRIVER_STATUS_CHANGED 32
mwilli2@3501 570 #define CMSG_USBIF_FE_INTERFACE_CONNECT 33
mwilli2@3501 571 #define CMSG_USBIF_FE_INTERFACE_DISCONNECT 34
mwilli2@3501 572 /*
mwilli2@3501 573 * CMSG_USBIF_FE_INTERFACE_STATUS_CHANGED:
mwilli2@3501 574 * Notify a guest about a status change on one of its block interfaces.
mwilli2@3501 575 * If the interface is DESTROYED or DOWN then the interface is disconnected:
mwilli2@3501 576 * 1. The shared-memory frame is available for reuse.
mwilli2@3501 577 * 2. Any unacknowledged messages pending on the interface were dropped.
mwilli2@3501 578 */
mwilli2@3501 579 #define USBIF_INTERFACE_STATUS_DESTROYED 0 /* Interface doesn't exist. */
mwilli2@3501 580 #define USBIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
mwilli2@3501 581 #define USBIF_INTERFACE_STATUS_CONNECTED 2 /* Exists and is connected. */
mwilli2@3501 582 typedef struct {
mwilli2@3501 583 u32 status; /* 0 */
mwilli2@3501 584 u16 evtchn; /* 4: (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
mwilli2@3501 585 domid_t domid; /* 6: status != BLKIF_INTERFACE_STATUS_DESTROYED */
mwilli2@3501 586 u32 bandwidth; /* 8 */
mwilli2@3501 587 u32 num_ports; /* 12 */
mwilli2@3501 588 } PACKED usbif_fe_interface_status_changed_t; /* 12 bytes */
mwilli2@3501 589
mwilli2@3501 590 /*
mwilli2@3501 591 * CMSG_USBIF_FE_DRIVER_STATUS_CHANGED:
mwilli2@3501 592 * Notify the domain controller that the front-end driver is DOWN or UP.
mwilli2@3501 593 * When the driver goes DOWN then the controller will send no more
mwilli2@3501 594 * status-change notifications.
mwilli2@3501 595 * If the driver goes DOWN while interfaces are still UP, the domain
mwilli2@3501 596 * will automatically take the interfaces DOWN.
mwilli2@3501 597 *
mwilli2@3501 598 * NB. The controller should not send an INTERFACE_STATUS_CHANGED message
mwilli2@3501 599 * for interfaces that are active when it receives an UP notification. We
mwilli2@3501 600 * expect that the frontend driver will query those interfaces itself.
mwilli2@3501 601 */
mwilli2@3501 602 #define USBIF_DRIVER_STATUS_DOWN 0
mwilli2@3501 603 #define USBIF_DRIVER_STATUS_UP 1
mwilli2@3501 604 typedef struct {
mwilli2@3501 605 /* IN */
mwilli2@3501 606 u32 status; /* 0: USBIF_DRIVER_STATUS_??? */
mwilli2@3501 607 } PACKED usbif_fe_driver_status_changed_t; /* 4 bytes */
mwilli2@3501 608
mwilli2@3501 609 /*
mwilli2@3501 610 * CMSG_USBIF_FE_INTERFACE_CONNECT:
mwilli2@3501 611 * If successful, the domain controller will acknowledge with a
mwilli2@3501 612 * STATUS_CONNECTED message.
mwilli2@3501 613 */
mwilli2@3501 614 typedef struct {
mwilli2@3501 615 u32 __pad;
mwilli2@3501 616 memory_t shmem_frame; /* 8 */
mwilli2@3501 617 MEMORY_PADDING;
mwilli2@3501 618 } PACKED usbif_fe_interface_connect_t; /* 16 bytes */
mwilli2@3501 619
mwilli2@3501 620 /*
mwilli2@3501 621 * CMSG_BLKIF_FE_INTERFACE_DISCONNECT:
mwilli2@3501 622 * If successful, the domain controller will acknowledge with a
mwilli2@3501 623 * STATUS_DISCONNECTED message.
mwilli2@3501 624 */
mwilli2@3501 625 typedef struct {} PACKED usbif_fe_interface_disconnect_t; /* 4 bytes */
mwilli2@3501 626
mwilli2@3501 627
mwilli2@3501 628 /******************************************************************************
mwilli2@3501 629 * USB-INTERFACE BACKEND DEFINITIONS
mwilli2@3501 630 */
mwilli2@3501 631
mwilli2@3501 632 /* Messages from domain controller. */
mwilli2@3501 633 #define CMSG_USBIF_BE_CREATE 0 /* Create a new block-device interface. */
mwilli2@3501 634 #define CMSG_USBIF_BE_DESTROY 1 /* Destroy a block-device interface. */
mwilli2@3501 635 #define CMSG_USBIF_BE_CONNECT 2 /* Connect i/f to remote driver. */
mwilli2@3501 636 #define CMSG_USBIF_BE_DISCONNECT 3 /* Disconnect i/f from remote driver. */
mwilli2@3501 637 #define CMSG_USBIF_BE_CLAIM_PORT 4 /* Claim host port for a domain. */
mwilli2@3501 638 #define CMSG_USBIF_BE_RELEASE_PORT 5 /* Release host port. */
mwilli2@3501 639 /* Messages to domain controller. */
mwilli2@3501 640 #define CMSG_USBIF_BE_DRIVER_STATUS_CHANGED 32
mwilli2@3501 641
mwilli2@3501 642 /* Non-specific 'okay' return. */
mwilli2@3501 643 #define USBIF_BE_STATUS_OKAY 0
mwilli2@3501 644 /* Non-specific 'error' return. */
mwilli2@3501 645 #define USBIF_BE_STATUS_ERROR 1
mwilli2@3501 646 /* The following are specific error returns. */
mwilli2@3501 647 #define USBIF_BE_STATUS_INTERFACE_EXISTS 2
mwilli2@3501 648 #define USBIF_BE_STATUS_INTERFACE_NOT_FOUND 3
mwilli2@3501 649 #define USBIF_BE_STATUS_INTERFACE_CONNECTED 4
mwilli2@3501 650 #define USBIF_BE_STATUS_OUT_OF_MEMORY 7
mwilli2@3501 651 #define USBIF_BE_STATUS_MAPPING_ERROR 9
mwilli2@3501 652
mwilli2@3501 653 /* This macro can be used to create an array of descriptive error strings. */
mwilli2@3501 654 #define USBIF_BE_STATUS_ERRORS { \
mwilli2@3501 655 "Okay", \
mwilli2@3501 656 "Non-specific error", \
mwilli2@3501 657 "Interface already exists", \
mwilli2@3501 658 "Interface not found", \
mwilli2@3501 659 "Interface is still connected", \
mwilli2@3501 660 "Out of memory", \
mwilli2@3501 661 "Could not map domain memory" }
mwilli2@3501 662
mwilli2@3501 663 /*
mwilli2@3501 664 * CMSG_USBIF_BE_CREATE:
mwilli2@3501 665 * When the driver sends a successful response then the interface is fully
mwilli2@3501 666 * created. The controller will send a DOWN notification to the front-end
mwilli2@3501 667 * driver.
mwilli2@3501 668 */
mwilli2@3501 669 typedef struct {
mwilli2@3501 670 /* IN */
mwilli2@3501 671 domid_t domid; /* 0: Domain attached to new interface. */
mwilli2@3501 672 u16 __pad;
mwilli2@3501 673 /* OUT */
mwilli2@3501 674 u32 status; /* 8 */
mwilli2@3501 675 } PACKED usbif_be_create_t; /* 12 bytes */
mwilli2@3501 676
mwilli2@3501 677 /*
mwilli2@3501 678 * CMSG_USBIF_BE_DESTROY:
mwilli2@3501 679 * When the driver sends a successful response then the interface is fully
mwilli2@3501 680 * torn down. The controller will send a DESTROYED notification to the
mwilli2@3501 681 * front-end driver.
mwilli2@3501 682 */
mwilli2@3501 683 typedef struct {
mwilli2@3501 684 /* IN */
mwilli2@3501 685 domid_t domid; /* 0: Identify interface to be destroyed. */
mwilli2@3501 686 u16 __pad;
mwilli2@3501 687 /* OUT */
mwilli2@3501 688 u32 status; /* 8 */
mwilli2@3501 689 } PACKED usbif_be_destroy_t; /* 12 bytes */
mwilli2@3501 690
mwilli2@3501 691 /*
mwilli2@3501 692 * CMSG_USBIF_BE_CONNECT:
mwilli2@3501 693 * When the driver sends a successful response then the interface is fully
mwilli2@3501 694 * connected. The controller will send a CONNECTED notification to the
mwilli2@3501 695 * front-end driver.
mwilli2@3501 696 */
mwilli2@3501 697 typedef struct {
mwilli2@3501 698 /* IN */
mwilli2@3501 699 domid_t domid; /* 0: Domain attached to new interface. */
mwilli2@3501 700 u16 __pad;
mwilli2@3501 701 memory_t shmem_frame; /* 8: Page cont. shared comms window. */
mwilli2@3501 702 MEMORY_PADDING;
mwilli2@3501 703 u32 evtchn; /* 16: Event channel for notifications. */
mwilli2@3501 704 u32 bandwidth; /* 20: Bandwidth allocated for isoch / int - us
mwilli2@3501 705 * per 1ms frame (ie between 0 and 900 or 800
mwilli2@3501 706 * depending on USB version). */
mwilli2@3501 707 /* OUT */
mwilli2@3501 708 u32 status; /* 24 */
mwilli2@3501 709 } PACKED usbif_be_connect_t; /* 28 bytes */
mwilli2@3501 710
mwilli2@3501 711 /*
mwilli2@3501 712 * CMSG_USBIF_BE_DISCONNECT:
mwilli2@3501 713 * When the driver sends a successful response then the interface is fully
mwilli2@3501 714 * disconnected. The controller will send a DOWN notification to the front-end
mwilli2@3501 715 * driver.
mwilli2@3501 716 */
mwilli2@3501 717 typedef struct {
mwilli2@3501 718 /* IN */
mwilli2@3501 719 domid_t domid; /* 0: Domain attached to new interface. */
mwilli2@3501 720 u16 __pad;
mwilli2@3501 721 /* OUT */
mwilli2@3501 722 u32 status; /* 8 */
mwilli2@3501 723 } PACKED usbif_be_disconnect_t; /* 12 bytes */
mwilli2@3501 724
mwilli2@3501 725 /*
mwilli2@3501 726 * CMSG_USBIF_BE_DRIVER_STATUS_CHANGED:
mwilli2@3501 727 * Notify the domain controller that the back-end driver is DOWN or UP.
mwilli2@3501 728 * If the driver goes DOWN while interfaces are still UP, the controller
mwilli2@3501 729 * will automatically send DOWN notifications.
mwilli2@3501 730 */
mwilli2@3501 731 typedef struct {
mwilli2@3501 732 u32 status; /* 0: USBIF_DRIVER_STATUS_??? */
mwilli2@3501 733 } PACKED usbif_be_driver_status_changed_t; /* 4 bytes */
mwilli2@3501 734
mwilli2@3501 735 #define USB_PATH_LEN 16
mwilli2@3501 736
mwilli2@3501 737 /*
mwilli2@3501 738 * CMSG_USBIF_BE_CLAIM_PORT:
mwilli2@3501 739 * Instruct the backend driver to claim any device plugged into the specified
mwilli2@3501 740 * host port and to allow the specified domain to control that port.
mwilli2@3501 741 */
mwilli2@3501 742 typedef struct
mwilli2@3501 743 {
mwilli2@3501 744 /* IN */
mwilli2@3501 745 domid_t domid; /* 0: which domain */
mwilli2@3501 746 u32 usbif_port; /* 6: port on the virtual root hub */
mwilli2@3501 747 u32 status; /* 10: status of operation */
mwilli2@3501 748 char path[USB_PATH_LEN]; /* Currently specified in the Linux style - may need to be
mwilli2@3501 749 * converted to some OS-independent format at some stage. */
mwilli2@3501 750 } PACKED usbif_be_claim_port_t;
mwilli2@3501 751
mwilli2@3501 752 /*
mwilli2@3501 753 * CMSG_USBIF_BE_RELEASE_PORT:
mwilli2@3501 754 * Instruct the backend driver to release any device plugged into the specified
mwilli2@3501 755 * host port.
mwilli2@3501 756 */
mwilli2@3501 757 typedef struct
mwilli2@3501 758 {
mwilli2@3501 759 char path[USB_PATH_LEN];
mwilli2@3501 760 } PACKED usbif_be_release_port_t;
mwilli2@3501 761
kaf24@2827 762 /******************************************************************************
kaf24@2827 763 * SHUTDOWN DEFINITIONS
kaf24@2827 764 */
kaf24@2827 765
kaf24@2827 766 /*
kaf24@2827 767 * Subtypes for shutdown messages.
kaf24@2827 768 */
kaf24@2827 769 #define CMSG_SHUTDOWN_POWEROFF 0 /* Clean shutdown (SHUTDOWN_poweroff). */
kaf24@2827 770 #define CMSG_SHUTDOWN_REBOOT 1 /* Clean shutdown (SHUTDOWN_reboot). */
kaf24@2827 771 #define CMSG_SHUTDOWN_SUSPEND 2 /* Create suspend info, then */
kaf24@2827 772 /* SHUTDOWN_suspend. */
kaf24@3298 773 #define CMSG_SHUTDOWN_SYSRQ 3
kaf24@2827 774
kaf24@2827 775
kaf24@2827 776 /******************************************************************************
kaf24@2827 777 * MEMORY CONTROLS
kaf24@2827 778 */
kaf24@2827 779
kaf24@2827 780 #define CMSG_MEM_REQUEST_SET 0 /* Request a domain to set its mem footprint. */
kaf24@2827 781
kaf24@2827 782 /*
kaf24@2827 783 * CMSG_MEM_REQUEST:
kaf24@2827 784 * Request that the domain change its memory reservation.
kaf24@2827 785 */
kaf24@2827 786 typedef struct {
kaf24@2827 787 /* OUT */
kaf24@2827 788 u32 target; /* 0: Target memory reservation in pages. */
kaf24@2827 789 /* IN */
kaf24@2827 790 u32 status; /* 4: Return code indicates success or failure. */
kaf24@2827 791 } PACKED mem_request_t; /* 8 bytes */
kaf24@2827 792
kaf24@2827 793
kaf24@2827 794 #endif /* __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__ */