Home | History | Annotate | Download | only in MacServices
      1 /*
      2  * PowerSrv.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 powerSrv.h
     35  *  \brief This is the Power Manager module private (internal).
     36  *  \author Yaron Menashe
     37  *  \date 27-Apr-2004
     38  */
     39 
     40 /****************************************************************************
     41  *                                                                          *
     42  *   MODULE:  Power Manager                                                 *
     43  *   PURPOSE: Power Manager Module private                                      *
     44  *                                                                          *
     45  ****************************************************************************/
     46 
     47 #ifndef _POWER_SRV_H_
     48 #define _POWER_SRV_H_
     49 
     50 #include "TWDriverInternal.h"
     51 #include "PowerSrv_API.h"
     52 
     53 /*#include "PowerSrvSM.h"*/
     54 
     55 /*****************************************************************************
     56  **         Constants                                                       **
     57  *****************************************************************************/
     58 
     59 
     60 /*****************************************************************************
     61  **         Enumerations                                                    **
     62  *****************************************************************************/
     63 
     64 
     65 
     66 
     67 
     68 /*new Power*/
     69 
     70 
     71 typedef enum
     72 {
     73 	DRIVER_MODE,
     74 	USER_MODE
     75 }powerSrvMode_e;
     76 
     77 typedef enum
     78 {
     79 	NEW_REQUEST,
     80 	PENDING_REQUEST,
     81 	RUNNING_REQUEST,
     82 	HANDLED_REQUEST
     83 }powerSrvRequestState_e;
     84 
     85 
     86 /*****************************************************************************
     87  **         Typedefs                                                        **
     88  *****************************************************************************/
     89 
     90 
     91 
     92 
     93 /*****************************************************************************
     94  **         Structures                                                      **
     95  *****************************************************************************/
     96 
     97 
     98 
     99 typedef struct
    100 {
    101 	powerSrvRequestState_e 		requestState;
    102 	powerSrvMode_e				requestMode;
    103 	E80211PsMode	            psMode;
    104 	TI_BOOL 						sendNullDataOnExit;
    105 	void* 						powerSaveCBObject;
    106 	powerSaveCmpltCB_t    		powerSrvCompleteCB;
    107 	powerSaveCmdResponseCB_t	powerSaveCmdResponseCB;
    108 }	powerSrvRequest_t;
    109 
    110 /** \struct powerSrv_t
    111  * this structure contain the data of the PowerSrv object.
    112  */
    113 
    114 
    115 typedef struct
    116 {
    117 	TI_HANDLE   			hPowerSrvSM;            /**<
    118                                              					* Hnadle to the Power Server State Machine object.
    119                                             			 		*/
    120 
    121 	TI_HANDLE   			hOS;                        	/**<
    122                                              					* Handle to the OS object.
    123                                              					*/
    124 
    125     TI_HANDLE   			hReport;                    	/**<
    126                                             	 				* Handle to the Report module.
    127                                              					*/
    128 
    129 	TI_HANDLE   			hEventMbox;         		/**< Handle to the power controller object via the WhalCtrl.
    130 											 * Need for configure the desired power mode policy in the system.
    131 											 */
    132     TI_HANDLE               hCmdBld;
    133 
    134 	powerSrvMode_e 		currentMode; 		/**<
    135 											*holds the current mode of the PSS - driver or user...
    136 											*/
    137 
    138 	powerSrvMode_e 		userLastRequestMode;
    139 											/**<
    140 											*
    141 											*/
    142 
    143 	powerSrvRequest_t 	userRequest;		/**<
    144 											*user request struct.
    145 											*/
    146 
    147 	powerSrvRequest_t 	driverRequest;		/**<
    148 											*driver request struct
    149 											*/
    150 
    151 	powerSrvRequest_t*  	pCurrentRequest;	/**<
    152 											*pointer to the current request - user/driver request
    153 											*/
    154 
    155 	TFailureEventCb		failureEventFunc;	/**<
    156 											* upper layer Failure Event CB.
    157 											* called when the scan command has been Timer Expiry
    158 											*/
    159 	TI_HANDLE			failureEventObj;		/**<
    160 											* object parameter passed to the failureEventFunc
    161 											* when it is called
    162 											*/
    163 
    164 } powerSrv_t;
    165 
    166 
    167 
    168 /*****************************************************************************
    169  **         External data definitions                                       **
    170  *****************************************************************************/
    171 
    172 
    173 /*****************************************************************************
    174  **         External functions definitions                                  **
    175  *****************************************************************************/
    176 
    177 
    178 
    179 
    180 
    181 /*****************************************************************************
    182  **         Public Function prototypes                                      **
    183  *****************************************************************************/
    184 
    185 /*****************************************************************************
    186  **         Private Function prototypes                                     **
    187  *****************************************************************************/
    188 
    189 /*****************************************************************************
    190  **         Private Function prototypes                                     **
    191  *****************************************************************************/
    192 
    193 #endif /*  _POWER_SRV_H_  */
    194 
    195