blob: 759cb74e63cbd744061ea13a4e4d5e83d3367b50 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lamaa8e15a2014-02-11 23:30:06 -08002 * Copyright (c) 2012-2013 Qualcomm Atheros, Inc.
3 * All Rights Reserved.
4 * Qualcomm Atheros Confidential and Proprietary.
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08005 */
Jeff Johnson295189b2012-06-20 16:38:30 -07006/******************************************************************************
7
8*
9
10* Name: pmcApi.h
11
12*
13
14* Description: Power Management Control (PMC) API definitions.
15
16* Copyright 2008 (c) Qualcomm, Incorporated.
17
18* All Rights Reserved.
19
20* Qualcomm Confidential and Proprietary.
21
22*
23
24******************************************************************************/
25
26
27#ifndef __PMC_API_H__
28
29#define __PMC_API_H__
30
31//This timer value determines the default periodicity at which BMPS retries will happen
32//This default value is overwritten typicaly by OS specific registry/INI values.
33#define BMPS_TRAFFIC_TIMER_DEFAULT 5000 //unit = ms
34#define DHCP_REMAIN_POWER_ACTIVE_THRESHOLD 12 // (12 * 5) sec = 60 seconds = 1 min
35
36//This timer value is used when starting the timer right after association. This value
37//should be large enough to allow the auth, DHCP handshake to complete
38#define BMPS_TRAFFIC_TIMER_ALLOW_SECURITY_DHCP 8000 //unit = ms
39
40#define PMC_IS_CHIP_ACCESSIBLE(pmcState) ( (IMPS != (pmcState)) && (REQUEST_IMPS != (pmcState)) && \
41 (STANDBY != (pmcState)) && (REQUEST_STANDBY != (pmcState)) )
42
43
44
45/* Power events that are signaled to PMC. */
46
47typedef enum ePmcPowerEvent
48
49{
50
51 ePMC_SYSTEM_HIBERNATE, /* host is entering hibernation */
52
53 ePMC_SYSTEM_RESUME, /* host is resuming after hibernation */
54
55 ePMC_HW_WLAN_SWITCH_OFF, /* Hardware WLAN Switch has been turned off */
56
57 ePMC_HW_WLAN_SWITCH_ON, /* Hardware WLAN Switch has been turned on */
58
59 ePMC_SW_WLAN_SWITCH_OFF, /* Software WLAN Switch has been turned off */
60
61 ePMC_SW_WLAN_SWITCH_ON, /* Software WLAN Switch has been turned on */
62
63 ePMC_BATTERY_OPERATION, /* host is now operating on battery power */
64
65 ePMC_AC_OPERATION /* host is now operating on AC power */
66
67} tPmcPowerEvent;
68
69
70
71
72/* Power saving modes. */
73
74typedef enum ePmcPowerSavingMode
75
76{
77
78 ePMC_IDLE_MODE_POWER_SAVE, /* Idle Mode Power Save (IMPS) */
79
80 ePMC_BEACON_MODE_POWER_SAVE, /* Beacon Mode Power Save (BMPS) */
81
82 ePMC_SPATIAL_MULTIPLEX_POWER_SAVE, /* Spatial Multiplexing Power Save (SMPS) */
83
84 ePMC_UAPSD_MODE_POWER_SAVE, /* Unscheduled Automatic Power Save Delivery Mode */
85
86 ePMC_STANDBY_MODE_POWER_SAVE, /* Standby Power Save Mode */
87
88 ePMC_WOWL_MODE_POWER_SAVE /* Wake-on-Wireless LAN Power Save Mode */
89
90} tPmcPowerSavingMode;
91
92
93
94
95/* Switch states. */
96
97typedef enum ePmcSwitchState
98
99{
100
101 ePMC_SWITCH_OFF, /* switch off */
102
103 ePMC_SWITCH_ON /* switch on */
104
105} tPmcSwitchState;
106
107
108
109
110/* Device power states. */
111
112typedef enum ePmcPowerState
113
114{
115
116 ePMC_FULL_POWER, /* full power */
117
118 ePMC_LOW_POWER, /* low power */
119
120} tPmcPowerState;
121
122
123
124/* PMC states. */
125
126typedef enum ePmcState
127
128{
129
130 STOPPED, /* PMC is stopped */
131
132 FULL_POWER, /* full power */
133
134 LOW_POWER, /* low power */
135
136 REQUEST_IMPS, /* requesting IMPS */
137
138 IMPS, /* in IMPS */
139
140 REQUEST_BMPS, /* requesting BMPS */
141
142 BMPS, /* in BMPS */
143
144 REQUEST_FULL_POWER, /* requesting full power */
145
146 REQUEST_START_UAPSD, /* requesting Start UAPSD */
147
148 REQUEST_STOP_UAPSD, /* requesting Stop UAPSD */
149
150 UAPSD, /* in UAPSD */
151
152 REQUEST_STANDBY, /* requesting standby mode */
153
154 STANDBY, /* in standby mode */
155
156 REQUEST_ENTER_WOWL, /* requesting enter WOWL */
157
158 REQUEST_EXIT_WOWL, /* requesting exit WOWL */
159
160 WOWL /* Chip in WOWL mode */
161
162} tPmcState;
163
164
165/* Which beacons should be forwarded to the host. */
166
167typedef enum ePmcBeaconsToForward
168
169{
170
171 ePMC_NO_BEACONS, /* none */
172
173 ePMC_BEACONS_WITH_TIM_SET, /* with TIM set */
174
175 ePMC_BEACONS_WITH_DTIM_SET, /* with DTIM set */
176
177 ePMC_NTH_BEACON, /* every Nth beacon */
178
179 ePMC_ALL_BEACONS /* all beacons */
180
181} tPmcBeaconsToForward;
182
183
184
185
186/* The Spatial Mulitplexing Power Save modes. */
187
188typedef enum ePmcSmpsMode
189
190{
191
192 ePMC_DYNAMIC_SMPS, /* dynamic SMPS */
193
194 ePMC_STATIC_SMPS /* static SMPS */
195
196} tPmcSmpsMode;
197
198
199
200
201/* Configuration parameters for Idle Mode Power Save (IMPS). */
202
203typedef struct sPmcImpsConfigParams
204
205{
206
207 tANI_BOOLEAN enterOnAc; /* FALSE if device should enter IMPS only when host operating
208
209 on battery power, TRUE if device should enter always */
210
211} tPmcImpsConfigParams, *tpPmcImpsConfigParams;
212
213
214
215
216/* Configuration parameters for Beacon Mode Power Save (BMPS). */
217
218typedef struct sPmcBmpsConfigParams
219
220{
221
222 tANI_BOOLEAN enterOnAc; /* FALSE if device should enter BMPS only when host operating on
223
224 battery power, TRUE if device should enter always */
225
226 tANI_U32 txThreshold; /* transmit rate under which BMPS should be entered (frames / traffic measurement period) */
227
228 tANI_U32 rxThreshold; /* receive rate under which BMPS should be entered (frames / traffic measurement period) */
229
230 tANI_U32 trafficMeasurePeriod; /* period for BMPS traffic measurement (milliseconds) */
231
232 tANI_U32 bmpsPeriod; /* amount of time in low power (beacon intervals) */
233
234 tPmcBeaconsToForward forwardBeacons; /* which beacons should be forwarded to the host */
235
236 tANI_U32 valueOfN; /* the value of N when forwardBeacons is set to ePMC_NTH_BEACON */
237
238 tANI_BOOLEAN usePsPoll; /* TRUE if PS-POLL should be used to retrieve frames from AP, FALSE if a
239
240 null data frame with the PM bit reset should be used */
241
242 tANI_BOOLEAN setPmOnLastFrame; /* TRUE to keep device in BMPS as much as possible, FALSE otherwise, TRUE means:
243
244 1) PM bit should be set on last pending transmit data frame
245
246 2) null frame with PM bit set should be transmitted after last pending receive
247
248 frame has been processed */
249
250 tANI_BOOLEAN enableBeaconEarlyTermination; /* if TRUE, BET feature in RIVA
251 will be enabled, FALSE otherwise, TRUE means:
252 RXP will read the beacon header for the
253 TIM bit & discard the rest if set to 0,
254 while in BMPS */
255 tANI_U8 bcnEarlyTermWakeInterval; /* This specifies how often in terms
256 of LI we will disable BET in order to sync
257 up TSF*/
258
259} tPmcBmpsConfigParams, *tpPmcBmpsConfigParams;
260
261
262
263
264/* Configuration parameters for Spatial Mulitplexing Power Save (SMPS). */
265
266typedef struct sPmcSmpsConfigParams
267
268{
269
270 tPmcSmpsMode mode; /* mode to use */
271
272 tANI_BOOLEAN enterOnAc; /* FALSE if device should enter SMPS only when host operating on
273
274 battery power, TRUE if device should enter always */
275
276} tPmcSmpsConfigParams, *tpPmcSmpsConfigParams;
277
278
279/* Routine definitions. */
280
281extern eHalStatus pmcOpen (tHalHandle hHal);
282
283extern eHalStatus pmcStart (tHalHandle hHal);
284
285extern eHalStatus pmcStop (tHalHandle hHal);
286
287extern eHalStatus pmcClose (tHalHandle hHal );
288
289extern eHalStatus pmcSignalPowerEvent (tHalHandle hHal, tPmcPowerEvent event);
290
291extern eHalStatus pmcSetConfigPowerSave (tHalHandle hHal, tPmcPowerSavingMode psMode, void *pConfigParams);
292
293extern eHalStatus pmcGetConfigPowerSave (tHalHandle hHal, tPmcPowerSavingMode psMode, void *pConfigParams);
294
295extern eHalStatus pmcEnablePowerSave (tHalHandle hHal, tPmcPowerSavingMode psMode);
296
297extern eHalStatus pmcStartAutoBmpsTimer (tHalHandle hHal);
298
299extern eHalStatus pmcStopAutoBmpsTimer (tHalHandle hHal);
300
301extern eHalStatus pmcDisablePowerSave (tHalHandle hHal, tPmcPowerSavingMode psMode);
302
303extern eHalStatus pmcQueryPowerState (tHalHandle hHal, tPmcPowerState *pPowerState, tPmcSwitchState *pHwWlanSwitchState,
304
305 tPmcSwitchState *pSwWlanSwitchState);
306
307extern tANI_BOOLEAN pmcIsPowerSaveEnabled (tHalHandle hHal, tPmcPowerSavingMode psMode);
308
309extern eHalStatus pmcRequestFullPower (tHalHandle hHal, void (*callbackRoutine) (void *callbackContext, eHalStatus status),
310
311 void *callbackContext, tRequestFullPowerReason fullPowerReason);
312
313extern eHalStatus pmcRequestImps (tHalHandle hHal, tANI_U32 impsPeriod,
314
315 void (*callbackRoutine) (void *callbackContext, eHalStatus status),
316
317 void *callbackContext);
318
319extern eHalStatus pmcRegisterPowerSaveCheck (tHalHandle hHal, tANI_BOOLEAN (*checkRoutine) (void *checkContext),
320
321 void *checkContext);
322
323extern eHalStatus pmcDeregisterPowerSaveCheck (tHalHandle hHal, tANI_BOOLEAN (*checkRoutine) (void *checkContext));
324
325extern void pmcMessageProcessor (tHalHandle hHal, tSirSmeRsp *pMsg);
Kiran Kumar Lokeref8c39922013-03-18 11:08:11 -0700326extern void pmcResetImpsFailStatus (tHalHandle hHal);
327extern v_BOOL_t IsPmcImpsReqFailed (tHalHandle hHal);
Jeff Johnson295189b2012-06-20 16:38:30 -0700328
329extern eHalStatus pmcRequestBmps (
330
331 tHalHandle hHal,
332
333 void (*callbackRoutine) (void *callbackContext, eHalStatus status),
334
335 void *callbackContext);
336
337
338extern eHalStatus pmcStartUapsd (
339
340 tHalHandle hHal,
341
342 void (*callbackRoutine) (void *callbackContext, eHalStatus status),
343
344 void *callbackContext);
345
346
347extern eHalStatus pmcStopUapsd (tHalHandle hHal);
348
349
350extern eHalStatus pmcRequestStandby (
351
352 tHalHandle hHal,
353
354 void (*callbackRoutine) (void *callbackContext, eHalStatus status),
355
356 void *callbackContext);
357
358
359extern eHalStatus pmcRegisterDeviceStateUpdateInd (tHalHandle hHal,
360
361 void (*callbackRoutine) (void *callbackContext, tPmcState pmcState),
362
363 void *callbackContext);
364
365
366extern eHalStatus pmcDeregisterDeviceStateUpdateInd (tHalHandle hHal,
367
368 void (*callbackRoutine) (void *callbackContext, tPmcState pmcState));
369
370
371extern eHalStatus pmcReady(tHalHandle hHal);
372
373
374void pmcDumpInit(tHalHandle hHal);
375
376
377extern eHalStatus pmcWowlAddBcastPattern (
Jeff Johnson295189b2012-06-20 16:38:30 -0700378 tHalHandle hHal,
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700379 tpSirWowlAddBcastPtrn pattern,
380 tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700381
382
383extern eHalStatus pmcWowlDelBcastPattern (
Jeff Johnson295189b2012-06-20 16:38:30 -0700384 tHalHandle hHal,
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700385 tpSirWowlDelBcastPtrn pattern,
386 tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700387
388
389extern eHalStatus pmcEnterWowl (
390
391 tHalHandle hHal,
392
393 void (*enterWowlCallbackRoutine) (void *callbackContext, eHalStatus status),
394
395 void *enterWowlCallbackContext,
396#ifdef WLAN_WAKEUP_EVENTS
397 void (*wakeReasonIndCB) (void *callbackContext, tpSirWakeReasonInd pWakeReasonInd),
398
399 void *wakeReasonIndCBContext,
400#endif // WLAN_WAKEUP_EVENTS
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700401 tpSirSmeWowlEnterParams wowlEnterParams, tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700402
403extern eHalStatus pmcExitWowl (tHalHandle hHal);
404
405
Jeff Johnsone7245742012-09-05 17:12:55 -0700406extern eHalStatus pmcSetHostOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest,
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700407 tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700408
409/* ---------------------------------------------------------------------------
410 \fn pmcSetKeepAlive
411 \brief Set the Keep Alive feature.
412 \param hHal - The handle returned by macOpen.
413 \param pRequest - Pointer to the Keep Alive.
414 \return eHalStatus
415 eHAL_STATUS_FAILURE Cannot set the keepalive.
416 eHAL_STATUS_SUCCESS Request accepted.
417 ---------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700418extern eHalStatus pmcSetKeepAlive (tHalHandle hHal, tpSirKeepAliveReq pRequest, tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700419
420extern tANI_BOOLEAN pmcValidateConnectState( tHalHandle hHal );
421
422extern tANI_BOOLEAN pmcAllowImps( tHalHandle hHal );
423
424
425#ifdef FEATURE_WLAN_SCAN_PNO
426/*Pref netw found Cb declaration*/
427typedef void(*preferredNetworkFoundIndCallback)(void *callbackContext, tpSirPrefNetworkFoundInd pPrefNetworkFoundInd);
428
429extern eHalStatus pmcSetPreferredNetworkList(tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, preferredNetworkFoundIndCallback callbackRoutine, void *callbackContext);
430extern eHalStatus pmcSetRssiFilter(tHalHandle hHal, v_U8_t rssiThreshold);
431#endif // FEATURE_WLAN_SCAN_PNO
432
433#ifdef WLAN_FEATURE_PACKET_FILTERING
434// Packet Coalescing Filter Match Count Callback declaration
435typedef void(*FilterMatchCountCallback)(void *callbackContext,
436 tpSirRcvFltPktMatchRsp pRcvFltPktMatchRsp);
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700437extern eHalStatus pmcGetFilterMatchCount(tHalHandle hHal, FilterMatchCountCallback callbackRoutine,
438 void *callbackContext, tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700439#endif // WLAN_FEATURE_PACKET_FILTERING
440
441#ifdef WLAN_FEATURE_GTK_OFFLOAD
442// GTK Offload Information Callback declaration
443typedef void(*GTKOffloadGetInfoCallback)(void *callbackContext, tpSirGtkOffloadGetInfoRspParams pGtkOffloadGetInfoRsp);
444
445/* ---------------------------------------------------------------------------
446 \fn pmcSetGTKOffload
447 \brief Set GTK offload feature.
448 \param hHal - The handle returned by macOpen.
449 \param pGtkOffload - Pointer to the GTK offload request.
450 \return eHalStatus
451 eHAL_STATUS_FAILURE Cannot set the offload.
452 eHAL_STATUS_SUCCESS Request accepted.
453 ---------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700454extern eHalStatus pmcSetGTKOffload (tHalHandle hHal, tpSirGtkOffloadParams pGtkOffload, tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700455
456/* ---------------------------------------------------------------------------
457 \fn pmcGetGTKOffload
458 \brief Get GTK offload information.
459 \param hHal - The handle returned by macOpen.
460 \param callbackRoutine - Pointer to the GTK Offload Get Info response callback routine.
461 \return eHalStatus
462 eHAL_STATUS_FAILURE Cannot set the offload.
463 eHAL_STATUS_SUCCESS Request accepted.
464 ---------------------------------------------------------------------------*/
Gopichand Nakkala870cbae2013-03-15 21:16:09 +0530465extern eHalStatus pmcGetGTKOffload(tHalHandle hHal,
466 GTKOffloadGetInfoCallback callbackRoutine,
467 void *callbackContext, tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -0700468#endif // WLAN_FEATURE_GTK_OFFLOAD
469
Rajeev79dbe4c2013-10-05 11:03:42 +0530470#ifdef FEATURE_WLAN_BATCH_SCAN
471/*Set batch scan request Cb declaration*/
472typedef void(*hddSetBatchScanReqCallback)(void *callbackContext,
473 tSirSetBatchScanRsp *pRsp);
474
475/*Trigger batch scan result indication Cb declaration*/
476typedef void(*hddTriggerBatchScanResultIndCallback)(void *callbackContext,
477 void *pRsp);
478
479/* -----------------------------------------------------------------------------
480 \fn pmcSetBatchScanReq
481 \brief Setting batch scan request in FW
482 \param hHal - The handle returned by macOpen.
483 \param sessionId - session id
484 \param callbackRoutine - Pointer to set batch scan request callback routine
485 \param calbackContext - callback context
486 \return eHalStatus
487 eHAL_STATUS_FAILURE Cannot set batch scan request
488 eHAL_STATUS_SUCCESS Request accepted.
489 -----------------------------------------------------------------------------*/
490extern eHalStatus pmcSetBatchScanReq(tHalHandle hHal, tSirSetBatchScanReq
491 *pRequest, tANI_U8 sessionId, hddSetBatchScanReqCallback callbackRoutine,
492 void *callbackContext);
493
494/* -----------------------------------------------------------------------------
495 \fn pmcTriggerBatchScanResultInd
496 \brief API to pull batch scan result from FW
497 \param hHal - The handle returned by macOpen.
498 \param sessionId - session id
499 \param callbackRoutine - Pointer to get batch scan request callback routine
500 \param calbackContext - callback context
501 \return eHalStatus
502 eHAL_STATUS_FAILURE Cannot set batch scan request
503 eHAL_STATUS_SUCCESS Request accepted.
504 -----------------------------------------------------------------------------*/
505extern eHalStatus pmcTriggerBatchScanResultInd
506(
507 tHalHandle hHal, tSirTriggerBatchScanResultInd *pRequest, tANI_U8 sessionId,
508 hddTriggerBatchScanResultIndCallback callbackRoutine, void *callbackContext
509);
510
511
512/* -----------------------------------------------------------------------------
513 \fn pmcStopBatchScanInd
514 \brief Stoping batch scan request in FW
515 \param hHal - The handle returned by macOpen.
516 \param pInd - Pointer to stop batch scan indication
517 \return eHalStatus
518 eHAL_STATUS_FAILURE Cannot set batch scan request
519 eHAL_STATUS_SUCCESS Request accepted.
520 -----------------------------------------------------------------------------*/
521
522extern eHalStatus pmcStopBatchScanInd
523(
524 tHalHandle hHal,
525 tSirStopBatchScanInd *pInd,
526 tANI_U8 sessionId
527);
528
529#endif // FEATURE_WLAN_BATCH_SCAN
530
531
Jeff Johnson295189b2012-06-20 16:38:30 -0700532#endif
533