Commit 46a05253 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 98d9fac4
...@@ -159,7 +159,7 @@ VmbusChannelClearEvent( ...@@ -159,7 +159,7 @@ VmbusChannelClearEvent(
Retrieve various channel debug info Retrieve various channel debug info
--*/ --*/
static void void
VmbusChannelGetDebugInfo( VmbusChannelGetDebugInfo(
VMBUS_CHANNEL *Channel, VMBUS_CHANNEL *Channel,
VMBUS_CHANNEL_DEBUG_INFO *DebugInfo VMBUS_CHANNEL_DEBUG_INFO *DebugInfo
...@@ -203,7 +203,7 @@ VmbusChannelGetDebugInfo( ...@@ -203,7 +203,7 @@ VmbusChannelGetDebugInfo(
Open the specified channel. Open the specified channel.
--*/ --*/
static int int
VmbusChannelOpen( VmbusChannelOpen(
VMBUS_CHANNEL *NewChannel, VMBUS_CHANNEL *NewChannel,
u32 SendRingBufferSize, u32 SendRingBufferSize,
...@@ -516,7 +516,7 @@ VmbusChannelCreateGpadlHeader( ...@@ -516,7 +516,7 @@ VmbusChannelCreateGpadlHeader(
Estabish a GPADL for the specified buffer Estabish a GPADL for the specified buffer
--*/ --*/
static int int
VmbusChannelEstablishGpadl( VmbusChannelEstablishGpadl(
VMBUS_CHANNEL *Channel, VMBUS_CHANNEL *Channel,
void * Kbuffer, /* from kmalloc() */ void * Kbuffer, /* from kmalloc() */
...@@ -621,7 +621,7 @@ VmbusChannelEstablishGpadl( ...@@ -621,7 +621,7 @@ VmbusChannelEstablishGpadl(
Teardown the specified GPADL handle Teardown the specified GPADL handle
--*/ --*/
static int int
VmbusChannelTeardownGpadl( VmbusChannelTeardownGpadl(
VMBUS_CHANNEL *Channel, VMBUS_CHANNEL *Channel,
u32 GpadlHandle u32 GpadlHandle
...@@ -682,7 +682,7 @@ VmbusChannelTeardownGpadl( ...@@ -682,7 +682,7 @@ VmbusChannelTeardownGpadl(
Close the specified channel Close the specified channel
--*/ --*/
static void void
VmbusChannelClose( VmbusChannelClose(
VMBUS_CHANNEL *Channel VMBUS_CHANNEL *Channel
) )
...@@ -759,7 +759,7 @@ VmbusChannelClose( ...@@ -759,7 +759,7 @@ VmbusChannelClose(
Send the specified buffer on the given channel Send the specified buffer on the given channel
--*/ --*/
static int int
VmbusChannelSendPacket( VmbusChannelSendPacket(
VMBUS_CHANNEL *Channel, VMBUS_CHANNEL *Channel,
const void * Buffer, const void * Buffer,
...@@ -821,7 +821,7 @@ VmbusChannelSendPacket( ...@@ -821,7 +821,7 @@ VmbusChannelSendPacket(
Send a range of single-page buffer packets using a GPADL Direct packet type. Send a range of single-page buffer packets using a GPADL Direct packet type.
--*/ --*/
static int int
VmbusChannelSendPacketPageBuffer( VmbusChannelSendPacketPageBuffer(
VMBUS_CHANNEL *Channel, VMBUS_CHANNEL *Channel,
PAGE_BUFFER PageBuffers[], PAGE_BUFFER PageBuffers[],
...@@ -900,7 +900,7 @@ VmbusChannelSendPacketPageBuffer( ...@@ -900,7 +900,7 @@ VmbusChannelSendPacketPageBuffer(
Send a multi-page buffer packet using a GPADL Direct packet type. Send a multi-page buffer packet using a GPADL Direct packet type.
--*/ --*/
static int int
VmbusChannelSendPacketMultiPageBuffer( VmbusChannelSendPacketMultiPageBuffer(
VMBUS_CHANNEL *Channel, VMBUS_CHANNEL *Channel,
MULTIPAGE_BUFFER *MultiPageBuffer, MULTIPAGE_BUFFER *MultiPageBuffer,
...@@ -979,14 +979,11 @@ VmbusChannelSendPacketMultiPageBuffer( ...@@ -979,14 +979,11 @@ VmbusChannelSendPacketMultiPageBuffer(
--*/ --*/
/* TODO: Do we ever receive a gpa direct packet other than the ones we send ? */ /* TODO: Do we ever receive a gpa direct packet other than the ones we send ? */
static int int VmbusChannelRecvPacket(VMBUS_CHANNEL *Channel,
VmbusChannelRecvPacket( void *Buffer,
VMBUS_CHANNEL *Channel,
void * Buffer,
u32 BufferLen, u32 BufferLen,
u32* BufferActualLen, u32 *BufferActualLen,
u64* RequestId u64 *RequestId)
)
{ {
VMPACKET_DESCRIPTOR desc; VMPACKET_DESCRIPTOR desc;
u32 packetLen; u32 packetLen;
...@@ -1057,7 +1054,7 @@ VmbusChannelRecvPacket( ...@@ -1057,7 +1054,7 @@ VmbusChannelRecvPacket(
Retrieve the raw packet on the specified channel Retrieve the raw packet on the specified channel
--*/ --*/
static int int
VmbusChannelRecvPacketRaw( VmbusChannelRecvPacketRaw(
VMBUS_CHANNEL *Channel, VMBUS_CHANNEL *Channel,
void * Buffer, void * Buffer,
...@@ -1134,10 +1131,7 @@ VmbusChannelRecvPacketRaw( ...@@ -1134,10 +1131,7 @@ VmbusChannelRecvPacketRaw(
Channel event callback Channel event callback
--*/ --*/
static void void VmbusChannelOnChannelEvent(VMBUS_CHANNEL *Channel)
VmbusChannelOnChannelEvent(
VMBUS_CHANNEL *Channel
)
{ {
DumpVmbusChannel(Channel); DumpVmbusChannel(Channel);
ASSERT(Channel->OnChannelCallback); ASSERT(Channel->OnChannelCallback);
...@@ -1160,7 +1154,7 @@ VmbusChannelOnChannelEvent( ...@@ -1160,7 +1154,7 @@ VmbusChannelOnChannelEvent(
Timer event callback Timer event callback
--*/ --*/
static void VmbusChannelOnTimer(unsigned long data) void VmbusChannelOnTimer(unsigned long data)
{ {
VMBUS_CHANNEL *channel = (VMBUS_CHANNEL*)data; VMBUS_CHANNEL *channel = (VMBUS_CHANNEL*)data;
......
...@@ -28,9 +28,6 @@ ...@@ -28,9 +28,6 @@
#include "include/osd.h" #include "include/osd.h"
#include "ChannelMgmt.h" #include "ChannelMgmt.h"
#pragma pack(push,1)
/* The format must be the same as VMDATA_GPA_DIRECT */ /* The format must be the same as VMDATA_GPA_DIRECT */
struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER { struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER {
u16 Type; u16 Type;
...@@ -41,8 +38,7 @@ struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER { ...@@ -41,8 +38,7 @@ struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER {
u32 Reserved; u32 Reserved;
u32 RangeCount; u32 RangeCount;
PAGE_BUFFER Range[MAX_PAGE_BUFFER_COUNT]; PAGE_BUFFER Range[MAX_PAGE_BUFFER_COUNT];
}; } __attribute__((packed));
/* The format must be the same as VMDATA_GPA_DIRECT */ /* The format must be the same as VMDATA_GPA_DIRECT */
struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER { struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER {
...@@ -54,101 +50,64 @@ struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER { ...@@ -54,101 +50,64 @@ struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER {
u32 Reserved; u32 Reserved;
u32 RangeCount; /* Always 1 in this case */ u32 RangeCount; /* Always 1 in this case */
MULTIPAGE_BUFFER Range; MULTIPAGE_BUFFER Range;
}; } __attribute__((packed));
#pragma pack(pop)
/* Routines */ extern int VmbusChannelOpen(VMBUS_CHANNEL *Channel,
static int
VmbusChannelOpen(
VMBUS_CHANNEL *Channel,
u32 SendRingBufferSize, u32 SendRingBufferSize,
u32 RecvRingBufferSize, u32 RecvRingBufferSize,
void * UserData, void *UserData,
u32 UserDataLen, u32 UserDataLen,
PFN_CHANNEL_CALLBACK pfnOnChannelCallback, PFN_CHANNEL_CALLBACK pfnOnChannelCallback,
void * Context void *Context);
);
extern void VmbusChannelClose(VMBUS_CHANNEL *Channel);
static void
VmbusChannelClose( extern int VmbusChannelSendPacket(VMBUS_CHANNEL *Channel,
VMBUS_CHANNEL *Channel const void *Buffer,
);
static int
VmbusChannelSendPacket(
VMBUS_CHANNEL *Channel,
const void * Buffer,
u32 BufferLen, u32 BufferLen,
u64 RequestId, u64 RequestId,
VMBUS_PACKET_TYPE Type, VMBUS_PACKET_TYPE Type,
u32 Flags u32 Flags);
);
static int extern int VmbusChannelSendPacketPageBuffer(VMBUS_CHANNEL *Channel,
VmbusChannelSendPacketPageBuffer(
VMBUS_CHANNEL *Channel,
PAGE_BUFFER PageBuffers[], PAGE_BUFFER PageBuffers[],
u32 PageCount, u32 PageCount,
void * Buffer, void *Buffer,
u32 BufferLen, u32 BufferLen,
u64 RequestId u64 RequestId);
);
static int extern int VmbusChannelSendPacketMultiPageBuffer(VMBUS_CHANNEL *Channel,
VmbusChannelSendPacketMultiPageBuffer(
VMBUS_CHANNEL *Channel,
MULTIPAGE_BUFFER *MultiPageBuffer, MULTIPAGE_BUFFER *MultiPageBuffer,
void * Buffer, void *Buffer,
u32 BufferLen, u32 BufferLen,
u64 RequestId u64 RequestId);
);
extern int VmbusChannelEstablishGpadl(VMBUS_CHANNEL *Channel,
static int void *Kbuffer,
VmbusChannelEstablishGpadl( u32 Size,
VMBUS_CHANNEL *Channel, u32 *GpadlHandle);
void * Kbuffer, /* from kmalloc() */
u32 Size, /* page-size multiple */ extern int VmbusChannelTeardownGpadl(VMBUS_CHANNEL *Channel,
u32 *GpadlHandle u32 GpadlHandle);
);
extern int VmbusChannelRecvPacket(VMBUS_CHANNEL *Channel,
static int void *Buffer,
VmbusChannelTeardownGpadl(
VMBUS_CHANNEL *Channel,
u32 GpadlHandle
);
static int
VmbusChannelRecvPacket(
VMBUS_CHANNEL *Channel,
void * Buffer,
u32 BufferLen, u32 BufferLen,
u32* BufferActualLen, u32 *BufferActualLen,
u64* RequestId u64 *RequestId);
);
extern int VmbusChannelRecvPacketRaw(VMBUS_CHANNEL *Channel,
static int void *Buffer,
VmbusChannelRecvPacketRaw(
VMBUS_CHANNEL *Channel,
void * Buffer,
u32 BufferLen, u32 BufferLen,
u32* BufferActualLen, u32 *BufferActualLen,
u64* RequestId u64 *RequestId);
);
extern void VmbusChannelOnChannelEvent(VMBUS_CHANNEL *Channel);
static void
VmbusChannelOnChannelEvent( extern void VmbusChannelGetDebugInfo(VMBUS_CHANNEL *Channel,
VMBUS_CHANNEL *Channel VMBUS_CHANNEL_DEBUG_INFO *DebugInfo);
);
extern void VmbusChannelOnTimer(unsigned long data);
static void
VmbusChannelGetDebugInfo(
VMBUS_CHANNEL *Channel,
VMBUS_CHANNEL_DEBUG_INFO *DebugInfo
);
static void VmbusChannelOnTimer(unsigned long data);
#endif /* _CHANNEL_H_ */ #endif /* _CHANNEL_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