diff options
author | Bill Pemberton <wfp5p@virginia.edu> | 2009-07-28 13:46:24 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-15 12:01:52 -0700 |
commit | aedb444a577184f7e113e1461fccc0ef10ffde55 (patch) | |
tree | 9ed5a2cf035fd81b59ce805bb649c9eac70d0451 /drivers | |
parent | b578852955765bfbe12bd31ac1e7888a3deaff40 (diff) |
Staging: hv: remove WAITEVENT typedef
Remove the WAITEVENT typedef and also replace HANDLE types that use
the WaitEvent calls with struct osd_waitevent.
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/hv/ChannelMgmt.h | 2 | ||||
-rw-r--r-- | drivers/staging/hv/NetVsc.h | 2 | ||||
-rw-r--r-- | drivers/staging/hv/RndisFilter.c | 2 | ||||
-rw-r--r-- | drivers/staging/hv/StorVsc.c | 2 | ||||
-rw-r--r-- | drivers/staging/hv/VmbusPrivate.h | 2 | ||||
-rw-r--r-- | drivers/staging/hv/include/osd.h | 18 | ||||
-rw-r--r-- | drivers/staging/hv/osd.c | 32 |
7 files changed, 28 insertions, 32 deletions
diff --git a/drivers/staging/hv/ChannelMgmt.h b/drivers/staging/hv/ChannelMgmt.h index 6208cd847e1..7cf01738e42 100644 --- a/drivers/staging/hv/ChannelMgmt.h +++ b/drivers/staging/hv/ChannelMgmt.h @@ -115,7 +115,7 @@ typedef struct _VMBUS_CHANNEL_MSGINFO { LIST_ENTRY SubMsgList; /* Synchronize the request/response if needed */ - HANDLE WaitEvent; + struct osd_waitevent *WaitEvent; VMBUS_CHANNEL_MESSAGE_RESPONSE Response; diff --git a/drivers/staging/hv/NetVsc.h b/drivers/staging/hv/NetVsc.h index f7c16801eb3..7636654c252 100644 --- a/drivers/staging/hv/NetVsc.h +++ b/drivers/staging/hv/NetVsc.h @@ -78,7 +78,7 @@ struct NETVSC_DEVICE { PNVSP_1_RECEIVE_BUFFER_SECTION ReceiveSections; /* Used for NetVSP initialization protocol */ - HANDLE ChannelInitEvent; + struct osd_waitevent *ChannelInitEvent; NVSP_MESSAGE ChannelInitPacket; NVSP_MESSAGE RevokePacket; diff --git a/drivers/staging/hv/RndisFilter.c b/drivers/staging/hv/RndisFilter.c index cac07273ca3..38b9a11542a 100644 --- a/drivers/staging/hv/RndisFilter.c +++ b/drivers/staging/hv/RndisFilter.c @@ -61,7 +61,7 @@ typedef struct _RNDIS_DEVICE { 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 */ diff --git a/drivers/staging/hv/StorVsc.c b/drivers/staging/hv/StorVsc.c index 26d3f141831..c55146c6c7a 100644 --- a/drivers/staging/hv/StorVsc.c +++ b/drivers/staging/hv/StorVsc.c @@ -47,7 +47,7 @@ typedef struct _STORVSC_REQUEST_EXTENSION { struct hv_device *Device; /* Synchronize the request/response if needed */ - HANDLE WaitEvent; + struct osd_waitevent *WaitEvent; VSTOR_PACKET VStorPacket; } STORVSC_REQUEST_EXTENSION; diff --git a/drivers/staging/hv/VmbusPrivate.h b/drivers/staging/hv/VmbusPrivate.h index 75013bc9e25..bf47408258e 100644 --- a/drivers/staging/hv/VmbusPrivate.h +++ b/drivers/staging/hv/VmbusPrivate.h @@ -102,7 +102,7 @@ struct VMBUS_MSGINFO { LIST_ENTRY MsgListEntry; /* Synchronize the request/response if needed */ - HANDLE WaitEvent; + struct osd_waitevent *WaitEvent; /* The message itself */ unsigned char Msg[0]; diff --git a/drivers/staging/hv/include/osd.h b/drivers/staging/hv/include/osd.h index 6a5675f4b26..470d8021b03 100644 --- a/drivers/staging/hv/include/osd.h +++ b/drivers/staging/hv/include/osd.h @@ -52,6 +52,12 @@ typedef struct { 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); @@ -122,13 +128,13 @@ extern void TimerClose(HANDLE hTimer); 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 diff --git a/drivers/staging/hv/osd.c b/drivers/staging/hv/osd.c index 4cee746d01c..50a2ca7dde2 100644 --- a/drivers/staging/hv/osd.c +++ b/drivers/staging/hv/osd.c @@ -55,12 +55,6 @@ typedef struct _TIMER { 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; @@ -220,9 +214,9 @@ void TimerClose(HANDLE hTimer) 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; @@ -233,38 +227,34 @@ HANDLE WaitEventCreate(void) 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; } |