31d5034cb7fa564c4189175060604d99990b1ab1
[sfrench/cifs-2.6.git] / drivers / staging / wilc1000 / wilc_platform.h
1 #ifndef __WILC_platfrom_H__
2 #define __WILC_platfrom_H__
3
4 /*!
5  *  @file       wilc_platform.h
6  *  @brief      platform specific file for Linux port
7  *  @author     syounan
8  *  @sa         wilc_oswrapper.h top level OS wrapper file
9  *  @date       15 Dec 2010
10  *  @version    1.0
11  */
12
13
14 /******************************************************************
15  *      Feature support checks
16  *******************************************************************/
17
18 /* CONFIG_WILC_THREAD_FEATURE is implemented */
19
20 /* remove the following block when implementing its feature */
21 #ifdef CONFIG_WILC_THREAD_SUSPEND_CONTROL
22 #error This feature is not supported by this OS
23 #endif
24
25 /* remove the following block when implementing its feature */
26 #ifdef CONFIG_WILC_THREAD_STRICT_PRIORITY
27 #error This feature is not supported by this OS
28 #endif
29
30 /* CONFIG_WILC_SEMAPHORE_FEATURE is implemented */
31
32 /* remove the following block when implementing its feature
33  * #ifdef CONFIG_WILC_SEMAPHORE_TIMEOUT
34  * #error This feature is not supported by this OS
35  #endif*/
36
37 /* CONFIG_WILC_SLEEP_FEATURE is implemented */
38
39 /* remove the following block when implementing its feature */
40 /* #ifdef CONFIG_WILC_SLEEP_HI_RES */
41 /* #error This feature is not supported by this OS */
42 /* #endif */
43
44 /* CONFIG_WILC_TIMER_FEATURE is implemented */
45
46 /* CONFIG_WILC_TIMER_PERIODIC is implemented */
47
48 /* CONFIG_WILC_MEMORY_FEATURE is implemented */
49
50 /* remove the following block when implementing its feature */
51 #ifdef CONFIG_WILC_MEMORY_POOLS
52 #error This feature is not supported by this OS
53 #endif
54
55 /* remove the following block when implementing its feature */
56 #ifdef CONFIG_WILC_MEMORY_DEBUG
57 #error This feature is not supported by this OS
58 #endif
59
60 /* remove the following block when implementing its feature */
61 #ifdef CONFIG_WILC_ASSERTION_SUPPORT
62 #error This feature is not supported by this OS
63 #endif
64
65 /* CONFIG_WILC_STRING_UTILS is implemented */
66
67 /* CONFIG_WILC_MSG_QUEUE_FEATURE is implemented */
68
69 /* remove the following block when implementing its feature */
70 #ifdef CONFIG_WILC_MSG_QUEUE_IPC_NAME
71 #error This feature is not supported by this OS
72 #endif
73
74 /* remove the following block when implementing its feature */
75 /*#ifdef CONFIG_WILC_MSG_QUEUE_TIMEOUT
76  * #error This feature is not supported by this OS
77  #endif*/
78
79 /* CONFIG_WILC_FILE_OPERATIONS_FEATURE is implemented */
80
81 /* CONFIG_WILC_FILE_OPERATIONS_STRING_API is implemented */
82
83 /* remove the following block when implementing its feature */
84 #ifdef CONFIG_WILC_FILE_OPERATIONS_PATH_API
85 #error This feature is not supported by this OS
86 #endif
87
88 /* CONFIG_WILC_TIME_FEATURE is implemented */
89
90 /* remove the following block when implementing its feature */
91 #ifdef CONFIG_WILC_TIME_UTC_SINCE_1970
92 #error This feature is not supported by this OS
93 #endif
94
95 /* remove the following block when implementing its feature */
96 #ifdef CONFIG_WILC_TIME_CALENDER
97 #error This feature is not supported by this OS
98 #endif
99
100 /* remove the following block when implementing its feature */
101 #ifdef CONFIG_WILC_EVENT_FEATURE
102 #error This feature is not supported by this OS
103 #endif
104
105 /* remove the following block when implementing its feature */
106 #ifdef CONFIG_WILC_EVENT_TIMEOUT
107 #error This feature is not supported by this OS
108 #endif
109
110 /* CONFIG_WILC_MATH_OPERATIONS_FEATURE is implemented */
111
112 /* CONFIG_WILC_EXTENDED_FILE_OPERATIONS is implemented */
113
114 /* CONFIG_WILC_EXTENDED_STRING_OPERATIONS is implemented */
115
116 /* CONFIG_WILC_EXTENDED_TIME_OPERATIONS is implemented */
117
118 /* remove the following block when implementing its feature */
119 #ifdef CONFIG_WILC_SOCKET_FEATURE
120 #error This feature is not supported by this OS
121 #endif
122
123 /******************************************************************
124  *      OS specific includes
125  *******************************************************************/
126 #define _XOPEN_SOURCE 600
127
128 #include <linux/kthread.h>
129 #include <linux/semaphore.h>
130 #include <linux/module.h>
131 #include <linux/slab.h>
132 #include <linux/kernel.h>
133 #include <linux/delay.h>
134 #include <linux/types.h>
135 #include <linux/stat.h>
136 #include <linux/time.h>
137 #include <linux/version.h>
138 #include "linux/string.h"
139 /******************************************************************
140  *      OS specific types
141  *******************************************************************/
142
143 typedef struct task_struct *WILC_ThreadHandle;
144
145 typedef void *WILC_MemoryPoolHandle;
146 typedef struct semaphore WILC_SemaphoreHandle;
147
148 typedef struct timer_list WILC_TimerHandle;
149
150
151
152 /* Message Queue type is a structure */
153 typedef struct __Message_struct {
154         void *pvBuffer;
155         WILC_Uint32 u32Length;
156         struct __Message_struct *pstrNext;
157 } Message;
158
159 typedef struct __MessageQueue_struct {
160         WILC_SemaphoreHandle hSem;
161         spinlock_t strCriticalSection;
162         WILC_Bool bExiting;
163         WILC_Uint32 u32ReceiversCount;
164         Message *pstrMessageList;
165 } WILC_MsgQueueHandle;
166
167
168
169 /*Time represented in 64 bit format*/
170 typedef time_t WILC_Time;
171
172
173 /*******************************************************************
174  *      others
175  ********************************************************************/
176
177 /* Generic printf function */
178 #define __WILC_FILE__           __FILE__
179 #define __WILC_FUNCTION__       __FUNCTION__
180 #define __WILC_LINE__           __LINE__
181 #endif