提交 82250213 编写于 作者: G Greg Kroah-Hartman

Staging: hv: typedef removal for ChannelMessages.h

ChannelMessages.h is now coding style clean.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 314b1c8b
...@@ -195,7 +195,7 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, ...@@ -195,7 +195,7 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel,
) )
{ {
int ret=0; int ret=0;
VMBUS_CHANNEL_OPEN_CHANNEL* openMsg; struct vmbus_channel_open_channel *openMsg;
struct vmbus_channel_msginfo *openInfo; struct vmbus_channel_msginfo *openInfo;
void *in, *out; void *in, *out;
unsigned long flags; unsigned long flags;
...@@ -245,12 +245,12 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, ...@@ -245,12 +245,12 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel,
SendRingBufferSize); SendRingBufferSize);
/* Create and init the channel open message */ /* Create and init the channel open message */
openInfo = kmalloc(sizeof(*openInfo) + sizeof(VMBUS_CHANNEL_OPEN_CHANNEL), GFP_KERNEL); openInfo = kmalloc(sizeof(*openInfo) + sizeof(struct vmbus_channel_open_channel), GFP_KERNEL);
ASSERT(openInfo != NULL); ASSERT(openInfo != NULL);
openInfo->WaitEvent = osd_WaitEventCreate(); openInfo->WaitEvent = osd_WaitEventCreate();
openMsg = (VMBUS_CHANNEL_OPEN_CHANNEL*)openInfo->Msg; openMsg = (struct vmbus_channel_open_channel *)openInfo->Msg;
openMsg->Header.MessageType = ChannelMessageOpenChannel; openMsg->Header.MessageType = ChannelMessageOpenChannel;
openMsg->OpenId = NewChannel->OfferMsg.ChildRelId; /* FIXME */ openMsg->OpenId = NewChannel->OfferMsg.ChildRelId; /* FIXME */
openMsg->ChildRelId = NewChannel->OfferMsg.ChildRelId; openMsg->ChildRelId = NewChannel->OfferMsg.ChildRelId;
...@@ -271,7 +271,7 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, ...@@ -271,7 +271,7 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel,
DPRINT_DBG(VMBUS, "Sending channel open msg..."); DPRINT_DBG(VMBUS, "Sending channel open msg...");
ret = VmbusPostMessage(openMsg, sizeof(VMBUS_CHANNEL_OPEN_CHANNEL)); ret = VmbusPostMessage(openMsg, sizeof(struct vmbus_channel_open_channel));
if (ret != 0) if (ret != 0)
{ {
DPRINT_ERR(VMBUS, "unable to open channel - %d", ret); DPRINT_ERR(VMBUS, "unable to open channel - %d", ret);
...@@ -312,14 +312,12 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, ...@@ -312,14 +312,12 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel,
Dump the gpadl body message to the console for debugging purposes. Dump the gpadl body message to the console for debugging purposes.
--*/ --*/
static void DumpGpadlBody( static void DumpGpadlBody(struct vmbus_channel_gpadl_body *Gpadl, u32 Len)
VMBUS_CHANNEL_GPADL_BODY *Gpadl,
u32 Len)
{ {
int i=0; int i=0;
int pfnCount=0; int pfnCount=0;
pfnCount = (Len - sizeof(VMBUS_CHANNEL_GPADL_BODY))/ sizeof(u64); pfnCount = (Len - sizeof(struct vmbus_channel_gpadl_body))/ sizeof(u64);
DPRINT_DBG(VMBUS, "gpadl body - len %d pfn count %d", Len, pfnCount); DPRINT_DBG(VMBUS, "gpadl body - len %d pfn count %d", Len, pfnCount);
for (i=0; i< pfnCount; i++) for (i=0; i< pfnCount; i++)
...@@ -338,9 +336,7 @@ static void DumpGpadlBody( ...@@ -338,9 +336,7 @@ static void DumpGpadlBody(
Dump the gpadl header message to the console for debugging purposes. Dump the gpadl header message to the console for debugging purposes.
--*/ --*/
static void DumpGpadlHeader( static void DumpGpadlHeader(struct vmbus_channel_gpadl_header *Gpadl)
VMBUS_CHANNEL_GPADL_HEADER *Gpadl
)
{ {
int i=0,j=0; int i=0,j=0;
int pageCount=0; int pageCount=0;
...@@ -384,8 +380,8 @@ VmbusChannelCreateGpadlHeader( ...@@ -384,8 +380,8 @@ VmbusChannelCreateGpadlHeader(
int i; int i;
int pageCount; int pageCount;
unsigned long long pfn; unsigned long long pfn;
VMBUS_CHANNEL_GPADL_HEADER* gpaHeader; struct vmbus_channel_gpadl_header *gpaHeader;
VMBUS_CHANNEL_GPADL_BODY* gpadlBody; struct vmbus_channel_gpadl_body *gpadlBody;
struct vmbus_channel_msginfo *msgHeader; struct vmbus_channel_msginfo *msgHeader;
struct vmbus_channel_msginfo *msgBody; struct vmbus_channel_msginfo *msgBody;
u32 msgSize; u32 msgSize;
...@@ -399,19 +395,19 @@ VmbusChannelCreateGpadlHeader( ...@@ -399,19 +395,19 @@ VmbusChannelCreateGpadlHeader(
pfn = virt_to_phys(Kbuffer) >> PAGE_SHIFT; pfn = virt_to_phys(Kbuffer) >> PAGE_SHIFT;
/* do we need a gpadl body msg */ /* do we need a gpadl body msg */
pfnSize = MAX_SIZE_CHANNEL_MESSAGE - sizeof(VMBUS_CHANNEL_GPADL_HEADER) - sizeof(GPA_RANGE); pfnSize = MAX_SIZE_CHANNEL_MESSAGE - sizeof(struct vmbus_channel_gpadl_header) - sizeof(GPA_RANGE);
pfnCount = pfnSize / sizeof(u64); pfnCount = pfnSize / sizeof(u64);
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(struct vmbus_channel_msginfo) + sizeof(VMBUS_CHANNEL_GPADL_HEADER) + sizeof(GPA_RANGE) + pfnCount*sizeof(u64); msgSize = sizeof(struct vmbus_channel_msginfo) + sizeof(struct 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);
msgHeader->MessageSize=msgSize; msgHeader->MessageSize=msgSize;
gpaHeader = (VMBUS_CHANNEL_GPADL_HEADER*)msgHeader->Msg; gpaHeader = (struct vmbus_channel_gpadl_header *)msgHeader->Msg;
gpaHeader->RangeCount = 1; gpaHeader->RangeCount = 1;
gpaHeader->RangeBufLen = sizeof(GPA_RANGE) + pageCount*sizeof(u64); gpaHeader->RangeBufLen = sizeof(GPA_RANGE) + pageCount*sizeof(u64);
gpaHeader->Range[0].ByteOffset = 0; gpaHeader->Range[0].ByteOffset = 0;
...@@ -427,7 +423,7 @@ VmbusChannelCreateGpadlHeader( ...@@ -427,7 +423,7 @@ VmbusChannelCreateGpadlHeader(
pfnLeft = pageCount - pfnCount; pfnLeft = pageCount - pfnCount;
/* how many pfns can we fit */ /* how many pfns can we fit */
pfnSize = MAX_SIZE_CHANNEL_MESSAGE - sizeof(VMBUS_CHANNEL_GPADL_BODY); pfnSize = MAX_SIZE_CHANNEL_MESSAGE - sizeof(struct vmbus_channel_gpadl_body);
pfnCount = pfnSize / sizeof(u64); pfnCount = pfnSize / sizeof(u64);
/* fill in the body */ /* fill in the body */
...@@ -442,12 +438,12 @@ VmbusChannelCreateGpadlHeader( ...@@ -442,12 +438,12 @@ VmbusChannelCreateGpadlHeader(
pfnCurr = pfnLeft; pfnCurr = pfnLeft;
} }
msgSize = sizeof(struct vmbus_channel_msginfo) + sizeof(VMBUS_CHANNEL_GPADL_BODY) + pfnCurr*sizeof(u64); msgSize = sizeof(struct vmbus_channel_msginfo) + sizeof(struct 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;
(*MessageCount)++; (*MessageCount)++;
gpadlBody = (VMBUS_CHANNEL_GPADL_BODY*)msgBody->Msg; gpadlBody = (struct vmbus_channel_gpadl_body *)msgBody->Msg;
/* FIXME: Gpadl is u32 and we are using a pointer which could be 64-bit */ /* FIXME: Gpadl is u32 and we are using a pointer which could be 64-bit */
/* gpadlBody->Gpadl = kbuffer; */ /* gpadlBody->Gpadl = kbuffer; */
...@@ -465,11 +461,11 @@ VmbusChannelCreateGpadlHeader( ...@@ -465,11 +461,11 @@ VmbusChannelCreateGpadlHeader(
else else
{ {
/* everything fits in a header */ /* everything fits in a header */
msgSize = sizeof(struct vmbus_channel_msginfo) + sizeof(VMBUS_CHANNEL_GPADL_HEADER) + sizeof(GPA_RANGE) + pageCount*sizeof(u64); msgSize = sizeof(struct vmbus_channel_msginfo) + sizeof(struct 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;
gpaHeader = (VMBUS_CHANNEL_GPADL_HEADER*)msgHeader->Msg; gpaHeader = (struct vmbus_channel_gpadl_header *)msgHeader->Msg;
gpaHeader->RangeCount = 1; gpaHeader->RangeCount = 1;
gpaHeader->RangeBufLen = sizeof(GPA_RANGE) + pageCount*sizeof(u64); gpaHeader->RangeBufLen = sizeof(GPA_RANGE) + pageCount*sizeof(u64);
gpaHeader->Range[0].ByteOffset = 0; gpaHeader->Range[0].ByteOffset = 0;
...@@ -503,9 +499,9 @@ int VmbusChannelEstablishGpadl(struct vmbus_channel *Channel, ...@@ -503,9 +499,9 @@ int VmbusChannelEstablishGpadl(struct vmbus_channel *Channel,
) )
{ {
int ret=0; int ret=0;
VMBUS_CHANNEL_GPADL_HEADER* gpadlMsg; struct vmbus_channel_gpadl_header *gpadlMsg;
VMBUS_CHANNEL_GPADL_BODY* gpadlBody; struct vmbus_channel_gpadl_body *gpadlBody;
/* VMBUS_CHANNEL_GPADL_CREATED* gpadlCreated; */ /* struct vmbus_channel_gpadl_created *gpadlCreated; */
struct vmbus_channel_msginfo *msgInfo; struct vmbus_channel_msginfo *msgInfo;
struct vmbus_channel_msginfo *subMsgInfo; struct vmbus_channel_msginfo *subMsgInfo;
...@@ -526,7 +522,7 @@ int VmbusChannelEstablishGpadl(struct vmbus_channel *Channel, ...@@ -526,7 +522,7 @@ int VmbusChannelEstablishGpadl(struct vmbus_channel *Channel,
ASSERT(msgCount >0); ASSERT(msgCount >0);
msgInfo->WaitEvent = osd_WaitEventCreate(); msgInfo->WaitEvent = osd_WaitEventCreate();
gpadlMsg = (VMBUS_CHANNEL_GPADL_HEADER*)msgInfo->Msg; gpadlMsg = (struct vmbus_channel_gpadl_header *)msgInfo->Msg;
gpadlMsg->Header.MessageType = ChannelMessageGpadlHeader; gpadlMsg->Header.MessageType = ChannelMessageGpadlHeader;
gpadlMsg->ChildRelId = Channel->OfferMsg.ChildRelId; gpadlMsg->ChildRelId = Channel->OfferMsg.ChildRelId;
gpadlMsg->Gpadl = nextGpadlHandle; gpadlMsg->Gpadl = nextGpadlHandle;
...@@ -552,8 +548,8 @@ int VmbusChannelEstablishGpadl(struct vmbus_channel *Channel, ...@@ -552,8 +548,8 @@ int VmbusChannelEstablishGpadl(struct vmbus_channel *Channel,
{ {
ITERATE_LIST_ENTRIES(anchor, curr, &msgInfo->SubMsgList) ITERATE_LIST_ENTRIES(anchor, curr, &msgInfo->SubMsgList)
{ {
subMsgInfo = (struct vmbus_channel_msginfo*)curr; subMsgInfo = (struct vmbus_channel_msginfo *)curr;
gpadlBody = (VMBUS_CHANNEL_GPADL_BODY*)subMsgInfo->Msg; gpadlBody = (struct vmbus_channel_gpadl_body *)subMsgInfo->Msg;
gpadlBody->Header.MessageType = ChannelMessageGpadlBody; gpadlBody->Header.MessageType = ChannelMessageGpadlBody;
gpadlBody->Gpadl = nextGpadlHandle; gpadlBody->Gpadl = nextGpadlHandle;
...@@ -602,7 +598,7 @@ int VmbusChannelEstablishGpadl(struct vmbus_channel *Channel, ...@@ -602,7 +598,7 @@ int VmbusChannelEstablishGpadl(struct vmbus_channel *Channel,
int VmbusChannelTeardownGpadl(struct vmbus_channel *Channel, u32 GpadlHandle) int VmbusChannelTeardownGpadl(struct vmbus_channel *Channel, u32 GpadlHandle)
{ {
int ret=0; int ret=0;
VMBUS_CHANNEL_GPADL_TEARDOWN *msg; struct vmbus_channel_gpadl_teardown *msg;
struct vmbus_channel_msginfo *info; struct vmbus_channel_msginfo *info;
unsigned long flags; unsigned long flags;
...@@ -610,12 +606,12 @@ int VmbusChannelTeardownGpadl(struct vmbus_channel *Channel, u32 GpadlHandle) ...@@ -610,12 +606,12 @@ int VmbusChannelTeardownGpadl(struct vmbus_channel *Channel, u32 GpadlHandle)
ASSERT(GpadlHandle != 0); ASSERT(GpadlHandle != 0);
info = kmalloc(sizeof(*info) + sizeof(VMBUS_CHANNEL_GPADL_TEARDOWN), GFP_KERNEL); info = kmalloc(sizeof(*info) + sizeof(struct vmbus_channel_gpadl_teardown), GFP_KERNEL);
ASSERT(info != NULL); ASSERT(info != NULL);
info->WaitEvent = osd_WaitEventCreate(); info->WaitEvent = osd_WaitEventCreate();
msg = (VMBUS_CHANNEL_GPADL_TEARDOWN*)info->Msg; msg = (struct vmbus_channel_gpadl_teardown *)info->Msg;
msg->Header.MessageType = ChannelMessageGpadlTeardown; msg->Header.MessageType = ChannelMessageGpadlTeardown;
msg->ChildRelId = Channel->OfferMsg.ChildRelId; msg->ChildRelId = Channel->OfferMsg.ChildRelId;
...@@ -625,7 +621,7 @@ int VmbusChannelTeardownGpadl(struct vmbus_channel *Channel, u32 GpadlHandle) ...@@ -625,7 +621,7 @@ int VmbusChannelTeardownGpadl(struct vmbus_channel *Channel, u32 GpadlHandle)
INSERT_TAIL_LIST(&gVmbusConnection.ChannelMsgList, &info->MsgListEntry); INSERT_TAIL_LIST(&gVmbusConnection.ChannelMsgList, &info->MsgListEntry);
spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags); spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
ret = VmbusPostMessage(msg, sizeof(VMBUS_CHANNEL_GPADL_TEARDOWN)); ret = VmbusPostMessage(msg, sizeof(struct vmbus_channel_gpadl_teardown));
if (ret != 0) if (ret != 0)
{ {
/* TODO: */ /* TODO: */
...@@ -659,7 +655,7 @@ int VmbusChannelTeardownGpadl(struct vmbus_channel *Channel, u32 GpadlHandle) ...@@ -659,7 +655,7 @@ int VmbusChannelTeardownGpadl(struct vmbus_channel *Channel, u32 GpadlHandle)
void VmbusChannelClose(struct vmbus_channel *Channel) void VmbusChannelClose(struct vmbus_channel *Channel)
{ {
int ret=0; int ret=0;
VMBUS_CHANNEL_CLOSE_CHANNEL* msg; struct vmbus_channel_close_channel *msg;
struct vmbus_channel_msginfo *info; struct vmbus_channel_msginfo *info;
unsigned long flags; unsigned long flags;
...@@ -670,16 +666,16 @@ void VmbusChannelClose(struct vmbus_channel *Channel) ...@@ -670,16 +666,16 @@ void VmbusChannelClose(struct vmbus_channel *Channel)
del_timer(&Channel->poll_timer); del_timer(&Channel->poll_timer);
/* Send a closing message */ /* Send a closing message */
info = kmalloc(sizeof(*info) + sizeof(VMBUS_CHANNEL_CLOSE_CHANNEL), GFP_KERNEL); info = kmalloc(sizeof(*info) + sizeof(struct vmbus_channel_close_channel), GFP_KERNEL);
ASSERT(info != NULL); ASSERT(info != NULL);
/* info->waitEvent = osd_WaitEventCreate(); */ /* info->waitEvent = osd_WaitEventCreate(); */
msg = (VMBUS_CHANNEL_CLOSE_CHANNEL*)info->Msg; msg = (struct vmbus_channel_close_channel *)info->Msg;
msg->Header.MessageType = ChannelMessageCloseChannel; msg->Header.MessageType = ChannelMessageCloseChannel;
msg->ChildRelId = Channel->OfferMsg.ChildRelId; msg->ChildRelId = Channel->OfferMsg.ChildRelId;
ret = VmbusPostMessage(msg, sizeof(VMBUS_CHANNEL_CLOSE_CHANNEL)); ret = VmbusPostMessage(msg, sizeof(struct vmbus_channel_close_channel));
if (ret != 0) if (ret != 0)
{ {
/* TODO: */ /* TODO: */
......
...@@ -31,58 +31,23 @@ ...@@ -31,58 +31,23 @@
/* Data types */ /* Data types */
typedef void (*PFN_CHANNEL_MESSAGE_HANDLER)(VMBUS_CHANNEL_MESSAGE_HEADER* msg); typedef void (*PFN_CHANNEL_MESSAGE_HANDLER)(struct vmbus_channel_message_header *msg);
typedef struct _VMBUS_CHANNEL_MESSAGE_TABLE_ENTRY { typedef struct _VMBUS_CHANNEL_MESSAGE_TABLE_ENTRY {
VMBUS_CHANNEL_MESSAGE_TYPE messageType; enum vmbus_channel_message_type messageType;
PFN_CHANNEL_MESSAGE_HANDLER messageHandler; PFN_CHANNEL_MESSAGE_HANDLER messageHandler;
} VMBUS_CHANNEL_MESSAGE_TABLE_ENTRY; } VMBUS_CHANNEL_MESSAGE_TABLE_ENTRY;
/* Internal routines */ /* Internal routines */
static void VmbusChannelOnOffer(struct vmbus_channel_message_header *hdr);
static void static void VmbusChannelOnOpenResult(struct vmbus_channel_message_header *hdr);
VmbusChannelOnOffer( static void VmbusChannelOnOfferRescind(struct vmbus_channel_message_header *hdr);
PVMBUS_CHANNEL_MESSAGE_HEADER hdr static void VmbusChannelOnGpadlCreated(struct vmbus_channel_message_header *hdr);
); static void VmbusChannelOnGpadlTorndown(struct vmbus_channel_message_header *hdr);
static void static void VmbusChannelOnOffersDelivered(struct vmbus_channel_message_header *hdr);
VmbusChannelOnOpenResult( static void VmbusChannelOnVersionResponse(struct vmbus_channel_message_header *hdr);
PVMBUS_CHANNEL_MESSAGE_HEADER hdr static void VmbusChannelProcessOffer(void * context);
); static void VmbusChannelProcessRescindOffer(void * context);
static void
VmbusChannelOnOfferRescind(
PVMBUS_CHANNEL_MESSAGE_HEADER hdr
);
static void
VmbusChannelOnGpadlCreated(
PVMBUS_CHANNEL_MESSAGE_HEADER hdr
);
static void
VmbusChannelOnGpadlTorndown(
PVMBUS_CHANNEL_MESSAGE_HEADER hdr
);
static void
VmbusChannelOnOffersDelivered(
PVMBUS_CHANNEL_MESSAGE_HEADER hdr
);
static void
VmbusChannelOnVersionResponse(
PVMBUS_CHANNEL_MESSAGE_HEADER hdr
);
static void
VmbusChannelProcessOffer(
void * context
);
static void
VmbusChannelProcessRescindOffer(
void * context
);
/* Globals */ /* Globals */
...@@ -355,12 +320,9 @@ VmbusChannelProcessRescindOffer( ...@@ -355,12 +320,9 @@ VmbusChannelProcessRescindOffer(
and queue a work item to the channel object to process the offer synchronously and queue a work item to the channel object to process the offer synchronously
--*/ --*/
static void static void VmbusChannelOnOffer(struct vmbus_channel_message_header *hdr)
VmbusChannelOnOffer(
PVMBUS_CHANNEL_MESSAGE_HEADER hdr
)
{ {
VMBUS_CHANNEL_OFFER_CHANNEL* offer = (VMBUS_CHANNEL_OFFER_CHANNEL*)hdr; struct vmbus_channel_offer_channel *offer = (struct vmbus_channel_offer_channel *)hdr;
struct vmbus_channel *newChannel; struct vmbus_channel *newChannel;
struct hv_guid *guidType; struct hv_guid *guidType;
...@@ -415,7 +377,7 @@ VmbusChannelOnOffer( ...@@ -415,7 +377,7 @@ VmbusChannelOnOffer(
DPRINT_DBG(VMBUS, "channel object allocated - %p", newChannel); DPRINT_DBG(VMBUS, "channel object allocated - %p", newChannel);
memcpy(&newChannel->OfferMsg, offer, sizeof(VMBUS_CHANNEL_OFFER_CHANNEL)); memcpy(&newChannel->OfferMsg, offer, sizeof(struct vmbus_channel_offer_channel));
newChannel->MonitorGroup = (u8)offer->MonitorId / 32; newChannel->MonitorGroup = (u8)offer->MonitorId / 32;
newChannel->MonitorBit = (u8)offer->MonitorId % 32; newChannel->MonitorBit = (u8)offer->MonitorId % 32;
...@@ -437,12 +399,9 @@ VmbusChannelOnOffer( ...@@ -437,12 +399,9 @@ VmbusChannelOnOffer(
synchronously synchronously
--*/ --*/
static void static void VmbusChannelOnOfferRescind(struct vmbus_channel_message_header *hdr)
VmbusChannelOnOfferRescind(
PVMBUS_CHANNEL_MESSAGE_HEADER hdr
)
{ {
VMBUS_CHANNEL_RESCIND_OFFER* rescind = (VMBUS_CHANNEL_RESCIND_OFFER*)hdr; struct vmbus_channel_rescind_offer *rescind = (struct vmbus_channel_rescind_offer *)hdr;
struct vmbus_channel *channel; struct vmbus_channel *channel;
DPRINT_ENTER(VMBUS); DPRINT_ENTER(VMBUS);
...@@ -472,10 +431,7 @@ VmbusChannelOnOfferRescind( ...@@ -472,10 +431,7 @@ VmbusChannelOnOfferRescind(
Nothing to do here. Nothing to do here.
--*/ --*/
static void static void VmbusChannelOnOffersDelivered(struct vmbus_channel_message_header *hdr)
VmbusChannelOnOffersDelivered(
PVMBUS_CHANNEL_MESSAGE_HEADER hdr
)
{ {
DPRINT_ENTER(VMBUS); DPRINT_ENTER(VMBUS);
DPRINT_EXIT(VMBUS); DPRINT_EXIT(VMBUS);
...@@ -493,17 +449,14 @@ VmbusChannelOnOffersDelivered( ...@@ -493,17 +449,14 @@ VmbusChannelOnOffersDelivered(
response and signal the requesting thread. response and signal the requesting thread.
--*/ --*/
static void static void VmbusChannelOnOpenResult(struct vmbus_channel_message_header *hdr)
VmbusChannelOnOpenResult(
PVMBUS_CHANNEL_MESSAGE_HEADER hdr
)
{ {
VMBUS_CHANNEL_OPEN_RESULT* result = (VMBUS_CHANNEL_OPEN_RESULT*)hdr; struct vmbus_channel_open_result *result = (struct vmbus_channel_open_result *)hdr;
LIST_ENTRY* anchor; LIST_ENTRY* anchor;
LIST_ENTRY* curr; LIST_ENTRY* curr;
struct vmbus_channel_msginfo *msgInfo; struct vmbus_channel_msginfo *msgInfo;
VMBUS_CHANNEL_MESSAGE_HEADER* requestHeader; struct vmbus_channel_message_header *requestHeader;
VMBUS_CHANNEL_OPEN_CHANNEL* openMsg; struct vmbus_channel_open_channel *openMsg;
unsigned long flags; unsigned long flags;
DPRINT_ENTER(VMBUS); DPRINT_ENTER(VMBUS);
...@@ -516,15 +469,15 @@ VmbusChannelOnOpenResult( ...@@ -516,15 +469,15 @@ VmbusChannelOnOpenResult(
ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList) ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList)
{ {
msgInfo = (struct vmbus_channel_msginfo *)curr; msgInfo = (struct vmbus_channel_msginfo *)curr;
requestHeader = (VMBUS_CHANNEL_MESSAGE_HEADER*)msgInfo->Msg; requestHeader = (struct vmbus_channel_message_header *)msgInfo->Msg;
if (requestHeader->MessageType == ChannelMessageOpenChannel) if (requestHeader->MessageType == ChannelMessageOpenChannel)
{ {
openMsg = (VMBUS_CHANNEL_OPEN_CHANNEL*)msgInfo->Msg; openMsg = (struct vmbus_channel_open_channel *)msgInfo->Msg;
if (openMsg->ChildRelId == result->ChildRelId && if (openMsg->ChildRelId == result->ChildRelId &&
openMsg->OpenId == result->OpenId) openMsg->OpenId == result->OpenId)
{ {
memcpy(&msgInfo->Response.OpenResult, result, sizeof(VMBUS_CHANNEL_OPEN_RESULT)); memcpy(&msgInfo->Response.OpenResult, result, sizeof(struct vmbus_channel_open_result));
osd_WaitEventSet(msgInfo->WaitEvent); osd_WaitEventSet(msgInfo->WaitEvent);
break; break;
} }
...@@ -547,17 +500,14 @@ VmbusChannelOnOpenResult( ...@@ -547,17 +500,14 @@ VmbusChannelOnOpenResult(
response and signal the requesting thread. response and signal the requesting thread.
--*/ --*/
static void static void VmbusChannelOnGpadlCreated(struct vmbus_channel_message_header *hdr)
VmbusChannelOnGpadlCreated(
PVMBUS_CHANNEL_MESSAGE_HEADER hdr
)
{ {
VMBUS_CHANNEL_GPADL_CREATED *gpadlCreated = (VMBUS_CHANNEL_GPADL_CREATED*)hdr; struct vmbus_channel_gpadl_created *gpadlCreated = (struct vmbus_channel_gpadl_created *)hdr;
LIST_ENTRY *anchor; LIST_ENTRY *anchor;
LIST_ENTRY *curr; LIST_ENTRY *curr;
struct vmbus_channel_msginfo *msgInfo; struct vmbus_channel_msginfo *msgInfo;
VMBUS_CHANNEL_MESSAGE_HEADER *requestHeader; struct vmbus_channel_message_header *requestHeader;
VMBUS_CHANNEL_GPADL_HEADER *gpadlHeader; struct vmbus_channel_gpadl_header *gpadlHeader;
unsigned long flags; unsigned long flags;
DPRINT_ENTER(VMBUS); DPRINT_ENTER(VMBUS);
...@@ -570,16 +520,16 @@ VmbusChannelOnGpadlCreated( ...@@ -570,16 +520,16 @@ VmbusChannelOnGpadlCreated(
ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList) ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList)
{ {
msgInfo = (struct vmbus_channel_msginfo *)curr; msgInfo = (struct vmbus_channel_msginfo *)curr;
requestHeader = (VMBUS_CHANNEL_MESSAGE_HEADER*)msgInfo->Msg; requestHeader = (struct vmbus_channel_message_header *)msgInfo->Msg;
if (requestHeader->MessageType == ChannelMessageGpadlHeader) if (requestHeader->MessageType == ChannelMessageGpadlHeader)
{ {
gpadlHeader = (VMBUS_CHANNEL_GPADL_HEADER*)requestHeader; gpadlHeader = (struct vmbus_channel_gpadl_header *)requestHeader;
if ((gpadlCreated->ChildRelId == gpadlHeader->ChildRelId) && if ((gpadlCreated->ChildRelId == gpadlHeader->ChildRelId) &&
(gpadlCreated->Gpadl == gpadlHeader->Gpadl)) (gpadlCreated->Gpadl == gpadlHeader->Gpadl))
{ {
memcpy(&msgInfo->Response.GpadlCreated, gpadlCreated, sizeof(VMBUS_CHANNEL_GPADL_CREATED)); memcpy(&msgInfo->Response.GpadlCreated, gpadlCreated, sizeof(struct vmbus_channel_gpadl_created));
osd_WaitEventSet(msgInfo->WaitEvent); osd_WaitEventSet(msgInfo->WaitEvent);
break; break;
} }
...@@ -602,17 +552,14 @@ VmbusChannelOnGpadlCreated( ...@@ -602,17 +552,14 @@ VmbusChannelOnGpadlCreated(
response and signal the requesting thread. response and signal the requesting thread.
--*/ --*/
static void static void VmbusChannelOnGpadlTorndown(struct vmbus_channel_message_header *hdr)
VmbusChannelOnGpadlTorndown(
PVMBUS_CHANNEL_MESSAGE_HEADER hdr
)
{ {
VMBUS_CHANNEL_GPADL_TORNDOWN* gpadlTorndown = (VMBUS_CHANNEL_GPADL_TORNDOWN*)hdr; struct vmbus_channel_gpadl_torndown* gpadlTorndown = (struct vmbus_channel_gpadl_torndown *)hdr;
LIST_ENTRY* anchor; LIST_ENTRY* anchor;
LIST_ENTRY* curr; LIST_ENTRY* curr;
struct vmbus_channel_msginfo *msgInfo; struct vmbus_channel_msginfo *msgInfo;
VMBUS_CHANNEL_MESSAGE_HEADER *requestHeader; struct vmbus_channel_message_header *requestHeader;
VMBUS_CHANNEL_GPADL_TEARDOWN *gpadlTeardown; struct vmbus_channel_gpadl_teardown *gpadlTeardown;
unsigned long flags; unsigned long flags;
DPRINT_ENTER(VMBUS); DPRINT_ENTER(VMBUS);
...@@ -623,15 +570,15 @@ VmbusChannelOnGpadlTorndown( ...@@ -623,15 +570,15 @@ VmbusChannelOnGpadlTorndown(
ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList) ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList)
{ {
msgInfo = (struct vmbus_channel_msginfo *)curr; msgInfo = (struct vmbus_channel_msginfo *)curr;
requestHeader = (VMBUS_CHANNEL_MESSAGE_HEADER*)msgInfo->Msg; requestHeader = (struct vmbus_channel_message_header *)msgInfo->Msg;
if (requestHeader->MessageType == ChannelMessageGpadlTeardown) if (requestHeader->MessageType == ChannelMessageGpadlTeardown)
{ {
gpadlTeardown = (VMBUS_CHANNEL_GPADL_TEARDOWN*)requestHeader; gpadlTeardown = (struct vmbus_channel_gpadl_teardown *)requestHeader;
if (gpadlTorndown->Gpadl == gpadlTeardown->Gpadl) if (gpadlTorndown->Gpadl == gpadlTeardown->Gpadl)
{ {
memcpy(&msgInfo->Response.GpadlTorndown, gpadlTorndown, sizeof(VMBUS_CHANNEL_GPADL_TORNDOWN)); memcpy(&msgInfo->Response.GpadlTorndown, gpadlTorndown, sizeof(struct vmbus_channel_gpadl_torndown));
osd_WaitEventSet(msgInfo->WaitEvent); osd_WaitEventSet(msgInfo->WaitEvent);
break; break;
} }
...@@ -654,17 +601,14 @@ VmbusChannelOnGpadlTorndown( ...@@ -654,17 +601,14 @@ VmbusChannelOnGpadlTorndown(
response and signal the requesting thread. response and signal the requesting thread.
--*/ --*/
static void static void VmbusChannelOnVersionResponse(struct vmbus_channel_message_header *hdr)
VmbusChannelOnVersionResponse(
PVMBUS_CHANNEL_MESSAGE_HEADER hdr
)
{ {
LIST_ENTRY* anchor; LIST_ENTRY* anchor;
LIST_ENTRY* curr; LIST_ENTRY* curr;
struct vmbus_channel_msginfo *msgInfo; struct vmbus_channel_msginfo *msgInfo;
VMBUS_CHANNEL_MESSAGE_HEADER *requestHeader; struct vmbus_channel_message_header *requestHeader;
VMBUS_CHANNEL_INITIATE_CONTACT *initiate; struct vmbus_channel_initiate_contact *initiate;
VMBUS_CHANNEL_VERSION_RESPONSE *versionResponse = (VMBUS_CHANNEL_VERSION_RESPONSE*)hdr; struct vmbus_channel_version_response *versionResponse = (struct vmbus_channel_version_response *)hdr;
unsigned long flags; unsigned long flags;
DPRINT_ENTER(VMBUS); DPRINT_ENTER(VMBUS);
...@@ -674,12 +618,12 @@ VmbusChannelOnVersionResponse( ...@@ -674,12 +618,12 @@ VmbusChannelOnVersionResponse(
ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList) ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList)
{ {
msgInfo = (struct vmbus_channel_msginfo *)curr; msgInfo = (struct vmbus_channel_msginfo *)curr;
requestHeader = (VMBUS_CHANNEL_MESSAGE_HEADER*)msgInfo->Msg; requestHeader = (struct vmbus_channel_message_header *)msgInfo->Msg;
if (requestHeader->MessageType == ChannelMessageInitiateContact) if (requestHeader->MessageType == ChannelMessageInitiateContact)
{ {
initiate = (VMBUS_CHANNEL_INITIATE_CONTACT*)requestHeader; initiate = (struct vmbus_channel_initiate_contact *)requestHeader;
memcpy(&msgInfo->Response.VersionResponse, versionResponse, sizeof(VMBUS_CHANNEL_VERSION_RESPONSE)); memcpy(&msgInfo->Response.VersionResponse, versionResponse, sizeof(struct vmbus_channel_version_response));
osd_WaitEventSet(msgInfo->WaitEvent); osd_WaitEventSet(msgInfo->WaitEvent);
} }
} }
...@@ -702,12 +646,12 @@ VmbusChannelOnVersionResponse( ...@@ -702,12 +646,12 @@ VmbusChannelOnVersionResponse(
void VmbusOnChannelMessage(void *Context) void VmbusOnChannelMessage(void *Context)
{ {
struct hv_message *msg = Context; struct hv_message *msg = Context;
VMBUS_CHANNEL_MESSAGE_HEADER* hdr; struct vmbus_channel_message_header *hdr;
int size; int size;
DPRINT_ENTER(VMBUS); DPRINT_ENTER(VMBUS);
hdr = (VMBUS_CHANNEL_MESSAGE_HEADER*)msg->u.Payload; hdr = (struct vmbus_channel_message_header *)msg->u.Payload;
size=msg->Header.PayloadSize; size=msg->Header.PayloadSize;
DPRINT_DBG(VMBUS, "message type %d size %d", hdr->MessageType, size); DPRINT_DBG(VMBUS, "message type %d size %d", hdr->MessageType, size);
...@@ -748,16 +692,16 @@ void VmbusOnChannelMessage(void *Context) ...@@ -748,16 +692,16 @@ void VmbusOnChannelMessage(void *Context)
int VmbusChannelRequestOffers(void) int VmbusChannelRequestOffers(void)
{ {
int ret=0; int ret=0;
VMBUS_CHANNEL_MESSAGE_HEADER* msg; struct vmbus_channel_message_header *msg;
struct vmbus_channel_msginfo *msgInfo; struct vmbus_channel_msginfo *msgInfo;
DPRINT_ENTER(VMBUS); DPRINT_ENTER(VMBUS);
msgInfo = kmalloc(sizeof(*msgInfo) + sizeof(VMBUS_CHANNEL_MESSAGE_HEADER), GFP_KERNEL); msgInfo = kmalloc(sizeof(*msgInfo) + sizeof(struct vmbus_channel_message_header), GFP_KERNEL);
ASSERT(msgInfo != NULL); ASSERT(msgInfo != NULL);
msgInfo->WaitEvent = osd_WaitEventCreate(); msgInfo->WaitEvent = osd_WaitEventCreate();
msg = (VMBUS_CHANNEL_MESSAGE_HEADER*)msgInfo->Msg; msg = (struct vmbus_channel_message_header *)msgInfo->Msg;
msg->MessageType = ChannelMessageRequestOffers; msg->MessageType = ChannelMessageRequestOffers;
...@@ -765,7 +709,7 @@ int VmbusChannelRequestOffers(void) ...@@ -765,7 +709,7 @@ int VmbusChannelRequestOffers(void)
INSERT_TAIL_LIST(&gVmbusConnection.channelMsgList, &msgInfo->msgListEntry); INSERT_TAIL_LIST(&gVmbusConnection.channelMsgList, &msgInfo->msgListEntry);
SpinlockRelease(gVmbusConnection.channelMsgLock);*/ SpinlockRelease(gVmbusConnection.channelMsgLock);*/
ret = VmbusPostMessage(msg, sizeof(VMBUS_CHANNEL_MESSAGE_HEADER)); ret = VmbusPostMessage(msg, sizeof(struct vmbus_channel_message_header));
if (ret != 0) if (ret != 0)
{ {
DPRINT_ERR(VMBUS, "Unable to request offers - %d", ret); DPRINT_ERR(VMBUS, "Unable to request offers - %d", ret);
......
...@@ -50,7 +50,7 @@ struct vmbus_channel { ...@@ -50,7 +50,7 @@ struct vmbus_channel {
enum vmbus_channel_state State; enum vmbus_channel_state State;
VMBUS_CHANNEL_OFFER_CHANNEL OfferMsg; struct vmbus_channel_offer_channel OfferMsg;
/* /*
* These are based on the OfferMsg.MonitorId. * These are based on the OfferMsg.MonitorId.
* Save it here for easy access. * Save it here for easy access.
...@@ -107,11 +107,11 @@ struct vmbus_channel_msginfo { ...@@ -107,11 +107,11 @@ struct vmbus_channel_msginfo {
struct osd_waitevent *WaitEvent; struct osd_waitevent *WaitEvent;
union { union {
VMBUS_CHANNEL_VERSION_SUPPORTED VersionSupported; struct vmbus_channel_version_supported VersionSupported;
VMBUS_CHANNEL_OPEN_RESULT OpenResult; struct vmbus_channel_open_result OpenResult;
VMBUS_CHANNEL_GPADL_TORNDOWN GpadlTorndown; struct vmbus_channel_gpadl_torndown GpadlTorndown;
VMBUS_CHANNEL_GPADL_CREATED GpadlCreated; struct vmbus_channel_gpadl_created GpadlCreated;
VMBUS_CHANNEL_VERSION_RESPONSE VersionResponse; struct vmbus_channel_version_response VersionResponse;
} Response; } Response;
u32 MessageSize; u32 MessageSize;
......
...@@ -51,7 +51,7 @@ int VmbusConnect(void) ...@@ -51,7 +51,7 @@ int VmbusConnect(void)
{ {
int ret=0; int ret=0;
struct vmbus_channel_msginfo *msgInfo = NULL; struct vmbus_channel_msginfo *msgInfo = NULL;
VMBUS_CHANNEL_INITIATE_CONTACT *msg; struct vmbus_channel_initiate_contact *msg;
unsigned long flags; unsigned long flags;
DPRINT_ENTER(VMBUS); DPRINT_ENTER(VMBUS);
...@@ -100,7 +100,7 @@ int VmbusConnect(void) ...@@ -100,7 +100,7 @@ int VmbusConnect(void)
goto Cleanup; goto Cleanup;
} }
msgInfo = kzalloc(sizeof(*msgInfo) + sizeof(VMBUS_CHANNEL_INITIATE_CONTACT), GFP_KERNEL); msgInfo = kzalloc(sizeof(*msgInfo) + sizeof(struct vmbus_channel_initiate_contact), GFP_KERNEL);
if (msgInfo == NULL) if (msgInfo == NULL)
{ {
ret = -1; ret = -1;
...@@ -108,7 +108,7 @@ int VmbusConnect(void) ...@@ -108,7 +108,7 @@ int VmbusConnect(void)
} }
msgInfo->WaitEvent = osd_WaitEventCreate(); msgInfo->WaitEvent = osd_WaitEventCreate();
msg = (VMBUS_CHANNEL_INITIATE_CONTACT*)msgInfo->Msg; msg = (struct vmbus_channel_initiate_contact *)msgInfo->Msg;
msg->Header.MessageType = ChannelMessageInitiateContact; msg->Header.MessageType = ChannelMessageInitiateContact;
msg->VMBusVersionRequested = VMBUS_REVISION_NUMBER; msg->VMBusVersionRequested = VMBUS_REVISION_NUMBER;
...@@ -129,7 +129,7 @@ int VmbusConnect(void) ...@@ -129,7 +129,7 @@ int VmbusConnect(void)
DPRINT_DBG(VMBUS, "Sending channel initiate msg..."); DPRINT_DBG(VMBUS, "Sending channel initiate msg...");
ret = VmbusPostMessage(msg, sizeof(VMBUS_CHANNEL_INITIATE_CONTACT)); ret = VmbusPostMessage(msg, sizeof(struct vmbus_channel_initiate_contact));
if (ret != 0) if (ret != 0)
{ {
REMOVE_ENTRY_LIST(&msgInfo->MsgListEntry); REMOVE_ENTRY_LIST(&msgInfo->MsgListEntry);
...@@ -208,7 +208,7 @@ int VmbusConnect(void) ...@@ -208,7 +208,7 @@ int VmbusConnect(void)
int VmbusDisconnect(void) int VmbusDisconnect(void)
{ {
int ret=0; int ret=0;
VMBUS_CHANNEL_UNLOAD *msg; struct vmbus_channel_message_header *msg;
DPRINT_ENTER(VMBUS); DPRINT_ENTER(VMBUS);
...@@ -216,11 +216,11 @@ int VmbusDisconnect(void) ...@@ -216,11 +216,11 @@ int VmbusDisconnect(void)
if (gVmbusConnection.ConnectState != Connected) if (gVmbusConnection.ConnectState != Connected)
return -1; return -1;
msg = kzalloc(sizeof(VMBUS_CHANNEL_UNLOAD), GFP_KERNEL); msg = kzalloc(sizeof(struct vmbus_channel_message_header), GFP_KERNEL);
msg->MessageType = ChannelMessageUnload; msg->MessageType = ChannelMessageUnload;
ret = VmbusPostMessage(msg, sizeof(VMBUS_CHANNEL_UNLOAD)); ret = VmbusPostMessage(msg, sizeof(struct vmbus_channel_message_header));
if (ret != 0) if (ret != 0)
{ {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "VmbusPacketFormat.h" #include "VmbusPacketFormat.h"
/* Version 1 messages */ /* Version 1 messages */
typedef enum _VMBUS_CHANNEL_MESSAGE_TYPE { enum vmbus_channel_message_type {
ChannelMessageInvalid = 0, ChannelMessageInvalid = 0,
ChannelMessageOfferChannel = 1, ChannelMessageOfferChannel = 1,
ChannelMessageRescindChannelOffer = 2, ChannelMessageRescindChannelOffer = 2,
...@@ -50,39 +50,39 @@ typedef enum _VMBUS_CHANNEL_MESSAGE_TYPE { ...@@ -50,39 +50,39 @@ typedef enum _VMBUS_CHANNEL_MESSAGE_TYPE {
ChannelMessageViewRangeRemove = 18, ChannelMessageViewRangeRemove = 18,
#endif #endif
ChannelMessageCount ChannelMessageCount
} __attribute__((packed)) VMBUS_CHANNEL_MESSAGE_TYPE, *PVMBUS_CHANNEL_MESSAGE_TYPE; } __attribute__((packed));
typedef struct _VMBUS_CHANNEL_MESSAGE_HEADER { struct vmbus_channel_message_header {
VMBUS_CHANNEL_MESSAGE_TYPE MessageType; enum vmbus_channel_message_type MessageType;
u32 Padding; u32 Padding;
} __attribute__((packed)) VMBUS_CHANNEL_MESSAGE_HEADER, *PVMBUS_CHANNEL_MESSAGE_HEADER; } __attribute__((packed));
/* Query VMBus Version parameters */ /* Query VMBus Version parameters */
typedef struct _VMBUS_CHANNEL_QUERY_VMBUS_VERSION { struct vmbus_channel_query_vmbus_version {
VMBUS_CHANNEL_MESSAGE_HEADER Header; struct vmbus_channel_message_header Header;
u32 Version; u32 Version;
} __attribute__((packed)) VMBUS_CHANNEL_QUERY_VMBUS_VERSION, *PVMBUS_CHANNEL_QUERY_VMBUS_VERSION; } __attribute__((packed));
/* VMBus Version Supported parameters */ /* VMBus Version Supported parameters */
typedef struct _VMBUS_CHANNEL_VERSION_SUPPORTED { struct vmbus_channel_version_supported {
VMBUS_CHANNEL_MESSAGE_HEADER Header; struct vmbus_channel_message_header Header;
bool VersionSupported; bool VersionSupported;
} __attribute__((packed)) VMBUS_CHANNEL_VERSION_SUPPORTED, *PVMBUS_CHANNEL_VERSION_SUPPORTED; } __attribute__((packed));
/* Offer Channel parameters */ /* Offer Channel parameters */
typedef struct _VMBUS_CHANNEL_OFFER_CHANNEL { struct vmbus_channel_offer_channel {
VMBUS_CHANNEL_MESSAGE_HEADER Header; struct vmbus_channel_message_header Header;
struct vmbus_channel_offer Offer; struct vmbus_channel_offer Offer;
u32 ChildRelId; u32 ChildRelId;
u8 MonitorId; u8 MonitorId;
bool MonitorAllocated; bool MonitorAllocated;
} __attribute__((packed)) VMBUS_CHANNEL_OFFER_CHANNEL, *PVMBUS_CHANNEL_OFFER_CHANNEL; } __attribute__((packed));
/* Rescind Offer parameters */ /* Rescind Offer parameters */
typedef struct _VMBUS_CHANNEL_RESCIND_OFFER { struct vmbus_channel_rescind_offer {
VMBUS_CHANNEL_MESSAGE_HEADER Header; struct vmbus_channel_message_header Header;
u32 ChildRelId; u32 ChildRelId;
} __attribute__((packed)) VMBUS_CHANNEL_RESCIND_OFFER, *PVMBUS_CHANNEL_RESCIND_OFFER; } __attribute__((packed));
/* /*
* Request Offer -- no parameters, SynIC message contains the partition ID * Request Offer -- no parameters, SynIC message contains the partition ID
...@@ -94,8 +94,8 @@ typedef struct _VMBUS_CHANNEL_RESCIND_OFFER { ...@@ -94,8 +94,8 @@ typedef struct _VMBUS_CHANNEL_RESCIND_OFFER {
*/ */
/* Open Channel parameters */ /* Open Channel parameters */
typedef struct _VMBUS_CHANNEL_OPEN_CHANNEL { struct vmbus_channel_open_channel {
VMBUS_CHANNEL_MESSAGE_HEADER Header; struct vmbus_channel_message_header Header;
/* Identifies the specific VMBus channel that is being opened. */ /* Identifies the specific VMBus channel that is being opened. */
u32 ChildRelId; u32 ChildRelId;
...@@ -118,24 +118,21 @@ typedef struct _VMBUS_CHANNEL_OPEN_CHANNEL { ...@@ -118,24 +118,21 @@ typedef struct _VMBUS_CHANNEL_OPEN_CHANNEL {
/* User-specific data to be passed along to the server endpoint. */ /* User-specific data to be passed along to the server endpoint. */
unsigned char UserData[MAX_USER_DEFINED_BYTES]; unsigned char UserData[MAX_USER_DEFINED_BYTES];
} __attribute__((packed)) VMBUS_CHANNEL_OPEN_CHANNEL, *PVMBUS_CHANNEL_OPEN_CHANNEL; } __attribute__((packed));
/* Reopen Channel parameters; */
typedef VMBUS_CHANNEL_OPEN_CHANNEL VMBUS_CHANNEL_REOPEN_CHANNEL, *PVMBUS_CHANNEL_REOPEN_CHANNEL;
/* Open Channel Result parameters */ /* Open Channel Result parameters */
typedef struct _VMBUS_CHANNEL_OPEN_RESULT { struct vmbus_channel_open_result {
VMBUS_CHANNEL_MESSAGE_HEADER Header; struct vmbus_channel_message_header Header;
u32 ChildRelId; u32 ChildRelId;
u32 OpenId; u32 OpenId;
u32 Status; u32 Status;
} __attribute__((packed)) VMBUS_CHANNEL_OPEN_RESULT, *PVMBUS_CHANNEL_OPEN_RESULT; } __attribute__((packed));
/* Close channel parameters; */ /* Close channel parameters; */
typedef struct _VMBUS_CHANNEL_CLOSE_CHANNEL { struct vmbus_channel_close_channel {
VMBUS_CHANNEL_MESSAGE_HEADER Header; struct vmbus_channel_message_header Header;
u32 ChildRelId; u32 ChildRelId;
} __attribute__((packed)) VMBUS_CHANNEL_CLOSE_CHANNEL, *PVMBUS_CHANNEL_CLOSE_CHANNEL; } __attribute__((packed));
/* Channel Message GPADL */ /* Channel Message GPADL */
#define GPADL_TYPE_RING_BUFFER 1 #define GPADL_TYPE_RING_BUFFER 1
...@@ -148,75 +145,73 @@ typedef struct _VMBUS_CHANNEL_CLOSE_CHANNEL { ...@@ -148,75 +145,73 @@ typedef struct _VMBUS_CHANNEL_CLOSE_CHANNEL {
* implied number of PFNs won't fit in this packet, there will be a * implied number of PFNs won't fit in this packet, there will be a
* follow-up packet that contains more. * follow-up packet that contains more.
*/ */
typedef struct _VMBUS_CHANNEL_GPADL_HEADER { struct vmbus_channel_gpadl_header {
VMBUS_CHANNEL_MESSAGE_HEADER Header; struct vmbus_channel_message_header Header;
u32 ChildRelId; u32 ChildRelId;
u32 Gpadl; u32 Gpadl;
u16 RangeBufLen; u16 RangeBufLen;
u16 RangeCount; u16 RangeCount;
GPA_RANGE Range[0]; GPA_RANGE Range[0];
} __attribute__((packed)) VMBUS_CHANNEL_GPADL_HEADER, *PVMBUS_CHANNEL_GPADL_HEADER; } __attribute__((packed));
/* This is the followup packet that contains more PFNs. */ /* This is the followup packet that contains more PFNs. */
typedef struct _VMBUS_CHANNEL_GPADL_BODY { struct vmbus_channel_gpadl_body {
VMBUS_CHANNEL_MESSAGE_HEADER Header; struct vmbus_channel_message_header Header;
u32 MessageNumber; u32 MessageNumber;
u32 Gpadl; u32 Gpadl;
u64 Pfn[0]; u64 Pfn[0];
} __attribute__((packed)) VMBUS_CHANNEL_GPADL_BODY, *PVMBUS_CHANNEL_GPADL_BODY; } __attribute__((packed));
typedef struct _VMBUS_CHANNEL_GPADL_CREATED { struct vmbus_channel_gpadl_created {
VMBUS_CHANNEL_MESSAGE_HEADER Header; struct vmbus_channel_message_header Header;
u32 ChildRelId; u32 ChildRelId;
u32 Gpadl; u32 Gpadl;
u32 CreationStatus; u32 CreationStatus;
} __attribute__((packed)) VMBUS_CHANNEL_GPADL_CREATED, *PVMBUS_CHANNEL_GPADL_CREATED; } __attribute__((packed));
typedef struct _VMBUS_CHANNEL_GPADL_TEARDOWN { struct vmbus_channel_gpadl_teardown {
VMBUS_CHANNEL_MESSAGE_HEADER Header; struct vmbus_channel_message_header Header;
u32 ChildRelId; u32 ChildRelId;
u32 Gpadl; u32 Gpadl;
} __attribute__((packed)) VMBUS_CHANNEL_GPADL_TEARDOWN, *PVMBUS_CHANNEL_GPADL_TEARDOWN; } __attribute__((packed));
typedef struct _VMBUS_CHANNEL_GPADL_TORNDOWN { struct vmbus_channel_gpadl_torndown {
VMBUS_CHANNEL_MESSAGE_HEADER Header; struct vmbus_channel_message_header Header;
u32 Gpadl; u32 Gpadl;
} __attribute__((packed)) VMBUS_CHANNEL_GPADL_TORNDOWN, *PVMBUS_CHANNEL_GPADL_TORNDOWN; } __attribute__((packed));
#ifdef VMBUS_FEATURE_PARENT_OR_PEER_MEMORY_MAPPED_INTO_A_CHILD #ifdef VMBUS_FEATURE_PARENT_OR_PEER_MEMORY_MAPPED_INTO_A_CHILD
typedef struct _VMBUS_CHANNEL_VIEW_RANGE_ADD { struct vmbus_channel_view_range_add {
VMBUS_CHANNEL_MESSAGE_HEADER Header; struct vmbus_channel_message_header Header;
PHYSICAL_ADDRESS ViewRangeBase; PHYSICAL_ADDRESS ViewRangeBase;
u64 ViewRangeLength; u64 ViewRangeLength;
u32 ChildRelId; u32 ChildRelId;
} __attribute__((packed)) VMBUS_CHANNEL_VIEW_RANGE_ADD, *PVMBUS_CHANNEL_VIEW_RANGE_ADD; } __attribute__((packed));
typedef struct _VMBUS_CHANNEL_VIEW_RANGE_REMOVE { struct vmbus_channel_view_range_remove {
VMBUS_CHANNEL_MESSAGE_HEADER Header; struct vmbus_channel_message_header Header;
PHYSICAL_ADDRESS ViewRangeBase; PHYSICAL_ADDRESS ViewRangeBase;
u32 ChildRelId; u32 ChildRelId;
} __attribute__((packed)) VMBUS_CHANNEL_VIEW_RANGE_REMOVE, *PVMBUS_CHANNEL_VIEW_RANGE_REMOVE; } __attribute__((packed));
#endif #endif
typedef struct _VMBUS_CHANNEL_RELID_RELEASED { struct vmbus_channel_relid_released {
VMBUS_CHANNEL_MESSAGE_HEADER Header; struct vmbus_channel_message_header Header;
u32 ChildRelId; u32 ChildRelId;
} __attribute__((packed)) VMBUS_CHANNEL_RELID_RELEASED, *PVMBUS_CHANNEL_RELID_RELEASED; } __attribute__((packed));
typedef struct _VMBUS_CHANNEL_INITIATE_CONTACT { struct vmbus_channel_initiate_contact {
VMBUS_CHANNEL_MESSAGE_HEADER Header; struct vmbus_channel_message_header Header;
u32 VMBusVersionRequested; u32 VMBusVersionRequested;
u32 Padding2; u32 Padding2;
u64 InterruptPage; u64 InterruptPage;
u64 MonitorPage1; u64 MonitorPage1;
u64 MonitorPage2; u64 MonitorPage2;
} __attribute__((packed)) VMBUS_CHANNEL_INITIATE_CONTACT, *PVMBUS_CHANNEL_INITIATE_CONTACT; } __attribute__((packed));
typedef struct _VMBUS_CHANNEL_VERSION_RESPONSE { struct vmbus_channel_version_response {
VMBUS_CHANNEL_MESSAGE_HEADER Header; struct vmbus_channel_message_header Header;
bool VersionSupported; bool VersionSupported;
} __attribute__((packed)) VMBUS_CHANNEL_VERSION_RESPONSE, *PVMBUS_CHANNEL_VERSION_RESPONSE; } __attribute__((packed));
typedef VMBUS_CHANNEL_MESSAGE_HEADER VMBUS_CHANNEL_UNLOAD, *PVMBUS_CHANNEL_UNLOAD;
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册