]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Staging: hv: Move the contents of vmbus_packet_format.h to hyperv.h
authorK. Y. Srinivasan <kys@microsoft.com>
Fri, 13 May 2011 02:34:20 +0000 (19:34 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 17 May 2011 18:46:15 +0000 (11:46 -0700)
Move the contents of vmbus_packet_format.h to hyperv.h

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/channel_mgmt.h
drivers/staging/hv/hv_kvp.c
drivers/staging/hv/hv_mouse.c
drivers/staging/hv/hv_util.c
drivers/staging/hv/hyperv.h
drivers/staging/hv/netvsc.h
drivers/staging/hv/storvsc.c
drivers/staging/hv/vmbus_packet_format.h [deleted file]

index 4025a595979702fc756a20d6cb423a1ed8cd3573..6405bfc8f5ed24e39370c7140cf08ac9040b51c8 100644 (file)
@@ -30,7 +30,6 @@
 #include <linux/workqueue.h>
 #include <linux/completion.h>
 #include "hyperv.h"
-#include "vmbus_packet_format.h"
 
 /* Version 1 messages */
 enum vmbus_channel_message_type {
index f9e3716947689a7740de0f6f63477bc56211a62e..42cf83339836624cd5b35697d096e285d7d56764 100644 (file)
@@ -31,7 +31,6 @@
 #include "logging.h"
 #include "hv_api.h"
 #include "vmbus.h"
-#include "vmbus_packet_format.h"
 #include "channel.h"
 #include "vmbus_private.h"
 #include "vmbus_api.h"
index d8f82d531e17bf58690e3657c23be45b009c60d3..960f11a7f9aded90812a69dfeefaf116e6bd8324 100644 (file)
@@ -32,7 +32,6 @@
 #include "vmbus.h"
 #include "vmbus_api.h"
 #include "channel.h"
-#include "vmbus_packet_format.h"
 
 
 /*
index 45d4a07958b01d31ffcacfb4b3f54d2241b0f981..7196908f3768f590bf0a992bc4edde76459086c6 100644 (file)
@@ -33,7 +33,6 @@
 #include "logging.h"
 #include "hv_api.h"
 #include "vmbus.h"
-#include "vmbus_packet_format.h"
 #include "channel.h"
 #include "vmbus_private.h"
 #include "vmbus_api.h"
index 5810f816e319e8988ac3ab8057f407c311c019f8..4ca22c60767fe20f62fc427fe2ce0916aced0381 100644 (file)
@@ -184,5 +184,138 @@ struct vmbus_channel_offer {
 #define VMBUS_CHANNEL_PARENT_OFFER                     0x200
 #define VMBUS_CHANNEL_REQUEST_MONITORED_NOTIFICATION   0x400
 
+struct vmpacket_descriptor {
+       u16 type;
+       u16 offset8;
+       u16 len8;
+       u16 flags;
+       u64 trans_id;
+} __packed;
+
+struct vmpacket_header {
+       u32 prev_pkt_start_offset;
+       struct vmpacket_descriptor descriptor;
+} __packed;
+
+struct vmtransfer_page_range {
+       u32 byte_count;
+       u32 byte_offset;
+} __packed;
+
+struct vmtransfer_page_packet_header {
+       struct vmpacket_descriptor d;
+       u16 xfer_pageset_id;
+       bool sender_owns_set;
+       u8 reserved;
+       u32 range_cnt;
+       struct vmtransfer_page_range ranges[1];
+} __packed;
+
+struct vmgpadl_packet_header {
+       struct vmpacket_descriptor d;
+       u32 gpadl;
+       u32 reserved;
+} __packed;
+
+struct vmadd_remove_transfer_page_set {
+       struct vmpacket_descriptor d;
+       u32 gpadl;
+       u16 xfer_pageset_id;
+       u16 reserved;
+} __packed;
+
+/*
+ * This structure defines a range in guest physical space that can be made to
+ * look virtually contiguous.
+ */
+struct gpa_range {
+       u32 byte_count;
+       u32 byte_offset;
+       u64 pfn_array[0];
+};
+
+/*
+ * This is the format for an Establish Gpadl packet, which contains a handle by
+ * which this GPADL will be known and a set of GPA ranges associated with it.
+ * This can be converted to a MDL by the guest OS.  If there are multiple GPA
+ * ranges, then the resulting MDL will be "chained," representing multiple VA
+ * ranges.
+ */
+struct vmestablish_gpadl {
+       struct vmpacket_descriptor d;
+       u32 gpadl;
+       u32 range_cnt;
+       struct gpa_range range[1];
+} __packed;
+
+/*
+ * This is the format for a Teardown Gpadl packet, which indicates that the
+ * GPADL handle in the Establish Gpadl packet will never be referenced again.
+ */
+struct vmteardown_gpadl {
+       struct vmpacket_descriptor d;
+       u32 gpadl;
+       u32 reserved;   /* for alignment to a 8-byte boundary */
+} __packed;
+
+/*
+ * This is the format for a GPA-Direct packet, which contains a set of GPA
+ * ranges, in addition to commands and/or data.
+ */
+struct vmdata_gpa_direct {
+       struct vmpacket_descriptor d;
+       u32 reserved;
+       u32 range_cnt;
+       struct gpa_range range[1];
+} __packed;
+
+/* This is the format for a Additional Data Packet. */
+struct vmadditional_data {
+       struct vmpacket_descriptor d;
+       u64 total_bytes;
+       u32 offset;
+       u32 byte_cnt;
+       unsigned char data[1];
+} __packed;
+
+union vmpacket_largest_possible_header {
+       struct vmpacket_descriptor simple_hdr;
+       struct vmtransfer_page_packet_header xfer_page_hdr;
+       struct vmgpadl_packet_header gpadl_hdr;
+       struct vmadd_remove_transfer_page_set add_rm_xfer_page_hdr;
+       struct vmestablish_gpadl establish_gpadl_hdr;
+       struct vmteardown_gpadl teardown_gpadl_hdr;
+       struct vmdata_gpa_direct data_gpa_direct_hdr;
+};
+
+#define VMPACKET_DATA_START_ADDRESS(__packet)  \
+       (void *)(((unsigned char *)__packet) +  \
+        ((struct vmpacket_descriptor)__packet)->offset8 * 8)
+
+#define VMPACKET_DATA_LENGTH(__packet)         \
+       ((((struct vmpacket_descriptor)__packet)->len8 -        \
+         ((struct vmpacket_descriptor)__packet)->offset8) * 8)
+
+#define VMPACKET_TRANSFER_MODE(__packet)       \
+       (((struct IMPACT)__packet)->type)
+
+enum vmbus_packet_type {
+       VM_PKT_INVALID                          = 0x0,
+       VM_PKT_SYNCH                            = 0x1,
+       VM_PKT_ADD_XFER_PAGESET                 = 0x2,
+       VM_PKT_RM_XFER_PAGESET                  = 0x3,
+       VM_PKT_ESTABLISH_GPADL                  = 0x4,
+       VM_PKT_TEARDOWN_GPADL                   = 0x5,
+       VM_PKT_DATA_INBAND                      = 0x6,
+       VM_PKT_DATA_USING_XFER_PAGES            = 0x7,
+       VM_PKT_DATA_USING_GPADL                 = 0x8,
+       VM_PKT_DATA_USING_GPA_DIRECT            = 0x9,
+       VM_PKT_CANCEL_REQUEST                   = 0xa,
+       VM_PKT_COMP                             = 0xb,
+       VM_PKT_DATA_USING_ADDITIONAL_PKT        = 0xc,
+       VM_PKT_ADDITIONAL_DATA                  = 0xd
+};
+
+#define VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED    1
 
 #endif /* _HYPERV_H */
index 75516cb3169b92bf27a3df589fc6ba4358beccfc..76fce46c7936296c9ead5551c11f7e0d7939ab09 100644 (file)
@@ -26,7 +26,6 @@
 #define _NETVSC_H_
 
 #include <linux/list.h>
-#include "vmbus_packet_format.h"
 #include "hyperv.h"
 #include "netvsc_api.h"
 
index 4ffcf5f3bcf2ac94c242beb9e9059e86e47fca0b..10a0859d2cac2ba7909b4aebe1908b8ac7b1ef53 100644 (file)
@@ -32,7 +32,6 @@
 #include "hv_api.h"
 #include "logging.h"
 #include "storvsc_api.h"
-#include "vmbus_packet_format.h"
 #include "vstorage.h"
 #include "channel.h"
 
diff --git a/drivers/staging/hv/vmbus_packet_format.h b/drivers/staging/hv/vmbus_packet_format.h
deleted file mode 100644 (file)
index c0b2c2b..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- *
- * Copyright (c) 2009, Microsoft Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope 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.
- *
- * Authors:
- *   Haiyang Zhang <haiyangz@microsoft.com>
- *   Hank Janssen  <hjanssen@microsoft.com>
- *
- */
-
-#ifndef _VMBUSPACKETFORMAT_H_
-#define _VMBUSPACKETFORMAT_H_
-
-struct vmpacket_descriptor {
-       u16 type;
-       u16 offset8;
-       u16 len8;
-       u16 flags;
-       u64 trans_id;
-} __packed;
-
-struct vmpacket_header {
-       u32 prev_pkt_start_offset;
-       struct vmpacket_descriptor descriptor;
-} __packed;
-
-struct vmtransfer_page_range {
-       u32 byte_count;
-       u32 byte_offset;
-} __packed;
-
-struct vmtransfer_page_packet_header {
-       struct vmpacket_descriptor d;
-       u16 xfer_pageset_id;
-       bool sender_owns_set;
-       u8 reserved;
-       u32 range_cnt;
-       struct vmtransfer_page_range ranges[1];
-} __packed;
-
-struct vmgpadl_packet_header {
-       struct vmpacket_descriptor d;
-       u32 gpadl;
-       u32 reserved;
-} __packed;
-
-struct vmadd_remove_transfer_page_set {
-       struct vmpacket_descriptor d;
-       u32 gpadl;
-       u16 xfer_pageset_id;
-       u16 reserved;
-} __packed;
-
-/*
- * This structure defines a range in guest physical space that can be made to
- * look virtually contiguous.
- */
-struct gpa_range {
-       u32 byte_count;
-       u32 byte_offset;
-       u64 pfn_array[0];
-};
-
-/*
- * This is the format for an Establish Gpadl packet, which contains a handle by
- * which this GPADL will be known and a set of GPA ranges associated with it.
- * This can be converted to a MDL by the guest OS.  If there are multiple GPA
- * ranges, then the resulting MDL will be "chained," representing multiple VA
- * ranges.
- */
-struct vmestablish_gpadl {
-       struct vmpacket_descriptor d;
-       u32 gpadl;
-       u32 range_cnt;
-       struct gpa_range range[1];
-} __packed;
-
-/*
- * This is the format for a Teardown Gpadl packet, which indicates that the
- * GPADL handle in the Establish Gpadl packet will never be referenced again.
- */
-struct vmteardown_gpadl {
-       struct vmpacket_descriptor d;
-       u32 gpadl;
-       u32 reserved;   /* for alignment to a 8-byte boundary */
-} __packed;
-
-/*
- * This is the format for a GPA-Direct packet, which contains a set of GPA
- * ranges, in addition to commands and/or data.
- */
-struct vmdata_gpa_direct {
-       struct vmpacket_descriptor d;
-       u32 reserved;
-       u32 range_cnt;
-       struct gpa_range range[1];
-} __packed;
-
-/* This is the format for a Additional Data Packet. */
-struct vmadditional_data {
-       struct vmpacket_descriptor d;
-       u64 total_bytes;
-       u32 offset;
-       u32 byte_cnt;
-       unsigned char data[1];
-} __packed;
-
-union vmpacket_largest_possible_header {
-       struct vmpacket_descriptor simple_hdr;
-       struct vmtransfer_page_packet_header xfer_page_hdr;
-       struct vmgpadl_packet_header gpadl_hdr;
-       struct vmadd_remove_transfer_page_set add_rm_xfer_page_hdr;
-       struct vmestablish_gpadl establish_gpadl_hdr;
-       struct vmteardown_gpadl teardown_gpadl_hdr;
-       struct vmdata_gpa_direct data_gpa_direct_hdr;
-};
-
-#define VMPACKET_DATA_START_ADDRESS(__packet)  \
-       (void *)(((unsigned char *)__packet) +  \
-        ((struct vmpacket_descriptor)__packet)->offset8 * 8)
-
-#define VMPACKET_DATA_LENGTH(__packet)         \
-       ((((struct vmpacket_descriptor)__packet)->len8 -        \
-         ((struct vmpacket_descriptor)__packet)->offset8) * 8)
-
-#define VMPACKET_TRANSFER_MODE(__packet)       \
-       (((struct IMPACT)__packet)->type)
-
-enum vmbus_packet_type {
-       VM_PKT_INVALID                          = 0x0,
-       VM_PKT_SYNCH                            = 0x1,
-       VM_PKT_ADD_XFER_PAGESET                 = 0x2,
-       VM_PKT_RM_XFER_PAGESET                  = 0x3,
-       VM_PKT_ESTABLISH_GPADL                  = 0x4,
-       VM_PKT_TEARDOWN_GPADL                   = 0x5,
-       VM_PKT_DATA_INBAND                      = 0x6,
-       VM_PKT_DATA_USING_XFER_PAGES            = 0x7,
-       VM_PKT_DATA_USING_GPADL                 = 0x8,
-       VM_PKT_DATA_USING_GPA_DIRECT            = 0x9,
-       VM_PKT_CANCEL_REQUEST                   = 0xa,
-       VM_PKT_COMP                             = 0xb,
-       VM_PKT_DATA_USING_ADDITIONAL_PKT        = 0xc,
-       VM_PKT_ADDITIONAL_DATA                  = 0xd
-};
-
-#define VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED    1
-
-#endif