From 6c9e7e719433e4821ed307e3b4434220a6542c26 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 17 Aug 2009 17:23:00 -0700 Subject: [PATCH] --- yaml --- r: 162197 b: refs/heads/master c: f346fdc27384c2dd0f1ffcccb5f701aaf4af75d2 h: refs/heads/master i: 162195: a101318f91bc98d9d43ee5109d9158cbf5073869 v: v3 --- [refs] | 2 +- trunk/drivers/staging/hv/Connection.c | 27 ++----- trunk/drivers/staging/hv/Vmbus.c | 16 ++-- trunk/drivers/staging/hv/VmbusPrivate.h | 103 ++++++++---------------- 4 files changed, 44 insertions(+), 104 deletions(-) diff --git a/[refs] b/[refs] index 4c13c53ea95c..db15c32f0370 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b239549ca6ce78ac46d0c59ac6a5179c46256876 +refs/heads/master: f346fdc27384c2dd0f1ffcccb5f701aaf4af75d2 diff --git a/trunk/drivers/staging/hv/Connection.c b/trunk/drivers/staging/hv/Connection.c index 173643434953..0370a0b01a3f 100644 --- a/trunk/drivers/staging/hv/Connection.c +++ b/trunk/drivers/staging/hv/Connection.c @@ -44,8 +44,7 @@ struct VMBUS_CONNECTION gVmbusConnection = { Sends a connect request on the partition service connection --*/ -static int -VmbusConnect(void) +int VmbusConnect(void) { int ret=0; VMBUS_CHANNEL_MSGINFO *msgInfo=NULL; @@ -203,10 +202,7 @@ VmbusConnect(void) Sends a disconnect request on the partition service connection --*/ -static int -VmbusDisconnect( - void - ) +int VmbusDisconnect(void) { int ret=0; VMBUS_CHANNEL_UNLOAD *msg; @@ -259,10 +255,7 @@ VmbusDisconnect( Get the channel object given its child relative id (ie channel id) --*/ -static VMBUS_CHANNEL* -GetChannelFromRelId( - u32 relId - ) +VMBUS_CHANNEL *GetChannelFromRelId(u32 relId) { VMBUS_CHANNEL* channel; VMBUS_CHANNEL* foundChannel=NULL; @@ -334,10 +327,7 @@ VmbusProcessChannelEvent( Handler for events --*/ -static void -VmbusOnEvents( - void - ) +void VmbusOnEvents(void) { int dword; /* int maxdword = PAGE_SIZE >> 3; // receive size is 1/2 page and divide that by 4 bytes */ @@ -394,11 +384,7 @@ VmbusOnEvents( Send a msg on the vmbus's message connection --*/ -static int -VmbusPostMessage( - void * buffer, - size_t bufferLen - ) +int VmbusPostMessage(void *buffer, size_t bufferLen) { int ret=0; HV_CONNECTION_ID connId; @@ -424,8 +410,7 @@ VmbusPostMessage( Send an event notification to the parent --*/ -static int -VmbusSetEvent(u32 childRelId) +int VmbusSetEvent(u32 childRelId) { int ret=0; diff --git a/trunk/drivers/staging/hv/Vmbus.c b/trunk/drivers/staging/hv/Vmbus.c index 387ceab96413..50d2773053b7 100644 --- a/trunk/drivers/staging/hv/Vmbus.c +++ b/trunk/drivers/staging/hv/Vmbus.c @@ -224,11 +224,9 @@ VmbusGetChannelInfo( --*/ -static struct hv_device* -VmbusChildDeviceCreate( - GUID DeviceType, - GUID DeviceInstance, - void *Context) +struct hv_device *VmbusChildDeviceCreate(GUID DeviceType, + GUID DeviceInstance, + void *Context) { VMBUS_DRIVER_OBJECT* vmbusDriver = (VMBUS_DRIVER_OBJECT*)gDriver; @@ -248,9 +246,7 @@ VmbusChildDeviceCreate( Registers the child device with the vmbus --*/ -static int -VmbusChildDeviceAdd( - struct hv_device *ChildDevice) +int VmbusChildDeviceAdd(struct hv_device *ChildDevice) { VMBUS_DRIVER_OBJECT* vmbusDriver = (VMBUS_DRIVER_OBJECT*)gDriver; @@ -267,9 +263,7 @@ VmbusChildDeviceAdd( Unregisters the child device from the vmbus --*/ -static void -VmbusChildDeviceRemove( - struct hv_device *ChildDevice) +void VmbusChildDeviceRemove(struct hv_device *ChildDevice) { VMBUS_DRIVER_OBJECT* vmbusDriver = (VMBUS_DRIVER_OBJECT*)gDriver; diff --git a/trunk/drivers/staging/hv/VmbusPrivate.h b/trunk/drivers/staging/hv/VmbusPrivate.h index 906736bfd9eb..6b2841866936 100644 --- a/trunk/drivers/staging/hv/VmbusPrivate.h +++ b/trunk/drivers/staging/hv/VmbusPrivate.h @@ -30,28 +30,20 @@ #include "Channel.h" #include "ChannelMgmt.h" #include "ChannelInterface.h" -/* #include "ChannelMessages.h" */ #include "RingBuffer.h" -/* #include "Packet.h" */ #include "include/List.h" -/* Defines */ - - /* * Maximum channels is determined by the size of the interrupt page * which is PAGE_SIZE. 1/2 of PAGE_SIZE is for send endpoint interrupt * and the other is receive endpoint interrupt */ -#define MAX_NUM_CHANNELS (PAGE_SIZE >> 1) << 3 /* 16348 channels */ +#define MAX_NUM_CHANNELS ((PAGE_SIZE >> 1) << 3) /* 16348 channels */ /* The value here must be in multiple of 32 */ /* TODO: Need to make this configurable */ -#define MAX_NUM_CHANNELS_SUPPORTED 256 - - -/* Data types */ +#define MAX_NUM_CHANNELS_SUPPORTED 256 enum VMBUS_CONNECT_STATE { @@ -61,36 +53,34 @@ enum VMBUS_CONNECT_STATE { Disconnecting }; -#define MAX_SIZE_CHANNEL_MESSAGE HV_MESSAGE_PAYLOAD_BYTE_COUNT +#define MAX_SIZE_CHANNEL_MESSAGE HV_MESSAGE_PAYLOAD_BYTE_COUNT struct VMBUS_CONNECTION { - - enum VMBUS_CONNECT_STATE ConnectState; + enum VMBUS_CONNECT_STATE ConnectState; atomic_t NextGpadlHandle; /* - * Represents channel interrupts. Each bit position represents - * a channel. When a channel sends an interrupt via VMBUS, it - * finds its bit in the sendInterruptPage, set it and calls Hv - * to generate a port event. The other end receives the port - * event and parse the recvInterruptPage to see which bit is - * set + * Represents channel interrupts. Each bit position represents a + * channel. When a channel sends an interrupt via VMBUS, it finds its + * bit in the sendInterruptPage, set it and calls Hv to generate a port + * event. The other end receives the port event and parse the + * recvInterruptPage to see which bit is set */ - void * InterruptPage; - void * SendInterruptPage; - void * RecvInterruptPage; + void *InterruptPage; + void *SendInterruptPage; + void *RecvInterruptPage; /* * 2 pages - 1st page for parent->child notification and 2nd * is child->parent notification */ - void * MonitorPages; - LIST_ENTRY ChannelMsgList; + void *MonitorPages; + LIST_ENTRY ChannelMsgList; spinlock_t channelmsg_lock; /* List of channels */ - LIST_ENTRY ChannelList; + LIST_ENTRY ChannelList; spinlock_t channel_lock; struct workqueue_struct *WorkQueue; @@ -99,75 +89,46 @@ struct VMBUS_CONNECTION { struct VMBUS_MSGINFO { /* Bookkeeping stuff */ - LIST_ENTRY MsgListEntry; + LIST_ENTRY MsgListEntry; /* Synchronize the request/response if needed */ struct osd_waitevent *WaitEvent; /* The message itself */ - unsigned char Msg[0]; + unsigned char Msg[0]; }; - -/* Externs */ - extern struct VMBUS_CONNECTION gVmbusConnection; - /* General vmbus interface */ -static struct hv_device* -VmbusChildDeviceCreate( - GUID deviceType, - GUID deviceInstance, - void *context); +struct hv_device *VmbusChildDeviceCreate(GUID deviceType, + GUID deviceInstance, + void *context); -static int -VmbusChildDeviceAdd( - struct hv_device *Device); +int VmbusChildDeviceAdd(struct hv_device *Device); -static void -VmbusChildDeviceRemove( - struct hv_device *Device); +void VmbusChildDeviceRemove(struct hv_device *Device); /* static void */ /* VmbusChildDeviceDestroy( */ /* struct hv_device *); */ -static VMBUS_CHANNEL* -GetChannelFromRelId( - u32 relId - ); +VMBUS_CHANNEL *GetChannelFromRelId(u32 relId); /* Connection interface */ -static int -VmbusConnect( - void - ); - -static int -VmbusDisconnect( - void - ); - -static int -VmbusPostMessage( - void * buffer, - size_t bufSize - ); - -static int -VmbusSetEvent( - u32 childRelId - ); - -static void -VmbusOnEvents( - void - ); +int VmbusConnect(void); + +int VmbusDisconnect(void); + +int VmbusPostMessage(void *buffer, size_t bufSize); + +int VmbusSetEvent(u32 childRelId); + +void VmbusOnEvents(void); #endif /* _VMBUS_PRIVATE_H_ */