TWD/MacServices/PowerSrv.h
changeset 0 10c42ec6c05f
equal deleted inserted replaced
-1:000000000000 0:10c42ec6c05f
       
     1 /*
       
     2  * PowerSrv.h
       
     3  *
       
     4  * Copyright(c) 1998 - 2010 Texas Instruments. All rights reserved.      
       
     5  * All rights reserved.      
       
     6  * 
       
     7  * This program and the accompanying materials are made available under the 
       
     8  * terms of the Eclipse Public License v1.0 or BSD License which accompanies
       
     9  * this distribution. The Eclipse Public License is available at
       
    10  * http://www.eclipse.org/legal/epl-v10.html and the BSD License is as below.                                   
       
    11  *                                                                       
       
    12  * Redistribution and use in source and binary forms, with or without    
       
    13  * modification, are permitted provided that the following conditions    
       
    14  * are met:                                                              
       
    15  *                                                                       
       
    16  *  * Redistributions of source code must retain the above copyright     
       
    17  *    notice, this list of conditions and the following disclaimer.      
       
    18  *  * Redistributions in binary form must reproduce the above copyright  
       
    19  *    notice, this list of conditions and the following disclaimer in    
       
    20  *    the documentation and/or other materials provided with the         
       
    21  *    distribution.                                                      
       
    22  *  * Neither the name Texas Instruments nor the names of its            
       
    23  *    contributors may be used to endorse or promote products derived    
       
    24  *    from this software without specific prior written permission.      
       
    25  *                                                                       
       
    26  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   
       
    27  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     
       
    28  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
       
    29  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  
       
    30  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
       
    31  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      
       
    32  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
       
    33  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
       
    34  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   
       
    35  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
       
    36  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
       
    37  */
       
    38 
       
    39 /** \file powerSrv.h
       
    40  *  \brief This is the Power Manager module private (internal).
       
    41  *  \author Yaron Menashe
       
    42  *  \date 27-Apr-2004
       
    43  */
       
    44 
       
    45 /****************************************************************************
       
    46  *                                                                          *
       
    47  *   MODULE:  Power Manager                                                 *
       
    48  *   PURPOSE: Power Manager Module private                                      *
       
    49  *                                                                          *
       
    50  ****************************************************************************/
       
    51 
       
    52 #ifndef _POWER_SRV_H_
       
    53 #define _POWER_SRV_H_
       
    54 
       
    55 #include "TWDriverInternal.h"
       
    56 #include "PowerSrv_API.h"
       
    57 
       
    58 /*#include "PowerSrvSM.h"*/
       
    59 
       
    60 /*****************************************************************************
       
    61  **         Constants                                                       **
       
    62  *****************************************************************************/
       
    63 
       
    64 
       
    65 /*****************************************************************************
       
    66  **         Enumerations                                                    **
       
    67  *****************************************************************************/
       
    68 
       
    69 
       
    70 
       
    71 
       
    72 
       
    73 /*new Power*/
       
    74 
       
    75 
       
    76 typedef enum 
       
    77 {
       
    78 	DRIVER_MODE,
       
    79 	USER_MODE
       
    80 }powerSrvMode_e;  
       
    81 
       
    82 typedef enum 
       
    83 {
       
    84 	NEW_REQUEST,
       
    85 	PENDING_REQUEST,
       
    86 	RUNNING_REQUEST,
       
    87 	HANDLED_REQUEST
       
    88 }powerSrvRequestState_e;
       
    89 
       
    90 
       
    91 /*****************************************************************************
       
    92  **         Typedefs                                                        **
       
    93  *****************************************************************************/
       
    94 
       
    95 
       
    96 
       
    97 
       
    98 /*****************************************************************************
       
    99  **         Structures                                                      **
       
   100  *****************************************************************************/
       
   101 
       
   102 
       
   103 
       
   104 typedef struct
       
   105 {
       
   106 	powerSrvRequestState_e 		requestState;
       
   107 	powerSrvMode_e				requestMode;
       
   108 	E80211PsMode	            psMode;
       
   109 	TI_BOOL 						sendNullDataOnExit;
       
   110 	void* 						powerSaveCBObject;
       
   111 	powerSaveCmpltCB_t    		powerSrvCompleteCB;
       
   112 	powerSaveCmdResponseCB_t	powerSaveCmdResponseCB;
       
   113 }	powerSrvRequest_t;   
       
   114 
       
   115 /** \struct powerSrv_t
       
   116  * this structure contain the data of the PowerSrv object.
       
   117  */
       
   118 
       
   119 
       
   120 typedef struct
       
   121 {
       
   122 	TI_HANDLE   			hPowerSrvSM;            /**<
       
   123                                              					* Hnadle to the Power Server State Machine object.
       
   124                                             			 		*/
       
   125 
       
   126 	TI_HANDLE   			hOS;                        	/**<
       
   127                                              					* Handle to the OS object.
       
   128                                              					*/
       
   129 
       
   130     TI_HANDLE   			hReport;                    	/**<
       
   131                                             	 				* Handle to the Report module.
       
   132                                              					*/
       
   133 
       
   134 	TI_HANDLE   			hEventMbox;         		/**< Handle to the power controller object via the WhalCtrl.
       
   135 											 * Need for configure the desired power mode policy in the system.
       
   136 											 */
       
   137     TI_HANDLE               hCmdBld;
       
   138 											 
       
   139 	powerSrvMode_e 		currentMode; 		/**<
       
   140 											*holds the current mode of the PSS - driver or user...
       
   141 											*/
       
   142 
       
   143 	powerSrvMode_e 		userLastRequestMode;
       
   144 											/**<
       
   145 											*
       
   146 											*/
       
   147 
       
   148 	powerSrvRequest_t 	userRequest;		/**<
       
   149 											*user request struct.
       
   150 											*/
       
   151 
       
   152 	powerSrvRequest_t 	driverRequest;		/**<
       
   153 											*driver request struct
       
   154 											*/
       
   155 
       
   156 	powerSrvRequest_t*  	pCurrentRequest;	/**<
       
   157 											*pointer to the current request - user/driver request
       
   158 											*/
       
   159 	
       
   160 	TFailureEventCb		failureEventFunc;	/**<
       
   161 											* upper layer Failure Event CB.
       
   162 											* called when the scan command has been Timer Expiry
       
   163 											*/
       
   164 	TI_HANDLE			failureEventObj;		/**<
       
   165 											* object parameter passed to the failureEventFunc
       
   166 											* when it is called 
       
   167 											*/
       
   168 	
       
   169 } powerSrv_t;
       
   170 
       
   171 
       
   172 
       
   173 /*****************************************************************************
       
   174  **         External data definitions                                       **
       
   175  *****************************************************************************/
       
   176 
       
   177 
       
   178 /*****************************************************************************
       
   179  **         External functions definitions                                  **
       
   180  *****************************************************************************/
       
   181 
       
   182 
       
   183 
       
   184 
       
   185 
       
   186 /*****************************************************************************
       
   187  **         Public Function prototypes                                      **
       
   188  *****************************************************************************/
       
   189 
       
   190 /*****************************************************************************
       
   191  **         Private Function prototypes                                     **
       
   192  *****************************************************************************/
       
   193 
       
   194 /*****************************************************************************
       
   195  **         Private Function prototypes                                     **
       
   196  *****************************************************************************/
       
   197 
       
   198 #endif /*  _POWER_SRV_H_  */
       
   199