Skip to contentSkip to conversation

REV 2 USB virt 2.6 split driver---USB interdomain protocol

PATCH New harry 1 participant 1 message Nov 30, 2005

lore
Share & tools
lore

harry

author
#0 lore raw

PATCH 14/17 REV 2 USB virt 2.6 split driver---USB interdomain protocol

This patch picks up all the fixes to the previous 13 patches that were required to get the code working now that the last four patches are reformatted and I'm able to test the code again. These fixes will go into the correct patches if I do another revision.

Aside from the fixes, this patch defines the USB interdomain protocol which consists of a number of transactions and a message sent using the xenidc_endpoint code.

This protocol is a direct translation of the 2.4 protocol and uses polling for device detection.

There is an issue with queued commands during error recovery. The queued commands need to be stalled during the unlink process but currently they are not.

Both the polling and the queued commands issues need to be fixed. This may affect the protocol.

The current protocol is good enough for read only access to USB devices and works for read-write access but is not safe for write access during error recovery.

linux-2.6-xen-sparse/drivers/xen/xenidc/Makefile +1 -0
diff -r 9fd760c9e92c -r 0dab7be3b83a linux-2.6-xen-sparse/drivers/xen/xenidc/Makefile
@@ -18,3 +18,4 @@
 xenidc-objs += xenidc_endpoint.o
 xenidc-objs += xenidc_rbr_provider_pool.o
 xenidc-objs += xenidc_rbr_mapper_pool.o
+
linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_buffer_resource_provider.c +1 -1
diff -r 9fd760c9e92c -r 0dab7be3b83a linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_buffer_resource_provider.c
@@ -215,7 +215,7 @@
 {
 	trace();
 	(void)xenidc_buffer_resource_provider_init_or_exit(provider, 1);
-	vfree(provider);
+	kfree(provider);
 }
 
 struct xenidc_buffer_resource_list
linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_rbr_provider_pool.c +0 -1
diff -r 9fd760c9e92c -r 0dab7be3b83a linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_rbr_provider_pool.c
@@ -20,7 +20,6 @@
 /*****************************************************************************/
 
 #include <linux/module.h>
-#include <linux/vmalloc.h>
 #include <asm-xen/xenidc_rbr_provider_pool.h>
 #include "xenidc_trace.h"
 
linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_remote_buffer_reference.c +1 -1
diff -r 9fd760c9e92c -r 0dab7be3b83a linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_remote_buffer_reference.c
@@ -51,7 +51,7 @@
 xenidc_rbr_calculate_map_resources_function *calculate_map_resources,
 xenidc_rbr_map_function *map, xenidc_rbr_unmap_function *unmap)
 {
-	int i = (class->type % XENIDC_RBR_HASH_COUNT);
+	int i = type % XENIDC_RBR_HASH_COUNT;
 	unsigned long flags;
 	trace();
 	xenidc_rbr_init();
linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_vaddress.c +1 -0
diff -r 9fd760c9e92c -r 0dab7be3b83a linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_vaddress.c
@@ -193,6 +193,7 @@
 		read_unlock_irqrestore(&xenidc_vaddress_lock, flags);
 		return;
 	}
+	read_unlock_irqrestore(&xenidc_vaddress_lock, flags);
 	write_lock_irqsave(&xenidc_vaddress_lock, flags);
 	if (initialised) {
 		write_unlock_irqrestore(&xenidc_vaddress_lock, flags);
linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_work.c +1 -0
diff -r 9fd760c9e92c -r 0dab7be3b83a linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_work.c
@@ -79,6 +79,7 @@
 
 EXPORT_SYMBOL(xenidc_work_schedule);
 EXPORT_SYMBOL(xenidc_work_list);
+EXPORT_SYMBOL(xenidc_work_list_lock);
 EXPORT_SYMBOL(xenidc_work_condition);
 EXPORT_SYMBOL(xenidc_work_waitqueue);
 EXPORT_SYMBOL(xenidc_work_wake_up);
linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_xbgt_channel.c +5 -2
diff -r 9fd760c9e92c -r 0dab7be3b83a linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_xbgt_channel.c
@@ -954,9 +954,11 @@
 					(struct xenidc_xbgt_channel *)data;
 	int return_value;
 	unsigned long flags;
-	trace();
 	channel->watch.node = channel->remote_path;
 	channel->watch.callback = xenidc_xbgt_channel_watch;
+	trace_info( "channel:%p, watch.node:%s", channel,
+							channel->watch.node );
+
 	return_value = register_xenbus_watch(&channel->watch);
 	spin_lock_irqsave(&channel->lock, flags);
 	if (return_value == 0) {
@@ -982,7 +984,8 @@
 	struct xenidc_xbgt_channel *channel =
 					(struct xenidc_xbgt_channel *)data;
 	unsigned long flags;
-	trace();
+	trace_info( "channel:%p, watch.node:%s", channel,
+							channel->watch.node );
 	unregister_xenbus_watch(&channel->watch);
 	spin_lock_irqsave(&channel->lock, flags);
 	xenidc_xbgt_channel_handle_stimulus(channel,
linux-2.6-xen-sparse/include/asm-xen/xenidc_endpoint.h +2 -1
diff -r 9fd760c9e92c -r 0dab7be3b83a linux-2.6-xen-sparse/include/asm-xen/xenidc_endpoint.h
@@ -155,7 +155,8 @@
 /* The xenidc_endpoint_transaction contains a struct list_head link which    */
 /* may be used by the current owner of the transaction.                      */
 
-#define XENIDC_ENDPOINT_TRANSACTION_LINK XENIDC_GATEWAY_TRANSACTION_LINK
+#define XENIDC_ENDPOINT_TRANSACTION_LINK \
+gateway_transaction.XENIDC_GATEWAY_TRANSACTION_LINK
 
 static inline struct list_head *
 xenidc_endpoint_transaction_to_link(
linux-2.6-xen-sparse/include/asm-xen/xenidc_work.h +1 -1
diff -r 9fd760c9e92c -r 0dab7be3b83a linux-2.6-xen-sparse/include/asm-xen/xenidc_work.h
@@ -125,7 +125,7 @@
 		while (!list_empty(&xenidc_work_list) && !(condition)) {      \
 			struct xenidc_work *work;			      \
 			work = list_entry(xenidc_work_list.next,	      \
-						struct xenidc_work, link);    \
+						 struct xenidc_work, link);   \
 			list_del_init(&work->link);			      \
 			spin_unlock_irqrestore(&xenidc_work_list_lock, flags);\
 			xenidc_work_perform_synchronously(work);	      \
xen/include/public/io/usbif.h new file +297 -0

297 lines not on this page · raw message

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel