summaryrefslogtreecommitdiff
path: root/wl1271/stad/src/Sta_Management/PowerMgr.h
blob: d75af5d68623c55c5d40a0e68188c21c1d1be70a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/*
 * PowerMgr.h
 *
 * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved.      
 * All rights reserved.                                                  
 *                                                                       
 * Redistribution and use in source and binary forms, with or without    
 * modification, are permitted provided that the following conditions    
 * are met:                                                              
 *                                                                       
 *  * Redistributions of source code must retain the above copyright     
 *    notice, this list of conditions and the following disclaimer.      
 *  * Redistributions in binary form must reproduce the above copyright  
 *    notice, this list of conditions and the following disclaimer in    
 *    the documentation and/or other materials provided with the         
 *    distribution.                                                      
 *  * Neither the name Texas Instruments nor the names of its            
 *    contributors may be used to endorse or promote products derived    
 *    from this software without specific prior written permission.      
 *                                                                       
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/** \file PowerMgr.h
 *  \brief This is the Power Manager module private (internal).
 *  \
 *  \date 24-Oct-2005
 */

/****************************************************************************
 *                                                                          *
 *   MODULE:  Power Manager                                                 *
 *   PURPOSE: Power Manager Module private                                      *
 *                                                                          *
 ****************************************************************************/

#ifndef _POWER_MGR_H_
#define _POWER_MGR_H_

#include "tidef.h"
#include "paramOut.h"

/*****************************************************************************
 **         Constants                                                       **
 *****************************************************************************/
#define RE_ENTER_PS_TIMEOUT 10 /* mSec */

#define BET_INTERVAL_VALUE 1000 /* mSec */

/*****************************************************************************
 **         Enumerations                                                    **
 *****************************************************************************/

/*****************************************************************************
 **         Typedefs                                                        **
 *****************************************************************************/

/*****************************************************************************
 **         Structures                                                      **
 *****************************************************************************/

typedef struct
{
    PowerMgr_PowerMode_e powerMode;
    TI_BOOL priorityEnable;
} powerMngModePriority_t;



/** \struct powerMgr_t
 * this structure contain the data of the PowerMgr object.
 */
typedef struct
{
    TI_HANDLE                   hOS;                            /**< Handle to the OS object */
    TI_HANDLE                   hReport;                        /**< Handle to the Report module */
    TI_HANDLE                   hTrafficMonitor;                /**< Handle to the Traffic Monitor object */
    TI_HANDLE                   hSiteMgr;                       /**< Handle to the Site Mgr object */
    TI_HANDLE                   hTWD;                           /**< Handle to the TWD object */
    TI_HANDLE                   hSoftGemini;                    /**< Handle to the SG object */
    TI_HANDLE                   hTimer;                         /**< Handle to the Timer module object */
    TI_HANDLE                   hRetryPsTimer;                  /**< Handle to the retry timer */
    TI_HANDLE                   hPsPollFailureTimer;            /**< Handle to ps-poll failure timer */
    TI_HANDLE                   hPowerMgrKeepAlive;             /**< Handle to the keep-alive sub module */
    PowerMgr_PowerMode_e        desiredPowerModeProfile;        /**< 
                                                                 * The configure power mode to the system in the
                                                                 * initialization function. This parameters is Saved
                                                                 * for restart the module.
                                                                 */
    powerMngModePriority_t      powerMngModePriority[POWER_MANAGER_MAX_PRIORITY];                                                                           
    PowerMgr_PowerMode_e        lastPowerModeProfile;           /**< 
                                                                 * The last configured power mode. 
                                                                 */
    TI_BOOL                     psEnable;                       /**<
                                                                 * The parameter holds the enable of the power save
                                                                 * mechanism.
                                                                 */
    TI_UINT16                   autoModeInterval;               /**<
                                                                 * Time period (in ms) to test the current TP before
                                                                 * changing the current power mode.
                                                                 */
    TI_UINT16                   autoModeActiveTH;               /**< Threshold (in Bytes) for moving to Active mode */
    TI_UINT16                   autoModeDozeTH;                 /**< 
                                                                 * Threshold (in Bytes) for moving to Short-Doze from
                                                                 * active mode.
                                                                 */
    PowerMgr_PowerMode_e        autoModeDozeMode;               /**< 
                                                                 * The power mode of doze (short-doze / long-doze) that
                                                                 * auto mode will be toggle between doze vs active.
                                                                 */
    PowerMgr_Priority_e         powerMngPriority;               /**<
                                                                 * the priority of the power manager - canbe - regular user (cli) or
                                                                 * special user i.e Soft Gemini.
                                                                 */
    TI_HANDLE                   passToActiveTMEvent;            /**< 
                                                                 * Traffic Monitor event (TrafficAlertElement) for
                                                                 * the pass to active event from the traffic monitor.
                                                                 */
    TI_HANDLE                   passToDozeTMEvent;              /**<
                                                                 * Traffic Monitor event (TrafficAlertElement) for
                                                                 * the pass to short doze from active event from the
                                                                 * traffic monitor.
                                                                 */
    TI_HANDLE                   betEnableTMEvent;               /**<
                                                                 * Traffic Monitor event (TrafficAlertElement) for
                                                                 * enabling BET.
                                                                 */
    TI_HANDLE                   betDisableTMEvent;               /**<
                                                                 * Traffic Monitor event (TrafficAlertElement) for
                                                                 * disabling BET.
                                                                 */
    TI_UINT8                    beaconListenInterval;           /**< 
                                                                 * specify how often the TNET wakes up to listen to
                                                                 * beacon frames. the value is expressed in units of
                                                                 * "beacon interval".
                                                                 */
    TI_UINT8                    dtimListenInterval;             /**< specify how often the TNET wakes up to listen to
                                                                 * dtim frames. the value is expressed in units of
                                                                 * "dtim interval".
                                                                 */                                                                          
    EPowerPolicy    			defaultPowerLevel;              /**< Power level when PS not active */
    EPowerPolicy    			PowerSavePowerLevel;            /**< Power level when PS active */
    EventsPowerSave_e           lastPsTransaction;              /**< Last result of PS request */
    TI_UINT32                   maxFullBeaconInterval;          /**< Maximal time between full beacon reception */
    TI_UINT8	                betEnable;                      /**< last configuration of BET enable/disable */
	TI_UINT8					betTrafficEnable;
	TI_UINT8					BetEnableThreshold;
	TI_UINT8					BetDisableThreshold;
    TI_UINT32                   PsPollDeliveryFailureRecoveryPeriod; /* Time to exit PS after receiving PsPoll failure event */

	TI_BOOL						reAuthActivePriority;
} PowerMgr_t;


#endif /*  _POWER_MGR_H_  */