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

Staging: hv: clean up typedefs in ChannelMgmt.h

This removes the typedefs from ChannelMgmt.h, it's now clean from a
codingstyle.pl standpoint.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent af248e1f
...@@ -29,24 +29,14 @@ ...@@ -29,24 +29,14 @@
#include "VmbusPrivate.h" #include "VmbusPrivate.h"
/* Internal routines */ /* Internal routines */
static int static int VmbusChannelCreateGpadlHeader(
VmbusChannelCreateGpadlHeader(
void * Kbuffer, /* must be phys and virt contiguous */ void * Kbuffer, /* must be phys and virt contiguous */
u32 Size, /* page-size multiple */ u32 Size, /* page-size multiple */
VMBUS_CHANNEL_MSGINFO **msgInfo, struct vmbus_channel_msginfo **msgInfo,
u32 *MessageCount u32 *MessageCount
); );
static void DumpVmbusChannel(struct vmbus_channel *channel);
static void static void VmbusChannelSetEvent(struct vmbus_channel *channel);
DumpVmbusChannel(
VMBUS_CHANNEL *Channel
);
static void
VmbusChannelSetEvent(
VMBUS_CHANNEL *Channel
);
#if 0 #if 0
...@@ -93,10 +83,7 @@ DumpMonitorPage( ...@@ -93,10 +83,7 @@ DumpMonitorPage(
Trigger an event notification on the specified channel. Trigger an event notification on the specified channel.
--*/ --*/
static void static void VmbusChannelSetEvent(struct vmbus_channel *Channel)
VmbusChannelSetEvent(
VMBUS_CHANNEL *Channel
)
{ {
HV_MONITOR_PAGE *monitorPage; HV_MONITOR_PAGE *monitorPage;
...@@ -125,10 +112,7 @@ VmbusChannelSetEvent( ...@@ -125,10 +112,7 @@ VmbusChannelSetEvent(
} }
#if 0 #if 0
static void static void VmbusChannelClearEvent(struct vmbus_channel *channel)
VmbusChannelClearEvent(
VMBUS_CHANNEL *Channel
)
{ {
HV_MONITOR_PAGE *monitorPage; HV_MONITOR_PAGE *monitorPage;
...@@ -160,11 +144,8 @@ VmbusChannelClearEvent( ...@@ -160,11 +144,8 @@ VmbusChannelClearEvent(
Retrieve various channel debug info Retrieve various channel debug info
--*/ --*/
void void VmbusChannelGetDebugInfo(struct vmbus_channel *Channel,
VmbusChannelGetDebugInfo( struct vmbus_channel_debug_info *DebugInfo)
VMBUS_CHANNEL *Channel,
VMBUS_CHANNEL_DEBUG_INFO *DebugInfo
)
{ {
HV_MONITOR_PAGE *monitorPage; HV_MONITOR_PAGE *monitorPage;
u8 monitorGroup = (u8)Channel->OfferMsg.MonitorId / 32; u8 monitorGroup = (u8)Channel->OfferMsg.MonitorId / 32;
...@@ -204,9 +185,7 @@ VmbusChannelGetDebugInfo( ...@@ -204,9 +185,7 @@ VmbusChannelGetDebugInfo(
Open the specified channel. Open the specified channel.
--*/ --*/
int int VmbusChannelOpen(struct vmbus_channel *NewChannel,
VmbusChannelOpen(
VMBUS_CHANNEL *NewChannel,
u32 SendRingBufferSize, u32 SendRingBufferSize,
u32 RecvRingBufferSize, u32 RecvRingBufferSize,
void * UserData, void * UserData,
...@@ -217,7 +196,7 @@ VmbusChannelOpen( ...@@ -217,7 +196,7 @@ VmbusChannelOpen(
{ {
int ret=0; int ret=0;
VMBUS_CHANNEL_OPEN_CHANNEL* openMsg; VMBUS_CHANNEL_OPEN_CHANNEL* openMsg;
VMBUS_CHANNEL_MSGINFO* openInfo; struct vmbus_channel_msginfo *openInfo;
void *in, *out; void *in, *out;
unsigned long flags; unsigned long flags;
...@@ -266,7 +245,7 @@ VmbusChannelOpen( ...@@ -266,7 +245,7 @@ VmbusChannelOpen(
SendRingBufferSize); SendRingBufferSize);
/* Create and init the channel open message */ /* Create and init the channel open message */
openInfo = kmalloc(sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_OPEN_CHANNEL), GFP_KERNEL); openInfo = kmalloc(sizeof(*openInfo) + sizeof(VMBUS_CHANNEL_OPEN_CHANNEL), GFP_KERNEL);
ASSERT(openInfo != NULL); ASSERT(openInfo != NULL);
openInfo->WaitEvent = osd_WaitEventCreate(); openInfo->WaitEvent = osd_WaitEventCreate();
...@@ -399,7 +378,7 @@ static int ...@@ -399,7 +378,7 @@ static int
VmbusChannelCreateGpadlHeader( VmbusChannelCreateGpadlHeader(
void * Kbuffer, /* from kmalloc() */ void * Kbuffer, /* from kmalloc() */
u32 Size, /* page-size multiple */ u32 Size, /* page-size multiple */
VMBUS_CHANNEL_MSGINFO **MsgInfo, struct vmbus_channel_msginfo **MsgInfo,
u32 *MessageCount) u32 *MessageCount)
{ {
int i; int i;
...@@ -407,8 +386,8 @@ VmbusChannelCreateGpadlHeader( ...@@ -407,8 +386,8 @@ VmbusChannelCreateGpadlHeader(
unsigned long long pfn; unsigned long long pfn;
VMBUS_CHANNEL_GPADL_HEADER* gpaHeader; VMBUS_CHANNEL_GPADL_HEADER* gpaHeader;
VMBUS_CHANNEL_GPADL_BODY* gpadlBody; VMBUS_CHANNEL_GPADL_BODY* gpadlBody;
VMBUS_CHANNEL_MSGINFO* msgHeader; struct vmbus_channel_msginfo *msgHeader;
VMBUS_CHANNEL_MSGINFO* msgBody; struct vmbus_channel_msginfo *msgBody;
u32 msgSize; u32 msgSize;
int pfnSum, pfnCount, pfnLeft, pfnCurr, pfnSize; int pfnSum, pfnCount, pfnLeft, pfnCurr, pfnSize;
...@@ -426,7 +405,7 @@ VmbusChannelCreateGpadlHeader( ...@@ -426,7 +405,7 @@ VmbusChannelCreateGpadlHeader(
if (pageCount > pfnCount) /* we need a gpadl body */ if (pageCount > pfnCount) /* we need a gpadl body */
{ {
/* fill in the header */ /* fill in the header */
msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_HEADER) + sizeof(GPA_RANGE) + pfnCount*sizeof(u64); msgSize = sizeof(struct vmbus_channel_msginfo) + sizeof(VMBUS_CHANNEL_GPADL_HEADER) + sizeof(GPA_RANGE) + pfnCount*sizeof(u64);
msgHeader = kzalloc(msgSize, GFP_KERNEL); msgHeader = kzalloc(msgSize, GFP_KERNEL);
INITIALIZE_LIST_HEAD(&msgHeader->SubMsgList); INITIALIZE_LIST_HEAD(&msgHeader->SubMsgList);
...@@ -463,7 +442,7 @@ VmbusChannelCreateGpadlHeader( ...@@ -463,7 +442,7 @@ VmbusChannelCreateGpadlHeader(
pfnCurr = pfnLeft; pfnCurr = pfnLeft;
} }
msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_BODY) + pfnCurr*sizeof(u64); msgSize = sizeof(struct vmbus_channel_msginfo) + sizeof(VMBUS_CHANNEL_GPADL_BODY) + pfnCurr*sizeof(u64);
msgBody = kzalloc(msgSize, GFP_KERNEL); msgBody = kzalloc(msgSize, GFP_KERNEL);
ASSERT(msgBody); ASSERT(msgBody);
msgBody->MessageSize = msgSize; msgBody->MessageSize = msgSize;
...@@ -486,7 +465,7 @@ VmbusChannelCreateGpadlHeader( ...@@ -486,7 +465,7 @@ VmbusChannelCreateGpadlHeader(
else else
{ {
/* everything fits in a header */ /* everything fits in a header */
msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_HEADER) + sizeof(GPA_RANGE) + pageCount*sizeof(u64); msgSize = sizeof(struct vmbus_channel_msginfo) + sizeof(VMBUS_CHANNEL_GPADL_HEADER) + sizeof(GPA_RANGE) + pageCount*sizeof(u64);
msgHeader = kzalloc(msgSize, GFP_KERNEL); msgHeader = kzalloc(msgSize, GFP_KERNEL);
msgHeader->MessageSize=msgSize; msgHeader->MessageSize=msgSize;
...@@ -517,9 +496,7 @@ VmbusChannelCreateGpadlHeader( ...@@ -517,9 +496,7 @@ VmbusChannelCreateGpadlHeader(
Estabish a GPADL for the specified buffer Estabish a GPADL for the specified buffer
--*/ --*/
int int VmbusChannelEstablishGpadl(struct vmbus_channel *Channel,
VmbusChannelEstablishGpadl(
VMBUS_CHANNEL *Channel,
void * Kbuffer, /* from kmalloc() */ void * Kbuffer, /* from kmalloc() */
u32 Size, /* page-size multiple */ u32 Size, /* page-size multiple */
u32 *GpadlHandle u32 *GpadlHandle
...@@ -530,8 +507,8 @@ VmbusChannelEstablishGpadl( ...@@ -530,8 +507,8 @@ VmbusChannelEstablishGpadl(
VMBUS_CHANNEL_GPADL_BODY* gpadlBody; VMBUS_CHANNEL_GPADL_BODY* gpadlBody;
/* VMBUS_CHANNEL_GPADL_CREATED* gpadlCreated; */ /* VMBUS_CHANNEL_GPADL_CREATED* gpadlCreated; */
VMBUS_CHANNEL_MSGINFO *msgInfo; struct vmbus_channel_msginfo *msgInfo;
VMBUS_CHANNEL_MSGINFO *subMsgInfo; struct vmbus_channel_msginfo *subMsgInfo;
u32 msgCount; u32 msgCount;
LIST_ENTRY* anchor; LIST_ENTRY* anchor;
...@@ -562,9 +539,9 @@ VmbusChannelEstablishGpadl( ...@@ -562,9 +539,9 @@ VmbusChannelEstablishGpadl(
DPRINT_DBG(VMBUS, "buffer %p, size %d msg cnt %d", Kbuffer, Size, msgCount); DPRINT_DBG(VMBUS, "buffer %p, size %d msg cnt %d", Kbuffer, Size, msgCount);
DPRINT_DBG(VMBUS, "Sending GPADL Header - len %zd", msgInfo->MessageSize - sizeof(VMBUS_CHANNEL_MSGINFO)); DPRINT_DBG(VMBUS, "Sending GPADL Header - len %zd", msgInfo->MessageSize - sizeof(*msgInfo));
ret = VmbusPostMessage(gpadlMsg, msgInfo->MessageSize - sizeof(VMBUS_CHANNEL_MSGINFO)); ret = VmbusPostMessage(gpadlMsg, msgInfo->MessageSize - sizeof(*msgInfo));
if (ret != 0) if (ret != 0)
{ {
DPRINT_ERR(VMBUS, "Unable to open channel - %d", ret); DPRINT_ERR(VMBUS, "Unable to open channel - %d", ret);
...@@ -575,16 +552,16 @@ VmbusChannelEstablishGpadl( ...@@ -575,16 +552,16 @@ VmbusChannelEstablishGpadl(
{ {
ITERATE_LIST_ENTRIES(anchor, curr, &msgInfo->SubMsgList) ITERATE_LIST_ENTRIES(anchor, curr, &msgInfo->SubMsgList)
{ {
subMsgInfo = (VMBUS_CHANNEL_MSGINFO*) curr; subMsgInfo = (struct vmbus_channel_msginfo*)curr;
gpadlBody = (VMBUS_CHANNEL_GPADL_BODY*)subMsgInfo->Msg; gpadlBody = (VMBUS_CHANNEL_GPADL_BODY*)subMsgInfo->Msg;
gpadlBody->Header.MessageType = ChannelMessageGpadlBody; gpadlBody->Header.MessageType = ChannelMessageGpadlBody;
gpadlBody->Gpadl = nextGpadlHandle; gpadlBody->Gpadl = nextGpadlHandle;
DPRINT_DBG(VMBUS, "Sending GPADL Body - len %zd", subMsgInfo->MessageSize - sizeof(VMBUS_CHANNEL_MSGINFO)); DPRINT_DBG(VMBUS, "Sending GPADL Body - len %zd", subMsgInfo->MessageSize - sizeof(*subMsgInfo));
DumpGpadlBody(gpadlBody, subMsgInfo->MessageSize - sizeof(VMBUS_CHANNEL_MSGINFO)); DumpGpadlBody(gpadlBody, subMsgInfo->MessageSize - sizeof(*subMsgInfo));
ret = VmbusPostMessage(gpadlBody, subMsgInfo->MessageSize - sizeof(VMBUS_CHANNEL_MSGINFO)); ret = VmbusPostMessage(gpadlBody, subMsgInfo->MessageSize - sizeof(*subMsgInfo));
ASSERT(ret == 0); ASSERT(ret == 0);
} }
} }
...@@ -622,22 +599,18 @@ VmbusChannelEstablishGpadl( ...@@ -622,22 +599,18 @@ VmbusChannelEstablishGpadl(
Teardown the specified GPADL handle Teardown the specified GPADL handle
--*/ --*/
int int VmbusChannelTeardownGpadl(struct vmbus_channel *Channel, u32 GpadlHandle)
VmbusChannelTeardownGpadl(
VMBUS_CHANNEL *Channel,
u32 GpadlHandle
)
{ {
int ret=0; int ret=0;
VMBUS_CHANNEL_GPADL_TEARDOWN *msg; VMBUS_CHANNEL_GPADL_TEARDOWN *msg;
VMBUS_CHANNEL_MSGINFO* info; struct vmbus_channel_msginfo *info;
unsigned long flags; unsigned long flags;
DPRINT_ENTER(VMBUS); DPRINT_ENTER(VMBUS);
ASSERT(GpadlHandle != 0); ASSERT(GpadlHandle != 0);
info = kmalloc(sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_TEARDOWN), GFP_KERNEL); info = kmalloc(sizeof(*info) + sizeof(VMBUS_CHANNEL_GPADL_TEARDOWN), GFP_KERNEL);
ASSERT(info != NULL); ASSERT(info != NULL);
info->WaitEvent = osd_WaitEventCreate(); info->WaitEvent = osd_WaitEventCreate();
...@@ -683,14 +656,11 @@ VmbusChannelTeardownGpadl( ...@@ -683,14 +656,11 @@ VmbusChannelTeardownGpadl(
Close the specified channel Close the specified channel
--*/ --*/
void void VmbusChannelClose(struct vmbus_channel *Channel)
VmbusChannelClose(
VMBUS_CHANNEL *Channel
)
{ {
int ret=0; int ret=0;
VMBUS_CHANNEL_CLOSE_CHANNEL* msg; VMBUS_CHANNEL_CLOSE_CHANNEL* msg;
VMBUS_CHANNEL_MSGINFO* info; struct vmbus_channel_msginfo *info;
unsigned long flags; unsigned long flags;
DPRINT_ENTER(VMBUS); DPRINT_ENTER(VMBUS);
...@@ -700,7 +670,7 @@ VmbusChannelClose( ...@@ -700,7 +670,7 @@ VmbusChannelClose(
del_timer(&Channel->poll_timer); del_timer(&Channel->poll_timer);
/* Send a closing message */ /* Send a closing message */
info = kmalloc(sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_CLOSE_CHANNEL), GFP_KERNEL); info = kmalloc(sizeof(*info) + sizeof(VMBUS_CHANNEL_CLOSE_CHANNEL), GFP_KERNEL);
ASSERT(info != NULL); ASSERT(info != NULL);
/* info->waitEvent = osd_WaitEventCreate(); */ /* info->waitEvent = osd_WaitEventCreate(); */
...@@ -760,9 +730,7 @@ VmbusChannelClose( ...@@ -760,9 +730,7 @@ VmbusChannelClose(
Send the specified buffer on the given channel Send the specified buffer on the given channel
--*/ --*/
int int VmbusChannelSendPacket(struct vmbus_channel *Channel,
VmbusChannelSendPacket(
VMBUS_CHANNEL *Channel,
const void * Buffer, const void * Buffer,
u32 BufferLen, u32 BufferLen,
u64 RequestId, u64 RequestId,
...@@ -822,9 +790,7 @@ VmbusChannelSendPacket( ...@@ -822,9 +790,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.
--*/ --*/
int int VmbusChannelSendPacketPageBuffer(struct vmbus_channel *Channel,
VmbusChannelSendPacketPageBuffer(
VMBUS_CHANNEL *Channel,
PAGE_BUFFER PageBuffers[], PAGE_BUFFER PageBuffers[],
u32 PageCount, u32 PageCount,
void * Buffer, void * Buffer,
...@@ -901,9 +867,7 @@ VmbusChannelSendPacketPageBuffer( ...@@ -901,9 +867,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.
--*/ --*/
int int VmbusChannelSendPacketMultiPageBuffer(struct vmbus_channel *Channel,
VmbusChannelSendPacketMultiPageBuffer(
VMBUS_CHANNEL *Channel,
MULTIPAGE_BUFFER *MultiPageBuffer, MULTIPAGE_BUFFER *MultiPageBuffer,
void * Buffer, void * Buffer,
u32 BufferLen, u32 BufferLen,
...@@ -980,7 +944,7 @@ VmbusChannelSendPacketMultiPageBuffer( ...@@ -980,7 +944,7 @@ 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 ? */
int VmbusChannelRecvPacket(VMBUS_CHANNEL *Channel, int VmbusChannelRecvPacket(struct vmbus_channel *Channel,
void *Buffer, void *Buffer,
u32 BufferLen, u32 BufferLen,
u32 *BufferActualLen, u32 *BufferActualLen,
...@@ -1055,9 +1019,7 @@ int VmbusChannelRecvPacket(VMBUS_CHANNEL *Channel, ...@@ -1055,9 +1019,7 @@ int VmbusChannelRecvPacket(VMBUS_CHANNEL *Channel,
Retrieve the raw packet on the specified channel Retrieve the raw packet on the specified channel
--*/ --*/
int int VmbusChannelRecvPacketRaw(struct vmbus_channel *Channel,
VmbusChannelRecvPacketRaw(
VMBUS_CHANNEL *Channel,
void * Buffer, void * Buffer,
u32 BufferLen, u32 BufferLen,
u32* BufferActualLen, u32* BufferActualLen,
...@@ -1132,7 +1094,7 @@ VmbusChannelRecvPacketRaw( ...@@ -1132,7 +1094,7 @@ VmbusChannelRecvPacketRaw(
Channel event callback Channel event callback
--*/ --*/
void VmbusChannelOnChannelEvent(VMBUS_CHANNEL *Channel) void VmbusChannelOnChannelEvent(struct vmbus_channel *Channel)
{ {
DumpVmbusChannel(Channel); DumpVmbusChannel(Channel);
ASSERT(Channel->OnChannelCallback); ASSERT(Channel->OnChannelCallback);
...@@ -1157,7 +1119,7 @@ void VmbusChannelOnChannelEvent(VMBUS_CHANNEL *Channel) ...@@ -1157,7 +1119,7 @@ void VmbusChannelOnChannelEvent(VMBUS_CHANNEL *Channel)
--*/ --*/
void VmbusChannelOnTimer(unsigned long data) void VmbusChannelOnTimer(unsigned long data)
{ {
VMBUS_CHANNEL *channel = (VMBUS_CHANNEL*)data; struct vmbus_channel *channel = (struct vmbus_channel *)data;
if (channel->OnChannelCallback) if (channel->OnChannelCallback)
{ {
...@@ -1179,10 +1141,7 @@ void VmbusChannelOnTimer(unsigned long data) ...@@ -1179,10 +1141,7 @@ void VmbusChannelOnTimer(unsigned long data)
Dump vmbus channel info to the console Dump vmbus channel info to the console
--*/ --*/
static void static void DumpVmbusChannel(struct vmbus_channel *Channel)
DumpVmbusChannel(
VMBUS_CHANNEL *Channel
)
{ {
DPRINT_DBG(VMBUS, "Channel (%d)", Channel->OfferMsg.ChildRelId); DPRINT_DBG(VMBUS, "Channel (%d)", Channel->OfferMsg.ChildRelId);
DumpRingInfo(&Channel->Outbound, "Outbound "); DumpRingInfo(&Channel->Outbound, "Outbound ");
......
...@@ -53,7 +53,7 @@ struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER { ...@@ -53,7 +53,7 @@ struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER {
} __attribute__((packed)); } __attribute__((packed));
extern int VmbusChannelOpen(VMBUS_CHANNEL *Channel, extern int VmbusChannelOpen(struct vmbus_channel *channel,
u32 SendRingBufferSize, u32 SendRingBufferSize,
u32 RecvRingBufferSize, u32 RecvRingBufferSize,
void *UserData, void *UserData,
...@@ -61,52 +61,52 @@ extern int VmbusChannelOpen(VMBUS_CHANNEL *Channel, ...@@ -61,52 +61,52 @@ extern int VmbusChannelOpen(VMBUS_CHANNEL *Channel,
PFN_CHANNEL_CALLBACK pfnOnChannelCallback, PFN_CHANNEL_CALLBACK pfnOnChannelCallback,
void *Context); void *Context);
extern void VmbusChannelClose(VMBUS_CHANNEL *Channel); extern void VmbusChannelClose(struct vmbus_channel *channel);
extern int VmbusChannelSendPacket(VMBUS_CHANNEL *Channel, extern int VmbusChannelSendPacket(struct vmbus_channel *channel,
const void *Buffer, const void *Buffer,
u32 BufferLen, u32 BufferLen,
u64 RequestId, u64 RequestId,
VMBUS_PACKET_TYPE Type, VMBUS_PACKET_TYPE Type,
u32 Flags); u32 Flags);
extern int VmbusChannelSendPacketPageBuffer(VMBUS_CHANNEL *Channel, extern int VmbusChannelSendPacketPageBuffer(struct 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);
extern int VmbusChannelSendPacketMultiPageBuffer(VMBUS_CHANNEL *Channel, extern int VmbusChannelSendPacketMultiPageBuffer(struct 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, extern int VmbusChannelEstablishGpadl(struct vmbus_channel *channel,
void *Kbuffer, void *Kbuffer,
u32 Size, u32 Size,
u32 *GpadlHandle); u32 *GpadlHandle);
extern int VmbusChannelTeardownGpadl(VMBUS_CHANNEL *Channel, extern int VmbusChannelTeardownGpadl(struct vmbus_channel *channel,
u32 GpadlHandle); u32 GpadlHandle);
extern int VmbusChannelRecvPacket(VMBUS_CHANNEL *Channel, extern int VmbusChannelRecvPacket(struct vmbus_channel *channel,
void *Buffer, void *Buffer,
u32 BufferLen, u32 BufferLen,
u32 *BufferActualLen, u32 *BufferActualLen,
u64 *RequestId); u64 *RequestId);
extern int VmbusChannelRecvPacketRaw(VMBUS_CHANNEL *Channel, extern int VmbusChannelRecvPacketRaw(struct vmbus_channel *channel,
void *Buffer, void *Buffer,
u32 BufferLen, u32 BufferLen,
u32 *BufferActualLen, u32 *BufferActualLen,
u64 *RequestId); u64 *RequestId);
extern void VmbusChannelOnChannelEvent(VMBUS_CHANNEL *Channel); extern void VmbusChannelOnChannelEvent(struct vmbus_channel *channel);
extern void VmbusChannelGetDebugInfo(VMBUS_CHANNEL *Channel, extern void VmbusChannelGetDebugInfo(struct vmbus_channel *channel,
VMBUS_CHANNEL_DEBUG_INFO *DebugInfo); struct vmbus_channel_debug_info *debug);
extern void VmbusChannelOnTimer(unsigned long data); extern void VmbusChannelOnTimer(unsigned long data);
......
...@@ -38,7 +38,7 @@ IVmbusChannelOpen( ...@@ -38,7 +38,7 @@ IVmbusChannelOpen(
void * Context void * Context
) )
{ {
return VmbusChannelOpen( (VMBUS_CHANNEL*)Device->context, return VmbusChannelOpen((struct vmbus_channel *)Device->context,
SendBufferSize, SendBufferSize,
RecvRingBufferSize, RecvRingBufferSize,
UserData, UserData,
...@@ -53,7 +53,7 @@ IVmbusChannelClose( ...@@ -53,7 +53,7 @@ IVmbusChannelClose(
struct hv_device *Device struct hv_device *Device
) )
{ {
VmbusChannelClose((VMBUS_CHANNEL*)Device->context); VmbusChannelClose((struct vmbus_channel *)Device->context);
} }
...@@ -67,7 +67,7 @@ IVmbusChannelSendPacket( ...@@ -67,7 +67,7 @@ IVmbusChannelSendPacket(
u32 Flags u32 Flags
) )
{ {
return VmbusChannelSendPacket((VMBUS_CHANNEL*)Device->context, return VmbusChannelSendPacket((struct vmbus_channel *)Device->context,
Buffer, Buffer,
BufferLen, BufferLen,
RequestId, RequestId,
...@@ -85,7 +85,7 @@ IVmbusChannelSendPacketPageBuffer( ...@@ -85,7 +85,7 @@ IVmbusChannelSendPacketPageBuffer(
u64 RequestId u64 RequestId
) )
{ {
return VmbusChannelSendPacketPageBuffer((VMBUS_CHANNEL*)Device->context, return VmbusChannelSendPacketPageBuffer((struct vmbus_channel *)Device->context,
PageBuffers, PageBuffers,
PageCount, PageCount,
Buffer, Buffer,
...@@ -102,7 +102,7 @@ IVmbusChannelSendPacketMultiPageBuffer( ...@@ -102,7 +102,7 @@ IVmbusChannelSendPacketMultiPageBuffer(
u64 RequestId u64 RequestId
) )
{ {
return VmbusChannelSendPacketMultiPageBuffer((VMBUS_CHANNEL*)Device->context, return VmbusChannelSendPacketMultiPageBuffer((struct vmbus_channel *)Device->context,
MultiPageBuffer, MultiPageBuffer,
Buffer, Buffer,
BufferLen, BufferLen,
...@@ -118,7 +118,7 @@ IVmbusChannelRecvPacket ( ...@@ -118,7 +118,7 @@ IVmbusChannelRecvPacket (
u64* RequestId u64* RequestId
) )
{ {
return VmbusChannelRecvPacket((VMBUS_CHANNEL*)Device->context, return VmbusChannelRecvPacket((struct vmbus_channel *)Device->context,
Buffer, Buffer,
BufferLen, BufferLen,
BufferActualLen, BufferActualLen,
...@@ -134,7 +134,7 @@ IVmbusChannelRecvPacketRaw( ...@@ -134,7 +134,7 @@ IVmbusChannelRecvPacketRaw(
u64* RequestId u64* RequestId
) )
{ {
return VmbusChannelRecvPacketRaw((VMBUS_CHANNEL*)Device->context, return VmbusChannelRecvPacketRaw((struct vmbus_channel *)Device->context,
Buffer, Buffer,
BufferLen, BufferLen,
BufferActualLen, BufferActualLen,
...@@ -149,7 +149,7 @@ IVmbusChannelEstablishGpadl( ...@@ -149,7 +149,7 @@ IVmbusChannelEstablishGpadl(
u32* GpadlHandle u32* GpadlHandle
) )
{ {
return VmbusChannelEstablishGpadl((VMBUS_CHANNEL*)Device->context, return VmbusChannelEstablishGpadl((struct vmbus_channel *)Device->context,
Buffer, Buffer,
BufferLen, BufferLen,
GpadlHandle); GpadlHandle);
...@@ -161,7 +161,7 @@ IVmbusChannelTeardownGpadl( ...@@ -161,7 +161,7 @@ IVmbusChannelTeardownGpadl(
u32 GpadlHandle u32 GpadlHandle
) )
{ {
return VmbusChannelTeardownGpadl((VMBUS_CHANNEL*)Device->context, return VmbusChannelTeardownGpadl((struct vmbus_channel *)Device->context,
GpadlHandle); GpadlHandle);
} }
...@@ -183,11 +183,11 @@ void GetChannelInterface(VMBUS_CHANNEL_INTERFACE *ChannelInterface) ...@@ -183,11 +183,11 @@ void GetChannelInterface(VMBUS_CHANNEL_INTERFACE *ChannelInterface)
void GetChannelInfo(struct hv_device *Device, DEVICE_INFO *DeviceInfo) void GetChannelInfo(struct hv_device *Device, DEVICE_INFO *DeviceInfo)
{ {
VMBUS_CHANNEL_DEBUG_INFO debugInfo; struct vmbus_channel_debug_info debugInfo;
if (Device->context) if (Device->context)
{ {
VmbusChannelGetDebugInfo((VMBUS_CHANNEL*)Device->context, &debugInfo); VmbusChannelGetDebugInfo((struct vmbus_channel *)Device->context, &debugInfo);
DeviceInfo->ChannelId = debugInfo.RelId; DeviceInfo->ChannelId = debugInfo.RelId;
DeviceInfo->ChannelState = debugInfo.State; DeviceInfo->ChannelState = debugInfo.State;
......
...@@ -131,11 +131,11 @@ static VMBUS_CHANNEL_MESSAGE_TABLE_ENTRY gChannelMessageTable[ChannelMessageCoun ...@@ -131,11 +131,11 @@ static VMBUS_CHANNEL_MESSAGE_TABLE_ENTRY gChannelMessageTable[ChannelMessageCoun
Allocate and initialize a vmbus channel object Allocate and initialize a vmbus channel object
--*/ --*/
VMBUS_CHANNEL* AllocVmbusChannel(void) struct vmbus_channel *AllocVmbusChannel(void)
{ {
VMBUS_CHANNEL* channel; struct vmbus_channel *channel;
channel = kzalloc(sizeof(VMBUS_CHANNEL), GFP_ATOMIC); channel = kzalloc(sizeof(*channel), GFP_ATOMIC);
if (!channel) if (!channel)
{ {
return NULL; return NULL;
...@@ -169,7 +169,7 @@ VMBUS_CHANNEL* AllocVmbusChannel(void) ...@@ -169,7 +169,7 @@ VMBUS_CHANNEL* AllocVmbusChannel(void)
--*/ --*/
static inline void ReleaseVmbusChannel(void* Context) static inline void ReleaseVmbusChannel(void* Context)
{ {
VMBUS_CHANNEL* channel = (VMBUS_CHANNEL*)Context; struct vmbus_channel *channel = Context;
DPRINT_ENTER(VMBUS); DPRINT_ENTER(VMBUS);
...@@ -191,7 +191,7 @@ static inline void ReleaseVmbusChannel(void* Context) ...@@ -191,7 +191,7 @@ static inline void ReleaseVmbusChannel(void* Context)
Release the resources used by the vmbus channel object Release the resources used by the vmbus channel object
--*/ --*/
void FreeVmbusChannel(VMBUS_CHANNEL* Channel) void FreeVmbusChannel(struct vmbus_channel *Channel)
{ {
del_timer(&Channel->poll_timer); del_timer(&Channel->poll_timer);
...@@ -217,11 +217,11 @@ VmbusChannelProcessOffer( ...@@ -217,11 +217,11 @@ VmbusChannelProcessOffer(
) )
{ {
int ret=0; int ret=0;
VMBUS_CHANNEL* newChannel=(VMBUS_CHANNEL*)context; struct vmbus_channel *newChannel = context;
struct vmbus_channel *channel;
LIST_ENTRY* anchor; LIST_ENTRY* anchor;
LIST_ENTRY* curr; LIST_ENTRY* curr;
bool fNew = true; bool fNew = true;
VMBUS_CHANNEL* channel;
unsigned long flags; unsigned long flags;
DPRINT_ENTER(VMBUS); DPRINT_ENTER(VMBUS);
...@@ -231,7 +231,7 @@ VmbusChannelProcessOffer( ...@@ -231,7 +231,7 @@ VmbusChannelProcessOffer(
ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelList) ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelList)
{ {
channel = CONTAINING_RECORD(curr, VMBUS_CHANNEL, ListEntry); channel = CONTAINING_RECORD(curr, struct vmbus_channel, ListEntry);
if (!memcmp(&channel->OfferMsg.Offer.InterfaceType, &newChannel->OfferMsg.Offer.InterfaceType,sizeof(GUID)) && if (!memcmp(&channel->OfferMsg.Offer.InterfaceType, &newChannel->OfferMsg.Offer.InterfaceType,sizeof(GUID)) &&
!memcmp(&channel->OfferMsg.Offer.InterfaceInstance, &newChannel->OfferMsg.Offer.InterfaceInstance, sizeof(GUID))) !memcmp(&channel->OfferMsg.Offer.InterfaceInstance, &newChannel->OfferMsg.Offer.InterfaceInstance, sizeof(GUID)))
...@@ -308,7 +308,7 @@ VmbusChannelProcessRescindOffer( ...@@ -308,7 +308,7 @@ VmbusChannelProcessRescindOffer(
void * context void * context
) )
{ {
VMBUS_CHANNEL* channel=(VMBUS_CHANNEL*)context; struct vmbus_channel *channel = context;
DPRINT_ENTER(VMBUS); DPRINT_ENTER(VMBUS);
...@@ -335,7 +335,7 @@ VmbusChannelOnOffer( ...@@ -335,7 +335,7 @@ VmbusChannelOnOffer(
) )
{ {
VMBUS_CHANNEL_OFFER_CHANNEL* offer = (VMBUS_CHANNEL_OFFER_CHANNEL*)hdr; VMBUS_CHANNEL_OFFER_CHANNEL* offer = (VMBUS_CHANNEL_OFFER_CHANNEL*)hdr;
VMBUS_CHANNEL* newChannel; struct vmbus_channel *newChannel;
GUID *guidType; GUID *guidType;
GUID *guidInstance; GUID *guidInstance;
...@@ -411,7 +411,7 @@ VmbusChannelOnOfferRescind( ...@@ -411,7 +411,7 @@ VmbusChannelOnOfferRescind(
) )
{ {
VMBUS_CHANNEL_RESCIND_OFFER* rescind = (VMBUS_CHANNEL_RESCIND_OFFER*)hdr; VMBUS_CHANNEL_RESCIND_OFFER* rescind = (VMBUS_CHANNEL_RESCIND_OFFER*)hdr;
VMBUS_CHANNEL* channel; struct vmbus_channel *channel;
DPRINT_ENTER(VMBUS); DPRINT_ENTER(VMBUS);
...@@ -469,7 +469,7 @@ VmbusChannelOnOpenResult( ...@@ -469,7 +469,7 @@ VmbusChannelOnOpenResult(
VMBUS_CHANNEL_OPEN_RESULT* result = (VMBUS_CHANNEL_OPEN_RESULT*)hdr; VMBUS_CHANNEL_OPEN_RESULT* result = (VMBUS_CHANNEL_OPEN_RESULT*)hdr;
LIST_ENTRY* anchor; LIST_ENTRY* anchor;
LIST_ENTRY* curr; LIST_ENTRY* curr;
VMBUS_CHANNEL_MSGINFO* msgInfo; struct vmbus_channel_msginfo *msgInfo;
VMBUS_CHANNEL_MESSAGE_HEADER* requestHeader; VMBUS_CHANNEL_MESSAGE_HEADER* requestHeader;
VMBUS_CHANNEL_OPEN_CHANNEL* openMsg; VMBUS_CHANNEL_OPEN_CHANNEL* openMsg;
unsigned long flags; unsigned long flags;
...@@ -483,7 +483,7 @@ VmbusChannelOnOpenResult( ...@@ -483,7 +483,7 @@ VmbusChannelOnOpenResult(
ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList) ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList)
{ {
msgInfo = (VMBUS_CHANNEL_MSGINFO*) curr; msgInfo = (struct vmbus_channel_msginfo *)curr;
requestHeader = (VMBUS_CHANNEL_MESSAGE_HEADER*)msgInfo->Msg; requestHeader = (VMBUS_CHANNEL_MESSAGE_HEADER*)msgInfo->Msg;
if (requestHeader->MessageType == ChannelMessageOpenChannel) if (requestHeader->MessageType == ChannelMessageOpenChannel)
...@@ -523,7 +523,7 @@ VmbusChannelOnGpadlCreated( ...@@ -523,7 +523,7 @@ VmbusChannelOnGpadlCreated(
VMBUS_CHANNEL_GPADL_CREATED *gpadlCreated = (VMBUS_CHANNEL_GPADL_CREATED*)hdr; VMBUS_CHANNEL_GPADL_CREATED *gpadlCreated = (VMBUS_CHANNEL_GPADL_CREATED*)hdr;
LIST_ENTRY *anchor; LIST_ENTRY *anchor;
LIST_ENTRY *curr; LIST_ENTRY *curr;
VMBUS_CHANNEL_MSGINFO *msgInfo; struct vmbus_channel_msginfo *msgInfo;
VMBUS_CHANNEL_MESSAGE_HEADER *requestHeader; VMBUS_CHANNEL_MESSAGE_HEADER *requestHeader;
VMBUS_CHANNEL_GPADL_HEADER *gpadlHeader; VMBUS_CHANNEL_GPADL_HEADER *gpadlHeader;
unsigned long flags; unsigned long flags;
...@@ -537,7 +537,7 @@ VmbusChannelOnGpadlCreated( ...@@ -537,7 +537,7 @@ VmbusChannelOnGpadlCreated(
ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList) ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList)
{ {
msgInfo = (VMBUS_CHANNEL_MSGINFO*) curr; msgInfo = (struct vmbus_channel_msginfo *)curr;
requestHeader = (VMBUS_CHANNEL_MESSAGE_HEADER*)msgInfo->Msg; requestHeader = (VMBUS_CHANNEL_MESSAGE_HEADER*)msgInfo->Msg;
if (requestHeader->MessageType == ChannelMessageGpadlHeader) if (requestHeader->MessageType == ChannelMessageGpadlHeader)
...@@ -578,7 +578,7 @@ VmbusChannelOnGpadlTorndown( ...@@ -578,7 +578,7 @@ VmbusChannelOnGpadlTorndown(
VMBUS_CHANNEL_GPADL_TORNDOWN* gpadlTorndown = (VMBUS_CHANNEL_GPADL_TORNDOWN*)hdr; VMBUS_CHANNEL_GPADL_TORNDOWN* gpadlTorndown = (VMBUS_CHANNEL_GPADL_TORNDOWN*)hdr;
LIST_ENTRY* anchor; LIST_ENTRY* anchor;
LIST_ENTRY* curr; LIST_ENTRY* curr;
VMBUS_CHANNEL_MSGINFO* msgInfo; struct vmbus_channel_msginfo *msgInfo;
VMBUS_CHANNEL_MESSAGE_HEADER *requestHeader; VMBUS_CHANNEL_MESSAGE_HEADER *requestHeader;
VMBUS_CHANNEL_GPADL_TEARDOWN *gpadlTeardown; VMBUS_CHANNEL_GPADL_TEARDOWN *gpadlTeardown;
unsigned long flags; unsigned long flags;
...@@ -590,7 +590,7 @@ VmbusChannelOnGpadlTorndown( ...@@ -590,7 +590,7 @@ VmbusChannelOnGpadlTorndown(
ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList) ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList)
{ {
msgInfo = (VMBUS_CHANNEL_MSGINFO*) curr; msgInfo = (struct vmbus_channel_msginfo *)curr;
requestHeader = (VMBUS_CHANNEL_MESSAGE_HEADER*)msgInfo->Msg; requestHeader = (VMBUS_CHANNEL_MESSAGE_HEADER*)msgInfo->Msg;
if (requestHeader->MessageType == ChannelMessageGpadlTeardown) if (requestHeader->MessageType == ChannelMessageGpadlTeardown)
...@@ -629,7 +629,7 @@ VmbusChannelOnVersionResponse( ...@@ -629,7 +629,7 @@ VmbusChannelOnVersionResponse(
{ {
LIST_ENTRY* anchor; LIST_ENTRY* anchor;
LIST_ENTRY* curr; LIST_ENTRY* curr;
VMBUS_CHANNEL_MSGINFO *msgInfo; struct vmbus_channel_msginfo *msgInfo;
VMBUS_CHANNEL_MESSAGE_HEADER *requestHeader; VMBUS_CHANNEL_MESSAGE_HEADER *requestHeader;
VMBUS_CHANNEL_INITIATE_CONTACT *initiate; VMBUS_CHANNEL_INITIATE_CONTACT *initiate;
VMBUS_CHANNEL_VERSION_RESPONSE *versionResponse = (VMBUS_CHANNEL_VERSION_RESPONSE*)hdr; VMBUS_CHANNEL_VERSION_RESPONSE *versionResponse = (VMBUS_CHANNEL_VERSION_RESPONSE*)hdr;
...@@ -641,7 +641,7 @@ VmbusChannelOnVersionResponse( ...@@ -641,7 +641,7 @@ VmbusChannelOnVersionResponse(
ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList) ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList)
{ {
msgInfo = (VMBUS_CHANNEL_MSGINFO*) curr; msgInfo = (struct vmbus_channel_msginfo *)curr;
requestHeader = (VMBUS_CHANNEL_MESSAGE_HEADER*)msgInfo->Msg; requestHeader = (VMBUS_CHANNEL_MESSAGE_HEADER*)msgInfo->Msg;
if (requestHeader->MessageType == ChannelMessageInitiateContact) if (requestHeader->MessageType == ChannelMessageInitiateContact)
...@@ -717,11 +717,11 @@ int VmbusChannelRequestOffers(void) ...@@ -717,11 +717,11 @@ int VmbusChannelRequestOffers(void)
{ {
int ret=0; int ret=0;
VMBUS_CHANNEL_MESSAGE_HEADER* msg; VMBUS_CHANNEL_MESSAGE_HEADER* msg;
VMBUS_CHANNEL_MSGINFO* msgInfo; struct vmbus_channel_msginfo *msgInfo;
DPRINT_ENTER(VMBUS); DPRINT_ENTER(VMBUS);
msgInfo = kmalloc(sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_MESSAGE_HEADER), GFP_KERNEL); msgInfo = kmalloc(sizeof(*msgInfo) + sizeof(VMBUS_CHANNEL_MESSAGE_HEADER), GFP_KERNEL);
ASSERT(msgInfo != NULL); ASSERT(msgInfo != NULL);
msgInfo->WaitEvent = osd_WaitEventCreate(); msgInfo->WaitEvent = osd_WaitEventCreate();
...@@ -775,8 +775,8 @@ int VmbusChannelRequestOffers(void) ...@@ -775,8 +775,8 @@ int VmbusChannelRequestOffers(void)
void VmbusChannelReleaseUnattachedChannels(void) void VmbusChannelReleaseUnattachedChannels(void)
{ {
LIST_ENTRY *entry; LIST_ENTRY *entry;
VMBUS_CHANNEL *channel; struct vmbus_channel *channel;
VMBUS_CHANNEL *start=NULL; struct vmbus_channel *start = NULL;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&gVmbusConnection.channel_lock, flags); spin_lock_irqsave(&gVmbusConnection.channel_lock, flags);
...@@ -784,7 +784,7 @@ void VmbusChannelReleaseUnattachedChannels(void) ...@@ -784,7 +784,7 @@ void VmbusChannelReleaseUnattachedChannels(void)
while (!IsListEmpty(&gVmbusConnection.ChannelList)) while (!IsListEmpty(&gVmbusConnection.ChannelList))
{ {
entry = TOP_LIST_ENTRY(&gVmbusConnection.ChannelList); entry = TOP_LIST_ENTRY(&gVmbusConnection.ChannelList);
channel = CONTAINING_RECORD(entry, VMBUS_CHANNEL, ListEntry); channel = CONTAINING_RECORD(entry, struct vmbus_channel, ListEntry);
if (channel == start) if (channel == start)
break; break;
......
...@@ -36,20 +36,20 @@ ...@@ -36,20 +36,20 @@
typedef void (*PFN_CHANNEL_CALLBACK)(void *context); typedef void (*PFN_CHANNEL_CALLBACK)(void *context);
typedef enum { enum vmbus_channel_state {
CHANNEL_OFFER_STATE, CHANNEL_OFFER_STATE,
CHANNEL_OPENING_STATE, CHANNEL_OPENING_STATE,
CHANNEL_OPEN_STATE, CHANNEL_OPEN_STATE,
} VMBUS_CHANNEL_STATE; };
typedef struct _VMBUS_CHANNEL { 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; enum vmbus_channel_state State;
VMBUS_CHANNEL_OFFER_CHANNEL OfferMsg; VMBUS_CHANNEL_OFFER_CHANNEL OfferMsg;
/* /*
...@@ -74,12 +74,11 @@ typedef struct _VMBUS_CHANNEL { ...@@ -74,12 +74,11 @@ typedef struct _VMBUS_CHANNEL {
PFN_CHANNEL_CALLBACK OnChannelCallback; PFN_CHANNEL_CALLBACK OnChannelCallback;
void *ChannelCallbackContext; void *ChannelCallbackContext;
} VMBUS_CHANNEL; };
struct vmbus_channel_debug_info {
typedef struct _VMBUS_CHANNEL_DEBUG_INFO {
u32 RelId; u32 RelId;
VMBUS_CHANNEL_STATE State; enum vmbus_channel_state State;
GUID InterfaceType; GUID InterfaceType;
GUID InterfaceInstance; GUID InterfaceInstance;
u32 MonitorId; u32 MonitorId;
...@@ -92,23 +91,13 @@ typedef struct _VMBUS_CHANNEL_DEBUG_INFO { ...@@ -92,23 +91,13 @@ typedef struct _VMBUS_CHANNEL_DEBUG_INFO {
RING_BUFFER_DEBUG_INFO Inbound; RING_BUFFER_DEBUG_INFO Inbound;
RING_BUFFER_DEBUG_INFO Outbound; 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_MESSAGE_RESPONSE;
/* /*
* 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 { struct vmbus_channel_msginfo {
/* Bookkeeping stuff */ /* Bookkeeping stuff */
LIST_ENTRY MsgListEntry; LIST_ENTRY MsgListEntry;
...@@ -118,7 +107,13 @@ typedef struct _VMBUS_CHANNEL_MSGINFO { ...@@ -118,7 +107,13 @@ typedef struct _VMBUS_CHANNEL_MSGINFO {
/* 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; 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;
} Response;
u32 MessageSize; u32 MessageSize;
/* /*
...@@ -126,12 +121,12 @@ typedef struct _VMBUS_CHANNEL_MSGINFO { ...@@ -126,12 +121,12 @@ typedef struct _VMBUS_CHANNEL_MSGINFO {
* It will contain at minimum the VMBUS_CHANNEL_MESSAGE_HEADER header * It will contain at minimum the VMBUS_CHANNEL_MESSAGE_HEADER header
*/ */
unsigned char Msg[0]; unsigned char Msg[0];
} VMBUS_CHANNEL_MSGINFO; };
VMBUS_CHANNEL *AllocVmbusChannel(void); struct vmbus_channel *AllocVmbusChannel(void);
void FreeVmbusChannel(VMBUS_CHANNEL *Channel); void FreeVmbusChannel(struct vmbus_channel *Channel);
void VmbusOnChannelMessage(void *Context); void VmbusOnChannelMessage(void *Context);
......
...@@ -49,7 +49,7 @@ struct VMBUS_CONNECTION gVmbusConnection = { ...@@ -49,7 +49,7 @@ struct VMBUS_CONNECTION gVmbusConnection = {
int VmbusConnect(void) int VmbusConnect(void)
{ {
int ret=0; int ret=0;
VMBUS_CHANNEL_MSGINFO *msgInfo=NULL; struct vmbus_channel_msginfo *msgInfo = NULL;
VMBUS_CHANNEL_INITIATE_CONTACT *msg; VMBUS_CHANNEL_INITIATE_CONTACT *msg;
unsigned long flags; unsigned long flags;
...@@ -99,7 +99,7 @@ int VmbusConnect(void) ...@@ -99,7 +99,7 @@ int VmbusConnect(void)
goto Cleanup; goto Cleanup;
} }
msgInfo = kzalloc(sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_INITIATE_CONTACT), GFP_KERNEL); msgInfo = kzalloc(sizeof(*msgInfo) + sizeof(VMBUS_CHANNEL_INITIATE_CONTACT), GFP_KERNEL);
if (msgInfo == NULL) if (msgInfo == NULL)
{ {
ret = -1; ret = -1;
...@@ -257,10 +257,10 @@ int VmbusDisconnect(void) ...@@ -257,10 +257,10 @@ int VmbusDisconnect(void)
Get the channel object given its child relative id (ie channel id) Get the channel object given its child relative id (ie channel id)
--*/ --*/
VMBUS_CHANNEL *GetChannelFromRelId(u32 relId) struct vmbus_channel *GetChannelFromRelId(u32 relId)
{ {
VMBUS_CHANNEL* channel; struct vmbus_channel *channel;
VMBUS_CHANNEL* foundChannel=NULL; struct vmbus_channel *foundChannel = NULL;
LIST_ENTRY* anchor; LIST_ENTRY* anchor;
LIST_ENTRY* curr; LIST_ENTRY* curr;
unsigned long flags; unsigned long flags;
...@@ -268,7 +268,7 @@ VMBUS_CHANNEL *GetChannelFromRelId(u32 relId) ...@@ -268,7 +268,7 @@ VMBUS_CHANNEL *GetChannelFromRelId(u32 relId)
spin_lock_irqsave(&gVmbusConnection.channel_lock, flags); spin_lock_irqsave(&gVmbusConnection.channel_lock, flags);
ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelList) ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelList)
{ {
channel = CONTAINING_RECORD(curr, VMBUS_CHANNEL, ListEntry); channel = CONTAINING_RECORD(curr, struct vmbus_channel, ListEntry);
if (channel->OfferMsg.ChildRelId == relId) if (channel->OfferMsg.ChildRelId == relId)
{ {
...@@ -297,7 +297,7 @@ VmbusProcessChannelEvent( ...@@ -297,7 +297,7 @@ VmbusProcessChannelEvent(
void * context void * context
) )
{ {
VMBUS_CHANNEL* channel; struct vmbus_channel *channel;
u32 relId = (u32)(unsigned long)context; u32 relId = (u32)(unsigned long)context;
ASSERT(relId > 0); ASSERT(relId > 0);
......
...@@ -115,7 +115,7 @@ void VmbusChildDeviceRemove(struct hv_device *Device); ...@@ -115,7 +115,7 @@ void VmbusChildDeviceRemove(struct hv_device *Device);
/* VmbusChildDeviceDestroy( */ /* VmbusChildDeviceDestroy( */
/* struct hv_device *); */ /* struct hv_device *); */
VMBUS_CHANNEL *GetChannelFromRelId(u32 relId); struct vmbus_channel *GetChannelFromRelId(u32 relId);
/* Connection interface */ /* Connection interface */
......
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