Drivers: hv: Save and export negotiated vmbus version
authorK. Y. Srinivasan <kys@microsoft.com>
Sat, 1 Dec 2012 14:46:41 +0000 (06:46 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jan 2013 19:34:36 +0000 (11:34 -0800)
Export the negotiated vmbus version as this may be useful for
individual drivers.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/connection.c
include/linux/hyperv.h

index 2b56a3f47b30e8f0558b5309b114aa5899e4a2da..70ea5d1fc16c375876022ef62dfe22dafb4f0c77 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/hyperv.h>
+#include <linux/export.h>
 #include <asm/hyperv.h>
 #include "hyperv_vmbus.h"
 
@@ -54,6 +55,12 @@ struct vmbus_connection vmbus_connection = {
 
 #define VERSION_INVAL -1
 
+/*
+ * Negotiated protocol version with the host.
+ */
+__u32 vmbus_proto_version;
+EXPORT_SYMBOL_GPL(vmbus_proto_version);
+
 static __u32 vmbus_get_next_version(__u32 current_version)
 {
        switch (current_version) {
@@ -215,6 +222,8 @@ int vmbus_connect(void)
        if (version == VERSION_INVAL)
                goto cleanup;
 
+       vmbus_proto_version = version;
+       pr_info("Negotiated host information %d\n", version);
        kfree(msginfo);
        return 0;
 
index bee559ada3bb559a521585b51ab4c34c34c1ae5a..134a2022a7a3ce629cd6f0b4b21c90107c34c433 100644 (file)
@@ -1204,5 +1204,11 @@ int hv_kvp_init(struct hv_util_service *);
 void hv_kvp_deinit(void);
 void hv_kvp_onchannelcallback(void *);
 
+/*
+ * Negotiated version with the Host.
+ */
+
+extern __u32 vmbus_proto_version;
+
 #endif /* __KERNEL__ */
 #endif /* _HYPERV_H */
This page took 0.0321 seconds and 5 git commands to generate.