summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Pemberton <wfp5p@virginia.edu>2009-07-28 13:46:25 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 12:01:52 -0700
commit06d2e318b749689d659b3f0c90a157f1ebb31f15 (patch)
tree7279e416a163d93fd4d8aee1c1a773ae8b7fdc12
parentaedb444a577184f7e113e1461fccc0ef10ffde55 (diff)
downloadop-kernel-dev-06d2e318b749689d659b3f0c90a157f1ebb31f15.zip
op-kernel-dev-06d2e318b749689d659b3f0c90a157f1ebb31f15.tar.gz
Staging: hv remove TIMER typedef
Remove the TIMER typedef and also replace HANDLE types that use the timer calls. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/hv/ChannelMgmt.h2
-rw-r--r--drivers/staging/hv/include/osd.h19
-rw-r--r--drivers/staging/hv/osd.c23
3 files changed, 20 insertions, 24 deletions
diff --git a/drivers/staging/hv/ChannelMgmt.h b/drivers/staging/hv/ChannelMgmt.h
index 7cf0173..71173d0 100644
--- a/drivers/staging/hv/ChannelMgmt.h
+++ b/drivers/staging/hv/ChannelMgmt.h
@@ -47,7 +47,7 @@ typedef struct _VMBUS_CHANNEL {
struct hv_device *DeviceObject;
- HANDLE PollTimer; /* SA-111 workaround */
+ struct osd_timer *PollTimer; /* SA-111 workaround */
VMBUS_CHANNEL_STATE State;
diff --git a/drivers/staging/hv/include/osd.h b/drivers/staging/hv/include/osd.h
index 470d802..2cd2cf0 100644
--- a/drivers/staging/hv/include/osd.h
+++ b/drivers/staging/hv/include/osd.h
@@ -48,6 +48,10 @@ typedef struct _DLIST_ENTRY {
/* typedef unsigned char GUID[16]; */
typedef void* HANDLE;
+typedef void (*PFN_WORKITEM_CALLBACK)(void* context);
+typedef void (*PFN_TIMER_CALLBACK)(void* context);
+
+
typedef struct {
unsigned char Data[16];
} GUID;
@@ -57,9 +61,12 @@ struct osd_waitevent {
wait_queue_head_t event;
};
+struct osd_timer {
+ struct timer_list timer;
+ PFN_TIMER_CALLBACK callback;
+ void* context;
+};
-typedef void (*PFN_WORKITEM_CALLBACK)(void* context);
-typedef void (*PFN_TIMER_CALLBACK)(void* context);
#ifdef __x86_64__
@@ -123,10 +130,10 @@ extern void PageFree(void* page, unsigned int count);
extern void* MemMapIO(unsigned long phys, unsigned long size);
extern void MemUnmapIO(void* virt);
-extern HANDLE TimerCreate(PFN_TIMER_CALLBACK pfnTimerCB, void* context);
-extern void TimerClose(HANDLE hTimer);
-extern int TimerStop(HANDLE hTimer);
-extern void TimerStart(HANDLE hTimer, u32 expirationInUs);
+extern struct osd_timer *TimerCreate(PFN_TIMER_CALLBACK pfnTimerCB, void* context);
+extern void TimerClose(struct osd_timer *t);
+extern int TimerStop(struct osd_timer *t);
+extern void TimerStart(struct osd_timer *t, u32 expirationInUs);
extern struct osd_waitevent *WaitEventCreate(void);
extern void WaitEventClose(struct osd_waitevent *waitEvent);
diff --git a/drivers/staging/hv/osd.c b/drivers/staging/hv/osd.c
index 50a2ca7..35c9ac2 100644
--- a/drivers/staging/hv/osd.c
+++ b/drivers/staging/hv/osd.c
@@ -49,11 +49,6 @@
/* Data types */
-typedef struct _TIMER {
- struct timer_list timer;
- PFN_TIMER_CALLBACK callback;
- void* context;
-}TIMER;
typedef struct _WORKITEM {
struct work_struct work;
@@ -168,14 +163,14 @@ void MemUnmapIO(void *virt)
void TimerCallback(unsigned long data)
{
- TIMER* t = (TIMER*)data;
+ struct osd_timer *t = (struct osd_timer *) data;
t->callback(t->context);
}
-HANDLE TimerCreate(PFN_TIMER_CALLBACK pfnTimerCB, void* context)
+struct osd_timer *TimerCreate(PFN_TIMER_CALLBACK pfnTimerCB, void* context)
{
- TIMER* t = kmalloc(sizeof(TIMER), GFP_KERNEL);
+ struct osd_timer *t = kmalloc(sizeof(struct osd_timer), GFP_KERNEL);
if (!t)
{
return NULL;
@@ -191,25 +186,19 @@ HANDLE TimerCreate(PFN_TIMER_CALLBACK pfnTimerCB, void* context)
return t;
}
-void TimerStart(HANDLE hTimer, u32 expirationInUs)
+void TimerStart(struct osd_timer *t, u32 expirationInUs)
{
- TIMER* t = (TIMER* )hTimer;
-
t->timer.expires = jiffies + usecs_to_jiffies(expirationInUs);
add_timer(&t->timer);
}
-int TimerStop(HANDLE hTimer)
+int TimerStop(struct osd_timer *t)
{
- TIMER* t = (TIMER* )hTimer;
-
return del_timer(&t->timer);
}
-void TimerClose(HANDLE hTimer)
+void TimerClose(struct osd_timer *t)
{
- TIMER* t = (TIMER* )hTimer;
-
del_timer(&t->timer);
kfree(t);
}
OpenPOWER on IntegriCloud