PVUSB update and bugfix: interface header
Subsystems (2)
PATCH 3/3 PVUSB update and bugfix: interface header
Signed-off-by Noboru Iwamatsu <[email protected]>
include/xen/interface/io/usbif.h +38 -8
@@ -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
[email protected]
http://lists.xensource.com/xen-devel