Skip to content

Commit

Permalink
Staging: hv: cleanup coding style issues in ChannelMgmt.h
Browse files Browse the repository at this point in the history
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Greg Kroah-Hartman committed Sep 15, 2009
1 parent e89ce62 commit b239549
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 77 deletions.
19 changes: 5 additions & 14 deletions drivers/staging/hv/ChannelMgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static VMBUS_CHANNEL_MESSAGE_TABLE_ENTRY gChannelMessageTable[ChannelMessageCoun
Allocate and initialize a vmbus channel object
--*/
static VMBUS_CHANNEL* AllocVmbusChannel(void)
VMBUS_CHANNEL* AllocVmbusChannel(void)
{
VMBUS_CHANNEL* channel;

Expand Down Expand Up @@ -189,7 +189,7 @@ static inline void ReleaseVmbusChannel(void* Context)
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);

Expand Down Expand Up @@ -665,10 +665,7 @@ VmbusChannelOnVersionResponse(
This is invoked in the vmbus worker thread context.
--*/
static void
VmbusOnChannelMessage(
void *Context
)
void VmbusOnChannelMessage(void *Context)
{
HV_MESSAGE *msg=(HV_MESSAGE*)Context;
VMBUS_CHANNEL_MESSAGE_HEADER* hdr;
Expand Down Expand Up @@ -714,10 +711,7 @@ VmbusOnChannelMessage(
Send a request to get all our pending offers.
--*/
static int
VmbusChannelRequestOffers(
void
)
int VmbusChannelRequestOffers(void)
{
int ret=0;
VMBUS_CHANNEL_MESSAGE_HEADER* msg;
Expand Down Expand Up @@ -776,10 +770,7 @@ VmbusChannelRequestOffers(
Release channels that are unattached/unconnected ie (no drivers associated)
--*/
static void
VmbusChannelReleaseUnattachedChannels(
void
)
void VmbusChannelReleaseUnattachedChannels(void)
{
LIST_ENTRY *entry;
VMBUS_CHANNEL *channel;
Expand Down
112 changes: 49 additions & 63 deletions drivers/staging/hv/ChannelMgmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@



typedef void (*PFN_CHANNEL_CALLBACK)(void * context);
typedef void (*PFN_CHANNEL_CALLBACK)(void *context);

typedef enum {
CHANNEL_OFFER_STATE,
Expand All @@ -43,114 +43,100 @@ typedef enum {
} VMBUS_CHANNEL_STATE;

typedef struct _VMBUS_CHANNEL {
LIST_ENTRY ListEntry;
LIST_ENTRY ListEntry;

struct hv_device *DeviceObject;

struct timer_list poll_timer; /* SA-111 workaround */

VMBUS_CHANNEL_STATE State;
VMBUS_CHANNEL_STATE State;

VMBUS_CHANNEL_OFFER_CHANNEL OfferMsg;
/* These are based on the OfferMsg.MonitorId. Save it here for easy access. */
u8 MonitorGroup;
u8 MonitorBit;
/*
* These are based on the OfferMsg.MonitorId.
* Save it here for easy access.
*/
u8 MonitorGroup;
u8 MonitorBit;

u32 RingBufferGpadlHandle;
u32 RingBufferGpadlHandle;

/* Allocated memory for ring buffer */
void * RingBufferPages;
u32 RingBufferPageCount;
RING_BUFFER_INFO Outbound; /* send to parent */
RING_BUFFER_INFO Inbound; /* receive from parent */
void *RingBufferPages;
u32 RingBufferPageCount;
RING_BUFFER_INFO Outbound; /* send to parent */
RING_BUFFER_INFO Inbound; /* receive from parent */
spinlock_t inbound_lock;
struct workqueue_struct *ControlWQ;

/* Channel callback are invoked in this workqueue context */
/* HANDLE dataWorkQueue; */

PFN_CHANNEL_CALLBACK OnChannelCallback;
void * ChannelCallbackContext;
/* HANDLE dataWorkQueue; */

PFN_CHANNEL_CALLBACK OnChannelCallback;
void *ChannelCallbackContext;
} VMBUS_CHANNEL;


typedef struct _VMBUS_CHANNEL_DEBUG_INFO {
u32 RelId;
VMBUS_CHANNEL_STATE State;
GUID InterfaceType;
GUID InterfaceInstance;
u32 MonitorId;
u32 ServerMonitorPending;
u32 ServerMonitorLatency;
u32 ServerMonitorConnectionId;
u32 ClientMonitorPending;
u32 ClientMonitorLatency;
u32 ClientMonitorConnectionId;

RING_BUFFER_DEBUG_INFO Inbound;
RING_BUFFER_DEBUG_INFO Outbound;
u32 RelId;
VMBUS_CHANNEL_STATE State;
GUID InterfaceType;
GUID InterfaceInstance;
u32 MonitorId;
u32 ServerMonitorPending;
u32 ServerMonitorLatency;
u32 ServerMonitorConnectionId;
u32 ClientMonitorPending;
u32 ClientMonitorLatency;
u32 ClientMonitorConnectionId;

RING_BUFFER_DEBUG_INFO Inbound;
RING_BUFFER_DEBUG_INFO Outbound;
} VMBUS_CHANNEL_DEBUG_INFO;


typedef union {
VMBUS_CHANNEL_VERSION_SUPPORTED VersionSupported;
VMBUS_CHANNEL_OPEN_RESULT OpenResult;
VMBUS_CHANNEL_GPADL_TORNDOWN GpadlTorndown;
VMBUS_CHANNEL_GPADL_CREATED GpadlCreated;
VMBUS_CHANNEL_VERSION_RESPONSE VersionResponse;
VMBUS_CHANNEL_VERSION_SUPPORTED VersionSupported;
VMBUS_CHANNEL_OPEN_RESULT OpenResult;
VMBUS_CHANNEL_GPADL_TORNDOWN GpadlTorndown;
VMBUS_CHANNEL_GPADL_CREATED GpadlCreated;
VMBUS_CHANNEL_VERSION_RESPONSE VersionResponse;
} VMBUS_CHANNEL_MESSAGE_RESPONSE;


/*
* Represents each channel msg on the vmbus connection This is a
* variable-size data structure depending on the msg type itself
*/

typedef struct _VMBUS_CHANNEL_MSGINFO {
/* Bookkeeping stuff */
LIST_ENTRY MsgListEntry;
LIST_ENTRY MsgListEntry;

/* So far, this is only used to handle gpadl body message */
LIST_ENTRY SubMsgList;
LIST_ENTRY SubMsgList;

/* Synchronize the request/response if needed */
struct osd_waitevent *WaitEvent;

VMBUS_CHANNEL_MESSAGE_RESPONSE Response;

u32 MessageSize;
/* The channel message that goes out on the "wire". */
/* It will contain at minimum the VMBUS_CHANNEL_MESSAGE_HEADER header */
unsigned char Msg[0];
u32 MessageSize;
/*
* The channel message that goes out on the "wire".
* It will contain at minimum the VMBUS_CHANNEL_MESSAGE_HEADER header
*/
unsigned char Msg[0];
} VMBUS_CHANNEL_MSGINFO;


/* Routines */

static VMBUS_CHANNEL*
AllocVmbusChannel(
void
);
VMBUS_CHANNEL *AllocVmbusChannel(void);

static void
FreeVmbusChannel(
VMBUS_CHANNEL *Channel
);
void FreeVmbusChannel(VMBUS_CHANNEL *Channel);

static void
VmbusOnChannelMessage(
void *Context
);
void VmbusOnChannelMessage(void *Context);

static int
VmbusChannelRequestOffers(
void
);
int VmbusChannelRequestOffers(void);

static void
VmbusChannelReleaseUnattachedChannels(
void
);
void VmbusChannelReleaseUnattachedChannels(void);

#endif /* _CHANNEL_MGMT_H_ */

0 comments on commit b239549

Please sign in to comment.