Staging: hv: fix up typedefs in NetVscApi.h

It's now all clean from a coding style standpoint.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Greg Kroah-Hartman 2009-08-27 15:58:15 -07:00
parent 8eef67392e
commit 7e23a6e962
5 changed files with 27 additions and 29 deletions

View file

@ -231,7 +231,7 @@ NetVscInitialize(
struct hv_driver *drv
)
{
NETVSC_DRIVER_OBJECT* driver = (NETVSC_DRIVER_OBJECT*)drv;
struct netvsc_driver *driver = (struct netvsc_driver *)drv;
int ret=0;
DPRINT_ENTER(NETVSC);
@ -802,7 +802,7 @@ NetVscOnDeviceAdd(
struct hv_netvsc_packet *packet;
LIST_ENTRY *entry;
NETVSC_DRIVER_OBJECT *netDriver = (NETVSC_DRIVER_OBJECT*) Device->Driver;;
struct netvsc_driver *netDriver = (struct netvsc_driver *)Device->Driver;
DPRINT_ENTER(NETVSC);
@ -1119,8 +1119,8 @@ NetVscOnReceive(
LIST_ENTRY* entry;
unsigned long start;
unsigned long end, endVirtual;
/* NETVSC_DRIVER_OBJECT *netvscDriver; */
XFERPAGE_PACKET *xferpagePacket=NULL;
/* struct netvsc_driver *netvscDriver; */
struct xferpage_packet *xferpagePacket=NULL;
LIST_ENTRY listHead;
int i=0, j=0;
@ -1217,7 +1217,7 @@ NetVscOnReceive(
/* Remove the 1st packet to represent the xfer page packet itself */
entry = REMOVE_HEAD_LIST(&listHead);
xferpagePacket = CONTAINING_RECORD(entry, XFERPAGE_PACKET, ListEntry);
xferpagePacket = CONTAINING_RECORD(entry, struct xferpage_packet, ListEntry);
xferpagePacket->Count = count - 1; /* This is how much we can satisfy */
ASSERT(xferpagePacket->Count > 0 && xferpagePacket->Count <= vmxferpagePacket->RangeCount);
@ -1287,7 +1287,7 @@ NetVscOnReceive(
netvscPacket->PageBuffers[0].Length);
/* Pass it to the upper layer */
((NETVSC_DRIVER_OBJECT*)Device->Driver)->OnReceiveCallback(Device, netvscPacket);
((struct netvsc_driver *)Device->Driver)->OnReceiveCallback(Device, netvscPacket);
NetVscOnReceiveCompletion(netvscPacket->Completion.Recv.ReceiveCompletionContext);
}

View file

@ -37,7 +37,7 @@
typedef struct _RNDIS_FILTER_DRIVER_OBJECT {
/* The original driver */
NETVSC_DRIVER_OBJECT InnerDriver;
struct netvsc_driver InnerDriver;
} RNDIS_FILTER_DRIVER_OBJECT;
@ -721,10 +721,7 @@ Exit:
return ret;
}
int
RndisFilterInit(
NETVSC_DRIVER_OBJECT *Driver
)
int RndisFilterInit(struct netvsc_driver *Driver)
{
DPRINT_ENTER(NETVSC);
@ -919,7 +916,7 @@ RndisFilterOnDeviceAdd(
int ret;
struct NETVSC_DEVICE *netDevice;
RNDIS_DEVICE *rndisDevice;
NETVSC_DEVICE_INFO *deviceInfo = (NETVSC_DEVICE_INFO*)AdditionalInfo;
struct netvsc_device_info *deviceInfo = (struct netvsc_device_info *)AdditionalInfo;
DPRINT_ENTER(NETVSC);

View file

@ -50,6 +50,6 @@
/* Interface */
extern int RndisFilterInit(NETVSC_DRIVER_OBJECT *Driver);
extern int RndisFilterInit(struct netvsc_driver *driver);
#endif /* _RNDISFILTER_H_ */

View file

@ -49,12 +49,12 @@ typedef int (*PFN_ON_RECVCALLBACK)(struct hv_device *dev,
typedef void (*PFN_ON_LINKSTATUS_CHANGED)(struct hv_device *dev, u32 Status);
/* Represent the xfer page packet which contains 1 or more netvsc packet */
typedef struct _XFERPAGE_PACKET {
struct xferpage_packet {
LIST_ENTRY ListEntry;
/* # of netvsc packets this xfer packet contains */
u32 Count;
} XFERPAGE_PACKET;
};
/* The number of pages which are enough to cover jumbo frame buffer. */
#define NETVSC_PACKET_MAXPAGE 4
@ -74,7 +74,7 @@ struct hv_netvsc_packet {
* Valid only for receives when we break a xfer page packet
* into multiple netvsc packets
*/
XFERPAGE_PACKET *XferPagePacket;
struct xferpage_packet *XferPagePacket;
union {
struct{
@ -99,7 +99,7 @@ struct hv_netvsc_packet {
};
/* Represents the net vsc driver */
typedef struct _NETVSC_DRIVER_OBJECT {
struct netvsc_driver {
/* Must be the first field */
/* Which is a bug FIXME! */
struct hv_driver Base;
@ -127,12 +127,12 @@ typedef struct _NETVSC_DRIVER_OBJECT {
/* PFN_QUERY_LINKSTATUS QueryLinkStatus; */
void *Context;
} NETVSC_DRIVER_OBJECT;
};
typedef struct _NETVSC_DEVICE_INFO {
struct netvsc_device_info {
unsigned char MacAddr[6];
bool LinkState; /* 0 - link up, 1 - link down */
} NETVSC_DEVICE_INFO;
};
/* Interface */
int NetVscInitialize(struct hv_driver *drv);

View file

@ -67,8 +67,9 @@ struct net_device_context {
struct netvsc_driver_context {
/* !! These must be the first 2 fields !! */
/* Which is a bug FIXME! */
struct driver_context drv_ctx;
NETVSC_DRIVER_OBJECT drv_obj;
struct netvsc_driver drv_obj;
};
@ -94,7 +95,7 @@ Desc: NetVsc driver initialization
static int netvsc_drv_init(PFN_DRIVERINITIALIZE pfn_drv_init)
{
int ret=0;
NETVSC_DRIVER_OBJECT *net_drv_obj=&g_netvsc_drv.drv_obj;
struct netvsc_driver *net_drv_obj=&g_netvsc_drv.drv_obj;
struct driver_context *drv_ctx=&g_netvsc_drv.drv_ctx;
DPRINT_ENTER(NETVSC_DRV);
@ -170,14 +171,14 @@ static int netvsc_probe(struct device *device)
struct driver_context *driver_ctx = driver_to_driver_context(device->driver);
struct netvsc_driver_context *net_drv_ctx = (struct netvsc_driver_context*)driver_ctx;
NETVSC_DRIVER_OBJECT *net_drv_obj = &net_drv_ctx->drv_obj;
struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj;
struct device_context *device_ctx = device_to_device_context(device);
struct hv_device *device_obj = &device_ctx->device_obj;
struct net_device *net = NULL;
struct net_device_context *net_device_ctx;
NETVSC_DEVICE_INFO device_info;
struct netvsc_device_info device_info;
DPRINT_ENTER(NETVSC_DRV);
@ -246,7 +247,7 @@ static int netvsc_remove(struct device *device)
int ret=0;
struct driver_context *driver_ctx = driver_to_driver_context(device->driver);
struct netvsc_driver_context *net_drv_ctx = (struct netvsc_driver_context*)driver_ctx;
NETVSC_DRIVER_OBJECT *net_drv_obj = &net_drv_ctx->drv_obj;
struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj;
struct device_context *device_ctx = device_to_device_context(device);
struct net_device *net = dev_get_drvdata(&device_ctx->device);
@ -301,7 +302,7 @@ static int netvsc_open(struct net_device *net)
struct net_device_context *net_device_ctx = netdev_priv(net);
struct driver_context *driver_ctx = driver_to_driver_context(net_device_ctx->device_ctx->device.driver);
struct netvsc_driver_context *net_drv_ctx = (struct netvsc_driver_context*)driver_ctx;
NETVSC_DRIVER_OBJECT *net_drv_obj = &net_drv_ctx->drv_obj;
struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj;
struct hv_device *device_obj = &net_device_ctx->device_ctx->device_obj;
@ -343,7 +344,7 @@ static int netvsc_close(struct net_device *net)
struct net_device_context *net_device_ctx = netdev_priv(net);
struct driver_context *driver_ctx = driver_to_driver_context(net_device_ctx->device_ctx->device.driver);
struct netvsc_driver_context *net_drv_ctx = (struct netvsc_driver_context*)driver_ctx;
NETVSC_DRIVER_OBJECT *net_drv_obj = &net_drv_ctx->drv_obj;
struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj;
struct hv_device *device_obj = &net_device_ctx->device_ctx->device_obj;
@ -410,7 +411,7 @@ static int netvsc_start_xmit (struct sk_buff *skb, struct net_device *net)
struct net_device_context *net_device_ctx = netdev_priv(net);
struct driver_context *driver_ctx = driver_to_driver_context(net_device_ctx->device_ctx->device.driver);
struct netvsc_driver_context *net_drv_ctx = (struct netvsc_driver_context*)driver_ctx;
NETVSC_DRIVER_OBJECT *net_drv_obj = &net_drv_ctx->drv_obj;
struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj;
int i=0;
struct hv_netvsc_packet *packet;
@ -637,7 +638,7 @@ Desc:
--*/
static void netvsc_drv_exit(void)
{
NETVSC_DRIVER_OBJECT *netvsc_drv_obj=&g_netvsc_drv.drv_obj;
struct netvsc_driver *netvsc_drv_obj=&g_netvsc_drv.drv_obj;
struct driver_context *drv_ctx=&g_netvsc_drv.drv_ctx;
struct device *current_dev=NULL;
int ret;