1 /******************************************************************************
4 * Interface to server controller (e.g., 'xend'). This header file defines the
5 * interface that is shared with guest OSes.
7 * Copyright (c) 2004, K A Fraser
10 #ifndef __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__
11 #define __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__
16 * CONTROLLER MESSAGING INTERFACE.
20 u8 type; /* 0: echoed in response */
21 u8 subtype; /* 1: echoed in response */
22 u8 id; /* 2: echoed in response */
23 u8 length; /* 3: number of bytes in 'msg' */
24 u8 msg[60]; /* 4: type-specific message data */
25 } PACKED control_msg_t; /* 64 bytes */
27 /* These are used by the control message deferred ring. */
28 #define CONTROL_RING_SIZE 8
29 typedef u32 CONTROL_RING_IDX;
30 #define MASK_CONTROL_IDX(_i) ((_i)&(CONTROL_RING_SIZE-1))
33 * Generate control ring structures and types.
35 * CONTROL_RING_MEM is currently an 8-slot ring of ctrl_msg_t structs and
36 * two 32-bit counters: (64 * 8) + (2 * 4) = 520
38 #define CONTROL_RING_MEM 520
39 DEFINE_RING_TYPES(ctrl, control_msg_t, control_msg_t);
43 ctrl_sring_t tx_ring; /* 0: guest -> controller */
44 char __x[CONTROL_RING_MEM];
47 ctrl_sring_t rx_ring; /* 520: controller -> guest */
48 char __y[CONTROL_RING_MEM];
50 } PACKED control_if_t; /* 1040 bytes */
53 * Top-level command types.
55 #define CMSG_CONSOLE 0 /* Console */
56 #define CMSG_BLKIF_BE 1 /* Block-device backend */
57 #define CMSG_BLKIF_FE 2 /* Block-device frontend */
58 #define CMSG_NETIF_BE 3 /* Network-device backend */
59 #define CMSG_NETIF_FE 4 /* Network-device frontend */
60 #define CMSG_SHUTDOWN 6 /* Shutdown messages */
61 #define CMSG_MEM_REQUEST 7 /* Memory reservation reqs */
62 #define CMSG_USBIF_BE 8 /* USB controller backend */
63 #define CMSG_USBIF_FE 9 /* USB controller frontend */
65 /******************************************************************************
70 * Subtypes for console messages.
72 #define CMSG_CONSOLE_DATA 0
75 /******************************************************************************
76 * BLOCK-INTERFACE FRONTEND DEFINITIONS
79 /* Messages from domain controller to guest. */
80 #define CMSG_BLKIF_FE_INTERFACE_STATUS 0
82 /* Messages from guest to domain controller. */
83 #define CMSG_BLKIF_FE_DRIVER_STATUS 32
84 #define CMSG_BLKIF_FE_INTERFACE_CONNECT 33
85 #define CMSG_BLKIF_FE_INTERFACE_DISCONNECT 34
86 #define CMSG_BLKIF_FE_INTERFACE_QUERY 35
88 /* These are used by both front-end and back-end drivers. */
89 #define blkif_vdev_t u16
90 #define blkif_pdev_t u32
91 #define blkif_sector_t u64
94 * CMSG_BLKIF_FE_INTERFACE_STATUS:
95 * Notify a guest about a status change on one of its block interfaces.
96 * If the interface is DESTROYED or DOWN then the interface is disconnected:
97 * 1. The shared-memory frame is available for reuse.
98 * 2. Any unacknowledged messages pending on the interface were dropped.
100 #define BLKIF_INTERFACE_STATUS_CLOSED 0 /* Interface doesn't exist. */
101 #define BLKIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
102 #define BLKIF_INTERFACE_STATUS_CONNECTED 2 /* Exists and is connected. */
103 #define BLKIF_INTERFACE_STATUS_CHANGED 3 /* A device has been added or removed. */
107 u16 evtchn; /* 8: (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
108 domid_t domid; /* 10: status != BLKIF_INTERFACE_STATUS_DESTROYED */
109 } PACKED blkif_fe_interface_status_t; /* 12 bytes */
112 * CMSG_BLKIF_FE_DRIVER_STATUS:
113 * Notify the domain controller that the front-end driver is DOWN or UP.
114 * When the driver goes DOWN then the controller will send no more
115 * status-change notifications.
116 * If the driver goes DOWN while interfaces are still UP, the domain
117 * will automatically take the interfaces DOWN.
119 * NB. The controller should not send an INTERFACE_STATUS_CHANGED message
120 * for interfaces that are active when it receives an UP notification. We
121 * expect that the frontend driver will query those interfaces itself.
123 #define BLKIF_DRIVER_STATUS_DOWN 0
124 #define BLKIF_DRIVER_STATUS_UP 1
127 u32 status; /* 0: BLKIF_DRIVER_STATUS_??? */
129 /* Driver should query interfaces [0..max_handle]. */
130 u32 max_handle; /* 4 */
131 } PACKED blkif_fe_driver_status_t; /* 8 bytes */
134 * CMSG_BLKIF_FE_INTERFACE_CONNECT:
135 * If successful, the domain controller will acknowledge with a
136 * STATUS_CONNECTED message.
141 memory_t shmem_frame; /* 8 */
143 } PACKED blkif_fe_interface_connect_t; /* 16 bytes */
146 * CMSG_BLKIF_FE_INTERFACE_DISCONNECT:
147 * If successful, the domain controller will acknowledge with a
148 * STATUS_DISCONNECTED message.
152 } PACKED blkif_fe_interface_disconnect_t; /* 4 bytes */
155 * CMSG_BLKIF_FE_INTERFACE_QUERY:
162 u16 evtchn; /* 8: (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
163 domid_t domid; /* 10: status != BLKIF_INTERFACE_STATUS_DESTROYED */
164 } PACKED blkif_fe_interface_query_t; /* 12 bytes */
167 /******************************************************************************
168 * BLOCK-INTERFACE BACKEND DEFINITIONS
171 /* Messages from domain controller. */
172 #define CMSG_BLKIF_BE_CREATE 0 /* Create a new block-device interface. */
173 #define CMSG_BLKIF_BE_DESTROY 1 /* Destroy a block-device interface. */
174 #define CMSG_BLKIF_BE_CONNECT 2 /* Connect i/f to remote driver. */
175 #define CMSG_BLKIF_BE_DISCONNECT 3 /* Disconnect i/f from remote driver. */
176 #define CMSG_BLKIF_BE_VBD_CREATE 4 /* Create a new VBD for an interface. */
177 #define CMSG_BLKIF_BE_VBD_DESTROY 5 /* Delete a VBD from an interface. */
179 /* Messages to domain controller. */
180 #define CMSG_BLKIF_BE_DRIVER_STATUS 32
183 * Message request/response definitions for block-device messages.
186 /* Non-specific 'okay' return. */
187 #define BLKIF_BE_STATUS_OKAY 0
188 /* Non-specific 'error' return. */
189 #define BLKIF_BE_STATUS_ERROR 1
190 /* The following are specific error returns. */
191 #define BLKIF_BE_STATUS_INTERFACE_EXISTS 2
192 #define BLKIF_BE_STATUS_INTERFACE_NOT_FOUND 3
193 #define BLKIF_BE_STATUS_INTERFACE_CONNECTED 4
194 #define BLKIF_BE_STATUS_VBD_EXISTS 5
195 #define BLKIF_BE_STATUS_VBD_NOT_FOUND 6
196 #define BLKIF_BE_STATUS_OUT_OF_MEMORY 7
197 #define BLKIF_BE_STATUS_PHYSDEV_NOT_FOUND 8
198 #define BLKIF_BE_STATUS_MAPPING_ERROR 9
200 /* This macro can be used to create an array of descriptive error strings. */
201 #define BLKIF_BE_STATUS_ERRORS { \
203 "Non-specific error", \
204 "Interface already exists", \
205 "Interface not found", \
206 "Interface is still connected", \
207 "VBD already exists", \
210 "Extent not found for VBD", \
211 "Could not map domain memory" }
214 * CMSG_BLKIF_BE_CREATE:
215 * When the driver sends a successful response then the interface is fully
216 * created. The controller will send a DOWN notification to the front-end
221 domid_t domid; /* 0: Domain attached to new interface. */
223 u32 blkif_handle; /* 4: Domain-specific interface handle. */
226 } PACKED blkif_be_create_t; /* 12 bytes */
229 * CMSG_BLKIF_BE_DESTROY:
230 * When the driver sends a successful response then the interface is fully
231 * torn down. The controller will send a DESTROYED notification to the
236 domid_t domid; /* 0: Identify interface to be destroyed. */
238 u32 blkif_handle; /* 4: ...ditto... */
241 } PACKED blkif_be_destroy_t; /* 12 bytes */
244 * CMSG_BLKIF_BE_CONNECT:
245 * When the driver sends a successful response then the interface is fully
246 * connected. The controller will send a CONNECTED notification to the
251 domid_t domid; /* 0: Domain attached to new interface. */
253 u32 blkif_handle; /* 4: Domain-specific interface handle. */
254 memory_t shmem_frame; /* 8: Page cont. shared comms window. */
256 u32 evtchn; /* 16: Event channel for notifications. */
259 } PACKED blkif_be_connect_t; /* 24 bytes */
262 * CMSG_BLKIF_BE_DISCONNECT:
263 * When the driver sends a successful response then the interface is fully
264 * disconnected. The controller will send a DOWN notification to the front-end
269 domid_t domid; /* 0: Domain attached to new interface. */
271 u32 blkif_handle; /* 4: Domain-specific interface handle. */
274 } PACKED blkif_be_disconnect_t; /* 12 bytes */
276 /* CMSG_BLKIF_BE_VBD_CREATE */
279 domid_t domid; /* 0: Identify blkdev interface. */
281 u32 blkif_handle; /* 4: ...ditto... */
282 blkif_pdev_t pdevice; /* 8 */
283 blkif_vdev_t vdevice; /* 12: Interface-specific id for this VBD. */
284 u16 readonly; /* 14: Non-zero -> VBD isn't writable. */
287 } PACKED blkif_be_vbd_create_t; /* 20 bytes */
289 /* CMSG_BLKIF_BE_VBD_DESTROY */
292 domid_t domid; /* 0: Identify blkdev interface. */
294 u32 blkif_handle; /* 4: ...ditto... */
295 blkif_vdev_t vdevice; /* 8: Interface-specific id of the VBD. */
299 } PACKED blkif_be_vbd_destroy_t; /* 16 bytes */
302 * CMSG_BLKIF_BE_DRIVER_STATUS:
303 * Notify the domain controller that the back-end driver is DOWN or UP.
304 * If the driver goes DOWN while interfaces are still UP, the controller
305 * will automatically send DOWN notifications.
308 u32 status; /* 0: BLKIF_DRIVER_STATUS_??? */
309 } PACKED blkif_be_driver_status_t; /* 4 bytes */
312 /******************************************************************************
313 * NETWORK-INTERFACE FRONTEND DEFINITIONS
316 /* Messages from domain controller to guest. */
317 #define CMSG_NETIF_FE_INTERFACE_STATUS 0
319 /* Messages from guest to domain controller. */
320 #define CMSG_NETIF_FE_DRIVER_STATUS 32
321 #define CMSG_NETIF_FE_INTERFACE_CONNECT 33
322 #define CMSG_NETIF_FE_INTERFACE_DISCONNECT 34
323 #define CMSG_NETIF_FE_INTERFACE_QUERY 35
326 * CMSG_NETIF_FE_INTERFACE_STATUS:
327 * Notify a guest about a status change on one of its network interfaces.
328 * If the interface is CLOSED or DOWN then the interface is disconnected:
329 * 1. The shared-memory frame is available for reuse.
330 * 2. Any unacknowledged messgaes pending on the interface were dropped.
332 #define NETIF_INTERFACE_STATUS_CLOSED 0 /* Interface doesn't exist. */
333 #define NETIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
334 #define NETIF_INTERFACE_STATUS_CONNECTED 2 /* Exists and is connected. */
335 #define NETIF_INTERFACE_STATUS_CHANGED 3 /* A device has been added or removed. */
339 u16 evtchn; /* 8: status == NETIF_INTERFACE_STATUS_CONNECTED */
340 u8 mac[6]; /* 10: status == NETIF_INTERFACE_STATUS_CONNECTED */
341 domid_t domid; /* 16: status != NETIF_INTERFACE_STATUS_DESTROYED */
342 } PACKED netif_fe_interface_status_t; /* 18 bytes */
345 * CMSG_NETIF_FE_DRIVER_STATUS:
346 * Notify the domain controller that the front-end driver is DOWN or UP.
347 * When the driver goes DOWN then the controller will send no more
348 * status-change notifications.
349 * If the driver goes DOWN while interfaces are still UP, the domain
350 * will automatically take the interfaces DOWN.
352 * NB. The controller should not send an INTERFACE_STATUS message
353 * for interfaces that are active when it receives an UP notification. We
354 * expect that the frontend driver will query those interfaces itself.
356 #define NETIF_DRIVER_STATUS_DOWN 0
357 #define NETIF_DRIVER_STATUS_UP 1
360 u32 status; /* 0: NETIF_DRIVER_STATUS_??? */
362 /* Driver should query interfaces [0..max_handle]. */
363 u32 max_handle; /* 4 */
364 } PACKED netif_fe_driver_status_t; /* 8 bytes */
367 * CMSG_NETIF_FE_INTERFACE_CONNECT:
368 * If successful, the domain controller will acknowledge with a
369 * STATUS_CONNECTED message.
374 memory_t tx_shmem_frame; /* 8 */
376 memory_t rx_shmem_frame; /* 16 */
378 } PACKED netif_fe_interface_connect_t; /* 24 bytes */
381 * CMSG_NETIF_FE_INTERFACE_DISCONNECT:
382 * If successful, the domain controller will acknowledge with a
383 * STATUS_DISCONNECTED message.
387 } PACKED netif_fe_interface_disconnect_t; /* 4 bytes */
390 * CMSG_NETIF_FE_INTERFACE_QUERY:
397 u16 evtchn; /* 8: status == NETIF_INTERFACE_STATUS_CONNECTED */
398 u8 mac[6]; /* 10: status == NETIF_INTERFACE_STATUS_CONNECTED */
399 domid_t domid; /* 16: status != NETIF_INTERFACE_STATUS_DESTROYED */
400 } PACKED netif_fe_interface_query_t; /* 18 bytes */
403 /******************************************************************************
404 * NETWORK-INTERFACE BACKEND DEFINITIONS
407 /* Messages from domain controller. */
408 #define CMSG_NETIF_BE_CREATE 0 /* Create a new net-device interface. */
409 #define CMSG_NETIF_BE_DESTROY 1 /* Destroy a net-device interface. */
410 #define CMSG_NETIF_BE_CONNECT 2 /* Connect i/f to remote driver. */
411 #define CMSG_NETIF_BE_DISCONNECT 3 /* Disconnect i/f from remote driver. */
412 #define CMSG_NETIF_BE_CREDITLIMIT 4 /* Limit i/f to a given credit limit. */
414 /* Messages to domain controller. */
415 #define CMSG_NETIF_BE_DRIVER_STATUS 32
418 * Message request/response definitions for net-device messages.
421 /* Non-specific 'okay' return. */
422 #define NETIF_BE_STATUS_OKAY 0
423 /* Non-specific 'error' return. */
424 #define NETIF_BE_STATUS_ERROR 1
425 /* The following are specific error returns. */
426 #define NETIF_BE_STATUS_INTERFACE_EXISTS 2
427 #define NETIF_BE_STATUS_INTERFACE_NOT_FOUND 3
428 #define NETIF_BE_STATUS_INTERFACE_CONNECTED 4
429 #define NETIF_BE_STATUS_OUT_OF_MEMORY 5
430 #define NETIF_BE_STATUS_MAPPING_ERROR 6
432 /* This macro can be used to create an array of descriptive error strings. */
433 #define NETIF_BE_STATUS_ERRORS { \
435 "Non-specific error", \
436 "Interface already exists", \
437 "Interface not found", \
438 "Interface is still connected", \
440 "Could not map domain memory" }
443 * CMSG_NETIF_BE_CREATE:
444 * When the driver sends a successful response then the interface is fully
445 * created. The controller will send a DOWN notification to the front-end
450 domid_t domid; /* 0: Domain attached to new interface. */
452 u32 netif_handle; /* 4: Domain-specific interface handle. */
455 u8 be_mac[6]; /* 16 */
459 } PACKED netif_be_create_t; /* 28 bytes */
462 * CMSG_NETIF_BE_DESTROY:
463 * When the driver sends a successful response then the interface is fully
464 * torn down. The controller will send a DESTROYED notification to the
469 domid_t domid; /* 0: Identify interface to be destroyed. */
471 u32 netif_handle; /* 4: ...ditto... */
474 } PACKED netif_be_destroy_t; /* 12 bytes */
477 * CMSG_NETIF_BE_CREDITLIMIT:
478 * Limit a virtual interface to "credit_bytes" bytes per "period_usec"
483 domid_t domid; /* 0: Domain attached to new interface. */
485 u32 netif_handle; /* 4: Domain-specific interface handle. */
486 u32 credit_bytes; /* 8: Vifs credit of bytes per period. */
487 u32 period_usec; /* 12: Credit replenishment period. */
490 } PACKED netif_be_creditlimit_t; /* 20 bytes */
493 * CMSG_NETIF_BE_CONNECT:
494 * When the driver sends a successful response then the interface is fully
495 * connected. The controller will send a CONNECTED notification to the
500 domid_t domid; /* 0: Domain attached to new interface. */
502 u32 netif_handle; /* 4: Domain-specific interface handle. */
503 memory_t tx_shmem_frame; /* 8: Page cont. tx shared comms window. */
505 memory_t rx_shmem_frame; /* 16: Page cont. rx shared comms window. */
507 u16 evtchn; /* 24: Event channel for notifications. */
511 } PACKED netif_be_connect_t; /* 32 bytes */
514 * CMSG_NETIF_BE_DISCONNECT:
515 * When the driver sends a successful response then the interface is fully
516 * disconnected. The controller will send a DOWN notification to the front-end
521 domid_t domid; /* 0: Domain attached to new interface. */
523 u32 netif_handle; /* 4: Domain-specific interface handle. */
526 } PACKED netif_be_disconnect_t; /* 12 bytes */
529 * CMSG_NETIF_BE_DRIVER_STATUS:
530 * Notify the domain controller that the back-end driver is DOWN or UP.
531 * If the driver goes DOWN while interfaces are still UP, the domain
532 * will automatically send DOWN notifications.
535 u32 status; /* 0: NETIF_DRIVER_STATUS_??? */
536 } PACKED netif_be_driver_status_t; /* 4 bytes */
540 /******************************************************************************
541 * USB-INTERFACE FRONTEND DEFINITIONS
544 /* Messages from domain controller to guest. */
545 #define CMSG_USBIF_FE_INTERFACE_STATUS_CHANGED 0
547 /* Messages from guest to domain controller. */
548 #define CMSG_USBIF_FE_DRIVER_STATUS_CHANGED 32
549 #define CMSG_USBIF_FE_INTERFACE_CONNECT 33
550 #define CMSG_USBIF_FE_INTERFACE_DISCONNECT 34
552 * CMSG_USBIF_FE_INTERFACE_STATUS_CHANGED:
553 * Notify a guest about a status change on one of its block interfaces.
554 * If the interface is DESTROYED or DOWN then the interface is disconnected:
555 * 1. The shared-memory frame is available for reuse.
556 * 2. Any unacknowledged messages pending on the interface were dropped.
558 #define USBIF_INTERFACE_STATUS_DESTROYED 0 /* Interface doesn't exist. */
559 #define USBIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
560 #define USBIF_INTERFACE_STATUS_CONNECTED 2 /* Exists and is connected. */
563 u16 evtchn; /* 4: (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
564 domid_t domid; /* 6: status != BLKIF_INTERFACE_STATUS_DESTROYED */
565 u32 bandwidth; /* 8 */
566 u32 num_ports; /* 12 */
567 } PACKED usbif_fe_interface_status_changed_t; /* 12 bytes */
570 * CMSG_USBIF_FE_DRIVER_STATUS_CHANGED:
571 * Notify the domain controller that the front-end driver is DOWN or UP.
572 * When the driver goes DOWN then the controller will send no more
573 * status-change notifications.
574 * If the driver goes DOWN while interfaces are still UP, the domain
575 * will automatically take the interfaces DOWN.
577 * NB. The controller should not send an INTERFACE_STATUS_CHANGED message
578 * for interfaces that are active when it receives an UP notification. We
579 * expect that the frontend driver will query those interfaces itself.
581 #define USBIF_DRIVER_STATUS_DOWN 0
582 #define USBIF_DRIVER_STATUS_UP 1
585 u32 status; /* 0: USBIF_DRIVER_STATUS_??? */
586 } PACKED usbif_fe_driver_status_changed_t; /* 4 bytes */
589 * CMSG_USBIF_FE_INTERFACE_CONNECT:
590 * If successful, the domain controller will acknowledge with a
591 * STATUS_CONNECTED message.
595 memory_t shmem_frame; /* 8 */
597 } PACKED usbif_fe_interface_connect_t; /* 16 bytes */
600 * CMSG_BLKIF_FE_INTERFACE_DISCONNECT:
601 * If successful, the domain controller will acknowledge with a
602 * STATUS_DISCONNECTED message.
604 typedef struct {} PACKED usbif_fe_interface_disconnect_t; /* 4 bytes */
607 /******************************************************************************
608 * USB-INTERFACE BACKEND DEFINITIONS
611 /* Messages from domain controller. */
612 #define CMSG_USBIF_BE_CREATE 0 /* Create a new block-device interface. */
613 #define CMSG_USBIF_BE_DESTROY 1 /* Destroy a block-device interface. */
614 #define CMSG_USBIF_BE_CONNECT 2 /* Connect i/f to remote driver. */
615 #define CMSG_USBIF_BE_DISCONNECT 3 /* Disconnect i/f from remote driver. */
616 #define CMSG_USBIF_BE_CLAIM_PORT 4 /* Claim host port for a domain. */
617 #define CMSG_USBIF_BE_RELEASE_PORT 5 /* Release host port. */
618 /* Messages to domain controller. */
619 #define CMSG_USBIF_BE_DRIVER_STATUS_CHANGED 32
621 /* Non-specific 'okay' return. */
622 #define USBIF_BE_STATUS_OKAY 0
623 /* Non-specific 'error' return. */
624 #define USBIF_BE_STATUS_ERROR 1
625 /* The following are specific error returns. */
626 #define USBIF_BE_STATUS_INTERFACE_EXISTS 2
627 #define USBIF_BE_STATUS_INTERFACE_NOT_FOUND 3
628 #define USBIF_BE_STATUS_INTERFACE_CONNECTED 4
629 #define USBIF_BE_STATUS_OUT_OF_MEMORY 7
630 #define USBIF_BE_STATUS_MAPPING_ERROR 9
632 /* This macro can be used to create an array of descriptive error strings. */
633 #define USBIF_BE_STATUS_ERRORS { \
635 "Non-specific error", \
636 "Interface already exists", \
637 "Interface not found", \
638 "Interface is still connected", \
640 "Could not map domain memory" }
643 * CMSG_USBIF_BE_CREATE:
644 * When the driver sends a successful response then the interface is fully
645 * created. The controller will send a DOWN notification to the front-end
650 domid_t domid; /* 0: Domain attached to new interface. */
654 } PACKED usbif_be_create_t; /* 12 bytes */
657 * CMSG_USBIF_BE_DESTROY:
658 * When the driver sends a successful response then the interface is fully
659 * torn down. The controller will send a DESTROYED notification to the
664 domid_t domid; /* 0: Identify interface to be destroyed. */
668 } PACKED usbif_be_destroy_t; /* 12 bytes */
671 * CMSG_USBIF_BE_CONNECT:
672 * When the driver sends a successful response then the interface is fully
673 * connected. The controller will send a CONNECTED notification to the
678 domid_t domid; /* 0: Domain attached to new interface. */
680 memory_t shmem_frame; /* 8: Page cont. shared comms window. */
682 u32 evtchn; /* 16: Event channel for notifications. */
683 u32 bandwidth; /* 20: Bandwidth allocated for isoch / int - us
684 * per 1ms frame (ie between 0 and 900 or 800
685 * depending on USB version). */
688 } PACKED usbif_be_connect_t; /* 28 bytes */
691 * CMSG_USBIF_BE_DISCONNECT:
692 * When the driver sends a successful response then the interface is fully
693 * disconnected. The controller will send a DOWN notification to the front-end
698 domid_t domid; /* 0: Domain attached to new interface. */
702 } PACKED usbif_be_disconnect_t; /* 12 bytes */
705 * CMSG_USBIF_BE_DRIVER_STATUS_CHANGED:
706 * Notify the domain controller that the back-end driver is DOWN or UP.
707 * If the driver goes DOWN while interfaces are still UP, the controller
708 * will automatically send DOWN notifications.
711 u32 status; /* 0: USBIF_DRIVER_STATUS_??? */
712 } PACKED usbif_be_driver_status_changed_t; /* 4 bytes */
714 #define USB_PATH_LEN 16
717 * CMSG_USBIF_BE_CLAIM_PORT:
718 * Instruct the backend driver to claim any device plugged into the specified
719 * host port and to allow the specified domain to control that port.
724 domid_t domid; /* 0: which domain */
725 u32 usbif_port; /* 6: port on the virtual root hub */
726 u32 status; /* 10: status of operation */
727 char path[USB_PATH_LEN]; /* Currently specified in the Linux style - may need to be
728 * converted to some OS-independent format at some stage. */
729 } PACKED usbif_be_claim_port_t;
732 * CMSG_USBIF_BE_RELEASE_PORT:
733 * Instruct the backend driver to release any device plugged into the specified
738 char path[USB_PATH_LEN];
739 } PACKED usbif_be_release_port_t;
741 /******************************************************************************
742 * SHUTDOWN DEFINITIONS
746 * Subtypes for shutdown messages.
748 #define CMSG_SHUTDOWN_POWEROFF 0 /* Clean shutdown (SHUTDOWN_poweroff). */
749 #define CMSG_SHUTDOWN_REBOOT 1 /* Clean shutdown (SHUTDOWN_reboot). */
750 #define CMSG_SHUTDOWN_SUSPEND 2 /* Create suspend info, then */
751 /* SHUTDOWN_suspend. */
752 #define CMSG_SHUTDOWN_SYSRQ 3
755 char key; /* 0: sysrq key */
756 char __pad[3]; /* 1: */
757 } PACKED shutdown_sysrq_t; /* 4 bytes */
759 /******************************************************************************
763 #define CMSG_MEM_REQUEST_SET 0 /* Request a domain to set its mem footprint. */
767 * Request that the domain change its memory reservation.
771 u32 target; /* 0: Target memory reservation in pages. */
773 u32 status; /* 4: Return code indicates success or failure. */
774 } PACKED mem_request_t; /* 8 bytes */
777 #endif /* __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__ */