]> Pileus Git - ~andy/linux/blob - drivers/staging/csr/csr_framework_ext_types.h
staging: csr: csr_framework_ext_types.h: fix coding style
[~andy/linux] / drivers / staging / csr / csr_framework_ext_types.h
1 #ifndef CSR_FRAMEWORK_EXT_TYPES_H__
2 #define CSR_FRAMEWORK_EXT_TYPES_H__
3 /*****************************************************************************
4
5         (c) Cambridge Silicon Radio Limited 2010
6         All rights reserved and confidential information of CSR
7
8         Refer to LICENSE.txt included with this source for details
9         on the license terms.
10
11 *****************************************************************************/
12
13 #ifdef __KERNEL__
14 #include <linux/kthread.h>
15 #include <linux/semaphore.h>
16 #else
17 #include <pthread.h>
18 #endif
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24
25 #ifdef __KERNEL__
26
27 struct CsrThread {
28         struct task_struct *thread_task;
29         char                name[16];
30 };
31
32 struct CsrEvent {
33         /* wait_queue for waking the kernel thread */
34         wait_queue_head_t wakeup_q;
35         unsigned int      wakeup_flag;
36 };
37
38 typedef struct CsrEvent CsrEventHandle;
39 typedef struct semaphore CsrMutexHandle;
40 typedef struct CsrThread CsrThreadHandle;
41
42 #else /* __KERNEL __ */
43
44 struct CsrEvent {
45         pthread_cond_t  event;
46         pthread_mutex_t mutex;
47         u32       eventBits;
48 };
49
50 typedef struct CsrEvent CsrEventHandle;
51 typedef pthread_mutex_t CsrMutexHandle;
52 typedef pthread_t CsrThreadHandle;
53
54 #endif /* __KERNEL__ */
55
56 #ifdef __cplusplus
57 }
58 #endif
59
60 #endif