Skip to contentSkip to conversation

REV 2 USB virt 2.6 split driver---xenidc channel

PATCH New harry 1 participant 1 message Nov 25, 2005

lore
Share & tools
lore

harry

author
#0 lore raw

PATCH 6/17 REV 2 USB virt 2.6 split driver---xenidc channel

This patch defines an abstract interface for an interdomain message channel. This interface is implemented using xenbus and grant-tables by the xenidc_xbgt_channel; one of which, together with a xenidc_gateway, makes up the xenidc_endpoint used by the USB driver as the transport for its interdomain protocol.

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_channel_ring.h new file +58 -0
diff -r 7c011e163562 -r 961eaf493021 linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_channel_ring.h
@@ -0,0 +1,58 @@
+/*****************************************************************************/
+/* Xen inter-domain communication channel ring structure definitions.        */
+/*                                                                           */
+/* Copyright (c) 2005 Harry Butterworth IBM Corporation                      */
+/*                                                                           */
+/* This program is free software; you can redistribute it and/or modify it   */
+/* under the terms of the GNU General Public License as published by the     */
+/* Free Software Foundation; either version 2 of the License, or (at your    */
+/* option) any later version.                                                */
+/*                                                                           */
+/* This program is distributed in the hope that it will be useful, but       */
+/* WITHOUT ANY WARRANTY; without even the implied warranty of                */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General */
+/* Public License for more details.                                          */
+/*                                                                           */
+/* You should have received a copy of the GNU General Public License along   */
+/* with this program; if not, write to the Free Software Foundation, Inc.,   */
+/* 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                   */
+/*                                                                           */
+/*****************************************************************************/
+
+#ifndef _XENIDC_CHANNEL_RING_H
+#define _XENIDC_CHANNEL_RING_H
+
+#include <linux/types.h>
+
+/* The ring consists of two pages, one provided by each side mapped rw into  */
+/* the provider's address space and ro into the other side's address space.  */
+/* Each page contains a header with wrapping buffer offsets in it. The       */
+/* remainder of the page is used as a wrapping buffer. One of the offsets in */
+/* the header refers to the wrapping buffer in the same page as the header,  */
+/* the other one refers to the wrapping buffer in the other page.  This is   */
+/* because the offsets which a side updates need to be in the page for which */
+/* that side has write access.                                               */
+/* The offets are zero initially which indicates the start of the wrapping   */
+/* buffer (at the first byte after the header).                              */
+/*                                                                           */
+/* I chose this ring structure because it is symmetrical and if the ring     */
+/* gets corrupted (by a scribbler for example) it will be easier to isolate  */
+/* the problem to a domain.                                                  */
+
+struct xenidc_channel_ring_header {
+	u16 this_ring_producer_offset;
+	u16 other_ring_consumer_offset;
+};
+
+/* Elements in the ring are variable length and all start with a header      */
+/* which indicates how long they are.  The next element starts directly      */
+/* afterwards irrespective of byte alignment.  Elements may span the wrap    */
+/* around point of the buffer.  The local buffer reference code is used to   */
+/* copy into and out of the wrapping buffers so none of this is a problem.   */
+
+struct xenidc_channel_ring_element_header {
+	u16 length;
+	u8 reserved1[6];
+};
+
+#endif
linux-2.6-xen-sparse/include/asm-xen/xenidc_channel.h new file +178 -0

178 lines not on this page · raw message

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