Skip to content

Commit

Permalink
Staging: hv: typedef removal for VmbusApi.h
Browse files Browse the repository at this point in the history
The function pointers still have ugly names, but the structures
are now cleaned up.

Note, a comment was added where the driver structure is pointing
at a problem that needs to be fixed up later in the code.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Greg Kroah-Hartman committed Sep 15, 2009
1 parent 54b2b84 commit ee3d7dd
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 80 deletions.
6 changes: 3 additions & 3 deletions drivers/staging/hv/Channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ int VmbusChannelSendPacket(struct vmbus_channel *Channel,
--*/
int VmbusChannelSendPacketPageBuffer(struct vmbus_channel *Channel,
PAGE_BUFFER PageBuffers[],
struct hv_page_buffer PageBuffers[],
u32 PageCount,
void * Buffer,
u32 BufferLen,
Expand All @@ -814,7 +814,7 @@ int VmbusChannelSendPacketPageBuffer(struct vmbus_channel *Channel,
DumpVmbusChannel(Channel);

/* Adjust the size down since VMBUS_CHANNEL_PACKET_PAGE_BUFFER is the largest size we support */
descSize = sizeof(struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER) - ((MAX_PAGE_BUFFER_COUNT - PageCount)*sizeof(PAGE_BUFFER));
descSize = sizeof(struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER) - ((MAX_PAGE_BUFFER_COUNT - PageCount)*sizeof(struct hv_page_buffer));
packetLen = descSize + BufferLen;
packetLenAligned = ALIGN_UP(packetLen, sizeof(u64));

Expand Down Expand Up @@ -868,7 +868,7 @@ int VmbusChannelSendPacketPageBuffer(struct vmbus_channel *Channel,
--*/
int VmbusChannelSendPacketMultiPageBuffer(struct vmbus_channel *Channel,
MULTIPAGE_BUFFER *MultiPageBuffer,
struct hv_multipage_buffer *MultiPageBuffer,
void * Buffer,
u32 BufferLen,
u64 RequestId
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/hv/Channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER {
u64 TransactionId;
u32 Reserved;
u32 RangeCount;
PAGE_BUFFER Range[MAX_PAGE_BUFFER_COUNT];
struct hv_page_buffer Range[MAX_PAGE_BUFFER_COUNT];
} __attribute__((packed));

/* The format must be the same as VMDATA_GPA_DIRECT */
Expand All @@ -48,7 +48,7 @@ struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER {
u64 TransactionId;
u32 Reserved;
u32 RangeCount; /* Always 1 in this case */
MULTIPAGE_BUFFER Range;
struct hv_multipage_buffer Range;
} __attribute__((packed));


Expand All @@ -70,14 +70,14 @@ extern int VmbusChannelSendPacket(struct vmbus_channel *channel,
u32 Flags);

extern int VmbusChannelSendPacketPageBuffer(struct vmbus_channel *channel,
PAGE_BUFFER PageBuffers[],
struct hv_page_buffer PageBuffers[],
u32 PageCount,
void *Buffer,
u32 BufferLen,
u64 RequestId);

extern int VmbusChannelSendPacketMultiPageBuffer(struct vmbus_channel *channel,
MULTIPAGE_BUFFER *MultiPageBuffer,
struct hv_multipage_buffer *mpb,
void *Buffer,
u32 BufferLen,
u64 RequestId);
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/hv/ChannelInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ IVmbusChannelSendPacket(
static int
IVmbusChannelSendPacketPageBuffer(
struct hv_device *Device,
PAGE_BUFFER PageBuffers[],
struct hv_page_buffer PageBuffers[],
u32 PageCount,
void * Buffer,
u32 BufferLen,
Expand All @@ -95,7 +95,7 @@ IVmbusChannelSendPacketPageBuffer(
static int
IVmbusChannelSendPacketMultiPageBuffer(
struct hv_device *Device,
MULTIPAGE_BUFFER *MultiPageBuffer,
struct hv_multipage_buffer *MultiPageBuffer,
void * Buffer,
u32 BufferLen,
u64 RequestId
Expand Down Expand Up @@ -165,7 +165,7 @@ IVmbusChannelTeardownGpadl(

}

void GetChannelInterface(VMBUS_CHANNEL_INTERFACE *ChannelInterface)
void GetChannelInterface(struct vmbus_channel_interface *ChannelInterface)
{
ChannelInterface->Open = IVmbusChannelOpen;
ChannelInterface->Close = IVmbusChannelClose;
Expand All @@ -180,7 +180,7 @@ void GetChannelInterface(VMBUS_CHANNEL_INTERFACE *ChannelInterface)
}


void GetChannelInfo(struct hv_device *Device, DEVICE_INFO *DeviceInfo)
void GetChannelInfo(struct hv_device *Device, struct hv_device_info *DeviceInfo)
{
struct vmbus_channel_debug_info debugInfo;

Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/hv/ChannelInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

#include "include/VmbusApi.h"

void GetChannelInterface(VMBUS_CHANNEL_INTERFACE *ChannelInterface);
void GetChannelInterface(struct vmbus_channel_interface *ChannelInterface);

void GetChannelInfo(struct hv_device *Device, DEVICE_INFO *DeviceInfo);
void GetChannelInfo(struct hv_device *Device, struct hv_device_info *DeviceInfo);

#endif /* _CHANNEL_INTERFACE_H_ */
2 changes: 1 addition & 1 deletion drivers/staging/hv/NetVsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ NetVscOnDeviceAdd(

for (i=0; i < NETVSC_RECEIVE_PACKETLIST_COUNT; i++)
{
packet = kzalloc(sizeof(struct hv_netvsc_packet) + (NETVSC_RECEIVE_SG_COUNT* sizeof(PAGE_BUFFER)), GFP_KERNEL);
packet = kzalloc(sizeof(struct hv_netvsc_packet) + (NETVSC_RECEIVE_SG_COUNT* sizeof(struct hv_page_buffer)), GFP_KERNEL);
if (!packet)
{
DPRINT_DBG(NETVSC, "unable to allocate netvsc pkts for receive pool (wanted %d got %d)", NETVSC_RECEIVE_PACKETLIST_COUNT, i);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/hv/RndisFilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ typedef struct _RNDIS_REQUEST {

/* Simplify allocation by having a netvsc packet inline */
struct hv_netvsc_packet Packet;
PAGE_BUFFER Buffer;
struct hv_page_buffer Buffer;
/* FIXME: We assumed a fixed size request here. */
struct rndis_message RequestMessage;
} RNDIS_REQUEST;
Expand Down
32 changes: 13 additions & 19 deletions drivers/staging/hv/Vmbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,12 @@ static struct hv_device* gDevice; /* vmbus root device */
/* Internal routines */


static void
VmbusGetChannelInterface(
VMBUS_CHANNEL_INTERFACE *Interface
);
static void VmbusGetChannelInterface(struct vmbus_channel_interface *Interface);

static void
VmbusGetChannelInfo(
struct hv_device *DeviceObject,
DEVICE_INFO *DeviceInfo
struct hv_device_info *DeviceInfo
);

static void
Expand Down Expand Up @@ -121,7 +118,7 @@ VmbusInitialize(
struct hv_driver *drv
)
{
VMBUS_DRIVER_OBJECT* driver = (VMBUS_DRIVER_OBJECT*)drv;
struct vmbus_driver *driver = (struct vmbus_driver *)drv;
int ret=0;

DPRINT_ENTER(VMBUS);
Expand Down Expand Up @@ -192,10 +189,7 @@ VmbusGetChannelOffers(void)
Get the channel interface
--*/
static void
VmbusGetChannelInterface(
VMBUS_CHANNEL_INTERFACE *Interface
)
static void VmbusGetChannelInterface(struct vmbus_channel_interface *Interface)
{
GetChannelInterface(Interface);
}
Expand All @@ -204,7 +198,7 @@ VmbusGetChannelInterface(
/*++;
Name:
VmbusGetChannelInterface()
VmbusGetChannelInfo()
Description:
Get the device info for the specified device object
Expand All @@ -213,7 +207,7 @@ VmbusGetChannelInterface(
static void
VmbusGetChannelInfo(
struct hv_device *DeviceObject,
DEVICE_INFO *DeviceInfo
struct hv_device_info *DeviceInfo
)
{
GetChannelInfo(DeviceObject, DeviceInfo);
Expand All @@ -235,7 +229,7 @@ struct hv_device *VmbusChildDeviceCreate(struct hv_guid *DeviceType,
struct hv_guid *DeviceInstance,
void *Context)
{
VMBUS_DRIVER_OBJECT* vmbusDriver = (VMBUS_DRIVER_OBJECT*)gDriver;
struct vmbus_driver *vmbusDriver = (struct vmbus_driver *)gDriver;

return vmbusDriver->OnChildDeviceCreate(
DeviceType,
Expand All @@ -255,7 +249,7 @@ struct hv_device *VmbusChildDeviceCreate(struct hv_guid *DeviceType,
--*/
int VmbusChildDeviceAdd(struct hv_device *ChildDevice)
{
VMBUS_DRIVER_OBJECT* vmbusDriver = (VMBUS_DRIVER_OBJECT*)gDriver;
struct vmbus_driver *vmbusDriver = (struct vmbus_driver *)gDriver;

return vmbusDriver->OnChildDeviceAdd(gDevice, ChildDevice);
}
Expand All @@ -272,7 +266,7 @@ int VmbusChildDeviceAdd(struct hv_device *ChildDevice)
--*/
void VmbusChildDeviceRemove(struct hv_device *ChildDevice)
{
VMBUS_DRIVER_OBJECT* vmbusDriver = (VMBUS_DRIVER_OBJECT*)gDriver;
struct vmbus_driver *vmbusDriver = (struct vmbus_driver *)gDriver;

vmbusDriver->OnChildDeviceRemove(ChildDevice);
}
Expand All @@ -293,9 +287,9 @@ VmbusChildDeviceDestroy(
struct hv_device *ChildDevice
)
{
VMBUS_DRIVER_OBJECT* vmbusDriver = (VMBUS_DRIVER_OBJECT*)gDriver;
struct vmbus_driver *vmbusDriver = (struct vmbus_driver *)gDriver;
vmbusDriver->OnChildDeviceDestroy(ChildDevice);
vmbusDriver->OnChildDeviceDestroy(ChildDevice);
}
************* */

Expand Down Expand Up @@ -381,7 +375,7 @@ VmbusOnCleanup(
struct hv_driver *drv
)
{
/* VMBUS_DRIVER_OBJECT* driver = (VMBUS_DRIVER_OBJECT*)drv; */
/* struct vmbus_driver *driver = (struct vmbus_driver *)drv; */

DPRINT_ENTER(VMBUS);

Expand Down Expand Up @@ -485,7 +479,7 @@ VmbusOnISR(
struct hv_driver *drv
)
{
/* VMBUS_DRIVER_OBJECT* driver = (VMBUS_DRIVER_OBJECT*)drv; */
/* struct vmbus_driver *driver = (struct vmbus_driver *)drv; */

int ret=0;
/* struct page* page; */
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/hv/include/NetVscApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct hv_netvsc_packet {
u32 TotalDataBufferLength;
/* Points to the send/receive buffer where the ethernet frame is */
u32 PageBufferCount;
PAGE_BUFFER PageBuffers[NETVSC_PACKET_MAXPAGE];
struct hv_page_buffer PageBuffers[NETVSC_PACKET_MAXPAGE];

};

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/hv/include/StorVscApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct hv_storvsc_request {
/* This points to the memory after DataBuffer */
void * Extension;

MULTIPAGE_BUFFER DataBuffer;
struct hv_multipage_buffer DataBuffer;
};


Expand Down
Loading

0 comments on commit ee3d7dd

Please sign in to comment.