Home | History | Annotate | Download | only in Sta_Management
      1 /*
      2  * PowerMgr.h
      3  *
      4  * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved.
      5  * All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  *
     11  *  * Redistributions of source code must retain the above copyright
     12  *    notice, this list of conditions and the following disclaimer.
     13  *  * Redistributions in binary form must reproduce the above copyright
     14  *    notice, this list of conditions and the following disclaimer in
     15  *    the documentation and/or other materials provided with the
     16  *    distribution.
     17  *  * Neither the name Texas Instruments nor the names of its
     18  *    contributors may be used to endorse or promote products derived
     19  *    from this software without specific prior written permission.
     20  *
     21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     32  */
     33 
     34 /** \file PowerMgr.h
     35  *  \brief This is the Power Manager module private (internal).
     36  *  \
     37  *  \date 24-Oct-2005
     38  */
     39 
     40 /****************************************************************************
     41  *                                                                          *
     42  *   MODULE:  Power Manager                                                 *
     43  *   PURPOSE: Power Manager Module private                                      *
     44  *                                                                          *
     45  ****************************************************************************/
     46 
     47 #ifndef _POWER_MGR_H_
     48 #define _POWER_MGR_H_
     49 
     50 #include "tidef.h"
     51 #include "paramOut.h"
     52 
     53 /*****************************************************************************
     54  **         Constants                                                       **
     55  *****************************************************************************/
     56 #define RE_ENTER_PS_TIMEOUT 10 /* mSec */
     57 
     58 #define BET_INTERVAL_VALUE 1000 /* mSec */
     59 
     60 /*****************************************************************************
     61  **         Enumerations                                                    **
     62  *****************************************************************************/
     63 
     64 /*****************************************************************************
     65  **         Typedefs                                                        **
     66  *****************************************************************************/
     67 
     68 /*****************************************************************************
     69  **         Structures                                                      **
     70  *****************************************************************************/
     71 
     72 typedef struct
     73 {
     74     PowerMgr_PowerMode_e powerMode;
     75     TI_BOOL priorityEnable;
     76 } powerMngModePriority_t;
     77 
     78 
     79 
     80 /** \struct powerMgr_t
     81  * this structure contain the data of the PowerMgr object.
     82  */
     83 typedef struct
     84 {
     85     TI_HANDLE                   hOS;                            /**< Handle to the OS object */
     86     TI_HANDLE                   hReport;                        /**< Handle to the Report module */
     87     TI_HANDLE                   hTrafficMonitor;                /**< Handle to the Traffic Monitor object */
     88     TI_HANDLE                   hSiteMgr;                       /**< Handle to the Site Mgr object */
     89     TI_HANDLE                   hTWD;                           /**< Handle to the TWD object */
     90     TI_HANDLE                   hSoftGemini;                    /**< Handle to the SG object */
     91     TI_HANDLE                   hTimer;                         /**< Handle to the Timer module object */
     92     TI_HANDLE                   hRetryPsTimer;                  /**< Handle to the retry timer */
     93     TI_HANDLE                   hPsPollFailureTimer;            /**< Handle to ps-poll failure timer */
     94     TI_HANDLE                   hPowerMgrKeepAlive;             /**< Handle to the keep-alive sub module */
     95     PowerMgr_PowerMode_e        desiredPowerModeProfile;        /**<
     96                                                                  * The configure power mode to the system in the
     97                                                                  * initialization function. This parameters is Saved
     98                                                                  * for restart the module.
     99                                                                  */
    100     powerMngModePriority_t      powerMngModePriority[POWER_MANAGER_MAX_PRIORITY];
    101     PowerMgr_PowerMode_e        lastPowerModeProfile;           /**<
    102                                                                  * The last configured power mode.
    103                                                                  */
    104     TI_BOOL                     psEnable;                       /**<
    105                                                                  * The parameter holds the enable of the power save
    106                                                                  * mechanism.
    107                                                                  */
    108     TI_UINT16                   autoModeInterval;               /**<
    109                                                                  * Time period (in ms) to test the current TP before
    110                                                                  * changing the current power mode.
    111                                                                  */
    112     TI_UINT16                   autoModeActiveTH;               /**< Threshold (in Bytes) for moving to Active mode */
    113     TI_UINT16                   autoModeDozeTH;                 /**<
    114                                                                  * Threshold (in Bytes) for moving to Short-Doze from
    115                                                                  * active mode.
    116                                                                  */
    117     PowerMgr_PowerMode_e        autoModeDozeMode;               /**<
    118                                                                  * The power mode of doze (short-doze / long-doze) that
    119                                                                  * auto mode will be toggle between doze vs active.
    120                                                                  */
    121     PowerMgr_Priority_e         powerMngPriority;               /**<
    122                                                                  * the priority of the power manager - canbe - regular user (cli) or
    123                                                                  * special user i.e Soft Gemini.
    124                                                                  */
    125     TI_HANDLE                   passToActiveTMEvent;            /**<
    126                                                                  * Traffic Monitor event (TrafficAlertElement) for
    127                                                                  * the pass to active event from the traffic monitor.
    128                                                                  */
    129     TI_HANDLE                   passToDozeTMEvent;              /**<
    130                                                                  * Traffic Monitor event (TrafficAlertElement) for
    131                                                                  * the pass to short doze from active event from the
    132                                                                  * traffic monitor.
    133                                                                  */
    134     TI_HANDLE                   betEnableTMEvent;               /**<
    135                                                                  * Traffic Monitor event (TrafficAlertElement) for
    136                                                                  * enabling BET.
    137                                                                  */
    138     TI_HANDLE                   betDisableTMEvent;               /**<
    139                                                                  * Traffic Monitor event (TrafficAlertElement) for
    140                                                                  * disabling BET.
    141                                                                  */
    142     TI_UINT8                    beaconListenInterval;           /**<
    143                                                                  * specify how often the TNET wakes up to listen to
    144                                                                  * beacon frames. the value is expressed in units of
    145                                                                  * "beacon interval".
    146                                                                  */
    147     TI_UINT8                    dtimListenInterval;             /**< specify how often the TNET wakes up to listen to
    148                                                                  * dtim frames. the value is expressed in units of
    149                                                                  * "dtim interval".
    150                                                                  */
    151     EPowerPolicy    			defaultPowerLevel;              /**< Power level when PS not active */
    152     EPowerPolicy    			PowerSavePowerLevel;            /**< Power level when PS active */
    153     EventsPowerSave_e           lastPsTransaction;              /**< Last result of PS request */
    154     TI_UINT32                   maxFullBeaconInterval;          /**< Maximal time between full beacon reception */
    155     TI_UINT8	                betEnable;                      /**< last configuration of BET enable/disable */
    156 	TI_UINT8					betTrafficEnable;
    157 	TI_UINT8					BetEnableThreshold;
    158 	TI_UINT8					BetDisableThreshold;
    159     TI_UINT32                   PsPollDeliveryFailureRecoveryPeriod; /* Time to exit PS after receiving PsPoll failure event */
    160 
    161 	TI_BOOL						reAuthActivePriority;
    162 } PowerMgr_t;
    163 
    164 
    165 #endif /*  _POWER_MGR_H_  */
    166 
    167