int
BlkVscInitialize(
- DRIVER_OBJECT *Driver
+ struct hv_driver *Driver
)
{
STORVSC_DRIVER_OBJECT* storDriver = (STORVSC_DRIVER_OBJECT*)Driver;
static void
NetVscOnCleanup(
- DRIVER_OBJECT *Driver
+ struct hv_driver *Driver
);
static void
--*/
int
NetVscInitialize(
- DRIVER_OBJECT *drv
+ struct hv_driver *drv
)
{
NETVSC_DRIVER_OBJECT* driver = (NETVSC_DRIVER_OBJECT*)drv;
--*/
void
NetVscOnCleanup(
- DRIVER_OBJECT *drv
+ struct hv_driver *drv
)
{
DPRINT_ENTER(NETVSC);
static void
RndisFilterOnCleanup(
- DRIVER_OBJECT *Driver
+ struct hv_driver *Driver
);
static int
static void
RndisFilterOnCleanup(
- DRIVER_OBJECT *Driver
+ struct hv_driver *Driver
)
{
DPRINT_ENTER(NETVSC);
static void
StorVscOnCleanup(
- DRIVER_OBJECT *Device
+ struct hv_driver *Device
);
static void
--*/
int
StorVscInitialize(
- DRIVER_OBJECT *Driver
+ struct hv_driver *Driver
)
{
STORVSC_DRIVER_OBJECT* storDriver = (STORVSC_DRIVER_OBJECT*)Driver;
--*/
void
StorVscOnCleanup(
- DRIVER_OBJECT *Driver
+ struct hv_driver *Driver
)
{
DPRINT_ENTER(STORVSC);
.Data = {0xfc, 0x60, 0x37, 0xac, 0xdf, 0x9a, 0xaa, 0x40, 0x94, 0x27, 0xa7, 0x0e, 0xd6, 0xde, 0x95, 0xc5}
};
-static DRIVER_OBJECT* gDriver; /* vmbus driver object */
+static struct hv_driver *gDriver; /* vmbus driver object */
static struct hv_device* gDevice; /* vmbus root device */
static void
VmbusOnCleanup(
- DRIVER_OBJECT* drv
+ struct hv_driver *drv
);
static int
VmbusOnISR(
- DRIVER_OBJECT* drv
+ struct hv_driver *drv
);
static void
VmbusOnMsgDPC(
- DRIVER_OBJECT* drv
+ struct hv_driver *drv
);
static void
VmbusOnEventDPC(
- DRIVER_OBJECT* drv
+ struct hv_driver *drv
);
/*++;
--*/
int
VmbusInitialize(
- DRIVER_OBJECT* drv
+ struct hv_driver *drv
)
{
VMBUS_DRIVER_OBJECT* driver = (VMBUS_DRIVER_OBJECT*)drv;
--*/
void
VmbusOnCleanup(
- DRIVER_OBJECT* drv
+ struct hv_driver *drv
)
{
/* VMBUS_DRIVER_OBJECT* driver = (VMBUS_DRIVER_OBJECT*)drv; */
--*/
void
VmbusOnMsgDPC(
- DRIVER_OBJECT* drv
+ struct hv_driver *drv
)
{
void *page_addr = gHvContext.synICMessagePage[0];
--*/
void
VmbusOnEventDPC(
- DRIVER_OBJECT* drv
+ struct hv_driver* drv
)
{
/* TODO: Process any events */
--*/
int
VmbusOnISR(
- DRIVER_OBJECT* drv
+ struct hv_driver *drv
)
{
/* VMBUS_DRIVER_OBJECT* driver = (VMBUS_DRIVER_OBJECT*)drv; */
/* Represents the net vsc driver */
typedef struct _NETVSC_DRIVER_OBJECT {
- DRIVER_OBJECT Base; /* Must be the first field */
+ struct hv_driver Base; /* Must be the first field */
u32 RingBufferSize;
u32 RequestExtSize;
int
NetVscInitialize(
- DRIVER_OBJECT* drv
+ struct hv_driver *drv
);
#endif /* _NETVSC_API_H_ */
/* Represents the block vsc driver */
typedef struct _STORVSC_DRIVER_OBJECT {
- DRIVER_OBJECT Base; /* Must be the first field */
+ struct hv_driver Base; /* Must be the first field */
/* Set by caller (in bytes) */
u32 RingBufferSize;
int
StorVscInitialize(
- DRIVER_OBJECT *Driver
+ struct hv_driver *Driver
);
int
BlkVscInitialize(
- DRIVER_OBJECT *Driver
+ struct hv_driver *Driver
);
#endif /* _STORVSC_API_H_ */
#define MAX_PAGE_BUFFER_COUNT 16
#define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */
-
-
-/* Fwd declarations */
-
-typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT;
-
-
/* Data types */
#pragma pack(pop)
+struct hv_driver;
struct hv_device;
/* All drivers */
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);
+typedef void (*PFN_ON_CLEANUP)(struct hv_driver *Driver);
/* Vmbus extensions */
-/* typedef int (*PFN_ON_MATCH)(struct hv_device *dev, PDRIVER_OBJECT drv); */
+/* typedef int (*PFN_ON_MATCH)(struct hv_device *dev, struct hv_driver *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 int (*PFN_ON_ISR)(struct hv_driver *drv);
+typedef void (*PFN_ON_DPC)(struct hv_driver *drv);
typedef void (*PFN_GET_CHANNEL_OFFERS)(void);
typedef struct hv_device *(*PFN_ON_CHILDDEVICE_CREATE)(GUID DeviceType, GUID DeviceInstance, void *Context);
typedef void (*VMBUS_GET_CHANNEL_INTERFACE)(VMBUS_CHANNEL_INTERFACE *Interface);
/* Base driver object */
-typedef struct _DRIVER_OBJECT {
+struct hv_driver {
const char* name;
GUID deviceType; /* the device type supported by this driver */
PFN_ON_CLEANUP OnCleanup;
VMBUS_CHANNEL_INTERFACE VmbusChannelInterface;
-} DRIVER_OBJECT;
+};
/* Base device object */
struct hv_device {
- DRIVER_OBJECT* Driver; /* the driver for this device */
+ struct hv_driver *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 */
/* Vmbus driver object */
typedef struct _VMBUS_DRIVER_OBJECT {
- DRIVER_OBJECT Base; /* !! Must be the 1st field !! */
+ struct hv_driver Base; /* !! Must be the 1st field !! */
/* Set by the caller */
PFN_ON_CHILDDEVICE_CREATE OnChildDeviceCreate;
int
VmbusInitialize(
- DRIVER_OBJECT* drv
+ struct hv_driver *drv
);
#endif /* _VMBUS_API_H_ */
/* Data types */
-typedef int (*PFN_DRIVERINITIALIZE)(DRIVER_OBJECT *drv);
-typedef int (*PFN_DRIVEREXIT)(DRIVER_OBJECT *drv);
+typedef int (*PFN_DRIVERINITIALIZE)(struct hv_driver *drv);
+typedef int (*PFN_DRIVEREXIT)(struct hv_driver *drv);
struct driver_context {
GUID class_id;
if (memcmp(&device_ctx->class_id, &driver_ctx->class_id, sizeof(GUID)) == 0)
{
/* !! NOTE: The driver_ctx is not a vmbus_drv_ctx. We typecast it here to access the */
- /* DRIVER_OBJECT field */
+ /* struct hv_driver field */
struct vmbus_driver_context *vmbus_drv_ctx = (struct vmbus_driver_context*)driver_ctx;
device_ctx->device_obj.Driver = &vmbus_drv_ctx->drv_obj.Base;
DPRINT_INFO(VMBUS_DRV, "device object (%p) set to driver object (%p)", &device_ctx->device_obj, device_ctx->device_obj.Driver);