[PATCH 05/13] staging/hv: use struct vmbus_channel
Joe Perches
joe at perches.com
Thu Jul 30 00:40:58 UTC 2009
Signed-off-by: Joe Perches <joe at perches.com>
---
drivers/staging/hv/Channel.c | 35 ++++++++++++++++---------------
drivers/staging/hv/Channel.h | 32 +++++++++++++++-------------
drivers/staging/hv/ChannelInterface.c | 20 ++++++++--------
drivers/staging/hv/ChannelMgmt.c | 28 ++++++++++++------------
drivers/staging/hv/ChannelMgmt.h | 9 +++----
drivers/staging/hv/Connection.c | 10 ++++----
drivers/staging/hv/VmbusPrivate.h | 2 +-
drivers/staging/hv/include/StorVscApi.h | 2 +-
8 files changed, 70 insertions(+), 68 deletions(-)
diff --git a/drivers/staging/hv/Channel.c b/drivers/staging/hv/Channel.c
index 18fbd0e..3a4946c 100644
--- a/drivers/staging/hv/Channel.c
+++ b/drivers/staging/hv/Channel.c
@@ -33,9 +33,9 @@ static int VmbusChannelCreateGpadlHeader(void *Kbuffer, /* must be phys and virt
VMBUS_CHANNEL_MSGINFO ** msgInfo,
u32 * MessageCount);
-static void DumpVmbusChannel(VMBUS_CHANNEL * Channel);
+static void DumpVmbusChannel(struct vmbus_channel *Channel);
-static void VmbusChannelSetEvent(VMBUS_CHANNEL * Channel);
+static void VmbusChannelSetEvent(struct vmbus_channel *Channel);
#if 0
static void DumpMonitorPage(HV_MONITOR_PAGE * MonitorPage)
@@ -79,7 +79,7 @@ Description:
Trigger an event notification on the specified channel.
--*/
-static void VmbusChannelSetEvent(VMBUS_CHANNEL * Channel)
+static void VmbusChannelSetEvent(struct vmbus_channel *Channel)
{
HV_MONITOR_PAGE *monitorPage;
@@ -105,7 +105,7 @@ static void VmbusChannelSetEvent(VMBUS_CHANNEL * Channel)
}
#if 0
-static void VmbusChannelClearEvent(VMBUS_CHANNEL * Channel)
+static void VmbusChannelClearEvent(struct vmbus_channel *Channel)
{
HV_MONITOR_PAGE *monitorPage;
@@ -139,7 +139,7 @@ Description:
--*/
void
-VmbusChannelGetDebugInfo(VMBUS_CHANNEL * Channel,
+VmbusChannelGetDebugInfo(struct vmbus_channel *Channel,
VMBUS_CHANNEL_DEBUG_INFO * DebugInfo)
{
HV_MONITOR_PAGE *monitorPage;
@@ -190,7 +190,7 @@ Description:
--*/
int
-VmbusChannelOpen(VMBUS_CHANNEL * NewChannel,
+VmbusChannelOpen(struct vmbus_channel *NewChannel,
u32 SendRingBufferSize,
u32 RecvRingBufferSize,
void *UserData,
@@ -498,7 +498,8 @@ Description:
Estabish a GPADL for the specified buffer
--*/
-int VmbusChannelEstablishGpadl(VMBUS_CHANNEL * Channel, void *Kbuffer, /* from kmalloc() */
+int VmbusChannelEstablishGpadl(struct vmbus_channel *Channel,
+ void *Kbuffer, /* from kmalloc() */
u32 Size, /* page-size multiple */
u32 * GpadlHandle)
{
@@ -609,7 +610,7 @@ Description:
Teardown the specified GPADL handle
--*/
-int VmbusChannelTeardownGpadl(VMBUS_CHANNEL * Channel, u32 GpadlHandle)
+int VmbusChannelTeardownGpadl(struct vmbus_channel *Channel, u32 GpadlHandle)
{
int ret = 0;
VMBUS_CHANNEL_GPADL_TEARDOWN *msg;
@@ -666,7 +667,7 @@ Description:
Close the specified channel
--*/
-void VmbusChannelClose(VMBUS_CHANNEL * Channel)
+void VmbusChannelClose(struct vmbus_channel *Channel)
{
int ret = 0;
VMBUS_CHANNEL_CLOSE_CHANNEL *msg;
@@ -739,7 +740,7 @@ Description:
--*/
int
-VmbusChannelSendPacket(VMBUS_CHANNEL * Channel,
+VmbusChannelSendPacket(struct vmbus_channel *Channel,
const void *Buffer,
u32 BufferLen,
u64 RequestId, VMBUS_PACKET_TYPE Type, u32 Flags)
@@ -797,7 +798,7 @@ Description:
--*/
int
-VmbusChannelSendPacketPageBuffer(VMBUS_CHANNEL * Channel,
+VmbusChannelSendPacketPageBuffer(struct vmbus_channel *Channel,
PAGE_BUFFER PageBuffers[],
u32 PageCount,
void *Buffer, u32 BufferLen, u64 RequestId)
@@ -871,7 +872,7 @@ Description:
--*/
int
-VmbusChannelSendPacketMultiPageBuffer(VMBUS_CHANNEL * Channel,
+VmbusChannelSendPacketMultiPageBuffer(struct vmbus_channel *Channel,
MULTIPAGE_BUFFER * MultiPageBuffer,
void *Buffer,
u32 BufferLen, u64 RequestId)
@@ -951,7 +952,7 @@ Description:
--*/
/* TODO: Do we ever receive a gpa direct packet other than the ones we send ? */
int
-VmbusChannelRecvPacket(VMBUS_CHANNEL * Channel,
+VmbusChannelRecvPacket(struct vmbus_channel *Channel,
void *Buffer,
u32 BufferLen, u32 * BufferActualLen, u64 * RequestId)
{
@@ -1026,7 +1027,7 @@ Description:
--*/
int
-VmbusChannelRecvPacketRaw(VMBUS_CHANNEL * Channel,
+VmbusChannelRecvPacketRaw(struct vmbus_channel *Channel,
void *Buffer,
u32 BufferLen, u32 * BufferActualLen, u64 * RequestId)
{
@@ -1097,7 +1098,7 @@ Description:
Channel event callback
--*/
-void VmbusChannelOnChannelEvent(VMBUS_CHANNEL * Channel)
+void VmbusChannelOnChannelEvent(struct vmbus_channel *Channel)
{
DumpVmbusChannel(Channel);
ASSERT(Channel->OnChannelCallback);
@@ -1121,7 +1122,7 @@ Description:
--*/
void VmbusChannelOnTimer(void *Context)
{
- VMBUS_CHANNEL *channel = (VMBUS_CHANNEL *) Context;
+ struct vmbus_channel *channel = (struct vmbus_channel *)Context;
if (channel->OnChannelCallback) {
channel->OnChannelCallback(channel->ChannelCallbackContext);
@@ -1140,7 +1141,7 @@ Description:
Dump vmbus channel info to the console
--*/
-static void DumpVmbusChannel(VMBUS_CHANNEL * Channel)
+static void DumpVmbusChannel(struct vmbus_channel *Channel)
{
DPRINT_DBG(VMBUS, "Channel (%d)", Channel->OfferMsg.ChildRelId);
DumpRingInfo(&Channel->Outbound, "Outbound ");
diff --git a/drivers/staging/hv/Channel.h b/drivers/staging/hv/Channel.h
index 891ecbd..c19e496 100644
--- a/drivers/staging/hv/Channel.h
+++ b/drivers/staging/hv/Channel.h
@@ -58,54 +58,56 @@ struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER {
/* Routines */
static int
-VmbusChannelOpen(VMBUS_CHANNEL * Channel,
+VmbusChannelOpen(struct vmbus_channel *Channel,
u32 SendRingBufferSize,
u32 RecvRingBufferSize,
void *UserData,
u32 UserDataLen,
PFN_CHANNEL_CALLBACK pfnOnChannelCallback, void *Context);
-static void VmbusChannelClose(VMBUS_CHANNEL * Channel);
+static void VmbusChannelClose(struct vmbus_channel *Channel);
-static int
-VmbusChannelSendPacket(VMBUS_CHANNEL * Channel,
- const void *Buffer,
- u32 BufferLen,
- u64 RequestId, VMBUS_PACKET_TYPE Type, u32 Flags);
+static int VmbusChannelSendPacket(struct vmbus_channel *Channel,
+ const void *Buffer,
+ u32 BufferLen,
+ u64 RequestId, VMBUS_PACKET_TYPE Type,
+ u32 Flags);
static int
-VmbusChannelSendPacketPageBuffer(VMBUS_CHANNEL * Channel,
+VmbusChannelSendPacketPageBuffer(struct vmbus_channel *Channel,
PAGE_BUFFER PageBuffers[],
u32 PageCount,
void *Buffer, u32 BufferLen, u64 RequestId);
static int
-VmbusChannelSendPacketMultiPageBuffer(VMBUS_CHANNEL * Channel,
+VmbusChannelSendPacketMultiPageBuffer(struct vmbus_channel *Channel,
MULTIPAGE_BUFFER * MultiPageBuffer,
void *Buffer,
u32 BufferLen, u64 RequestId);
-static int VmbusChannelEstablishGpadl(VMBUS_CHANNEL * Channel, void *Kbuffer, /* from kmalloc() */
+static int VmbusChannelEstablishGpadl(struct vmbus_channel *Channel,
+ void *Kbuffer, /* from kmalloc() */
u32 Size, /* page-size multiple */
u32 * GpadlHandle);
-static int VmbusChannelTeardownGpadl(VMBUS_CHANNEL * Channel, u32 GpadlHandle);
+static int VmbusChannelTeardownGpadl(struct vmbus_channel *Channel,
+ u32 GpadlHandle);
static int
-VmbusChannelRecvPacket(VMBUS_CHANNEL * Channel,
+VmbusChannelRecvPacket(struct vmbus_channel *Channel,
void *Buffer,
u32 BufferLen, u32 * BufferActualLen, u64 * RequestId);
static int
-VmbusChannelRecvPacketRaw(VMBUS_CHANNEL * Channel,
+VmbusChannelRecvPacketRaw(struct vmbus_channel *Channel,
void *Buffer,
u32 BufferLen,
u32 * BufferActualLen, u64 * RequestId);
-static void VmbusChannelOnChannelEvent(VMBUS_CHANNEL * Channel);
+static void VmbusChannelOnChannelEvent(struct vmbus_channel *Channel);
static void
-VmbusChannelGetDebugInfo(VMBUS_CHANNEL * Channel,
+VmbusChannelGetDebugInfo(struct vmbus_channel *Channel,
VMBUS_CHANNEL_DEBUG_INFO * DebugInfo);
static void VmbusChannelOnTimer(void *Context);
diff --git a/drivers/staging/hv/ChannelInterface.c b/drivers/staging/hv/ChannelInterface.c
index 13773a2..3f5f4c1 100644
--- a/drivers/staging/hv/ChannelInterface.c
+++ b/drivers/staging/hv/ChannelInterface.c
@@ -31,7 +31,7 @@ IVmbusChannelOpen(struct hv_device *Device,
u32 UserDataLen,
VMBUS_CHANNEL_CALLBACK ChannelCallback, void *Context)
{
- return VmbusChannelOpen((VMBUS_CHANNEL *) Device->context,
+ return VmbusChannelOpen((struct vmbus_channel *)Device->context,
SendBufferSize,
RecvRingBufferSize,
UserData,
@@ -40,7 +40,7 @@ IVmbusChannelOpen(struct hv_device *Device,
static void IVmbusChannelClose(struct hv_device *Device)
{
- VmbusChannelClose((VMBUS_CHANNEL *) Device->context);
+ VmbusChannelClose((struct vmbus_channel *)Device->context);
}
static int
@@ -48,7 +48,7 @@ IVmbusChannelSendPacket(struct hv_device *Device,
const void *Buffer,
u32 BufferLen, u64 RequestId, u32 Type, u32 Flags)
{
- return VmbusChannelSendPacket((VMBUS_CHANNEL *) Device->context,
+ return VmbusChannelSendPacket((struct vmbus_channel *)Device->context,
Buffer,
BufferLen, RequestId, Type, Flags);
}
@@ -59,7 +59,7 @@ IVmbusChannelSendPacketPageBuffer(struct hv_device *Device,
u32 PageCount,
void *Buffer, u32 BufferLen, u64 RequestId)
{
- return VmbusChannelSendPacketPageBuffer((VMBUS_CHANNEL *) Device->
+ return VmbusChannelSendPacketPageBuffer((struct vmbus_channel *)Device->
context, PageBuffers, PageCount,
Buffer, BufferLen, RequestId);
}
@@ -70,7 +70,7 @@ IVmbusChannelSendPacketMultiPageBuffer(struct hv_device *Device,
void *Buffer,
u32 BufferLen, u64 RequestId)
{
- return VmbusChannelSendPacketMultiPageBuffer((VMBUS_CHANNEL *) Device->
+ return VmbusChannelSendPacketMultiPageBuffer((struct vmbus_channel *)Device->
context, MultiPageBuffer,
Buffer, BufferLen,
RequestId);
@@ -81,7 +81,7 @@ IVmbusChannelRecvPacket(struct hv_device *Device,
void *Buffer,
u32 BufferLen, u32 * BufferActualLen, u64 * RequestId)
{
- return VmbusChannelRecvPacket((VMBUS_CHANNEL *) Device->context,
+ return VmbusChannelRecvPacket((struct vmbus_channel *)Device->context,
Buffer,
BufferLen, BufferActualLen, RequestId);
}
@@ -92,7 +92,7 @@ IVmbusChannelRecvPacketRaw(struct hv_device *Device,
u32 BufferLen,
u32 * BufferActualLen, u64 * RequestId)
{
- return VmbusChannelRecvPacketRaw((VMBUS_CHANNEL *) Device->context,
+ return VmbusChannelRecvPacketRaw((struct vmbus_channel *)Device->context,
Buffer,
BufferLen, BufferActualLen, RequestId);
}
@@ -101,13 +101,13 @@ static int
IVmbusChannelEstablishGpadl(struct hv_device *Device,
void *Buffer, u32 BufferLen, u32 * GpadlHandle)
{
- return VmbusChannelEstablishGpadl((VMBUS_CHANNEL *) Device->context,
+ return VmbusChannelEstablishGpadl((struct vmbus_channel *)Device->context,
Buffer, BufferLen, GpadlHandle);
}
static int IVmbusChannelTeardownGpadl(struct hv_device *Device, u32 GpadlHandle)
{
- return VmbusChannelTeardownGpadl((VMBUS_CHANNEL *) Device->context,
+ return VmbusChannelTeardownGpadl((struct vmbus_channel *)Device->context,
GpadlHandle);
}
@@ -133,7 +133,7 @@ static void GetChannelInfo(struct hv_device *Device, DEVICE_INFO * DeviceInfo)
VMBUS_CHANNEL_DEBUG_INFO debugInfo;
if (Device->context) {
- VmbusChannelGetDebugInfo((VMBUS_CHANNEL *) Device->context,
+ VmbusChannelGetDebugInfo((struct vmbus_channel *)Device->context,
&debugInfo);
DeviceInfo->ChannelId = debugInfo.RelId;
diff --git a/drivers/staging/hv/ChannelMgmt.c b/drivers/staging/hv/ChannelMgmt.c
index 1abae82..1eda1b2 100644
--- a/drivers/staging/hv/ChannelMgmt.c
+++ b/drivers/staging/hv/ChannelMgmt.c
@@ -101,11 +101,11 @@ Description:
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(struct vmbus_channel), GFP_ATOMIC);
if (!channel) {
return NULL;
}
@@ -140,7 +140,7 @@ Description:
--*/
static inline void ReleaseVmbusChannel(void *Context)
{
- VMBUS_CHANNEL *channel = (VMBUS_CHANNEL *) Context;
+ struct vmbus_channel *channel = (struct vmbus_channel *)Context;
DPRINT_ENTER(VMBUS);
@@ -162,7 +162,7 @@ Description:
Release the resources used by the vmbus channel object
--*/
-void FreeVmbusChannel(VMBUS_CHANNEL * Channel)
+void FreeVmbusChannel(struct vmbus_channel *Channel)
{
TimerClose(Channel->PollTimer);
@@ -184,11 +184,11 @@ Description:
static void VmbusChannelProcessOffer(void *context)
{
int ret = 0;
- VMBUS_CHANNEL *newChannel = (VMBUS_CHANNEL *) context;
+ struct vmbus_channel *newChannel = (struct vmbus_channel *)context;
LIST_ENTRY *anchor;
LIST_ENTRY *curr;
bool fNew = true;
- VMBUS_CHANNEL *channel;
+ struct vmbus_channel *channel;
unsigned long flags;
DPRINT_ENTER(VMBUS);
@@ -197,7 +197,7 @@ static void VmbusChannelProcessOffer(void *context)
spin_lock_irqsave(&gVmbusConnection.channel_lock, flags);
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,
@@ -273,7 +273,7 @@ Description:
--*/
static void VmbusChannelProcessRescindOffer(void *context)
{
- VMBUS_CHANNEL *channel = (VMBUS_CHANNEL *) context;
+ struct vmbus_channel *channel = (struct vmbus_channel *)context;
DPRINT_ENTER(VMBUS);
@@ -297,7 +297,7 @@ static void VmbusChannelOnOffer(PVMBUS_CHANNEL_MESSAGE_HEADER hdr)
{
VMBUS_CHANNEL_OFFER_CHANNEL *offer =
(VMBUS_CHANNEL_OFFER_CHANNEL *) hdr;
- VMBUS_CHANNEL *newChannel;
+ struct vmbus_channel *newChannel;
GUID *guidType;
GUID *guidInstance;
@@ -382,7 +382,7 @@ static void VmbusChannelOnOfferRescind(PVMBUS_CHANNEL_MESSAGE_HEADER hdr)
{
VMBUS_CHANNEL_RESCIND_OFFER *rescind =
(VMBUS_CHANNEL_RESCIND_OFFER *) hdr;
- VMBUS_CHANNEL *channel;
+ struct vmbus_channel *channel;
DPRINT_ENTER(VMBUS);
@@ -727,15 +727,15 @@ void VmbusChannelReleaseUnattachedChannels(void
)
{
LIST_ENTRY *entry;
- VMBUS_CHANNEL *channel;
- VMBUS_CHANNEL *start = NULL;
+ struct vmbus_channel *channel;
+ struct vmbus_channel *start = NULL;
unsigned long flags;
spin_lock_irqsave(&gVmbusConnection.channel_lock, flags);
while (!IsListEmpty(&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)
break;
diff --git a/drivers/staging/hv/ChannelMgmt.h b/drivers/staging/hv/ChannelMgmt.h
index ab2191e..f0dbf60 100644
--- a/drivers/staging/hv/ChannelMgmt.h
+++ b/drivers/staging/hv/ChannelMgmt.h
@@ -39,7 +39,7 @@ typedef enum {
CHANNEL_OPEN_STATE,
} VMBUS_CHANNEL_STATE;
-typedef struct _VMBUS_CHANNEL {
+ struct vmbus_channel {
LIST_ENTRY ListEntry;
struct hv_device *DeviceObject;
@@ -69,7 +69,7 @@ typedef struct _VMBUS_CHANNEL {
PFN_CHANNEL_CALLBACK OnChannelCallback;
void *ChannelCallbackContext;
-} VMBUS_CHANNEL;
+};
typedef struct _VMBUS_CHANNEL_DEBUG_INFO {
u32 RelId;
@@ -121,10 +121,9 @@ typedef struct _VMBUS_CHANNEL_MSGINFO {
/* Routines */
-static VMBUS_CHANNEL *AllocVmbusChannel(void
- );
+static struct vmbus_channel *AllocVmbusChannel(void);
-static void FreeVmbusChannel(VMBUS_CHANNEL * Channel);
+static void FreeVmbusChannel(struct vmbus_channel *Channel);
static void VmbusOnChannelMessage(void *Context);
diff --git a/drivers/staging/hv/Connection.c b/drivers/staging/hv/Connection.c
index a2fb7e6..8f27c57 100644
--- a/drivers/staging/hv/Connection.c
+++ b/drivers/staging/hv/Connection.c
@@ -242,17 +242,17 @@ Description:
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;
- VMBUS_CHANNEL *foundChannel = NULL;
+ struct vmbus_channel *channel;
+ struct vmbus_channel *foundChannel = NULL;
LIST_ENTRY *anchor;
LIST_ENTRY *curr;
unsigned long flags;
spin_lock_irqsave(&gVmbusConnection.channel_lock, flags);
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) {
foundChannel = channel;
@@ -275,7 +275,7 @@ Description:
--*/
static void VmbusProcessChannelEvent(void *context)
{
- VMBUS_CHANNEL *channel;
+ struct vmbus_channel *channel;
u32 relId = (u32) (unsigned long)context;
ASSERT(relId > 0);
diff --git a/drivers/staging/hv/VmbusPrivate.h b/drivers/staging/hv/VmbusPrivate.h
index b73922d..d8749b7 100644
--- a/drivers/staging/hv/VmbusPrivate.h
+++ b/drivers/staging/hv/VmbusPrivate.h
@@ -120,7 +120,7 @@ static void VmbusChildDeviceRemove(struct hv_device *Device);
/* VmbusChildDeviceDestroy( */
/* struct hv_device *); */
-static VMBUS_CHANNEL *GetChannelFromRelId(u32 relId);
+static struct vmbus_channel *GetChannelFromRelId(u32 relId);
/* Connection interface */
diff --git a/drivers/staging/hv/include/StorVscApi.h b/drivers/staging/hv/include/StorVscApi.h
index 597aca3..8f9341f 100644
--- a/drivers/staging/hv/include/StorVscApi.h
+++ b/drivers/staging/hv/include/StorVscApi.h
@@ -46,7 +46,7 @@
/* Fwd decl */
-/* struct VMBUS_CHANNEL; */
+/* struct struct vmbus_channel; */
typedef struct _STORVSC_REQUEST *PSTORVSC_REQUEST;
/* Data types */
--
1.6.3.1.10.g659a0.dirty
More information about the devel
mailing list