Signed-off-by: Noboru Iwamatsu <n_iwamatsu@xxxxxxxxxxxxxx>
diff -r 4ac3e1d6605c -r 3be939975ad6 include/xen/interface/io/usbif.h
--- a/include/xen/interface/io/usbif.h Tue Sep 29 11:23:06 2009 +0100
+++ b/include/xen/interface/io/usbif.h Tue Oct 06 15:18:27 2009 +0900
@@ -31,6 +31,13 @@
#include "ring.h"
#include "../grant_table.h"
+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
*
@@ -57,21 +64,26 @@
* 10 = control, 11 = bulk)
*/
#define usbif_pipeportnum(pipe) ((pipe) & 0x1f)
-#define usbif_setportnum_pipe(pipe,portnum) \
+#define usbif_setportnum_pipe(pipe, portnum) \
((pipe)|(portnum))
+
#define usbif_pipeunlink(pipe) ((pipe) & 0x20)
+#define usbif_pipesubmit(pipe) (!usbif_pipeunlink(pipe))
#define usbif_setunlink_pipe(pipe) ((pipe)|(0x20))
#define USBIF_BACK_MAX_PENDING_REQS (128)
-#define USBIF_MAX_SEGMENTS_PER_REQUEST (10)
+#define USBIF_MAX_SEGMENTS_PER_REQUEST (16)
+/*
+ * RING for transferring urbs.
+ */
struct usbif_request_segment {
grant_ref_t gref;
uint16_t offset;
uint16_t length;
};
-struct usbif_request {
+struct usbif_urb_request {
uint16_t id; /* request id */
uint16_t nr_buffer_segs; /* number of urb->transfer_buffer segments */
@@ -104,18 +116,36 @@
/* urb data segments */
struct usbif_request_segment seg[USBIF_MAX_SEGMENTS_PER_REQUEST];
};
-typedef struct usbif_request usbif_request_t;
+typedef struct usbif_urb_request usbif_urb_request_t;
-struct usbif_response {
+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_response usbif_response_t;
+typedef struct usbif_urb_response usbif_urb_response_t;
-DEFINE_RING_TYPES(usbif, struct usbif_request, struct usbif_response);
-#define USB_RING_SIZE __RING_SIZE((struct usbif_sring *)0, PAGE_SIZE)
+DEFINE_RING_TYPES(usbif_urb, struct usbif_urb_request, struct
usbif_urb_response);
+#define USB_URB_RING_SIZE __RING_SIZE((struct usbif_urb_sring *)0, PAGE_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 */
+};
+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 __RING_SIZE((struct usbif_conn_sring *)0, PAGE_SIZE)
#endif /* __XEN_PUBLIC_IO_USBIF_H__ */
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|