summaryrefslogtreecommitdiffstats
path: root/drivers/staging/hv/include
diff options
context:
space:
mode:
authorNicolas Palix <npalix@diku.dk>2009-07-28 17:32:53 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 12:01:51 -0700
commit3d3b5518a35fa3c31b74224d944cbc83302c5ab4 (patch)
treeb58f07d29492df39332ad60c4a3dff055dbf5609 /drivers/staging/hv/include
parentdf8d9b1f6deb468dd6752f0cd1029157c15248fd (diff)
downloadop-kernel-dev-3d3b5518a35fa3c31b74224d944cbc83302c5ab4.zip
op-kernel-dev-3d3b5518a35fa3c31b74224d944cbc83302c5ab4.tar.gz
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/include')
-rw-r--r--drivers/staging/hv/include/NetVscApi.h14
-rw-r--r--drivers/staging/hv/include/StorVscApi.h6
-rw-r--r--drivers/staging/hv/include/VmbusApi.h43
-rw-r--r--drivers/staging/hv/include/vmbus.h4
4 files changed, 34 insertions, 33 deletions
diff --git a/drivers/staging/hv/include/NetVscApi.h b/drivers/staging/hv/include/NetVscApi.h
index fdd8ad9..56ae23a 100644
--- a/drivers/staging/hv/include/NetVscApi.h
+++ b/drivers/staging/hv/include/NetVscApi.h
@@ -44,15 +44,15 @@ typedef struct _NETVSC_PACKET *PNETVSC_PACKET;
/* Data types */
-typedef int (*PFN_ON_OPEN)(DEVICE_OBJECT *Device);
-typedef int (*PFN_ON_CLOSE)(DEVICE_OBJECT *Device);
+typedef int (*PFN_ON_OPEN)(struct hv_device *Device);
+typedef int (*PFN_ON_CLOSE)(struct hv_device *Device);
-typedef void (*PFN_QUERY_LINKSTATUS)(DEVICE_OBJECT *Device);
-typedef int (*PFN_ON_SEND)(DEVICE_OBJECT *dev, PNETVSC_PACKET packet);
+typedef void (*PFN_QUERY_LINKSTATUS)(struct hv_device *Device);
+typedef int (*PFN_ON_SEND)(struct hv_device *dev, PNETVSC_PACKET packet);
typedef void (*PFN_ON_SENDRECVCOMPLETION)(void * Context);
-typedef int (*PFN_ON_RECVCALLBACK)(DEVICE_OBJECT *dev, PNETVSC_PACKET packet);
-typedef void (*PFN_ON_LINKSTATUS_CHANGED)(DEVICE_OBJECT *dev, u32 Status);
+typedef int (*PFN_ON_RECVCALLBACK)(struct hv_device *dev, PNETVSC_PACKET packet);
+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 {
@@ -74,7 +74,7 @@ typedef struct _NETVSC_PACKET {
/* Bookkeeping stuff */
DLIST_ENTRY ListEntry;
- DEVICE_OBJECT *Device;
+ struct hv_device *Device;
bool IsDataPacket;
/*
diff --git a/drivers/staging/hv/include/StorVscApi.h b/drivers/staging/hv/include/StorVscApi.h
index 785506b1..bd09409 100644
--- a/drivers/staging/hv/include/StorVscApi.h
+++ b/drivers/staging/hv/include/StorVscApi.h
@@ -56,11 +56,11 @@ typedef struct _STORVSC_REQUEST* PSTORVSC_REQUEST;
/* Data types */
-typedef int (*PFN_ON_IO_REQUEST)(PDEVICE_OBJECT Device, PSTORVSC_REQUEST Request);
+typedef int (*PFN_ON_IO_REQUEST)(struct hv_device *Device, PSTORVSC_REQUEST Request);
typedef void (*PFN_ON_IO_REQUEST_COMPLTN)(PSTORVSC_REQUEST Request);
-typedef int (*PFN_ON_HOST_RESET)(PDEVICE_OBJECT Device);
-typedef void (*PFN_ON_HOST_RESCAN)(PDEVICE_OBJECT Device);
+typedef int (*PFN_ON_HOST_RESET)(struct hv_device *Device);
+typedef void (*PFN_ON_HOST_RESCAN)(struct hv_device *Device);
/* Matches Windows-end */
diff --git a/drivers/staging/hv/include/VmbusApi.h b/drivers/staging/hv/include/VmbusApi.h
index b9862e5..c09f589 100644
--- a/drivers/staging/hv/include/VmbusApi.h
+++ b/drivers/staging/hv/include/VmbusApi.h
@@ -39,7 +39,6 @@
/* Fwd declarations */
typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT;
-typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT;
/* Data types */
@@ -69,29 +68,31 @@ typedef struct _MULTIPAGE_BUFFER {
#pragma pack(pop)
+struct hv_device;
+
/* All drivers */
-typedef int (*PFN_ON_DEVICEADD)(PDEVICE_OBJECT Device, void* AdditionalInfo);
-typedef int (*PFN_ON_DEVICEREMOVE)(PDEVICE_OBJECT Device);
+typedef int (*PFN_ON_DEVICEADD)(struct hv_device *Device, void* AdditionalInfo);
+typedef int (*PFN_ON_DEVICEREMOVE)(struct hv_device *Device);
typedef char** (*PFN_ON_GETDEVICEIDS)(void);
typedef void (*PFN_ON_CLEANUP)(PDRIVER_OBJECT Driver);
/* Vmbus extensions */
-/* typedef int (*PFN_ON_MATCH)(PDEVICE_OBJECT dev, PDRIVER_OBJECT drv); */
-/* typedef int (*PFN_ON_PROBE)(PDEVICE_OBJECT dev); */
+/* typedef int (*PFN_ON_MATCH)(struct hv_device *dev, PDRIVER_OBJECT drv); */
+/* typedef int (*PFN_ON_PROBE)(struct hv_device *dev); */
typedef int (*PFN_ON_ISR)(PDRIVER_OBJECT drv);
typedef void (*PFN_ON_DPC)(PDRIVER_OBJECT drv);
typedef void (*PFN_GET_CHANNEL_OFFERS)(void);
-typedef PDEVICE_OBJECT (*PFN_ON_CHILDDEVICE_CREATE)(GUID DeviceType, GUID DeviceInstance, void *Context);
-typedef void (*PFN_ON_CHILDDEVICE_DESTROY)(PDEVICE_OBJECT Device);
-typedef int (*PFN_ON_CHILDDEVICE_ADD)(PDEVICE_OBJECT RootDevice, PDEVICE_OBJECT ChildDevice);
-typedef void (*PFN_ON_CHILDDEVICE_REMOVE)(PDEVICE_OBJECT Device);
+typedef struct hv_device *(*PFN_ON_CHILDDEVICE_CREATE)(GUID DeviceType, GUID DeviceInstance, void *Context);
+typedef void (*PFN_ON_CHILDDEVICE_DESTROY)(struct hv_device *Device);
+typedef int (*PFN_ON_CHILDDEVICE_ADD)(struct hv_device *RootDevice, struct hv_device *ChildDevice);
+typedef void (*PFN_ON_CHILDDEVICE_REMOVE)(struct hv_device *Device);
/* Vmbus channel interface */
typedef void (*VMBUS_CHANNEL_CALLBACK)(void * context);
typedef int (*VMBUS_CHANNEL_OPEN)(
- PDEVICE_OBJECT Device,
+ struct hv_device *Device,
u32 SendBufferSize,
u32 RecvRingBufferSize,
void * UserData,
@@ -101,11 +102,11 @@ typedef int (*VMBUS_CHANNEL_OPEN)(
);
typedef void (*VMBUS_CHANNEL_CLOSE)(
- PDEVICE_OBJECT Device
+ struct hv_device *Device
);
typedef int (*VMBUS_CHANNEL_SEND_PACKET)(
- PDEVICE_OBJECT Device,
+ struct hv_device *Device,
const void * Buffer,
u32 BufferLen,
u64 RequestId,
@@ -114,7 +115,7 @@ typedef int (*VMBUS_CHANNEL_SEND_PACKET)(
);
typedef int (*VMBUS_CHANNEL_SEND_PACKET_PAGEBUFFER)(
- PDEVICE_OBJECT Device,
+ struct hv_device *Device,
PAGE_BUFFER PageBuffers[],
u32 PageCount,
void * Buffer,
@@ -123,7 +124,7 @@ typedef int (*VMBUS_CHANNEL_SEND_PACKET_PAGEBUFFER)(
);
typedef int (*VMBUS_CHANNEL_SEND_PACKET_MULTIPAGEBUFFER)(
- PDEVICE_OBJECT Device,
+ struct hv_device *Device,
MULTIPAGE_BUFFER *MultiPageBuffer,
void * Buffer,
u32 BufferLen,
@@ -131,7 +132,7 @@ typedef int (*VMBUS_CHANNEL_SEND_PACKET_MULTIPAGEBUFFER)(
);
typedef int (*VMBUS_CHANNEL_RECV_PACKET)(
- PDEVICE_OBJECT Device,
+ struct hv_device *Device,
void * Buffer,
u32 BufferLen,
u32* BufferActualLen,
@@ -139,7 +140,7 @@ typedef int (*VMBUS_CHANNEL_RECV_PACKET)(
);
typedef int (*VMBUS_CHANNEL_RECV_PACKET_PAW)(
- PDEVICE_OBJECT Device,
+ struct hv_device *Device,
void * Buffer,
u32 BufferLen,
u32* BufferActualLen,
@@ -147,14 +148,14 @@ typedef int (*VMBUS_CHANNEL_RECV_PACKET_PAW)(
);
typedef int (*VMBUS_CHANNEL_ESTABLISH_GPADL)(
- PDEVICE_OBJECT Device,
+ struct hv_device *Device,
void * Buffer, /* from kmalloc() */
u32 BufferLen, /* page-size multiple */
u32* GpadlHandle
);
typedef int (*VMBUS_CHANNEL_TEARDOWN_GPADL)(
- PDEVICE_OBJECT Device,
+ struct hv_device *Device,
u32 GpadlHandle
);
@@ -186,7 +187,7 @@ typedef struct _DEVICE_INFO {
PORT_INFO Outbound;
} DEVICE_INFO;
-typedef void (*VMBUS_GET_CHANNEL_INFO)(PDEVICE_OBJECT Device, DEVICE_INFO* DeviceInfo);
+typedef void (*VMBUS_GET_CHANNEL_INFO)(struct hv_device *Device, DEVICE_INFO* DeviceInfo);
typedef struct _VMBUS_CHANNEL_INTERFACE {
VMBUS_CHANNEL_OPEN Open;
@@ -218,14 +219,14 @@ typedef struct _DRIVER_OBJECT {
/* Base device object */
-typedef struct _DEVICE_OBJECT {
+struct hv_device {
DRIVER_OBJECT* Driver; /* the driver for this device */
char name[64];
GUID deviceType; /* the device type id of this device */
GUID deviceInstance; /* the device instance id of this device */
void* context;
void* Extension; /* Device extension; */
-} DEVICE_OBJECT;
+};
/* Vmbus driver object */
diff --git a/drivers/staging/hv/include/vmbus.h b/drivers/staging/hv/include/vmbus.h
index c1a8c55..b99c4b5 100644
--- a/drivers/staging/hv/include/vmbus.h
+++ b/drivers/staging/hv/include/vmbus.h
@@ -53,7 +53,7 @@ struct device_context {
GUID device_id;
int probe_error;
struct device device;
- DEVICE_OBJECT device_obj;
+ struct hv_device device_obj;
};
@@ -64,7 +64,7 @@ struct device_context {
/* Inlines */
-static inline struct device_context *to_device_context(DEVICE_OBJECT *device_obj)
+static inline struct device_context *to_device_context(struct hv_device *device_obj)
{
return container_of(device_obj, struct device_context, device_obj);
}
OpenPOWER on IntegriCloud