#include "logging.h"
#include "VmbusPrivate.h"
-typedef void (*PFN_CHANNEL_MESSAGE_HANDLER)(struct vmbus_channel_message_header *msg);
-
struct vmbus_channel_message_table_entry {
- enum vmbus_channel_message_type messageType;
- PFN_CHANNEL_MESSAGE_HANDLER messageHandler;
+ enum vmbus_channel_message_type messageType;
+ void (*messageHandler)(struct vmbus_channel_message_header *msg);
};
-static void VmbusChannelOnOffer(struct vmbus_channel_message_header *);
-static void VmbusChannelOnOpenResult(struct vmbus_channel_message_header *);
-static void VmbusChannelOnOfferRescind(struct vmbus_channel_message_header *);
-static void VmbusChannelOnGpadlCreated(struct vmbus_channel_message_header *);
-static void VmbusChannelOnGpadlTorndown(struct vmbus_channel_message_header *);
-static void VmbusChannelOnOffersDelivered(struct vmbus_channel_message_header *);
-static void VmbusChannelOnVersionResponse(struct vmbus_channel_message_header *);
-static void VmbusChannelProcessOffer(void *context);
-static void VmbusChannelProcessRescindOffer(void *context);
-
-
#define MAX_NUM_DEVICE_CLASSES_SUPPORTED 4
static const struct hv_guid
gSupportedDeviceClasses[MAX_NUM_DEVICE_CLASSES_SUPPORTED] = {
},
};
-/* Channel message dispatch table */
-static struct vmbus_channel_message_table_entry
- gChannelMessageTable[ChannelMessageCount] = {
- {ChannelMessageInvalid, NULL},
- {ChannelMessageOfferChannel, VmbusChannelOnOffer},
- {ChannelMessageRescindChannelOffer, VmbusChannelOnOfferRescind},
- {ChannelMessageRequestOffers, NULL},
- {ChannelMessageAllOffersDelivered, VmbusChannelOnOffersDelivered},
- {ChannelMessageOpenChannel, NULL},
- {ChannelMessageOpenChannelResult, VmbusChannelOnOpenResult},
- {ChannelMessageCloseChannel, NULL},
- {ChannelMessageGpadlHeader, NULL},
- {ChannelMessageGpadlBody, NULL},
- {ChannelMessageGpadlCreated, VmbusChannelOnGpadlCreated},
- {ChannelMessageGpadlTeardown, NULL},
- {ChannelMessageGpadlTorndown, VmbusChannelOnGpadlTorndown},
- {ChannelMessageRelIdReleased, NULL},
- {ChannelMessageInitiateContact, NULL},
- {ChannelMessageVersionResponse, VmbusChannelOnVersionResponse},
- {ChannelMessageUnload, NULL},
-};
-
/**
* AllocVmbusChannel - Allocate and initialize a vmbus channel object
*/
DPRINT_EXIT(VMBUS);
}
+/* Channel message dispatch table */
+static struct vmbus_channel_message_table_entry
+ gChannelMessageTable[ChannelMessageCount] = {
+ {ChannelMessageInvalid, NULL},
+ {ChannelMessageOfferChannel, VmbusChannelOnOffer},
+ {ChannelMessageRescindChannelOffer, VmbusChannelOnOfferRescind},
+ {ChannelMessageRequestOffers, NULL},
+ {ChannelMessageAllOffersDelivered, VmbusChannelOnOffersDelivered},
+ {ChannelMessageOpenChannel, NULL},
+ {ChannelMessageOpenChannelResult, VmbusChannelOnOpenResult},
+ {ChannelMessageCloseChannel, NULL},
+ {ChannelMessageGpadlHeader, NULL},
+ {ChannelMessageGpadlBody, NULL},
+ {ChannelMessageGpadlCreated, VmbusChannelOnGpadlCreated},
+ {ChannelMessageGpadlTeardown, NULL},
+ {ChannelMessageGpadlTorndown, VmbusChannelOnGpadlTorndown},
+ {ChannelMessageRelIdReleased, NULL},
+ {ChannelMessageInitiateContact, NULL},
+ {ChannelMessageVersionResponse, VmbusChannelOnVersionResponse},
+ {ChannelMessageUnload, NULL},
+};
+
/**
* VmbusOnChannelMessage - Handler for channel protocol messages.
*