Home | History | Annotate | Download | only in Sta_Management
      1 /*
      2  * PowerMgr_API.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_API.h
     35  *  \brief This is the Power Manager module API.
     36  *  \
     37  */
     38 
     39 /****************************************************************************
     40  *                                                                          *
     41  *   MODULE:  Power Manager                                                 *
     42  *   PURPOSE: Power Manager Module API                                      *
     43  *                                                                          *
     44  ****************************************************************************/
     45 
     46 #ifndef _POWER_MGR_API_H_
     47 #define _POWER_MGR_API_H_
     48 
     49 #include "tidef.h"
     50 #include "paramOut.h"
     51 #include "DrvMainModules.h"
     52 
     53 /*****************************************************************************
     54  **         Constants                                                       **
     55  *****************************************************************************/
     56 
     57 
     58 /*****************************************************************************
     59  **         Enumerations                                                    **
     60  *****************************************************************************/
     61 
     62 
     63 /*****************************************************************************
     64  **         Typedefs                                                        **
     65  *****************************************************************************/
     66 
     67 
     68 /*****************************************************************************
     69  **         Structures                                                      **
     70  *****************************************************************************/
     71 
     72 
     73 /*****************************************************************************
     74  **         External data definitions                                       **
     75  *****************************************************************************/
     76 
     77 
     78 /*****************************************************************************
     79  **         External functions definitions                                  **
     80  *****************************************************************************/
     81 
     82 
     83 /*****************************************************************************
     84  **         Public Function prototypes                                      **
     85  *****************************************************************************/
     86 
     87 /**
     88  * \
     89  * \date 24-Oct-2005\n
     90  * \brief Creates the object of the power Manager.
     91  *
     92  * Function Scope \e Public.\n
     93  * Parameters:\n
     94  * 1) TI_HANDLE - handle to the OS.\n
     95  * Return Value: TI_HANDLE - handle to the PowerMgr object.\n
     96  */
     97 TI_HANDLE PowerMgr_create(TI_HANDLE theOsHandle);
     98 
     99 /**
    100  * \
    101  * \date 24-Oct-2005\n
    102  * \brief Destroy the object of the power Manager.
    103  *
    104  * Function Scope \e Public.\n
    105  * Parameters:\n
    106  * 1) TI_HANDLE - handle to the PowerMgr object.\n
    107  * Return Value: TI_STATUS - TI_OK on success else TI_NOK.\n
    108  */
    109 TI_STATUS PowerMgr_destroy(TI_HANDLE thePowerMgrHandle);
    110 
    111 /**
    112  * \
    113  * \date 24-Oct-2005\n
    114  * \brief Initialization of the PowerMgr module.
    115  *
    116  * Function Scope \e Public.\n
    117  * Parameters:    pStadHandles - The driver modules handles  \n
    118  * Return Value:  void  \n
    119  */
    120 void PowerMgr_init (TStadHandlesList *pStadHandles);
    121 
    122 TI_STATUS PowerMgr_SetDefaults (TI_HANDLE hPowerMgr, PowerMgrInitParams_t* pPowerMgrInitParams);
    123 
    124 /**
    125  * \
    126  * \date 24-Oct-2005\n
    127  * \brief Start the power save algorithm of the driver and also the 802.11 PS.
    128  *
    129  * Function Scope \e Public.\n
    130  * Parameters:\n
    131  * 1) TI_HANDLE - handle to the PowerMgr object.\n
    132  * Return Value: TI_STATUS - TI_OK on success else TI_NOK.\n
    133  * \b Description:\n
    134  * PsEnable = true, and decide on the proper power mode.
    135  */
    136 TI_STATUS PowerMgr_startPS(TI_HANDLE thePowerMgrHandle);
    137 
    138 /**
    139  * \
    140  * \date 24-Oct-2005\n
    141  * \brief stop the power save algorithm of the driver and also the 802.11 PS.
    142  *
    143  * Function Scope \e Public.\n
    144  * Parameters:\n
    145  * 1) TI_HANDLE - handle to the PowerMgr object.\n
    146  * 2) TI_BOOL - indicates if this is roaming (FALSE) or disconnect (TRUE)
    147  * Return Value: TI_STATUS - TI_OK on success else TI_NOK.\n
    148  * \b Description:\n
    149  * PsEnable = false, and set the power mode to active.
    150  */
    151 TI_STATUS PowerMgr_stopPS(TI_HANDLE thePowerMgrHandle, TI_BOOL bDisconnect);
    152 
    153 /**
    154  * \
    155  * \date 24-Oct-2005\n
    156  * \brief returns the 802.11 power save status (enable / disable).
    157  *
    158  * Function Scope \e Public.\n
    159  * Parameters:\n
    160  * 1) TI_HANDLE - handle to the PowerMgr object.\n
    161  * Return Value: TI_BOOL - TI_TRUE if enable else TI_FALSE.\n
    162 */
    163 TI_BOOL PowerMgr_getPsStatus(TI_HANDLE thePowerMgrHandle);
    164 
    165 
    166 
    167 /**
    168  * \
    169  * \date 24-Oct-2005\n
    170  * \brief Configure of the PowerMode (auto / active / short doze / long doze).
    171  *
    172  * Function Scope \e Public.\n
    173  * Parameters:\n
    174  * 1) TI_HANDLE - handle to the PowerMgr object.\n
    175  * 2) PowerMgr_PowerMode_e - the requested power mode (auto / active / short doze / long doze).
    176  * Return Value: TI_STATUS - TI_OK on success else TI_NOK.\n
    177  * \b Description:\n
    178  * desiredPowerModeProfile = PowerMode input parameter, and set the proper power mode.
    179 */
    180 TI_STATUS PowerMgr_setPowerMode(TI_HANDLE thePowerMgrHandle);
    181 
    182 
    183 /**
    184  * \
    185  * \date 24-Oct-2005\n
    186  * \brief Get the current PowerMode of the PowerMgr module.
    187  *
    188  * Function Scope \e Public.\n
    189  * Parameters:\n
    190  * 1) TI_HANDLE - handle to the PowerMgr object.\n
    191  * Return Value: PowerMgr_PowerMode_e .\n
    192  */
    193 PowerMgr_PowerMode_e PowerMgr_getPowerMode(TI_HANDLE thePowerMgrHandle);
    194 
    195 TI_STATUS powerMgr_getParam(TI_HANDLE thePowerMgrHandle,
    196                             paramInfo_t *theParamP);
    197 TI_STATUS powerMgr_setParam(TI_HANDLE thePowerMgrHandle,
    198                             paramInfo_t *theParamP);
    199 
    200 
    201 /**
    202  * \
    203  * \date 20-July-2004\n
    204  * \brief print configuration of the PowerMgr object - use for debug!
    205  *
    206  * Function Scope \e Public.\n
    207  * Parameters:\n
    208  * 1) TI_HANDLE - handle to the PowerMgr object.\n
    209  * Return Value: void.\n
    210  */
    211 void PowerMgr_printObject(TI_HANDLE thePowerMgrHandle);
    212 
    213 /**
    214  * \date 10-April-2007\n
    215  * \brief reset PM upon recovery event.
    216  *
    217  * Function Scope \e Public.\n
    218  * Parameters:\n
    219  * 1) TI_HANDLE - handle to the PowerMgr object.\n
    220  * Return Value: void.\n
    221  */
    222 
    223 TI_STATUS PowerMgr_notifyFWReset(TI_HANDLE hPowerMgr);
    224 
    225 TI_BOOL PowerMgr_getReAuthActivePriority(TI_HANDLE thePowerMgrHandle);
    226 
    227 #endif /*_POWER_MGR_API_H_*/
    228