LIST_ENTRY SubMsgList;
/* Synchronize the request/response if needed */
- HANDLE WaitEvent;
+ struct osd_waitevent *WaitEvent;
VMBUS_CHANNEL_MESSAGE_RESPONSE Response;
PNVSP_1_RECEIVE_BUFFER_SECTION ReceiveSections;
/* Used for NetVSP initialization protocol */
- HANDLE ChannelInitEvent;
+ struct osd_waitevent *ChannelInitEvent;
NVSP_MESSAGE ChannelInitPacket;
NVSP_MESSAGE RevokePacket;
typedef struct _RNDIS_REQUEST {
LIST_ENTRY ListEntry;
- HANDLE WaitEvent;
+ struct osd_waitevent *WaitEvent;
/* FIXME: We assumed a fixed size response here. If we do ever need to handle a bigger response, */
/* we can either define a max response message or add a response buffer variable above this field */
struct hv_device *Device;
/* Synchronize the request/response if needed */
- HANDLE WaitEvent;
+ struct osd_waitevent *WaitEvent;
VSTOR_PACKET VStorPacket;
} STORVSC_REQUEST_EXTENSION;
LIST_ENTRY MsgListEntry;
/* Synchronize the request/response if needed */
- HANDLE WaitEvent;
+ struct osd_waitevent *WaitEvent;
/* The message itself */
unsigned char Msg[0];
unsigned char Data[16];
} GUID;
+struct osd_waitevent {
+ int condition;
+ wait_queue_head_t event;
+};
+
+
typedef void (*PFN_WORKITEM_CALLBACK)(void* context);
typedef void (*PFN_TIMER_CALLBACK)(void* context);
extern int TimerStop(HANDLE hTimer);
extern void TimerStart(HANDLE hTimer, u32 expirationInUs);
-extern HANDLE WaitEventCreate(void);
-extern void WaitEventClose(HANDLE hWait);
-extern void WaitEventSet(HANDLE hWait);
-extern int WaitEventWait(HANDLE hWait);
+extern struct osd_waitevent *WaitEventCreate(void);
+extern void WaitEventClose(struct osd_waitevent *waitEvent);
+extern void WaitEventSet(struct osd_waitevent *waitEvent);
+extern int WaitEventWait(struct osd_waitevent *waitEvent);
-/* If >0, hWait got signaled. If ==0, timeout. If < 0, error */
-extern int WaitEventWaitEx(HANDLE hWait, u32 TimeoutInMs);
+/* If >0, waitEvent got signaled. If ==0, timeout. If < 0, error */
+extern int WaitEventWaitEx(struct osd_waitevent *waitEvent, u32 TimeoutInMs);
#define GetVirtualAddress Physical2LogicalAddr
void* context;
}TIMER;
-
-typedef struct _WAITEVENT {
- int condition;
- wait_queue_head_t event;
-} WAITEVENT;
-
typedef struct _WORKITEM {
struct work_struct work;
PFN_WORKITEM_CALLBACK callback;
kfree(t);
}
-HANDLE WaitEventCreate(void)
+struct osd_waitevent *WaitEventCreate(void)
{
- WAITEVENT* wait = kmalloc(sizeof(WAITEVENT), GFP_KERNEL);
+ struct osd_waitevent *wait = kmalloc(sizeof(struct osd_waitevent), GFP_KERNEL);
if (!wait)
{
return NULL;
return wait;
}
-void WaitEventClose(HANDLE hWait)
+void WaitEventClose(struct osd_waitevent *waitEvent)
{
- WAITEVENT* waitEvent = (WAITEVENT* )hWait;
kfree(waitEvent);
}
-void WaitEventSet(HANDLE hWait)
+void WaitEventSet(struct osd_waitevent *waitEvent)
{
- WAITEVENT* waitEvent = (WAITEVENT* )hWait;
waitEvent->condition = 1;
wake_up_interruptible(&waitEvent->event);
}
-int WaitEventWait(HANDLE hWait)
+int WaitEventWait(struct osd_waitevent *waitEvent)
{
int ret=0;
- WAITEVENT* waitEvent = (WAITEVENT* )hWait;
- ret= wait_event_interruptible(waitEvent->event,
- waitEvent->condition);
+ ret = wait_event_interruptible(waitEvent->event,
+ waitEvent->condition);
waitEvent->condition = 0;
return ret;
}
-int WaitEventWaitEx(HANDLE hWait, u32 TimeoutInMs)
+int WaitEventWaitEx(struct osd_waitevent *waitEvent, u32 TimeoutInMs)
{
int ret=0;
- WAITEVENT* waitEvent = (WAITEVENT* )hWait;
- ret= wait_event_interruptible_timeout(waitEvent->event,
- waitEvent->condition,
- msecs_to_jiffies(TimeoutInMs));
+ ret = wait_event_interruptible_timeout(waitEvent->event,
+ waitEvent->condition,
+ msecs_to_jiffies(TimeoutInMs));
waitEvent->condition = 0;
return ret;
}