Commit f346fdc2 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: hv: cleanup coding style issues in VmbusPrivate.h

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b239549c
...@@ -44,8 +44,7 @@ Description: ...@@ -44,8 +44,7 @@ Description:
Sends a connect request on the partition service connection Sends a connect request on the partition service connection
--*/ --*/
static int int VmbusConnect(void)
VmbusConnect(void)
{ {
int ret=0; int ret=0;
VMBUS_CHANNEL_MSGINFO *msgInfo=NULL; VMBUS_CHANNEL_MSGINFO *msgInfo=NULL;
...@@ -203,10 +202,7 @@ Description: ...@@ -203,10 +202,7 @@ Description:
Sends a disconnect request on the partition service connection Sends a disconnect request on the partition service connection
--*/ --*/
static int int VmbusDisconnect(void)
VmbusDisconnect(
void
)
{ {
int ret=0; int ret=0;
VMBUS_CHANNEL_UNLOAD *msg; VMBUS_CHANNEL_UNLOAD *msg;
...@@ -259,10 +255,7 @@ Description: ...@@ -259,10 +255,7 @@ Description:
Get the channel object given its child relative id (ie channel id) Get the channel object given its child relative id (ie channel id)
--*/ --*/
static VMBUS_CHANNEL* VMBUS_CHANNEL *GetChannelFromRelId(u32 relId)
GetChannelFromRelId(
u32 relId
)
{ {
VMBUS_CHANNEL* channel; VMBUS_CHANNEL* channel;
VMBUS_CHANNEL* foundChannel=NULL; VMBUS_CHANNEL* foundChannel=NULL;
...@@ -334,10 +327,7 @@ Description: ...@@ -334,10 +327,7 @@ Description:
Handler for events Handler for events
--*/ --*/
static void void VmbusOnEvents(void)
VmbusOnEvents(
void
)
{ {
int dword; int dword;
/* int maxdword = PAGE_SIZE >> 3; // receive size is 1/2 page and divide that by 4 bytes */ /* int maxdword = PAGE_SIZE >> 3; // receive size is 1/2 page and divide that by 4 bytes */
...@@ -394,11 +384,7 @@ Description: ...@@ -394,11 +384,7 @@ Description:
Send a msg on the vmbus's message connection Send a msg on the vmbus's message connection
--*/ --*/
static int int VmbusPostMessage(void *buffer, size_t bufferLen)
VmbusPostMessage(
void * buffer,
size_t bufferLen
)
{ {
int ret=0; int ret=0;
HV_CONNECTION_ID connId; HV_CONNECTION_ID connId;
...@@ -424,8 +410,7 @@ Description: ...@@ -424,8 +410,7 @@ Description:
Send an event notification to the parent Send an event notification to the parent
--*/ --*/
static int int VmbusSetEvent(u32 childRelId)
VmbusSetEvent(u32 childRelId)
{ {
int ret=0; int ret=0;
......
...@@ -224,9 +224,7 @@ Description: ...@@ -224,9 +224,7 @@ Description:
--*/ --*/
static struct hv_device* struct hv_device *VmbusChildDeviceCreate(GUID DeviceType,
VmbusChildDeviceCreate(
GUID DeviceType,
GUID DeviceInstance, GUID DeviceInstance,
void *Context) void *Context)
{ {
...@@ -248,9 +246,7 @@ Description: ...@@ -248,9 +246,7 @@ Description:
Registers the child device with the vmbus Registers the child device with the vmbus
--*/ --*/
static int int VmbusChildDeviceAdd(struct hv_device *ChildDevice)
VmbusChildDeviceAdd(
struct hv_device *ChildDevice)
{ {
VMBUS_DRIVER_OBJECT* vmbusDriver = (VMBUS_DRIVER_OBJECT*)gDriver; VMBUS_DRIVER_OBJECT* vmbusDriver = (VMBUS_DRIVER_OBJECT*)gDriver;
...@@ -267,9 +263,7 @@ Description: ...@@ -267,9 +263,7 @@ Description:
Unregisters the child device from the vmbus Unregisters the child device from the vmbus
--*/ --*/
static void void VmbusChildDeviceRemove(struct hv_device *ChildDevice)
VmbusChildDeviceRemove(
struct hv_device *ChildDevice)
{ {
VMBUS_DRIVER_OBJECT* vmbusDriver = (VMBUS_DRIVER_OBJECT*)gDriver; VMBUS_DRIVER_OBJECT* vmbusDriver = (VMBUS_DRIVER_OBJECT*)gDriver;
......
...@@ -30,30 +30,22 @@ ...@@ -30,30 +30,22 @@
#include "Channel.h" #include "Channel.h"
#include "ChannelMgmt.h" #include "ChannelMgmt.h"
#include "ChannelInterface.h" #include "ChannelInterface.h"
/* #include "ChannelMessages.h" */
#include "RingBuffer.h" #include "RingBuffer.h"
/* #include "Packet.h" */
#include "include/List.h" #include "include/List.h"
/* Defines */
/* /*
* Maximum channels is determined by the size of the interrupt page * 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 * which is PAGE_SIZE. 1/2 of PAGE_SIZE is for send endpoint interrupt
* and the other is receive 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 */ /* The value here must be in multiple of 32 */
/* TODO: Need to make this configurable */ /* TODO: Need to make this configurable */
#define MAX_NUM_CHANNELS_SUPPORTED 256 #define MAX_NUM_CHANNELS_SUPPORTED 256
/* Data types */
enum VMBUS_CONNECT_STATE { enum VMBUS_CONNECT_STATE {
Disconnected, Disconnected,
Connecting, Connecting,
...@@ -64,28 +56,26 @@ enum VMBUS_CONNECT_STATE { ...@@ -64,28 +56,26 @@ enum VMBUS_CONNECT_STATE {
#define MAX_SIZE_CHANNEL_MESSAGE HV_MESSAGE_PAYLOAD_BYTE_COUNT #define MAX_SIZE_CHANNEL_MESSAGE HV_MESSAGE_PAYLOAD_BYTE_COUNT
struct VMBUS_CONNECTION { struct VMBUS_CONNECTION {
enum VMBUS_CONNECT_STATE ConnectState; enum VMBUS_CONNECT_STATE ConnectState;
atomic_t NextGpadlHandle; atomic_t NextGpadlHandle;
/* /*
* Represents channel interrupts. Each bit position represents * Represents channel interrupts. Each bit position represents a
* a channel. When a channel sends an interrupt via VMBUS, it * channel. When a channel sends an interrupt via VMBUS, it finds its
* finds its bit in the sendInterruptPage, set it and calls Hv * bit in the sendInterruptPage, set it and calls Hv to generate a port
* to generate a port event. The other end receives the port * event. The other end receives the port event and parse the
* event and parse the recvInterruptPage to see which bit is * recvInterruptPage to see which bit is set
* set
*/ */
void * InterruptPage; void *InterruptPage;
void * SendInterruptPage; void *SendInterruptPage;
void * RecvInterruptPage; void *RecvInterruptPage;
/* /*
* 2 pages - 1st page for parent->child notification and 2nd * 2 pages - 1st page for parent->child notification and 2nd
* is child->parent notification * is child->parent notification
*/ */
void * MonitorPages; void *MonitorPages;
LIST_ENTRY ChannelMsgList; LIST_ENTRY ChannelMsgList;
spinlock_t channelmsg_lock; spinlock_t channelmsg_lock;
...@@ -109,65 +99,36 @@ struct VMBUS_MSGINFO { ...@@ -109,65 +99,36 @@ struct VMBUS_MSGINFO {
}; };
/* Externs */
extern struct VMBUS_CONNECTION gVmbusConnection; extern struct VMBUS_CONNECTION gVmbusConnection;
/* General vmbus interface */ /* General vmbus interface */
static struct hv_device* struct hv_device *VmbusChildDeviceCreate(GUID deviceType,
VmbusChildDeviceCreate(
GUID deviceType,
GUID deviceInstance, GUID deviceInstance,
void *context); void *context);
static int int VmbusChildDeviceAdd(struct hv_device *Device);
VmbusChildDeviceAdd(
struct hv_device *Device);
static void void VmbusChildDeviceRemove(struct hv_device *Device);
VmbusChildDeviceRemove(
struct hv_device *Device);
/* static void */ /* static void */
/* VmbusChildDeviceDestroy( */ /* VmbusChildDeviceDestroy( */
/* struct hv_device *); */ /* struct hv_device *); */
static VMBUS_CHANNEL* VMBUS_CHANNEL *GetChannelFromRelId(u32 relId);
GetChannelFromRelId(
u32 relId
);
/* Connection interface */ /* Connection interface */
static int int VmbusConnect(void);
VmbusConnect(
void int VmbusDisconnect(void);
);
int VmbusPostMessage(void *buffer, size_t bufSize);
static int
VmbusDisconnect( int VmbusSetEvent(u32 childRelId);
void
); void VmbusOnEvents(void);
static int
VmbusPostMessage(
void * buffer,
size_t bufSize
);
static int
VmbusSetEvent(
u32 childRelId
);
static void
VmbusOnEvents(
void
);
#endif /* _VMBUS_PRIVATE_H_ */ #endif /* _VMBUS_PRIVATE_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment