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