summaryrefslogtreecommitdiff
path: root/drivers/staging/hv/NetVsc.c
diff options
context:
space:
mode:
authorNicolas Palix <npalix@diku.dk>2009-07-28 15:32:53 (GMT)
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 19:01:51 (GMT)
commit3d3b5518a35fa3c31b74224d944cbc83302c5ab4 (patch)
treeb58f07d29492df39332ad60c4a3dff055dbf5609 /drivers/staging/hv/NetVsc.c
parentdf8d9b1f6deb468dd6752f0cd1029157c15248fd (diff)
downloadlinux-fsl-qoriq-3d3b5518a35fa3c31b74224d944cbc83302c5ab4.tar.xz
Staging: hv: Transform PDEVICE_OBJECT and DEVICE_OBJECT typedefs into their corresponding structs
Remove typedef DEVICE_OBJECT and use a struct named hv_device instead. Remove typedef PDEVICE_OBJECT which aliases a pointer and use struct hv_device * instead. Here is the semantic patch to perform this transformation: (http://coccinelle.lip6.fr/) //<smpl> @rm_PDEVICE_OBJECT@ @@ -typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT; @rm_DEVICE_OBJECT@ @@ -typedef struct _DEVICE_OBJECT +struct hv_device {...} -DEVICE_OBJECT ; @fixtypedef_PDEVICE_OBJECT@ typedef PDEVICE_OBJECT; @@ -PDEVICE_OBJECT +struct hv_device* @fixtypedef_DEVICE_OBJECT@ typedef DEVICE_OBJECT; @@ -DEVICE_OBJECT +struct hv_device @fixstruct__DEVICE_OBJECT@ @@ struct -_DEVICE_OBJECT +hv_device //</smpl> Signed-off-by: Nicolas Palix <npalix@diku.dk> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/hv/NetVsc.c')
-rw-r--r--drivers/staging/hv/NetVsc.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/staging/hv/NetVsc.c b/drivers/staging/hv/NetVsc.c
index c0d5dc3..ab4660f 100644
--- a/drivers/staging/hv/NetVsc.c
+++ b/drivers/staging/hv/NetVsc.c
@@ -40,13 +40,13 @@ static const GUID gNetVscDeviceType={
/* Internal routines */
static int
NetVscOnDeviceAdd(
- DEVICE_OBJECT *Device,
+ struct hv_device *Device,
void *AdditionalInfo
);
static int
NetVscOnDeviceRemove(
- DEVICE_OBJECT *Device
+ struct hv_device *Device
);
static void
@@ -61,12 +61,12 @@ NetVscOnChannelCallback(
static int
NetVscInitializeSendBufferWithNetVsp(
- DEVICE_OBJECT *Device
+ struct hv_device *Device
);
static int
NetVscInitializeReceiveBufferWithNetVsp(
- DEVICE_OBJECT *Device
+ struct hv_device *Device
);
static int
@@ -81,24 +81,24 @@ NetVscDestroyReceiveBuffer(
static int
NetVscConnectToVsp(
- DEVICE_OBJECT *Device
+ struct hv_device *Device
);
static void
NetVscOnSendCompletion(
- DEVICE_OBJECT *Device,
+ struct hv_device *Device,
VMPACKET_DESCRIPTOR *Packet
);
static int
NetVscOnSend(
- DEVICE_OBJECT *Device,
+ struct hv_device *Device,
NETVSC_PACKET *Packet
);
static void
NetVscOnReceive(
- DEVICE_OBJECT *Device,
+ struct hv_device *Device,
VMPACKET_DESCRIPTOR *Packet
);
@@ -109,11 +109,11 @@ NetVscOnReceiveCompletion(
static void
NetVscSendReceiveCompletion(
- DEVICE_OBJECT *Device,
+ struct hv_device *Device,
u64 TransactionId
);
-static inline struct NETVSC_DEVICE *AllocNetDevice(DEVICE_OBJECT *Device)
+static inline struct NETVSC_DEVICE *AllocNetDevice(struct hv_device *Device)
{
struct NETVSC_DEVICE *netDevice;
@@ -139,7 +139,7 @@ static inline void FreeNetDevice(struct NETVSC_DEVICE *Device)
/* Get the net device object iff exists and its refcount > 1 */
-static inline struct NETVSC_DEVICE *GetOutboundNetDevice(DEVICE_OBJECT *Device)
+static inline struct NETVSC_DEVICE *GetOutboundNetDevice(struct hv_device *Device)
{
struct NETVSC_DEVICE *netDevice;
@@ -157,7 +157,7 @@ static inline struct NETVSC_DEVICE *GetOutboundNetDevice(DEVICE_OBJECT *Device)
}
/* Get the net device object iff exists and its refcount > 0 */
-static inline struct NETVSC_DEVICE *GetInboundNetDevice(DEVICE_OBJECT *Device)
+static inline struct NETVSC_DEVICE *GetInboundNetDevice(struct hv_device *Device)
{
struct NETVSC_DEVICE *netDevice;
@@ -174,7 +174,7 @@ static inline struct NETVSC_DEVICE *GetInboundNetDevice(DEVICE_OBJECT *Device)
return netDevice;
}
-static inline void PutNetDevice(DEVICE_OBJECT *Device)
+static inline void PutNetDevice(struct hv_device *Device)
{
struct NETVSC_DEVICE *netDevice;
@@ -184,7 +184,7 @@ static inline void PutNetDevice(DEVICE_OBJECT *Device)
InterlockedDecrement(&netDevice->RefCount);
}
-static inline struct NETVSC_DEVICE *ReleaseOutboundNetDevice(DEVICE_OBJECT *Device)
+static inline struct NETVSC_DEVICE *ReleaseOutboundNetDevice(struct hv_device *Device)
{
struct NETVSC_DEVICE *netDevice;
@@ -201,7 +201,7 @@ static inline struct NETVSC_DEVICE *ReleaseOutboundNetDevice(DEVICE_OBJECT *Devi
return netDevice;
}
-static inline struct NETVSC_DEVICE *ReleaseInboundNetDevice(DEVICE_OBJECT *Device)
+static inline struct NETVSC_DEVICE *ReleaseInboundNetDevice(struct hv_device *Device)
{
struct NETVSC_DEVICE *netDevice;
@@ -268,7 +268,7 @@ NetVscInitialize(
static int
NetVscInitializeReceiveBufferWithNetVsp(
- DEVICE_OBJECT *Device
+ struct hv_device *Device
)
{
int ret=0;
@@ -397,7 +397,7 @@ Exit:
static int
NetVscInitializeSendBufferWithNetVsp(
- DEVICE_OBJECT *Device
+ struct hv_device *Device
)
{
int ret=0;
@@ -661,7 +661,7 @@ NetVscDestroySendBuffer(
static int
NetVscConnectToVsp(
- DEVICE_OBJECT *Device
+ struct hv_device *Device
)
{
int ret=0;
@@ -794,7 +794,7 @@ Description:
--*/
int
NetVscOnDeviceAdd(
- DEVICE_OBJECT *Device,
+ struct hv_device *Device,
void *AdditionalInfo
)
{
@@ -911,7 +911,7 @@ Description:
--*/
int
NetVscOnDeviceRemove(
- DEVICE_OBJECT *Device
+ struct hv_device *Device
)
{
struct NETVSC_DEVICE *netDevice;
@@ -993,7 +993,7 @@ NetVscOnCleanup(
static void
NetVscOnSendCompletion(
- DEVICE_OBJECT *Device,
+ struct hv_device *Device,
VMPACKET_DESCRIPTOR *Packet
)
{
@@ -1047,7 +1047,7 @@ NetVscOnSendCompletion(
static int
NetVscOnSend(
- DEVICE_OBJECT *Device,
+ struct hv_device *Device,
NETVSC_PACKET *Packet
)
{
@@ -1111,7 +1111,7 @@ NetVscOnSend(
static void
NetVscOnReceive(
- DEVICE_OBJECT *Device,
+ struct hv_device *Device,
VMPACKET_DESCRIPTOR *Packet
)
{
@@ -1304,7 +1304,7 @@ NetVscOnReceive(
static void
NetVscSendReceiveCompletion(
- DEVICE_OBJECT *Device,
+ struct hv_device *Device,
u64 TransactionId
)
{
@@ -1358,7 +1358,7 @@ NetVscOnReceiveCompletion(
void * Context)
{
NETVSC_PACKET *packet = (NETVSC_PACKET*)Context;
- DEVICE_OBJECT *device = (DEVICE_OBJECT*)packet->Device;
+ struct hv_device *device = (struct hv_device*)packet->Device;
struct NETVSC_DEVICE *netDevice;
u64 transactionId=0;
bool fSendReceiveComp = false;
@@ -1417,7 +1417,7 @@ NetVscOnChannelCallback(
{
const int netPacketSize=2048;
int ret=0;
- DEVICE_OBJECT *device=(DEVICE_OBJECT*)Context;
+ struct hv_device *device=(struct hv_device*)Context;
struct NETVSC_DEVICE *netDevice;
u32 bytesRecvd;