xen: Import other xen/io/*.h

A Xen public header have been imported into QEMU (by
f65eadb639 "xen: import ring.h from xen"), but there are other header
that depends on ring.h which come from the system when building QEMU.

This patch resolves the issue of having headers from the system
importing a different copie of ring.h.

This patch is prompt by the build issue described in the previous
patch: 'Revert xen/io/ring.h of "Clean up a few header guard symbols"'

ring.h and the new imported headers are moved to
"include/hw/xen/interface" as those describe interfaces with a guest.

The imported headers are cleaned up a bit while importing them: some
part of the file that QEMU doesn't use are removed (description
of how to make hypercall in grant_table.h have been removed).

Other cleanup:
- xen-mapcache.c and xen-legacy-backend.c don't need grant_table.h.
- xenfb.c doesn't need event_channel.h.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Message-Id: <20190621105441.3025-3-anthony.perard@citrix.com>
This commit is contained in:
Anthony PERARD
2019-06-24 10:42:30 +01:00
parent d1744bd321
commit a3434a2d56
18 changed files with 2903 additions and 16 deletions
+2 -2
View File
@@ -13,8 +13,8 @@
#ifndef HW_9PFS_XEN_9PFS_H
#define HW_9PFS_XEN_9PFS_H
#include <xen/io/protocols.h>
#include "hw/xen/io/ring.h"
#include "hw/xen/interface/io/protocols.h"
#include "hw/xen/interface/io/ring.h"
/*
* Do not merge into xen-9p-backend.c: clang doesn't allow unused static
+2 -3
View File
@@ -1,9 +1,8 @@
#ifndef XEN_BLKIF_H
#define XEN_BLKIF_H
#include "hw/xen/io/ring.h"
#include <xen/io/blkif.h>
#include <xen/io/protocols.h>
#include "hw/xen/interface/io/blkif.h"
#include "hw/xen/interface/io/protocols.h"
/*
* Not a real protocol. Used to generate ring structs which contain
+1 -1
View File
@@ -28,7 +28,7 @@
#include "chardev/char-fe.h"
#include "hw/xen/xen-legacy-backend.h"
#include <xen/io/console.h>
#include "hw/xen/interface/io/console.h"
struct buffer {
uint8_t *data;
+3 -4
View File
@@ -32,10 +32,9 @@
#include "ui/console.h"
#include "hw/xen/xen-legacy-backend.h"
#include <xen/event_channel.h>
#include <xen/io/fbif.h>
#include <xen/io/kbdif.h>
#include <xen/io/protocols.h>
#include "hw/xen/interface/io/fbif.h"
#include "hw/xen/interface/io/kbdif.h"
#include "hw/xen/interface/io/protocols.h"
#include "trace.h"
+1 -1
View File
@@ -30,7 +30,7 @@
#include "net/util.h"
#include "hw/xen/xen-legacy-backend.h"
#include <xen/io/netif.h>
#include "hw/xen/interface/io/netif.h"
/* ------------------------------------------------------------- */
+1 -2
View File
@@ -32,8 +32,7 @@
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
#include "hw/xen/io/ring.h"
#include <xen/io/usbif.h>
#include "hw/xen/interface/io/usbif.h"
/*
* Check for required support of usbif.h: USBIF_SHORT_NOT_OK was the last
-2
View File
@@ -34,8 +34,6 @@
#include "hw/xen/xen_pvdev.h"
#include "monitor/qdev.h"
#include <xen/grant_table.h>
DeviceState *xen_sysdev;
BusState *xen_sysbus;
+36
View File
@@ -0,0 +1,36 @@
/******************************************************************************
* grant_table.h
*
* Interface for granting foreign access to page frames, and receiving
* page-ownership transfers.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Copyright (c) 2004, K A Fraser
*/
#ifndef __XEN_PUBLIC_GRANT_TABLE_H__
#define __XEN_PUBLIC_GRANT_TABLE_H__
/*
* Reference to a grant entry in a specified domain's grant table.
*/
typedef uint32_t grant_ref_t;
#endif /* __XEN_PUBLIC_GRANT_TABLE_H__ */
File diff suppressed because it is too large Load Diff
+46
View File
@@ -0,0 +1,46 @@
/******************************************************************************
* console.h
*
* Console I/O interface for Xen guest OSes.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Copyright (c) 2005, Keir Fraser
*/
#ifndef __XEN_PUBLIC_IO_CONSOLE_H__
#define __XEN_PUBLIC_IO_CONSOLE_H__
typedef uint32_t XENCONS_RING_IDX;
#define MASK_XENCONS_IDX(idx, ring) ((idx) & (sizeof(ring)-1))
struct xencons_interface {
char in[1024];
char out[2048];
XENCONS_RING_IDX in_cons, in_prod;
XENCONS_RING_IDX out_cons, out_prod;
};
#ifdef XEN_WANT_FLEX_CONSOLE_RING
#include "ring.h"
DEFINE_XEN_FLEX_RING(xencons);
#endif
#endif /* __XEN_PUBLIC_IO_CONSOLE_H__ */
+156
View File
@@ -0,0 +1,156 @@
/*
* fbif.h -- Xen virtual frame buffer device
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Copyright (C) 2005 Anthony Liguori <aliguori@us.ibm.com>
* Copyright (C) 2006 Red Hat, Inc., Markus Armbruster <armbru@redhat.com>
*/
#ifndef __XEN_PUBLIC_IO_FBIF_H__
#define __XEN_PUBLIC_IO_FBIF_H__
/* Out events (frontend -> backend) */
/*
* Out events may be sent only when requested by backend, and receipt
* of an unknown out event is an error.
*/
/* Event type 1 currently not used */
/*
* Framebuffer update notification event
* Capable frontend sets feature-update in xenstore.
* Backend requests it by setting request-update in xenstore.
*/
#define XENFB_TYPE_UPDATE 2
struct xenfb_update
{
uint8_t type; /* XENFB_TYPE_UPDATE */
int32_t x; /* source x */
int32_t y; /* source y */
int32_t width; /* rect width */
int32_t height; /* rect height */
};
/*
* Framebuffer resize notification event
* Capable backend sets feature-resize in xenstore.
*/
#define XENFB_TYPE_RESIZE 3
struct xenfb_resize
{
uint8_t type; /* XENFB_TYPE_RESIZE */
int32_t width; /* width in pixels */
int32_t height; /* height in pixels */
int32_t stride; /* stride in bytes */
int32_t depth; /* depth in bits */
int32_t offset; /* offset of the framebuffer in bytes */
};
#define XENFB_OUT_EVENT_SIZE 40
union xenfb_out_event
{
uint8_t type;
struct xenfb_update update;
struct xenfb_resize resize;
char pad[XENFB_OUT_EVENT_SIZE];
};
/* In events (backend -> frontend) */
/*
* Frontends should ignore unknown in events.
*/
/*
* Framebuffer refresh period advice
* Backend sends it to advise the frontend their preferred period of
* refresh. Frontends that keep the framebuffer constantly up-to-date
* just ignore it. Frontends that use the advice should immediately
* refresh the framebuffer (and send an update notification event if
* those have been requested), then use the update frequency to guide
* their periodical refreshs.
*/
#define XENFB_TYPE_REFRESH_PERIOD 1
#define XENFB_NO_REFRESH 0
struct xenfb_refresh_period
{
uint8_t type; /* XENFB_TYPE_UPDATE_PERIOD */
uint32_t period; /* period of refresh, in ms,
* XENFB_NO_REFRESH if no refresh is needed */
};
#define XENFB_IN_EVENT_SIZE 40
union xenfb_in_event
{
uint8_t type;
struct xenfb_refresh_period refresh_period;
char pad[XENFB_IN_EVENT_SIZE];
};
/* shared page */
#define XENFB_IN_RING_SIZE 1024
#define XENFB_IN_RING_LEN (XENFB_IN_RING_SIZE / XENFB_IN_EVENT_SIZE)
#define XENFB_IN_RING_OFFS 1024
#define XENFB_IN_RING(page) \
((union xenfb_in_event *)((char *)(page) + XENFB_IN_RING_OFFS))
#define XENFB_IN_RING_REF(page, idx) \
(XENFB_IN_RING((page))[(idx) % XENFB_IN_RING_LEN])
#define XENFB_OUT_RING_SIZE 2048
#define XENFB_OUT_RING_LEN (XENFB_OUT_RING_SIZE / XENFB_OUT_EVENT_SIZE)
#define XENFB_OUT_RING_OFFS (XENFB_IN_RING_OFFS + XENFB_IN_RING_SIZE)
#define XENFB_OUT_RING(page) \
((union xenfb_out_event *)((char *)(page) + XENFB_OUT_RING_OFFS))
#define XENFB_OUT_RING_REF(page, idx) \
(XENFB_OUT_RING((page))[(idx) % XENFB_OUT_RING_LEN])
struct xenfb_page
{
uint32_t in_cons, in_prod;
uint32_t out_cons, out_prod;
int32_t width; /* the width of the framebuffer (in pixels) */
int32_t height; /* the height of the framebuffer (in pixels) */
uint32_t line_length; /* the length of a row of pixels (in bytes) */
uint32_t mem_length; /* the length of the framebuffer (in bytes) */
uint8_t depth; /* the depth of a pixel (in bits) */
/*
* Framebuffer page directory
*
* Each directory page holds PAGE_SIZE / sizeof(*pd)
* framebuffer pages, and can thus map up to PAGE_SIZE *
* PAGE_SIZE / sizeof(*pd) bytes. With PAGE_SIZE == 4096 and
* sizeof(unsigned long) == 4/8, that's 4 Megs 32 bit and 2 Megs
* 64 bit. 256 directories give enough room for a 512 Meg
* framebuffer with a max resolution of 12,800x10,240. Should
* be enough for a while with room leftover for expansion.
*/
unsigned long pd[256];
};
#endif
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+42
View File
@@ -0,0 +1,42 @@
/******************************************************************************
* protocols.h
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Copyright (c) 2008, Keir Fraser
*/
#ifndef __XEN_PROTOCOLS_H__
#define __XEN_PROTOCOLS_H__
#define XEN_IO_PROTO_ABI_X86_32 "x86_32-abi"
#define XEN_IO_PROTO_ABI_X86_64 "x86_64-abi"
#define XEN_IO_PROTO_ABI_ARM "arm-abi"
#if defined(__i386__)
# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_32
#elif defined(__x86_64__)
# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_64
#elif defined(__arm__) || defined(__aarch64__)
# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_ARM
#else
# error arch fixup needed here
#endif
#endif
+254
View File
@@ -0,0 +1,254 @@
/*
* usbif.h
*
* USB I/O interface for Xen guest OSes.
*
* Copyright (C) 2009, FUJITSU LABORATORIES LTD.
* Author: Noboru Iwamatsu <n_iwamatsu@jp.fujitsu.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef __XEN_PUBLIC_IO_USBIF_H__
#define __XEN_PUBLIC_IO_USBIF_H__
#include "ring.h"
#include "../grant_table.h"
/*
* Feature and Parameter Negotiation
* =================================
* The two halves of a Xen pvUSB driver utilize nodes within the XenStore to
* communicate capabilities and to negotiate operating parameters. This
* section enumerates these nodes which reside in the respective front and
* backend portions of the XenStore, following the XenBus convention.
*
* Any specified default value is in effect if the corresponding XenBus node
* is not present in the XenStore.
*
* XenStore nodes in sections marked "PRIVATE" are solely for use by the
* driver side whose XenBus tree contains them.
*
*****************************************************************************
* Backend XenBus Nodes
*****************************************************************************
*
*------------------ Backend Device Identification (PRIVATE) ------------------
*
* num-ports
* Values: unsigned [1...31]
*
* Number of ports for this (virtual) USB host connector.
*
* usb-ver
* Values: unsigned [1...2]
*
* USB version of this host connector: 1 = USB 1.1, 2 = USB 2.0.
*
* port/[1...31]
* Values: string
*
* Physical USB device connected to the given port, e.g. "3-1.5".
*
*****************************************************************************
* Frontend XenBus Nodes
*****************************************************************************
*
*----------------------- Request Transport Parameters -----------------------
*
* event-channel
* Values: unsigned
*
* The identifier of the Xen event channel used to signal activity
* in the ring buffer.
*
* urb-ring-ref
* Values: unsigned
*
* The Xen grant reference granting permission for the backend to map
* the sole page in a single page sized ring buffer. This is the ring
* buffer for urb requests.
*
* conn-ring-ref
* Values: unsigned
*
* The Xen grant reference granting permission for the backend to map
* the sole page in a single page sized ring buffer. This is the ring
* buffer for connection/disconnection requests.
*
* protocol
* Values: string (XEN_IO_PROTO_ABI_*)
* Default Value: XEN_IO_PROTO_ABI_NATIVE
*
* The machine ABI rules governing the format of all ring request and
* response structures.
*
*/
enum usb_spec_version {
USB_VER_UNKNOWN = 0,
USB_VER_USB11,
USB_VER_USB20,
USB_VER_USB30, /* not supported yet */
};
/*
* USB pipe in usbif_request
*
* - port number: bits 0-4
* (USB_MAXCHILDREN is 31)
*
* - operation flag: bit 5
* (0 = submit urb,
* 1 = unlink urb)
*
* - direction: bit 7
* (0 = Host-to-Device [Out]
* 1 = Device-to-Host [In])
*
* - device address: bits 8-14
*
* - endpoint: bits 15-18
*
* - pipe type: bits 30-31
* (00 = isochronous, 01 = interrupt,
* 10 = control, 11 = bulk)
*/
#define USBIF_PIPE_PORT_MASK 0x0000001f
#define USBIF_PIPE_UNLINK 0x00000020
#define USBIF_PIPE_DIR 0x00000080
#define USBIF_PIPE_DEV_MASK 0x0000007f
#define USBIF_PIPE_DEV_SHIFT 8
#define USBIF_PIPE_EP_MASK 0x0000000f
#define USBIF_PIPE_EP_SHIFT 15
#define USBIF_PIPE_TYPE_MASK 0x00000003
#define USBIF_PIPE_TYPE_SHIFT 30
#define USBIF_PIPE_TYPE_ISOC 0
#define USBIF_PIPE_TYPE_INT 1
#define USBIF_PIPE_TYPE_CTRL 2
#define USBIF_PIPE_TYPE_BULK 3
#define usbif_pipeportnum(pipe) ((pipe) & USBIF_PIPE_PORT_MASK)
#define usbif_setportnum_pipe(pipe, portnum) ((pipe) | (portnum))
#define usbif_pipeunlink(pipe) ((pipe) & USBIF_PIPE_UNLINK)
#define usbif_pipesubmit(pipe) (!usbif_pipeunlink(pipe))
#define usbif_setunlink_pipe(pipe) ((pipe) | USBIF_PIPE_UNLINK)
#define usbif_pipein(pipe) ((pipe) & USBIF_PIPE_DIR)
#define usbif_pipeout(pipe) (!usbif_pipein(pipe))
#define usbif_pipedevice(pipe) \
(((pipe) >> USBIF_PIPE_DEV_SHIFT) & USBIF_PIPE_DEV_MASK)
#define usbif_pipeendpoint(pipe) \
(((pipe) >> USBIF_PIPE_EP_SHIFT) & USBIF_PIPE_EP_MASK)
#define usbif_pipetype(pipe) \
(((pipe) >> USBIF_PIPE_TYPE_SHIFT) & USBIF_PIPE_TYPE_MASK)
#define usbif_pipeisoc(pipe) (usbif_pipetype(pipe) == USBIF_PIPE_TYPE_ISOC)
#define usbif_pipeint(pipe) (usbif_pipetype(pipe) == USBIF_PIPE_TYPE_INT)
#define usbif_pipectrl(pipe) (usbif_pipetype(pipe) == USBIF_PIPE_TYPE_CTRL)
#define usbif_pipebulk(pipe) (usbif_pipetype(pipe) == USBIF_PIPE_TYPE_BULK)
#define USBIF_MAX_SEGMENTS_PER_REQUEST (16)
#define USBIF_MAX_PORTNR 31
#define USBIF_RING_SIZE 4096
/*
* RING for transferring urbs.
*/
struct usbif_request_segment {
grant_ref_t gref;
uint16_t offset;
uint16_t length;
};
struct usbif_urb_request {
uint16_t id; /* request id */
uint16_t nr_buffer_segs; /* number of urb->transfer_buffer segments */
/* basic urb parameter */
uint32_t pipe;
uint16_t transfer_flags;
#define USBIF_SHORT_NOT_OK 0x0001
uint16_t buffer_length;
union {
uint8_t ctrl[8]; /* setup_packet (Ctrl) */
struct {
uint16_t interval; /* maximum (1024*8) in usb core */
uint16_t start_frame; /* start frame */
uint16_t number_of_packets; /* number of ISO packet */
uint16_t nr_frame_desc_segs; /* number of iso_frame_desc segments */
} isoc;
struct {
uint16_t interval; /* maximum (1024*8) in usb core */
uint16_t pad[3];
} intr;
struct {
uint16_t unlink_id; /* unlink request id */
uint16_t pad[3];
} unlink;
} u;
/* urb data segments */
struct usbif_request_segment seg[USBIF_MAX_SEGMENTS_PER_REQUEST];
};
typedef struct usbif_urb_request usbif_urb_request_t;
struct usbif_urb_response {
uint16_t id; /* request id */
uint16_t start_frame; /* start frame (ISO) */
int32_t status; /* status (non-ISO) */
int32_t actual_length; /* actual transfer length */
int32_t error_count; /* number of ISO errors */
};
typedef struct usbif_urb_response usbif_urb_response_t;
DEFINE_RING_TYPES(usbif_urb, struct usbif_urb_request, struct usbif_urb_response);
#define USB_URB_RING_SIZE __CONST_RING_SIZE(usbif_urb, USBIF_RING_SIZE)
/*
* RING for notifying connect/disconnect events to frontend
*/
struct usbif_conn_request {
uint16_t id;
};
typedef struct usbif_conn_request usbif_conn_request_t;
struct usbif_conn_response {
uint16_t id; /* request id */
uint8_t portnum; /* port number */
uint8_t speed; /* usb_device_speed */
#define USBIF_SPEED_NONE 0
#define USBIF_SPEED_LOW 1
#define USBIF_SPEED_FULL 2
#define USBIF_SPEED_HIGH 3
};
typedef struct usbif_conn_response usbif_conn_response_t;
DEFINE_RING_TYPES(usbif_conn, struct usbif_conn_request, struct usbif_conn_response);
#define USB_CONN_RING_SIZE __CONST_RING_SIZE(usbif_conn, USBIF_RING_SIZE)
#endif /* __XEN_PUBLIC_IO_USBIF_H__ */
+70
View File
@@ -0,0 +1,70 @@
/*****************************************************************************
* xenbus.h
*
* Xenbus protocol details.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Copyright (C) 2005 XenSource Ltd.
*/
#ifndef _XEN_PUBLIC_IO_XENBUS_H
#define _XEN_PUBLIC_IO_XENBUS_H
/*
* The state of either end of the Xenbus, i.e. the current communication
* status of initialisation across the bus. States here imply nothing about
* the state of the connection between the driver and the kernel's device
* layers.
*/
enum xenbus_state {
XenbusStateUnknown = 0,
XenbusStateInitialising = 1,
/*
* InitWait: Finished early initialisation but waiting for information
* from the peer or hotplug scripts.
*/
XenbusStateInitWait = 2,
/*
* Initialised: Waiting for a connection from the peer.
*/
XenbusStateInitialised = 3,
XenbusStateConnected = 4,
/*
* Closing: The device is being closed due to an error or an unplug event.
*/
XenbusStateClosing = 5,
XenbusStateClosed = 6,
/*
* Reconfiguring: The device is being reconfigured.
*/
XenbusStateReconfiguring = 7,
XenbusStateReconfigured = 8
};
typedef enum xenbus_state XenbusState;
#endif /* _XEN_PUBLIC_IO_XENBUS_H */
+1 -1
View File
@@ -12,7 +12,7 @@
#include <xenctrl.h>
#include <xenstore.h>
#include <xen/io/xenbus.h>
#include "hw/xen/interface/io/xenbus.h"
#include "hw/hw.h"
#include "hw/xen/xen.h"