|
1 /* |
|
2 * PowerSrv_API.h |
|
3 * |
|
4 * Copyright(c) 1998 - 2010 Texas Instruments. All rights reserved. |
|
5 * All rights reserved. |
|
6 * |
|
7 * This program and the accompanying materials are made available under the |
|
8 * terms of the Eclipse Public License v1.0 or BSD License which accompanies |
|
9 * this distribution. The Eclipse Public License is available at |
|
10 * http://www.eclipse.org/legal/epl-v10.html and the BSD License is as below. |
|
11 * |
|
12 * Redistribution and use in source and binary forms, with or without |
|
13 * modification, are permitted provided that the following conditions |
|
14 * are met: |
|
15 * |
|
16 * * Redistributions of source code must retain the above copyright |
|
17 * notice, this list of conditions and the following disclaimer. |
|
18 * * Redistributions in binary form must reproduce the above copyright |
|
19 * notice, this list of conditions and the following disclaimer in |
|
20 * the documentation and/or other materials provided with the |
|
21 * distribution. |
|
22 * * Neither the name Texas Instruments nor the names of its |
|
23 * contributors may be used to endorse or promote products derived |
|
24 * from this software without specific prior written permission. |
|
25 * |
|
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
|
29 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
|
30 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
31 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
32 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
|
33 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
34 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
35 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|
36 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
37 */ |
|
38 |
|
39 /** \file powerSrv_API.h |
|
40 * \brief This is the Power Manager module API. |
|
41 * \author Yaron Menashe |
|
42 */ |
|
43 |
|
44 /**************************************************************************** |
|
45 * * |
|
46 * MODULE: Power Server * |
|
47 * PURPOSE: Power Server Module API * |
|
48 * * |
|
49 ****************************************************************************/ |
|
50 |
|
51 #ifndef _POWER_SRV_API_H_ |
|
52 #define _POWER_SRV_API_H_ |
|
53 |
|
54 #include "MacServices_api.h" |
|
55 |
|
56 /***************************************************************************** |
|
57 ** Constants ** |
|
58 *****************************************************************************/ |
|
59 |
|
60 |
|
61 /***************************************************************************** |
|
62 ** Enumerations ** |
|
63 *****************************************************************************/ |
|
64 |
|
65 |
|
66 |
|
67 /***************************************************************************** |
|
68 ** Typedefs ** |
|
69 *****************************************************************************/ |
|
70 /*typedef void (*powerSaveCmdResponseCB_t )(TI_HANDLE cmdResponseHandle,TI_UINT8 MboxStatus);*/ |
|
71 typedef TPowerSaveResponseCb powerSaveCmdResponseCB_t; |
|
72 /*typedef void (*powerSaveCmpltCB_t )(TI_HANDLE powerSaveCmpltHandle,TI_UINT8 PSMode,TI_UINT8 transStatus);*/ |
|
73 typedef TPowerSaveCompleteCb powerSaveCmpltCB_t; |
|
74 /***************************************************************************** |
|
75 ** Structures ** |
|
76 *****************************************************************************/ |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 /***************************************************************************** |
|
82 ** External data definitions ** |
|
83 *****************************************************************************/ |
|
84 |
|
85 |
|
86 /***************************************************************************** |
|
87 ** External functions definitions ** |
|
88 *****************************************************************************/ |
|
89 |
|
90 |
|
91 /***************************************************************************** |
|
92 ** Public Function prototypes ** |
|
93 *****************************************************************************/ |
|
94 |
|
95 |
|
96 /** |
|
97 * \author Assaf Azulay |
|
98 * \date 20-Oct-2005\n |
|
99 * \brief Creates the object of the power Server. |
|
100 * |
|
101 * Function Scope \e Public.\n |
|
102 * Parameters:\n |
|
103 * 1) TI_HANDLE - handle to the OS.\n |
|
104 * Return Value: TI_HANDLE - handle to the powerSrv object.\n |
|
105 */ |
|
106 TI_HANDLE powerSrv_create(TI_HANDLE hOs); |
|
107 |
|
108 |
|
109 /** |
|
110 * \author Assaf Azulay |
|
111 * \date 27-Apr-2005\n |
|
112 * \brief Destroy the object of the power Server. |
|
113 * |
|
114 * Function Scope \e Public.\n |
|
115 * Parameters:\n |
|
116 * 1) TI_HANDLE - handle to the powerSrv object.\n |
|
117 * Return Value: TI_STATUS - TI_OK on success else TI_NOK.\n |
|
118 */ |
|
119 TI_STATUS powerSrv_destroy(TI_HANDLE hPowerSrv); |
|
120 |
|
121 |
|
122 /** |
|
123 * \author Assaf Azulay |
|
124 * \date 24-Oct-2005\n |
|
125 * \brief Initialization of the powerSrv module. |
|
126 * |
|
127 * Function Scope \e Public.\n |
|
128 * Parameters:\n |
|
129 * 1) TI_HANDLE - handle to the powerSrv object.\n |
|
130 * 3) TI_HANDLE - handle to the Report object.\n |
|
131 * 2) TI_HANDLE - handle to the EventMbox object.\n |
|
132 * 4) TI_HANDLE - handle to the CommandBuilder object.\n |
|
133 * 5) TI_HANDLE - handle to the Timer module object.\n |
|
134 * Return Value: TI_STATUS - TI_OK on success else TI_NOK.\n |
|
135 */ |
|
136 TI_STATUS powerSrv_init (TI_HANDLE hPowerSrv, |
|
137 TI_HANDLE hReport, |
|
138 TI_HANDLE hEventMbox, |
|
139 TI_HANDLE hCmdBld, |
|
140 TI_HANDLE hTimer); |
|
141 |
|
142 |
|
143 TI_STATUS powerSrv_config(TI_HANDLE hPowerSrv, |
|
144 TPowerSrvInitParams *pPowerSrvInitParams); |
|
145 |
|
146 /** |
|
147 * \author Assaf Azulay |
|
148 * \date 24-Oct-2005\n |
|
149 * \brief request PS by User |
|
150 * |
|
151 * Function Scope \e Public.\n |
|
152 * Parameters:\n |
|
153 * 1) hPowerSrv - handle to the PowerSrv object.\n |
|
154 * 2) psMode - Power save/Active request.\n |
|
155 * 3) sendNullDataOnExit - \n |
|
156 * 4) powerSaveCompleteCBObject - handle to the Callback functin module.\n |
|
157 * 5) powerSaveCompleteCB - Calback function - for success/faild notification.\n |
|
158 * 6) powerSavecmdResponseCB - Calback function - for GWSI success/faild notification.\n |
|
159 * Return Value: TI_STATUS - TI_OK / PENDING / TI_NOK.\n |
|
160 * \b Description:\n |
|
161 * This function is a user mode request from the Power Save Server./n |
|
162 * it will create a Request from typ "USER_REQUEST" and will try to perform the user request for PS/Active./n |
|
163 * this will be done in respect of priority to Driver request./n |
|
164 */ |
|
165 TI_STATUS powerSrv_SetPsMode (TI_HANDLE hPowerSrv, |
|
166 E80211PsMode psMode, |
|
167 TI_BOOL sendNullDataOnExit, |
|
168 void * powerSaveCompleteCBObject, |
|
169 powerSaveCmpltCB_t powerSaveCompleteCB, |
|
170 powerSaveCmdResponseCB_t powerSavecmdResponseCB); |
|
171 |
|
172 |
|
173 /** |
|
174 * \author Assaf Azulay |
|
175 * \date 24-Oct-2005\n |
|
176 * \brief SW configure, use to override the current PowerMode (what ever it will be) to |
|
177 * active/PS combined with awake/power-down. use for temporary change the system policy. |
|
178 * |
|
179 * Function Scope \e Public.\n |
|
180 * Parameters:\n |
|
181 * 1) TI_HANDLE - handle to the powerSrv object.\n |
|
182 * 2) powerSrv_RequestFor_802_11_PS_e - the driver mode obliged to be in 802.11 PS or not change.\n |
|
183 * 3) PowerCtrl_PowerLevel_e - the desired driver power level (allowed: AWAKE or POWER DOWN).\n |
|
184 * 4) TI_HANDLE theObjectHandle - the handle the object that need the PS success/fail notification.\n |
|
185 * 5) ps802_11_NotificationCB_t - the callback function.\n |
|
186 * 6) char* - the clinet name that ask for driver mode.\n |
|
187 * Return Value: TI_STATUS - if success (already in power save) then TI_OK,\n |
|
188 * if pend (wait to ACK form AP for the null data frame) then PENDING\n |
|
189 * if PS isn't enabled then POWER_SAVE_802_11_NOT_ALLOWED\n |
|
190 * else TI_NOK.\n |
|
191 * \b Description:\n |
|
192 * enter in to configuration of the driver that in higher priority from the user.\n |
|
193 * the configuration is:\n |
|
194 * - to enter to802.11 PS or not (if not this isn't a request to get out from 802.11 PS).\n |
|
195 * - to change the HW power level to awake or power-down if not already there. |
|
196 * this is a must request.\n |
|
197 */ |
|
198 TI_STATUS powerSrv_ReservePS (TI_HANDLE hPowerSrv, |
|
199 E80211PsMode psMode, |
|
200 TI_BOOL sendNullDataOnExit, |
|
201 void * powerSaveCBObject, |
|
202 powerSaveCmpltCB_t powerSaveCompleteCB); |
|
203 |
|
204 |
|
205 /** |
|
206 * \author Assaf Azulay |
|
207 * \date 24-Oct-2005\n |
|
208 * \brief end the temporary change of system policy, and returns to the user system policy. |
|
209 * |
|
210 * Function Scope \e Public.\n |
|
211 * Parameters:\n |
|
212 * 1) TI_HANDLE - handle to the powerSrv object.\n |
|
213 * 2) char* - the clinet name that ask for driver mode.\n |
|
214 * Return Value: TI_STATUS - TI_OK on success else TI_NOK.\n |
|
215 * \b Description:\n |
|
216 * enter in to configuration of the driver that in higher priority from the user.\n |
|
217 * the configuration is:\n |
|
218 * end the user mode configuration (driver mode priority) and returns the user configuration |
|
219 * (user mode priority). |
|
220 */ |
|
221 TI_STATUS powerSrv_ReleasePS( TI_HANDLE hPowerSrv, |
|
222 TI_BOOL sendNullDataOnExit, |
|
223 void * powerSaveCBObject, |
|
224 powerSaveCmpltCB_t powerSaveCompleteCB); |
|
225 |
|
226 |
|
227 /** |
|
228 * \author Assaf Azulay |
|
229 * \date 24-Oct-2005\n |
|
230 * \brief reflects the actual state of the state machine |
|
231 * |
|
232 * Function Scope \e Public.\n |
|
233 * Parameters:\n |
|
234 * 1) TI_HANDLE - handle to the powerSrv object.\n |
|
235 * Return Value:\n |
|
236 * TI_BOOL - thre is in PS false otherwise.\n |
|
237 */ |
|
238 TI_BOOL powerSrv_getPsStatus(TI_HANDLE hPowerSrv); |
|
239 |
|
240 |
|
241 /** |
|
242 * \author Assaf Azulay |
|
243 * \date 24-Oct-2005\n |
|
244 * \sets the rate as got from user else sets default value.\n |
|
245 * |
|
246 * Function Scope \e Public.\n |
|
247 * Parameters:\n |
|
248 * 1) TI_HANDLE - handle to the powerSrv object.\n |
|
249 * 2) TI_UINT16 - desierd rate .\n |
|
250 * Return Value:\n |
|
251 * void.\n |
|
252 */ |
|
253 void powerSrv_SetRateModulation(TI_HANDLE hPowerSrv, TI_UINT16 rate); |
|
254 |
|
255 |
|
256 |
|
257 /** |
|
258 * \author Assaf Azulay |
|
259 * \date 9-Mar-2006\n |
|
260 * \brief Registers a failure event callback for scan error notifications. |
|
261 * |
|
262 * Function Scope \e Public.\n |
|
263 * Parameters:\n |
|
264 * - hPowerSrv - handle to the PowerSrv object. |
|
265 * - failureEventCB - the failure event callback function. |
|
266 * - hFailureEventObj - handle to the object passed to the failure event callback function. |
|
267 */ |
|
268 void powerSrvRegisterFailureEventCB( TI_HANDLE hPowerSrv, |
|
269 void * failureEventCB, TI_HANDLE hFailureEventObj ); |
|
270 |
|
271 |
|
272 /** |
|
273 * \date 03-Jul-2006\n |
|
274 * \return the rate as it was seted by powerSrv_SetRateModulation.\n |
|
275 * |
|
276 * Function Scope \e Public.\n |
|
277 * Parameters:\n |
|
278 * 1) TI_HANDLE - handle to the powerSrv object.\n |
|
279 * Return Value: TI_UINT16 - desierd rate .\n |
|
280 * void.\n |
|
281 */ |
|
282 TI_UINT32 powerSrv_GetRateModulation(TI_HANDLE hPowerSrv); |
|
283 |
|
284 TI_STATUS powerSrv_restart( TI_HANDLE hPowerSrv); |
|
285 |
|
286 #endif /* _POWER_SRV_API_H_ */ |