Commit 7e23a6e9 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8eef6739
...@@ -231,7 +231,7 @@ NetVscInitialize( ...@@ -231,7 +231,7 @@ NetVscInitialize(
struct hv_driver *drv struct hv_driver *drv
) )
{ {
NETVSC_DRIVER_OBJECT* driver = (NETVSC_DRIVER_OBJECT*)drv; struct netvsc_driver *driver = (struct netvsc_driver *)drv;
int ret=0; int ret=0;
DPRINT_ENTER(NETVSC); DPRINT_ENTER(NETVSC);
...@@ -802,7 +802,7 @@ NetVscOnDeviceAdd( ...@@ -802,7 +802,7 @@ NetVscOnDeviceAdd(
struct hv_netvsc_packet *packet; struct hv_netvsc_packet *packet;
LIST_ENTRY *entry; LIST_ENTRY *entry;
NETVSC_DRIVER_OBJECT *netDriver = (NETVSC_DRIVER_OBJECT*) Device->Driver;; struct netvsc_driver *netDriver = (struct netvsc_driver *)Device->Driver;
DPRINT_ENTER(NETVSC); DPRINT_ENTER(NETVSC);
...@@ -1119,8 +1119,8 @@ NetVscOnReceive( ...@@ -1119,8 +1119,8 @@ NetVscOnReceive(
LIST_ENTRY* entry; LIST_ENTRY* entry;
unsigned long start; unsigned long start;
unsigned long end, endVirtual; unsigned long end, endVirtual;
/* NETVSC_DRIVER_OBJECT *netvscDriver; */ /* struct netvsc_driver *netvscDriver; */
XFERPAGE_PACKET *xferpagePacket=NULL; struct xferpage_packet *xferpagePacket=NULL;
LIST_ENTRY listHead; LIST_ENTRY listHead;
int i=0, j=0; int i=0, j=0;
...@@ -1217,7 +1217,7 @@ NetVscOnReceive( ...@@ -1217,7 +1217,7 @@ NetVscOnReceive(
/* Remove the 1st packet to represent the xfer page packet itself */ /* Remove the 1st packet to represent the xfer page packet itself */
entry = REMOVE_HEAD_LIST(&listHead); 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 */ xferpagePacket->Count = count - 1; /* This is how much we can satisfy */
ASSERT(xferpagePacket->Count > 0 && xferpagePacket->Count <= vmxferpagePacket->RangeCount); ASSERT(xferpagePacket->Count > 0 && xferpagePacket->Count <= vmxferpagePacket->RangeCount);
...@@ -1287,7 +1287,7 @@ NetVscOnReceive( ...@@ -1287,7 +1287,7 @@ NetVscOnReceive(
netvscPacket->PageBuffers[0].Length); netvscPacket->PageBuffers[0].Length);
/* Pass it to the upper layer */ /* 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); NetVscOnReceiveCompletion(netvscPacket->Completion.Recv.ReceiveCompletionContext);
} }
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
typedef struct _RNDIS_FILTER_DRIVER_OBJECT { typedef struct _RNDIS_FILTER_DRIVER_OBJECT {
/* The original driver */ /* The original driver */
NETVSC_DRIVER_OBJECT InnerDriver; struct netvsc_driver InnerDriver;
} RNDIS_FILTER_DRIVER_OBJECT; } RNDIS_FILTER_DRIVER_OBJECT;
...@@ -721,10 +721,7 @@ Exit: ...@@ -721,10 +721,7 @@ Exit:
return ret; return ret;
} }
int int RndisFilterInit(struct netvsc_driver *Driver)
RndisFilterInit(
NETVSC_DRIVER_OBJECT *Driver
)
{ {
DPRINT_ENTER(NETVSC); DPRINT_ENTER(NETVSC);
...@@ -919,7 +916,7 @@ RndisFilterOnDeviceAdd( ...@@ -919,7 +916,7 @@ RndisFilterOnDeviceAdd(
int ret; int ret;
struct NETVSC_DEVICE *netDevice; struct NETVSC_DEVICE *netDevice;
RNDIS_DEVICE *rndisDevice; RNDIS_DEVICE *rndisDevice;
NETVSC_DEVICE_INFO *deviceInfo = (NETVSC_DEVICE_INFO*)AdditionalInfo; struct netvsc_device_info *deviceInfo = (struct netvsc_device_info *)AdditionalInfo;
DPRINT_ENTER(NETVSC); DPRINT_ENTER(NETVSC);
......
...@@ -50,6 +50,6 @@ ...@@ -50,6 +50,6 @@
/* Interface */ /* Interface */
extern int RndisFilterInit(NETVSC_DRIVER_OBJECT *Driver); extern int RndisFilterInit(struct netvsc_driver *driver);
#endif /* _RNDISFILTER_H_ */ #endif /* _RNDISFILTER_H_ */
...@@ -49,12 +49,12 @@ typedef int (*PFN_ON_RECVCALLBACK)(struct hv_device *dev, ...@@ -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); typedef void (*PFN_ON_LINKSTATUS_CHANGED)(struct hv_device *dev, u32 Status);
/* Represent the xfer page packet which contains 1 or more netvsc packet */ /* Represent the xfer page packet which contains 1 or more netvsc packet */
typedef struct _XFERPAGE_PACKET { struct xferpage_packet {
LIST_ENTRY ListEntry; LIST_ENTRY ListEntry;
/* # of netvsc packets this xfer packet contains */ /* # of netvsc packets this xfer packet contains */
u32 Count; u32 Count;
} XFERPAGE_PACKET; };
/* The number of pages which are enough to cover jumbo frame buffer. */ /* The number of pages which are enough to cover jumbo frame buffer. */
#define NETVSC_PACKET_MAXPAGE 4 #define NETVSC_PACKET_MAXPAGE 4
...@@ -74,7 +74,7 @@ struct hv_netvsc_packet { ...@@ -74,7 +74,7 @@ struct hv_netvsc_packet {
* Valid only for receives when we break a xfer page packet * Valid only for receives when we break a xfer page packet
* into multiple netvsc packets * into multiple netvsc packets
*/ */
XFERPAGE_PACKET *XferPagePacket; struct xferpage_packet *XferPagePacket;
union { union {
struct{ struct{
...@@ -99,7 +99,7 @@ struct hv_netvsc_packet { ...@@ -99,7 +99,7 @@ struct hv_netvsc_packet {
}; };
/* Represents the net vsc driver */ /* Represents the net vsc driver */
typedef struct _NETVSC_DRIVER_OBJECT { struct netvsc_driver {
/* Must be the first field */ /* Must be the first field */
/* Which is a bug FIXME! */ /* Which is a bug FIXME! */
struct hv_driver Base; struct hv_driver Base;
...@@ -127,12 +127,12 @@ typedef struct _NETVSC_DRIVER_OBJECT { ...@@ -127,12 +127,12 @@ typedef struct _NETVSC_DRIVER_OBJECT {
/* PFN_QUERY_LINKSTATUS QueryLinkStatus; */ /* PFN_QUERY_LINKSTATUS QueryLinkStatus; */
void *Context; void *Context;
} NETVSC_DRIVER_OBJECT; };
typedef struct _NETVSC_DEVICE_INFO { struct netvsc_device_info {
unsigned char MacAddr[6]; unsigned char MacAddr[6];
bool LinkState; /* 0 - link up, 1 - link down */ bool LinkState; /* 0 - link up, 1 - link down */
} NETVSC_DEVICE_INFO; };
/* Interface */ /* Interface */
int NetVscInitialize(struct hv_driver *drv); int NetVscInitialize(struct hv_driver *drv);
......
...@@ -67,8 +67,9 @@ struct net_device_context { ...@@ -67,8 +67,9 @@ struct net_device_context {
struct netvsc_driver_context { struct netvsc_driver_context {
/* !! These must be the first 2 fields !! */ /* !! These must be the first 2 fields !! */
/* Which is a bug FIXME! */
struct driver_context drv_ctx; struct driver_context drv_ctx;
NETVSC_DRIVER_OBJECT drv_obj; struct netvsc_driver drv_obj;
}; };
...@@ -94,7 +95,7 @@ Desc: NetVsc driver initialization ...@@ -94,7 +95,7 @@ Desc: NetVsc driver initialization
static int netvsc_drv_init(PFN_DRIVERINITIALIZE pfn_drv_init) static int netvsc_drv_init(PFN_DRIVERINITIALIZE pfn_drv_init)
{ {
int ret=0; 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; struct driver_context *drv_ctx=&g_netvsc_drv.drv_ctx;
DPRINT_ENTER(NETVSC_DRV); DPRINT_ENTER(NETVSC_DRV);
...@@ -170,14 +171,14 @@ static int netvsc_probe(struct device *device) ...@@ -170,14 +171,14 @@ static int netvsc_probe(struct device *device)
struct driver_context *driver_ctx = driver_to_driver_context(device->driver); struct driver_context *driver_ctx = driver_to_driver_context(device->driver);
struct netvsc_driver_context *net_drv_ctx = (struct netvsc_driver_context*)driver_ctx; 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 device_context *device_ctx = device_to_device_context(device);
struct hv_device *device_obj = &device_ctx->device_obj; struct hv_device *device_obj = &device_ctx->device_obj;
struct net_device *net = NULL; struct net_device *net = NULL;
struct net_device_context *net_device_ctx; struct net_device_context *net_device_ctx;
NETVSC_DEVICE_INFO device_info; struct netvsc_device_info device_info;
DPRINT_ENTER(NETVSC_DRV); DPRINT_ENTER(NETVSC_DRV);
...@@ -246,7 +247,7 @@ static int netvsc_remove(struct device *device) ...@@ -246,7 +247,7 @@ static int netvsc_remove(struct device *device)
int ret=0; int ret=0;
struct driver_context *driver_ctx = driver_to_driver_context(device->driver); struct driver_context *driver_ctx = driver_to_driver_context(device->driver);
struct netvsc_driver_context *net_drv_ctx = (struct netvsc_driver_context*)driver_ctx; 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 device_context *device_ctx = device_to_device_context(device);
struct net_device *net = dev_get_drvdata(&device_ctx->device); struct net_device *net = dev_get_drvdata(&device_ctx->device);
...@@ -301,7 +302,7 @@ static int netvsc_open(struct net_device *net) ...@@ -301,7 +302,7 @@ static int netvsc_open(struct net_device *net)
struct net_device_context *net_device_ctx = netdev_priv(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 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; 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; struct hv_device *device_obj = &net_device_ctx->device_ctx->device_obj;
...@@ -343,7 +344,7 @@ static int netvsc_close(struct net_device *net) ...@@ -343,7 +344,7 @@ static int netvsc_close(struct net_device *net)
struct net_device_context *net_device_ctx = netdev_priv(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 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; 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; 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) ...@@ -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 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 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; 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; int i=0;
struct hv_netvsc_packet *packet; struct hv_netvsc_packet *packet;
...@@ -637,7 +638,7 @@ Desc: ...@@ -637,7 +638,7 @@ Desc:
--*/ --*/
static void netvsc_drv_exit(void) 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 driver_context *drv_ctx=&g_netvsc_drv.drv_ctx;
struct device *current_dev=NULL; struct device *current_dev=NULL;
int ret; int ret;
......
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