]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
Staging: hv: rename VmbusApi.h to vmbus_api.h
authorGreg Kroah-Hartman <gregkh@suse.de>
Thu, 6 May 2010 05:43:02 +0000 (22:43 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 11 May 2010 18:36:17 +0000 (11:36 -0700)
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/VmbusApi.h [deleted file]
drivers/staging/hv/VmbusPrivate.h
drivers/staging/hv/channel_interface.h
drivers/staging/hv/hv_utils.c
drivers/staging/hv/netvsc_api.h
drivers/staging/hv/storvsc_api.h
drivers/staging/hv/vmbus.h
drivers/staging/hv/vmbus_api.h [new file with mode: 0644]

diff --git a/drivers/staging/hv/VmbusApi.h b/drivers/staging/hv/VmbusApi.h
deleted file mode 100644 (file)
index 4275be3..0000000
+++ /dev/null
@@ -1,193 +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 _VMBUS_API_H_
-#define _VMBUS_API_H_
-
-#define MAX_PAGE_BUFFER_COUNT                          16
-#define MAX_MULTIPAGE_BUFFER_COUNT                     32 /* 128K */
-
-#pragma pack(push, 1)
-
-/* Single-page buffer */
-struct hv_page_buffer {
-       u32 Length;
-       u32 Offset;
-       u64 Pfn;
-};
-
-/* Multiple-page buffer */
-struct hv_multipage_buffer {
-       /* Length and Offset determines the # of pfns in the array */
-       u32 Length;
-       u32 Offset;
-       u64 PfnArray[MAX_MULTIPAGE_BUFFER_COUNT];
-};
-
-/* 0x18 includes the proprietary packet header */
-#define MAX_PAGE_BUFFER_PACKET         (0x18 +                 \
-                                       (sizeof(struct hv_page_buffer) * \
-                                        MAX_PAGE_BUFFER_COUNT))
-#define MAX_MULTIPAGE_BUFFER_PACKET    (0x18 +                 \
-                                        sizeof(struct hv_multipage_buffer))
-
-
-#pragma pack(pop)
-
-struct hv_driver;
-struct hv_device;
-
-struct hv_dev_port_info {
-       u32 InterruptMask;
-       u32 ReadIndex;
-       u32 WriteIndex;
-       u32 BytesAvailToRead;
-       u32 BytesAvailToWrite;
-};
-
-struct hv_device_info {
-       u32 ChannelId;
-       u32 ChannelState;
-       struct hv_guid ChannelType;
-       struct hv_guid ChannelInstance;
-
-       u32 MonitorId;
-       u32 ServerMonitorPending;
-       u32 ServerMonitorLatency;
-       u32 ServerMonitorConnectionId;
-       u32 ClientMonitorPending;
-       u32 ClientMonitorLatency;
-       u32 ClientMonitorConnectionId;
-
-       struct hv_dev_port_info Inbound;
-       struct hv_dev_port_info Outbound;
-};
-
-/**
- * struct vmbus_channel_interface - Contains member functions for vmbus channel
- * @Open:      Open the channel
- * @Close:     Close the channel
- * @SendPacket:        Send a packet over the channel
- * @SendPacketPageBuffer:      Send a single page buffer over the channel
- * @SendPacketMultiPageBuffer: Send a multiple page buffers
- * @RecvPacket:        Receive packet
- * @RecvPacketRaw:     Receive Raw packet
- * @EstablishGpadl:    Set up GPADL for ringbuffer
- * @TeardownGpadl:     Teardown GPADL for ringbuffer
- * @GetInfo:   Get info about the channel
- *
- * This structure contains function pointer to control vmbus channel
- * behavior. None of these functions is externally callable, but they
- * are used for normal vmbus channel internal behavior.
- * Only used by Hyper-V drivers.
- */
-struct vmbus_channel_interface {
-       int (*Open)(struct hv_device *Device, u32 SendBufferSize,
-                   u32 RecvRingBufferSize, void *UserData, u32 UserDataLen,
-                   void (*ChannelCallback)(void *context),
-                   void *Context);
-       void (*Close)(struct hv_device *device);
-       int (*SendPacket)(struct hv_device *Device, const void *Buffer,
-                         u32 BufferLen, u64 RequestId, u32 Type, u32 Flags);
-       int (*SendPacketPageBuffer)(struct hv_device *dev,
-                                   struct hv_page_buffer PageBuffers[],
-                                   u32 PageCount, void *Buffer, u32 BufferLen,
-                                   u64 RequestId);
-       int (*SendPacketMultiPageBuffer)(struct hv_device *device,
-                                        struct hv_multipage_buffer *mpb,
-                                        void *Buffer,
-                                        u32 BufferLen,
-                                        u64 RequestId);
-       int (*RecvPacket)(struct hv_device *dev, void *buf, u32 buflen,
-                         u32 *BufferActualLen, u64 *RequestId);
-       int (*RecvPacketRaw)(struct hv_device *dev, void *buf, u32 buflen,
-                            u32 *BufferActualLen, u64 *RequestId);
-       int (*EstablishGpadl)(struct hv_device *dev, void *buf, u32 buflen,
-                             u32 *GpadlHandle);
-       int (*TeardownGpadl)(struct hv_device *device, u32 GpadlHandle);
-       void (*GetInfo)(struct hv_device *dev, struct hv_device_info *devinfo);
-};
-
-/* Base driver object */
-struct hv_driver {
-       const char *name;
-
-       /* the device type supported by this driver */
-       struct hv_guid deviceType;
-
-       int (*OnDeviceAdd)(struct hv_device *device, void *data);
-       int (*OnDeviceRemove)(struct hv_device *device);
-       void (*OnCleanup)(struct hv_driver *driver);
-
-       struct vmbus_channel_interface VmbusChannelInterface;
-};
-
-/* Base device object */
-struct hv_device {
-       /* the driver for this device */
-       struct hv_driver *Driver;
-
-       char name[64];
-
-       /* the device type id of this device */
-       struct hv_guid deviceType;
-
-       /* the device instance id of this device */
-       struct hv_guid deviceInstance;
-
-       void *context;
-
-       /* Device extension; */
-       void *Extension;
-};
-
-/* Vmbus driver object */
-struct vmbus_driver {
-       /* !! Must be the 1st field !! */
-       /* FIXME if ^, then someone is doing somthing stupid */
-       struct hv_driver Base;
-
-       /* Set by the caller */
-       struct hv_device * (*OnChildDeviceCreate)(struct hv_guid *DeviceType,
-                                               struct hv_guid *DeviceInstance,
-                                               void *Context);
-       void (*OnChildDeviceDestroy)(struct hv_device *device);
-       int (*OnChildDeviceAdd)(struct hv_device *RootDevice,
-                               struct hv_device *ChildDevice);
-       void (*OnChildDeviceRemove)(struct hv_device *device);
-
-       /* Set by the callee */
-       int (*OnIsr)(struct hv_driver *driver);
-       void (*OnMsgDpc)(struct hv_driver *driver);
-       void (*OnEventDpc)(struct hv_driver *driver);
-       void (*GetChannelOffers)(void);
-
-       void (*GetChannelInterface)(struct vmbus_channel_interface *i);
-       void (*GetChannelInfo)(struct hv_device *dev,
-                              struct hv_device_info *devinfo);
-};
-
-int VmbusInitialize(struct hv_driver *drv);
-
-#endif /* _VMBUS_API_H_ */
index 57a116ca87168435ff3a02d7cf4c020fc3e6e48e..588c667a7f6b1350bcad2021c133adf9a20871d3 100644 (file)
@@ -26,7 +26,7 @@
 #define _VMBUS_PRIVATE_H_
 
 #include "hv.h"
-#include "VmbusApi.h"
+#include "vmbus_api.h"
 #include "channel.h"
 #include "channel_mgmt.h"
 #include "channel_interface.h"
index 27b7a253b7114d0613e1b790d51ea1787f576343..6acaf6ce2c48d2c3fe5c6771c77ed9b0c58722ee 100644 (file)
@@ -25,7 +25,7 @@
 #ifndef _CHANNEL_INTERFACE_H_
 #define _CHANNEL_INTERFACE_H_
 
-#include "VmbusApi.h"
+#include "vmbus_api.h"
 
 void GetChannelInterface(struct vmbus_channel_interface *ChannelInterface);
 
index 6ccaea27d75a72dd86295875ac83320682860922..d6f6dfa036711db763c7b6e42d793bc861c8a2b1 100644 (file)
@@ -33,7 +33,7 @@
 #include "VersionInfo.h"
 #include "channel.h"
 #include "VmbusPrivate.h"
-#include "VmbusApi.h"
+#include "vmbus_api.h"
 #include "utils.h"
 
 
index 91a4cd9965d854f9044c8bc784a9a4f5ca47d1c8..4b5b3ac458c8e75272260514305e8fb527cc4796 100644 (file)
@@ -25,7 +25,7 @@
 #ifndef _NETVSC_API_H_
 #define _NETVSC_API_H_
 
-#include "VmbusApi.h"
+#include "vmbus_api.h"
 
 /* Fwd declaration */
 struct hv_netvsc_packet;
index 126a8588edb160ddc3845c93b74f83b562e683e4..0063bde9a4b23ac22bbaad19d1912518a855c008 100644 (file)
@@ -25,7 +25,7 @@
 #ifndef _STORVSC_API_H_
 #define _STORVSC_API_H_
 
-#include "VmbusApi.h"
+#include "vmbus_api.h"
 
 /* Defines */
 #define STORVSC_RING_BUFFER_SIZE                       (10*PAGE_SIZE)
index 6404b8424beff4e8373fff95b476933f453f2c17..0c6ee0f487f3538384e0d4f2931b2f496b6a01e8 100644 (file)
@@ -26,7 +26,7 @@
 #define _VMBUS_H_
 
 #include <linux/device.h>
-#include "VmbusApi.h"
+#include "vmbus_api.h"
 
 struct driver_context {
        struct hv_guid class_id;
diff --git a/drivers/staging/hv/vmbus_api.h b/drivers/staging/hv/vmbus_api.h
new file mode 100644 (file)
index 0000000..4275be3
--- /dev/null
@@ -0,0 +1,193 @@
+/*
+ *
+ * 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 _VMBUS_API_H_
+#define _VMBUS_API_H_
+
+#define MAX_PAGE_BUFFER_COUNT                          16
+#define MAX_MULTIPAGE_BUFFER_COUNT                     32 /* 128K */
+
+#pragma pack(push, 1)
+
+/* Single-page buffer */
+struct hv_page_buffer {
+       u32 Length;
+       u32 Offset;
+       u64 Pfn;
+};
+
+/* Multiple-page buffer */
+struct hv_multipage_buffer {
+       /* Length and Offset determines the # of pfns in the array */
+       u32 Length;
+       u32 Offset;
+       u64 PfnArray[MAX_MULTIPAGE_BUFFER_COUNT];
+};
+
+/* 0x18 includes the proprietary packet header */
+#define MAX_PAGE_BUFFER_PACKET         (0x18 +                 \
+                                       (sizeof(struct hv_page_buffer) * \
+                                        MAX_PAGE_BUFFER_COUNT))
+#define MAX_MULTIPAGE_BUFFER_PACKET    (0x18 +                 \
+                                        sizeof(struct hv_multipage_buffer))
+
+
+#pragma pack(pop)
+
+struct hv_driver;
+struct hv_device;
+
+struct hv_dev_port_info {
+       u32 InterruptMask;
+       u32 ReadIndex;
+       u32 WriteIndex;
+       u32 BytesAvailToRead;
+       u32 BytesAvailToWrite;
+};
+
+struct hv_device_info {
+       u32 ChannelId;
+       u32 ChannelState;
+       struct hv_guid ChannelType;
+       struct hv_guid ChannelInstance;
+
+       u32 MonitorId;
+       u32 ServerMonitorPending;
+       u32 ServerMonitorLatency;
+       u32 ServerMonitorConnectionId;
+       u32 ClientMonitorPending;
+       u32 ClientMonitorLatency;
+       u32 ClientMonitorConnectionId;
+
+       struct hv_dev_port_info Inbound;
+       struct hv_dev_port_info Outbound;
+};
+
+/**
+ * struct vmbus_channel_interface - Contains member functions for vmbus channel
+ * @Open:      Open the channel
+ * @Close:     Close the channel
+ * @SendPacket:        Send a packet over the channel
+ * @SendPacketPageBuffer:      Send a single page buffer over the channel
+ * @SendPacketMultiPageBuffer: Send a multiple page buffers
+ * @RecvPacket:        Receive packet
+ * @RecvPacketRaw:     Receive Raw packet
+ * @EstablishGpadl:    Set up GPADL for ringbuffer
+ * @TeardownGpadl:     Teardown GPADL for ringbuffer
+ * @GetInfo:   Get info about the channel
+ *
+ * This structure contains function pointer to control vmbus channel
+ * behavior. None of these functions is externally callable, but they
+ * are used for normal vmbus channel internal behavior.
+ * Only used by Hyper-V drivers.
+ */
+struct vmbus_channel_interface {
+       int (*Open)(struct hv_device *Device, u32 SendBufferSize,
+                   u32 RecvRingBufferSize, void *UserData, u32 UserDataLen,
+                   void (*ChannelCallback)(void *context),
+                   void *Context);
+       void (*Close)(struct hv_device *device);
+       int (*SendPacket)(struct hv_device *Device, const void *Buffer,
+                         u32 BufferLen, u64 RequestId, u32 Type, u32 Flags);
+       int (*SendPacketPageBuffer)(struct hv_device *dev,
+                                   struct hv_page_buffer PageBuffers[],
+                                   u32 PageCount, void *Buffer, u32 BufferLen,
+                                   u64 RequestId);
+       int (*SendPacketMultiPageBuffer)(struct hv_device *device,
+                                        struct hv_multipage_buffer *mpb,
+                                        void *Buffer,
+                                        u32 BufferLen,
+                                        u64 RequestId);
+       int (*RecvPacket)(struct hv_device *dev, void *buf, u32 buflen,
+                         u32 *BufferActualLen, u64 *RequestId);
+       int (*RecvPacketRaw)(struct hv_device *dev, void *buf, u32 buflen,
+                            u32 *BufferActualLen, u64 *RequestId);
+       int (*EstablishGpadl)(struct hv_device *dev, void *buf, u32 buflen,
+                             u32 *GpadlHandle);
+       int (*TeardownGpadl)(struct hv_device *device, u32 GpadlHandle);
+       void (*GetInfo)(struct hv_device *dev, struct hv_device_info *devinfo);
+};
+
+/* Base driver object */
+struct hv_driver {
+       const char *name;
+
+       /* the device type supported by this driver */
+       struct hv_guid deviceType;
+
+       int (*OnDeviceAdd)(struct hv_device *device, void *data);
+       int (*OnDeviceRemove)(struct hv_device *device);
+       void (*OnCleanup)(struct hv_driver *driver);
+
+       struct vmbus_channel_interface VmbusChannelInterface;
+};
+
+/* Base device object */
+struct hv_device {
+       /* the driver for this device */
+       struct hv_driver *Driver;
+
+       char name[64];
+
+       /* the device type id of this device */
+       struct hv_guid deviceType;
+
+       /* the device instance id of this device */
+       struct hv_guid deviceInstance;
+
+       void *context;
+
+       /* Device extension; */
+       void *Extension;
+};
+
+/* Vmbus driver object */
+struct vmbus_driver {
+       /* !! Must be the 1st field !! */
+       /* FIXME if ^, then someone is doing somthing stupid */
+       struct hv_driver Base;
+
+       /* Set by the caller */
+       struct hv_device * (*OnChildDeviceCreate)(struct hv_guid *DeviceType,
+                                               struct hv_guid *DeviceInstance,
+                                               void *Context);
+       void (*OnChildDeviceDestroy)(struct hv_device *device);
+       int (*OnChildDeviceAdd)(struct hv_device *RootDevice,
+                               struct hv_device *ChildDevice);
+       void (*OnChildDeviceRemove)(struct hv_device *device);
+
+       /* Set by the callee */
+       int (*OnIsr)(struct hv_driver *driver);
+       void (*OnMsgDpc)(struct hv_driver *driver);
+       void (*OnEventDpc)(struct hv_driver *driver);
+       void (*GetChannelOffers)(void);
+
+       void (*GetChannelInterface)(struct vmbus_channel_interface *i);
+       void (*GetChannelInfo)(struct hv_device *dev,
+                              struct hv_device_info *devinfo);
+};
+
+int VmbusInitialize(struct hv_driver *drv);
+
+#endif /* _VMBUS_API_H_ */