2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/pwr_mgt.h#1 $
6 \brief In this file we define the STATE and EVENT for Power Management FSM.
8 The SCAN FSM is responsible for performing SCAN behavior when the Arbiter enter
9 ARB_STATE_SCAN. The STATE and EVENT for SCAN FSM are defined here with detail
18 * 07 09 2010 george.huang
20 * [WPD00001556] Migrate PM variables from FW to driver: for composing QoS Info
24 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
26 * 06 06 2010 kevin.huang
27 * [WPD00003832][MT6620 5931] Create driver base
28 * [MT6620 5931] Create driver base
31 * [WPD00001943]Create WiFi test driver framework on WinXP
32 * don't need SPIN_LOCK_PWR_CTRL anymore, it will raise IRQL
33 * and cause SdBusSubmitRequest running at DISPATCH_LEVEL as well.
37 * [WPD00001943]Create WiFi test driver framework on WinXP
38 * firmware download load adress & start address are now configured from config.h
39 * * * due to the different configurations on FPGA and ASIC
40 ** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-12-10 16:39:10 GMT mtk02752
41 ** disable PM macros temporally
42 ** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-10-29 19:48:37 GMT mtk01084
43 ** temp remove power management macro
44 ** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-04-08 16:51:11 GMT mtk01084
45 ** update for power management control macro
46 ** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-04-03 14:59:58 GMT mtk01426
47 ** Add #if CFG_HIF_LOOPBACK_PRETEST
48 ** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-23 16:53:10 GMT mtk01084
49 ** modify ACQUIRE_POWER_CONTROL_FROM_PM() and RECLAIM_POWER_CONTROL_TO_PM() macro
50 ** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-19 18:32:47 GMT mtk01084
51 ** update for basic power management functions
52 ** \main\maintrunk.MT6620WiFiDriver_Prj\1 2009-03-19 15:05:20 GMT mtk01084
59 /*******************************************************************************
60 * C O M P I L E R F L A G S
61 ********************************************************************************
64 /*******************************************************************************
65 * E X T E R N A L R E F E R E N C E S
66 ********************************************************************************
69 /*******************************************************************************
71 ********************************************************************************
73 #define PM_UAPSD_AC0 (BIT(0))
74 #define PM_UAPSD_AC1 (BIT(1))
75 #define PM_UAPSD_AC2 (BIT(2))
76 #define PM_UAPSD_AC3 (BIT(3))
78 #define PM_UAPSD_ALL (PM_UAPSD_AC0 | PM_UAPSD_AC1 | PM_UAPSD_AC2 | PM_UAPSD_AC3)
79 #define PM_UAPSD_NONE 0
82 /*******************************************************************************
84 ********************************************************************************
86 typedef struct _PM_PROFILE_SETUP_INFO_T {
88 UINT_8 ucBmpDeliveryAC; /* 0: AC_BE, 1: AC_BK, 2: AC_VI, 3: AC_VO */
89 UINT_8 ucBmpTriggerAC; /* 0: AC_BE, 1: AC_BK, 2: AC_VI, 3: AC_VO */
91 UINT_8 ucUapsdSp; /* Number of triggered packets in UAPSD */
93 } PM_PROFILE_SETUP_INFO_T, *P_PM_PROFILE_SETUP_INFO_T;
96 /*******************************************************************************
98 ********************************************************************************
101 /*******************************************************************************
102 * P R I V A T E D A T A
103 ********************************************************************************
106 /*******************************************************************************
108 ********************************************************************************
111 #if !CFG_ENABLE_FULL_PM
112 #define ACQUIRE_POWER_CONTROL_FROM_PM(_prAdapter)
113 #define RECLAIM_POWER_CONTROL_TO_PM(_prAdapter, _fgEnableGINT_in_IST)
115 #define ACQUIRE_POWER_CONTROL_FROM_PM(_prAdapter) \
117 if (_prAdapter->fgIsFwOwn) { \
118 nicpmSetDriverOwn(_prAdapter); \
120 /* Increase Block to Enter Low Power Semaphore count */ \
121 GLUE_INC_REF_CNT(_prAdapter->u4PwrCtrlBlockCnt); \
124 #define RECLAIM_POWER_CONTROL_TO_PM(_prAdapter, _fgEnableGINT_in_IST) \
126 ASSERT(_prAdapter->u4PwrCtrlBlockCnt != 0); \
127 /* Decrease Block to Enter Low Power Semaphore count */ \
128 GLUE_DEC_REF_CNT(_prAdapter->u4PwrCtrlBlockCnt); \
129 if (_prAdapter->fgWiFiInSleepyState && (_prAdapter->u4PwrCtrlBlockCnt == 0)) { \
130 nicpmSetFWOwn(_prAdapter, _fgEnableGINT_in_IST); \
136 /*******************************************************************************
137 * F U N C T I O N D E C L A R A T I O N S
138 ********************************************************************************
141 /*******************************************************************************
143 ********************************************************************************
146 #endif /* _PWR_MGT_H */