aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/hv/Vmbus.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2009-08-31 17:37:58 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 12:02:01 -0700
commitb3bfb3cecfef142a0caf49fbb85a1d5a056f5c16 (patch)
tree99eaa9f880d6c737d234a774c7ffd5e8f24035d8 /drivers/staging/hv/Vmbus.c
parentStaging: hv: coding style cleanups on Vmbus.c (diff)
downloadlinux-dev-b3bfb3cecfef142a0caf49fbb85a1d5a056f5c16.tar.xz
linux-dev-b3bfb3cecfef142a0caf49fbb85a1d5a056f5c16.zip
Staging: hv: code reduction from Vmbus.c
Reorder some functions to get rid of all of the forward declarations. Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/hv/Vmbus.c')
-rw-r--r--drivers/staging/hv/Vmbus.c109
1 files changed, 49 insertions, 60 deletions
diff --git a/drivers/staging/hv/Vmbus.c b/drivers/staging/hv/Vmbus.c
index 0377155a0fdd..a4dd06f6d459 100644
--- a/drivers/staging/hv/Vmbus.c
+++ b/drivers/staging/hv/Vmbus.c
@@ -51,66 +51,6 @@ static const struct hv_guid gVmbusDeviceId = {
static struct hv_driver *gDriver; /* vmbus driver object */
static struct hv_device *gDevice; /* vmbus root device */
-static void VmbusGetChannelInterface(struct vmbus_channel_interface *Interface);
-static void VmbusGetChannelInfo(struct hv_device *DeviceObject,
- struct hv_device_info *DeviceInfo);
-static void VmbusGetChannelOffers(void);
-static int VmbusOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo);
-static int VmbusOnDeviceRemove(struct hv_device *dev);
-static void VmbusOnCleanup(struct hv_driver *drv);
-static int VmbusOnISR(struct hv_driver *drv);
-static void VmbusOnMsgDPC(struct hv_driver *drv);
-static void VmbusOnEventDPC(struct hv_driver *drv);
-
-/**
- * VmbusInitialize - Main entry point
- */
-int VmbusInitialize(struct hv_driver *drv)
-{
- struct vmbus_driver *driver = (struct vmbus_driver *)drv;
- int ret;
-
- DPRINT_ENTER(VMBUS);
-
- DPRINT_INFO(VMBUS, "+++++++ Build Date=%s %s +++++++",
- VersionDate, VersionTime);
- DPRINT_INFO(VMBUS, "+++++++ Build Description=%s +++++++",
- VersionDesc);
- DPRINT_INFO(VMBUS, "+++++++ Vmbus supported version = %d +++++++",
- VMBUS_REVISION_NUMBER);
- DPRINT_INFO(VMBUS, "+++++++ Vmbus using SINT %d +++++++",
- VMBUS_MESSAGE_SINT);
- DPRINT_DBG(VMBUS, "sizeof(VMBUS_CHANNEL_PACKET_PAGE_BUFFER)=%zd, "
- "sizeof(VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER)=%zd",
- sizeof(struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER),
- sizeof(struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER));
-
- drv->name = gDriverName;
- memcpy(&drv->deviceType, &gVmbusDeviceType, sizeof(struct hv_guid));
-
- /* Setup dispatch table */
- driver->Base.OnDeviceAdd = VmbusOnDeviceAdd;
- driver->Base.OnDeviceRemove = VmbusOnDeviceRemove;
- driver->Base.OnCleanup = VmbusOnCleanup;
- driver->OnIsr = VmbusOnISR;
- driver->OnMsgDpc = VmbusOnMsgDPC;
- driver->OnEventDpc = VmbusOnEventDPC;
- driver->GetChannelOffers = VmbusGetChannelOffers;
- driver->GetChannelInterface = VmbusGetChannelInterface;
- driver->GetChannelInfo = VmbusGetChannelInfo;
-
- /* Hypervisor initialization...setup hypercall page..etc */
- ret = HvInit();
- if (ret != 0)
- DPRINT_ERR(VMBUS, "Unable to initialize the hypervisor - 0x%x",
- ret);
- gDriver = drv;
-
- DPRINT_EXIT(VMBUS);
-
- return ret;
-}
-
/**
* VmbusGetChannelOffers - Retrieve the channel offers from the parent partition
*/
@@ -320,3 +260,52 @@ static int VmbusOnISR(struct hv_driver *drv)
DPRINT_EXIT(VMBUS);
return ret;
}
+
+/**
+ * VmbusInitialize - Main entry point
+ */
+int VmbusInitialize(struct hv_driver *drv)
+{
+ struct vmbus_driver *driver = (struct vmbus_driver *)drv;
+ int ret;
+
+ DPRINT_ENTER(VMBUS);
+
+ DPRINT_INFO(VMBUS, "+++++++ Build Date=%s %s +++++++",
+ VersionDate, VersionTime);
+ DPRINT_INFO(VMBUS, "+++++++ Build Description=%s +++++++",
+ VersionDesc);
+ DPRINT_INFO(VMBUS, "+++++++ Vmbus supported version = %d +++++++",
+ VMBUS_REVISION_NUMBER);
+ DPRINT_INFO(VMBUS, "+++++++ Vmbus using SINT %d +++++++",
+ VMBUS_MESSAGE_SINT);
+ DPRINT_DBG(VMBUS, "sizeof(VMBUS_CHANNEL_PACKET_PAGE_BUFFER)=%zd, "
+ "sizeof(VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER)=%zd",
+ sizeof(struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER),
+ sizeof(struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER));
+
+ drv->name = gDriverName;
+ memcpy(&drv->deviceType, &gVmbusDeviceType, sizeof(struct hv_guid));
+
+ /* Setup dispatch table */
+ driver->Base.OnDeviceAdd = VmbusOnDeviceAdd;
+ driver->Base.OnDeviceRemove = VmbusOnDeviceRemove;
+ driver->Base.OnCleanup = VmbusOnCleanup;
+ driver->OnIsr = VmbusOnISR;
+ driver->OnMsgDpc = VmbusOnMsgDPC;
+ driver->OnEventDpc = VmbusOnEventDPC;
+ driver->GetChannelOffers = VmbusGetChannelOffers;
+ driver->GetChannelInterface = VmbusGetChannelInterface;
+ driver->GetChannelInfo = VmbusGetChannelInfo;
+
+ /* Hypervisor initialization...setup hypercall page..etc */
+ ret = HvInit();
+ if (ret != 0)
+ DPRINT_ERR(VMBUS, "Unable to initialize the hypervisor - 0x%x",
+ ret);
+ gDriver = drv;
+
+ DPRINT_EXIT(VMBUS);
+
+ return ret;
+}