Commit 82250213 authored by Greg Kroah-Hartman's avatar 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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 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 @@ Description: ...@@ -312,14 +312,12 @@ Description:
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 @@ Description: ...@@ -338,9 +336,7 @@ Description:
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 @@ Description: ...@@ -602,7 +598,7 @@ Description:
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 @@ Description: ...@@ -659,7 +655,7 @@ Description:
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: */
......
This diff is collapsed.
...@@ -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 @@ Description: ...@@ -208,7 +208,7 @@ Description:
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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment