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

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

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e89ce628
...@@ -129,7 +129,7 @@ Description: ...@@ -129,7 +129,7 @@ Description:
Allocate and initialize a vmbus channel object Allocate and initialize a vmbus channel object
--*/ --*/
static VMBUS_CHANNEL* AllocVmbusChannel(void) VMBUS_CHANNEL* AllocVmbusChannel(void)
{ {
VMBUS_CHANNEL* channel; VMBUS_CHANNEL* channel;
...@@ -189,7 +189,7 @@ Description: ...@@ -189,7 +189,7 @@ Description:
Release the resources used by the vmbus channel object Release the resources used by the vmbus channel object
--*/ --*/
static void FreeVmbusChannel(VMBUS_CHANNEL* Channel) void FreeVmbusChannel(VMBUS_CHANNEL* Channel)
{ {
del_timer(&Channel->poll_timer); del_timer(&Channel->poll_timer);
...@@ -665,10 +665,7 @@ Description: ...@@ -665,10 +665,7 @@ Description:
This is invoked in the vmbus worker thread context. This is invoked in the vmbus worker thread context.
--*/ --*/
static void void VmbusOnChannelMessage(void *Context)
VmbusOnChannelMessage(
void *Context
)
{ {
HV_MESSAGE *msg=(HV_MESSAGE*)Context; HV_MESSAGE *msg=(HV_MESSAGE*)Context;
VMBUS_CHANNEL_MESSAGE_HEADER* hdr; VMBUS_CHANNEL_MESSAGE_HEADER* hdr;
...@@ -714,10 +711,7 @@ Description: ...@@ -714,10 +711,7 @@ Description:
Send a request to get all our pending offers. Send a request to get all our pending offers.
--*/ --*/
static int int VmbusChannelRequestOffers(void)
VmbusChannelRequestOffers(
void
)
{ {
int ret=0; int ret=0;
VMBUS_CHANNEL_MESSAGE_HEADER* msg; VMBUS_CHANNEL_MESSAGE_HEADER* msg;
...@@ -776,10 +770,7 @@ Description: ...@@ -776,10 +770,7 @@ Description:
Release channels that are unattached/unconnected ie (no drivers associated) Release channels that are unattached/unconnected ie (no drivers associated)
--*/ --*/
static void void VmbusChannelReleaseUnattachedChannels(void)
VmbusChannelReleaseUnattachedChannels(
void
)
{ {
LIST_ENTRY *entry; LIST_ENTRY *entry;
VMBUS_CHANNEL *channel; VMBUS_CHANNEL *channel;
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
typedef void (*PFN_CHANNEL_CALLBACK)(void * context); typedef void (*PFN_CHANNEL_CALLBACK)(void *context);
typedef enum { typedef enum {
CHANNEL_OFFER_STATE, CHANNEL_OFFER_STATE,
...@@ -43,62 +43,64 @@ typedef enum { ...@@ -43,62 +43,64 @@ typedef enum {
} VMBUS_CHANNEL_STATE; } VMBUS_CHANNEL_STATE;
typedef struct _VMBUS_CHANNEL { typedef struct _VMBUS_CHANNEL {
LIST_ENTRY ListEntry; LIST_ENTRY ListEntry;
struct hv_device *DeviceObject; struct hv_device *DeviceObject;
struct timer_list poll_timer; /* SA-111 workaround */ struct timer_list poll_timer; /* SA-111 workaround */
VMBUS_CHANNEL_STATE State; VMBUS_CHANNEL_STATE State;
VMBUS_CHANNEL_OFFER_CHANNEL OfferMsg; VMBUS_CHANNEL_OFFER_CHANNEL OfferMsg;
/* These are based on the OfferMsg.MonitorId. Save it here for easy access. */ /*
u8 MonitorGroup; * These are based on the OfferMsg.MonitorId.
u8 MonitorBit; * Save it here for easy access.
*/
u8 MonitorGroup;
u8 MonitorBit;
u32 RingBufferGpadlHandle; u32 RingBufferGpadlHandle;
/* Allocated memory for ring buffer */ /* Allocated memory for ring buffer */
void * RingBufferPages; void *RingBufferPages;
u32 RingBufferPageCount; u32 RingBufferPageCount;
RING_BUFFER_INFO Outbound; /* send to parent */ RING_BUFFER_INFO Outbound; /* send to parent */
RING_BUFFER_INFO Inbound; /* receive from parent */ RING_BUFFER_INFO Inbound; /* receive from parent */
spinlock_t inbound_lock; spinlock_t inbound_lock;
struct workqueue_struct *ControlWQ; struct workqueue_struct *ControlWQ;
/* Channel callback are invoked in this workqueue context */ /* Channel callback are invoked in this workqueue context */
/* HANDLE dataWorkQueue; */ /* HANDLE dataWorkQueue; */
PFN_CHANNEL_CALLBACK OnChannelCallback;
void * ChannelCallbackContext;
PFN_CHANNEL_CALLBACK OnChannelCallback;
void *ChannelCallbackContext;
} VMBUS_CHANNEL; } VMBUS_CHANNEL;
typedef struct _VMBUS_CHANNEL_DEBUG_INFO { typedef struct _VMBUS_CHANNEL_DEBUG_INFO {
u32 RelId; u32 RelId;
VMBUS_CHANNEL_STATE State; VMBUS_CHANNEL_STATE State;
GUID InterfaceType; GUID InterfaceType;
GUID InterfaceInstance; GUID InterfaceInstance;
u32 MonitorId; u32 MonitorId;
u32 ServerMonitorPending; u32 ServerMonitorPending;
u32 ServerMonitorLatency; u32 ServerMonitorLatency;
u32 ServerMonitorConnectionId; u32 ServerMonitorConnectionId;
u32 ClientMonitorPending; u32 ClientMonitorPending;
u32 ClientMonitorLatency; u32 ClientMonitorLatency;
u32 ClientMonitorConnectionId; u32 ClientMonitorConnectionId;
RING_BUFFER_DEBUG_INFO Inbound; RING_BUFFER_DEBUG_INFO Inbound;
RING_BUFFER_DEBUG_INFO Outbound; RING_BUFFER_DEBUG_INFO Outbound;
} VMBUS_CHANNEL_DEBUG_INFO; } VMBUS_CHANNEL_DEBUG_INFO;
typedef union { typedef union {
VMBUS_CHANNEL_VERSION_SUPPORTED VersionSupported; VMBUS_CHANNEL_VERSION_SUPPORTED VersionSupported;
VMBUS_CHANNEL_OPEN_RESULT OpenResult; VMBUS_CHANNEL_OPEN_RESULT OpenResult;
VMBUS_CHANNEL_GPADL_TORNDOWN GpadlTorndown; VMBUS_CHANNEL_GPADL_TORNDOWN GpadlTorndown;
VMBUS_CHANNEL_GPADL_CREATED GpadlCreated; VMBUS_CHANNEL_GPADL_CREATED GpadlCreated;
VMBUS_CHANNEL_VERSION_RESPONSE VersionResponse; VMBUS_CHANNEL_VERSION_RESPONSE VersionResponse;
} VMBUS_CHANNEL_MESSAGE_RESPONSE; } VMBUS_CHANNEL_MESSAGE_RESPONSE;
...@@ -106,51 +108,35 @@ typedef union { ...@@ -106,51 +108,35 @@ typedef union {
* Represents each channel msg on the vmbus connection This is a * Represents each channel msg on the vmbus connection This is a
* variable-size data structure depending on the msg type itself * variable-size data structure depending on the msg type itself
*/ */
typedef struct _VMBUS_CHANNEL_MSGINFO { typedef struct _VMBUS_CHANNEL_MSGINFO {
/* Bookkeeping stuff */ /* Bookkeeping stuff */
LIST_ENTRY MsgListEntry; LIST_ENTRY MsgListEntry;
/* So far, this is only used to handle gpadl body message */ /* So far, this is only used to handle gpadl body message */
LIST_ENTRY SubMsgList; LIST_ENTRY SubMsgList;
/* Synchronize the request/response if needed */ /* Synchronize the request/response if needed */
struct osd_waitevent *WaitEvent; struct osd_waitevent *WaitEvent;
VMBUS_CHANNEL_MESSAGE_RESPONSE Response; VMBUS_CHANNEL_MESSAGE_RESPONSE Response;
u32 MessageSize; u32 MessageSize;
/* The channel message that goes out on the "wire". */ /*
/* It will contain at minimum the VMBUS_CHANNEL_MESSAGE_HEADER header */ * The channel message that goes out on the "wire".
unsigned char Msg[0]; * It will contain at minimum the VMBUS_CHANNEL_MESSAGE_HEADER header
*/
unsigned char Msg[0];
} VMBUS_CHANNEL_MSGINFO; } VMBUS_CHANNEL_MSGINFO;
/* Routines */ VMBUS_CHANNEL *AllocVmbusChannel(void);
static VMBUS_CHANNEL*
AllocVmbusChannel(
void
);
static void void FreeVmbusChannel(VMBUS_CHANNEL *Channel);
FreeVmbusChannel(
VMBUS_CHANNEL *Channel
);
static void void VmbusOnChannelMessage(void *Context);
VmbusOnChannelMessage(
void *Context
);
static int int VmbusChannelRequestOffers(void);
VmbusChannelRequestOffers(
void
);
static void void VmbusChannelReleaseUnattachedChannels(void);
VmbusChannelReleaseUnattachedChannels(
void
);
#endif /* _CHANNEL_MGMT_H_ */ #endif /* _CHANNEL_MGMT_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