[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[win-pv-devel] [PATCH 2/4] Make XENBUS_CONSOLE interface available to other drivers



This patch adds the interface to the set of that may be queried via the
PDO.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
 include/revision.h  | 16 +++++++++-------
 src/coinst/coinst.c |  2 +-
 src/xenbus/fdo.h    |  7 +++++++
 src/xenbus/pdo.c    | 16 ++++++++++++++--
 4 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/include/revision.h b/include/revision.h
index 5e39e20..2aa7dc5 100644
--- a/include/revision.h
+++ b/include/revision.h
@@ -41,14 +41,16 @@
 // R  - XENBUS_RANGE_SET_INTERFACE
 // C  - XENBUS_CACHE_INTERFACE
 // G  - XENBUS_GNTTAB_INTERFACE
+// U  - XENBUS_UNPLUG_INTERFACE
+// CO - XENBUS_CONSOLE_INTERFACE
 // EM - XENFILT_EMULATED_INTERFACE
 
-//                    REVISION   S  SI   E   D  ST   R   C   G   U  EM
-#define DEFINE_REVISION_TABLE                                               \
-    DEFINE_REVISION(0x08000009,  1,  2,  4,  1,  1,  1,  1,  1,  1,  1),    \
-    DEFINE_REVISION(0x0800000A,  1,  2,  5,  1,  1,  1,  1,  1,  1,  1),    \
-    DEFINE_REVISION(0x0800000B,  1,  2,  5,  1,  2,  1,  1,  2,  1,  1),    \
-    DEFINE_REVISION(0x09000000,  1,  2,  5,  1,  2,  1,  1,  2,  1,  1),    \
-    DEFINE_REVISION(0x09000001,  1,  2,  6,  1,  2,  1,  1,  2,  1,  1)
+//                    REVISION   S  SI   E   D  ST   R   C   G   U  CO  EM
+#define DEFINE_REVISION_TABLE                                                \
+    DEFINE_REVISION(0x08000009,  1,  2,  4,  1,  1,  1,  1,  1,  1,  0,  1), \
+    DEFINE_REVISION(0x0800000A,  1,  2,  5,  1,  1,  1,  1,  1,  1,  0,  1), \
+    DEFINE_REVISION(0x0800000B,  1,  2,  5,  1,  2,  1,  1,  2,  1,  0,  1), \
+    DEFINE_REVISION(0x09000000,  1,  2,  5,  1,  2,  1,  1,  2,  1,  0,  1), \
+    DEFINE_REVISION(0x09000001,  1,  2,  6,  1,  2,  1,  1,  2,  1,  1,  1)
 
 #endif  // _REVISION_H
diff --git a/src/coinst/coinst.c b/src/coinst/coinst.c
index 89d52d0..f19d108 100644
--- a/src/coinst/coinst.c
+++ b/src/coinst/coinst.c
@@ -981,7 +981,7 @@ fail1:
     return FALSE;
 }
 
-#define DEFINE_REVISION(_N, _S, _SI, _E, _D, _ST, _R, _C, _G, _U, _EM) \
+#define DEFINE_REVISION(_N, _S, _SI, _E, _D, _ST, _R, _C, _G, _U, _CO, _EM) \
     (_N)
 
 static DWORD    DeviceRevision[] = {
diff --git a/src/xenbus/fdo.h b/src/xenbus/fdo.h
index 9e9b599..90f81ac 100644
--- a/src/xenbus/fdo.h
+++ b/src/xenbus/fdo.h
@@ -259,6 +259,13 @@ FdoGetUnplugContext(
     IN  PXENBUS_FDO Fdo
     );
 
+#include "console.h"
+
+extern PXENBUS_CONSOLE_CONTEXT
+FdoGetConsoleContext(
+    IN  PXENBUS_FDO Fdo
+    );
+
 extern NTSTATUS
 FdoDispatch(
     IN  PXENBUS_FDO Fdo,
diff --git a/src/xenbus/pdo.c b/src/xenbus/pdo.c
index 48ba84e..efd29dc 100644
--- a/src/xenbus/pdo.c
+++ b/src/xenbus/pdo.c
@@ -363,11 +363,12 @@ typedef struct _XENBUS_PDO_REVISION {
     ULONG   CacheInterfaceVersion;
     ULONG   GnttabInterfaceVersion;
     ULONG   UnplugInterfaceVersion;
+    ULONG   ConsoleInterfaceVersion;
     ULONG   EmulatedInterfaceVersion;
 } XENBUS_PDO_REVISION, *PXENBUS_PDO_REVISION;
 
-#define DEFINE_REVISION(_N, _S, _SI, _E, _D, _ST, _R, _C, _G, _U, _EM) \
-    { (_N), (_S), (_SI), (_E), (_D), (_ST), (_R), (_C), (_G), (_U), (_EM) }
+#define DEFINE_REVISION(_N, _S, _SI, _E, _D, _ST, _R, _C, _G, _U, _CO, _EM) \
+    { (_N), (_S), (_SI), (_E), (_D), (_ST), (_R), (_C), (_G), (_U), (_CO), 
(_EM) }
 
 static XENBUS_PDO_REVISION PdoRevision[] = {
     DEFINE_REVISION_TABLE
@@ -432,6 +433,13 @@ PdoDumpRevisions(
         ASSERT(IMPLY(Index == ARRAYSIZE(PdoRevision) - 1,
                      Revision->UnplugInterfaceVersion == 
XENBUS_UNPLUG_INTERFACE_VERSION_MAX));
 
+        ASSERT(IMPLY(Revision->ConsoleInterfaceVersion != 0,
+                     Revision->ConsoleInterfaceVersion >= 
XENBUS_CONSOLE_INTERFACE_VERSION_MIN));
+        ASSERT(IMPLY(Revision->ConsoleInterfaceVersion != 0,
+                     Revision->ConsoleInterfaceVersion <= 
XENBUS_CONSOLE_INTERFACE_VERSION_MAX));
+        ASSERT(IMPLY(Index == ARRAYSIZE(PdoRevision) - 1,
+                     Revision->ConsoleInterfaceVersion == 
XENBUS_CONSOLE_INTERFACE_VERSION_MAX));
+
         ASSERT3U(Revision->EmulatedInterfaceVersion, >=, 
XENFILT_EMULATED_INTERFACE_VERSION_MIN);
         ASSERT3U(Revision->EmulatedInterfaceVersion, <=, 
XENFILT_EMULATED_INTERFACE_VERSION_MAX);
         ASSERT(IMPLY(Index == ARRAYSIZE(PdoRevision) - 1,
@@ -447,6 +455,7 @@ PdoDumpRevisions(
              "CACHE v%u "
              "GNTTAB v%u "
              "UNPLUG v%u "
+             "CONSOLE v%u "
              "EMULATED v%u\n",
              Revision->Number,
              Revision->SuspendInterfaceVersion,
@@ -458,6 +467,7 @@ PdoDumpRevisions(
              Revision->CacheInterfaceVersion,
              Revision->GnttabInterfaceVersion,
              Revision->UnplugInterfaceVersion,
+             Revision->ConsoleInterfaceVersion,
              Revision->EmulatedInterfaceVersion);
     }
 }
@@ -1023,6 +1033,7 @@ DEFINE_PDO_QUERY_INTERFACE(RangeSet)
 DEFINE_PDO_QUERY_INTERFACE(Cache)
 DEFINE_PDO_QUERY_INTERFACE(Gnttab)
 DEFINE_PDO_QUERY_INTERFACE(Unplug)
+DEFINE_PDO_QUERY_INTERFACE(Console)
 
 struct _INTERFACE_ENTRY {
     const GUID  *Guid;
@@ -1041,6 +1052,7 @@ static struct _INTERFACE_ENTRY PdoInterfaceTable[] = {
     { &GUID_XENBUS_CACHE_INTERFACE, "CACHE_INTERFACE", PdoQueryCacheInterface 
},
     { &GUID_XENBUS_GNTTAB_INTERFACE, "GNTTAB_INTERFACE", 
PdoQueryGnttabInterface },
     { &GUID_XENBUS_UNPLUG_INTERFACE, "UNPLUG_INTERFACE", 
PdoQueryUnplugInterface },
+    { &GUID_XENBUS_CONSOLE_INTERFACE, "CONSOLE_INTERFACE", 
PdoQueryConsoleInterface },
     { &GUID_XENFILT_EMULATED_INTERFACE, "EMULATED_INTERFACE", PdoDelegateIrp },
     { NULL, NULL, NULL }
 };
-- 
2.5.3


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.