blob: 8b8d59780b2cfac1317fb8d9ace12b79705e59f4 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala9c070ad2013-01-08 21:16:34 -08002 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21/*
Jeff Johnson32d95a32012-09-10 13:15:23 -070022 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -070023 *
24 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
25 *
26 *
27 * Permission to use, copy, modify, and/or distribute this software for
28 * any purpose with or without fee is hereby granted, provided that the
29 * above copyright notice and this permission notice appear in all
30 * copies.
31 *
32 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
33 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
34 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
35 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
36 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
37 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
38 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39 * PERFORMANCE OF THIS SOFTWARE.
40 */
41
42#if !defined( __VOS_API_H )
43#define __VOS_API_H
44
45/**=========================================================================
46
47 \file vos_Api.h
48
49 \brief virtual Operating System Services (vOSS) API
50
51 Header file that inludes all the vOSS API definitions.
52
53 Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved.
54
55 Qualcomm Confidential and Proprietary.
56
57 ========================================================================*/
58 /*===========================================================================
59
60 EDIT HISTORY FOR FILE
61
62
63 This section contains comments describing changes made to the module.
64 Notice that changes are listed in reverse chronological order.
65
66
67 $Header:$ $DateTime: $ $Author: $
68
69
70 when who what, where, why
71 -------- --- --------------------------------------------------------
72 06/23/08 hba Added vos_preOpen()
73 05/18/08 lac Created module.
74===========================================================================*/
75
76/*--------------------------------------------------------------------------
77 Include Files
78 ------------------------------------------------------------------------*/
79// one stop shopping. This brings in the entire vOSS API.
80#include <vos_types.h>
81#include <vos_status.h>
82#include <vos_memory.h>
83#include <vos_list.h>
84#include <vos_getBin.h>
85#include <vos_trace.h>
86#include <vos_event.h>
87#include <vos_lock.h>
88#include <vos_mq.h>
89#include <vos_nvitem.h>
90#include <vos_packet.h>
91#include <vos_threads.h>
92#include <vos_timer.h>
93#include <vos_pack_align.h>
94
95/*-------------------------------------------------------------------------
96 Function declarations and documenation
97 ------------------------------------------------------------------------*/
98
99/**--------------------------------------------------------------------------
100
101 \brief vos_preOpen() - PreOpen the vOSS Module
102
103 The \a vos_preOpen() function allocates the Vos Context, but do not
104 initialize all the members. This overal initialization will happen
105 at vos_Open().
106 The reason why we need vos_preOpen() is to get a minimum context
107 where to store BAL and SAL relative data, which happens before
108 vos_Open() is called.
109
110 \param pVosContext: A pointer to where to store the VOS Context
111
112
113 \return VOS_STATUS_SUCCESS - Scheduler was successfully initialized and
114 is ready to be used.
115
116 VOS_STATUS_E_FAILURE - Failure to initialize the scheduler/
117
118 \sa vos_open()
119
120---------------------------------------------------------------------------*/
121VOS_STATUS vos_preOpen ( v_CONTEXT_t *pVosContext );
122
123VOS_STATUS vos_preClose( v_CONTEXT_t *pVosContext );
124
Jeff Johnson295189b2012-06-20 16:38:30 -0700125
126VOS_STATUS vos_preStart( v_CONTEXT_t vosContext );
127
Jeff Johnson295189b2012-06-20 16:38:30 -0700128
129VOS_STATUS vos_open( v_CONTEXT_t *pVosContext, v_SIZE_t hddContextSize );
130
131
132
133VOS_STATUS vos_start( v_CONTEXT_t vosContext );
134
135VOS_STATUS vos_stop( v_CONTEXT_t vosContext );
136
137VOS_STATUS vos_close( v_CONTEXT_t vosContext );
138
139/* vos shutdown will not close control transport and will not handshake with Riva */
140VOS_STATUS vos_shutdown( v_CONTEXT_t vosContext );
141
142/* the wda interface to shutdown */
143VOS_STATUS vos_wda_shutdown( v_CONTEXT_t vosContext );
144
145/**---------------------------------------------------------------------------
146
147 \brief vos_get_context() - get context data area
148
149 Each module in the system has a context / data area that is allocated
150 and maanged by voss. This API allows any user to get a pointer to its
151 allocated context data area from the VOSS global context.
152
153 \param vosContext - the VOSS Global Context.
154
155 \param moduleId - the module ID, who's context data are is being retrived.
156
157 \return - pointer to the context data area.
158
159 - NULL if the context data is not allocated for the module ID
160 specified
161
162 --------------------------------------------------------------------------*/
163v_VOID_t *vos_get_context( VOS_MODULE_ID moduleId,
164 v_CONTEXT_t vosContext );
165
166
167/**---------------------------------------------------------------------------
168
169 \brief vos_get_global_context() - get VOSS global Context
170
171 This API allows any user to get the VOS Global Context pointer from a
172 module context data area.
173
174 \param moduleContext - the input module context pointer
175
176 \param moduleId - the module ID who's context pointer is input in
177 moduleContext.
178
179 \return - pointer to the VOSS global context
180
181 - NULL if the function is unable to retreive the VOSS context.
182
183 --------------------------------------------------------------------------*/
184v_CONTEXT_t vos_get_global_context( VOS_MODULE_ID moduleId,
185 v_VOID_t *moduleContext );
186
187v_U8_t vos_is_logp_in_progress(VOS_MODULE_ID moduleId, v_VOID_t *moduleContext);
188void vos_set_logp_in_progress(VOS_MODULE_ID moduleId, v_U8_t value);
189v_U8_t vos_is_load_unload_in_progress(VOS_MODULE_ID moduleId, v_VOID_t *moduleContext);
190void vos_set_load_unload_in_progress(VOS_MODULE_ID moduleId, v_U8_t value);
191
192/**---------------------------------------------------------------------------
193
194 \brief vos_alloc_context() - allocate a context within the VOSS global Context
195
196 This API allows any user to allocate a user context area within the
197 VOS Global Context.
198
199 \param pVosContext - pointer to the global Vos context
200
201 \param moduleId - the module ID who's context area is being allocated.
202
203 \param ppModuleContext - pointer to location where the pointer to the
204 allocated context is returned. Note this
205 output pointer is valid only if the API
206 returns VOS_STATUS_SUCCESS
207
208 \param size - the size of the context area to be allocated.
209
210 \return - VOS_STATUS_SUCCESS - the context for the module ID has been
211 allocated successfully. The pointer to the context area
212 can be found in *ppModuleContext.
213 \note This function returns VOS_STATUS_SUCCESS if the
214 module context was already allocated and the size
215 allocated matches the size on this call.
216
217 VOS_STATUS_E_INVAL - the moduleId is not a valid or does
218 not identify a module that can have a context allocated.
219
220 VOS_STATUS_E_EXISTS - vos could allocate the requested context
221 because a context for this module ID already exists and it is
222 a *different* size that specified on this call.
223
224 VOS_STATUS_E_NOMEM - vos could not allocate memory for the
225 requested context area.
226
227 \sa vos_get_context(), vos_free_context()
228
229 --------------------------------------------------------------------------*/
230VOS_STATUS vos_alloc_context( v_VOID_t *pVosContext, VOS_MODULE_ID moduleID,
231 v_VOID_t **ppModuleContext, v_SIZE_t size );
232
233
234/**---------------------------------------------------------------------------
235
236 \brief vos_free_context() - free an allocated a context within the
237 VOSS global Context
238
239 This API allows a user to free the user context area within the
240 VOS Global Context.
241
242 \param pVosContext - pointer to the global Vos context
243
244 \param moduleId - the module ID who's context area is being free
245
246 \param pModuleContext - pointer to module context area to be free'd.
247
248 \return - VOS_STATUS_SUCCESS - the context for the module ID has been
249 free'd. The pointer to the context area is not longer
250 available.
251
252 VOS_STATUS_E_FAULT - pVosContext or pModuleContext are not
253 valid pointers.
254
255 VOS_STATUS_E_INVAL - the moduleId is not a valid or does
256 not identify a module that can have a context free'd.
257
258 VOS_STATUS_E_EXISTS - vos could not free the requested
259 context area because a context for this module ID does not
260 exist in the global vos context.
261
262 \sa vos_get_context()
263
264 --------------------------------------------------------------------------*/
265VOS_STATUS vos_free_context( v_VOID_t *pVosContext, VOS_MODULE_ID moduleID,
266 v_VOID_t *pModuleContext );
267
268v_BOOL_t vos_is_apps_power_collapse_allowed(void* pHddCtx);
Madan Mohan Koyyalamudi78f17402013-06-13 14:47:55 +0530269void vos_abort_mac_scan(tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700270
271/**
272 @brief vos_wlanShutdown() - This API will shutdown WLAN driver
273
274 This function is called when Riva subsystem crashes. There are two
275 methods (or operations) in WLAN driver to handle Riva crash,
276 1. shutdown: Called when Riva goes down, this will shutdown WLAN
277 driver without handshaking with Riva.
278 2. re-init: Next API
279
280 @param
281 NONE
282 @return
283 VOS_STATUS_SUCCESS - Operation completed successfully.
284 VOS_STATUS_E_FAILURE - Operation failed.
285
286*/
287VOS_STATUS vos_wlanShutdown(void);
288
289/**
290 @brief vos_wlanReInit() - This API will re-init WLAN driver
291
292 This function is called when Riva subsystem reboots. There are two
293 methods (or operations) in WLAN driver to handle Riva crash,
294 1. shutdown: Previous API
295 2. re-init: Called when Riva comes back after the crash. This will
296 re-initialize WLAN driver. In some cases re-open may be
297 referred instead of re-init.
298 @param
299 NONE
300 @return
301 VOS_STATUS_SUCCESS - Operation completed successfully.
302 VOS_STATUS_E_FAILURE - Operation failed.
303
304*/
305VOS_STATUS vos_wlanReInit(void);
306
Jeff Johnsone7245742012-09-05 17:12:55 -0700307/**
308 @brief vos_wlanRestart() - This API will reload WLAN driver.
309
310 This function is called if driver detects any fatal state which
311 can be recovered by a WLAN module reload ( Android framwork initiated ).
312 Note that this API will not initiate any RIVA subsystem restart.
313
314 @param
315 NONE
316 @return
317 VOS_STATUS_SUCCESS - Operation completed successfully.
318 VOS_STATUS_E_FAILURE - Operation failed.
319
320*/
321VOS_STATUS vos_wlanRestart(void);
322
Madan Mohan Koyyalamudi93d3b5f2013-08-05 12:51:17 +0530323/**
324 @brief vos_fwDumpReq()
325
326 This function is called to issue dump commands to Firmware
327
328 @param
329 cmd - Command No. to execute
330 arg1 - argument 1 to cmd
331 arg2 - argument 2 to cmd
332 arg3 - argument 3 to cmd
333 arg4 - argument 4 to cmd
334 @return
335 NONE
336*/
337v_VOID_t vos_fwDumpReq(tANI_U32 cmd, tANI_U32 arg1, tANI_U32 arg2,
338 tANI_U32 arg3, tANI_U32 arg4);
Jeff Johnson295189b2012-06-20 16:38:30 -0700339#endif // if !defined __VOS_NVITEM_H