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>
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);
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);
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;
/* 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);
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);
}
typedef struct _RNDIS_FILTER_DRIVER_OBJECT {
/* The original driver */
- NETVSC_DRIVER_OBJECT InnerDriver;
+ struct netvsc_driver InnerDriver;
} RNDIS_FILTER_DRIVER_OBJECT;
return ret;
}
-int
-RndisFilterInit(
- NETVSC_DRIVER_OBJECT *Driver
- )
+int RndisFilterInit(struct netvsc_driver *Driver)
{
DPRINT_ENTER(NETVSC);
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);
/* Interface */
-extern int RndisFilterInit(NETVSC_DRIVER_OBJECT *Driver);
+extern int RndisFilterInit(struct netvsc_driver *driver);
#endif /* _RNDISFILTER_H_ */
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
* Valid only for receives when we break a xfer page packet
* into multiple netvsc packets
*/
- XFERPAGE_PACKET *XferPagePacket;
+ struct xferpage_packet *XferPagePacket;
union {
struct{
};
/* 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;
/* 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);
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;
};
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);
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);
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);
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;
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;
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;
--*/
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;