Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame^] | 2 | * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame^] | 21 | |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 22 | /* |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame^] | 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 29 | * |
| 30 | * Author: Sandesh Goel |
| 31 | * Date: 02/25/02 |
| 32 | * History:- |
| 33 | * Date Modified by Modification Information |
| 34 | * -------------------------------------------------------------------- |
| 35 | * |
| 36 | */ |
| 37 | |
| 38 | #ifndef __PMM_GLOBAL_H__ |
| 39 | #define __PMM_GLOBAL_H__ |
| 40 | |
| 41 | #include "sirApi.h" |
| 42 | |
| 43 | typedef struct sPmmStaState |
| 44 | { |
| 45 | /// Whether this STA is in powersave or not |
| 46 | tANI_U8 powerSave : 1; |
| 47 | /// Whether this STA is CF-pollable or not |
| 48 | tANI_U8 cfPollable : 1; |
| 49 | /// counter to indicate PS state update due to asynchronous PS Poll |
| 50 | tANI_U8 psPollUpdate:2; |
| 51 | |
| 52 | /// Reserved |
| 53 | tANI_U8 rsvd : 4; |
| 54 | |
| 55 | /// Index of the next STA in PS closest to this one |
| 56 | tANI_U8 nextPS; |
| 57 | } tPmmStaState, *tpPmmStaState; |
| 58 | |
| 59 | |
| 60 | #define NO_STATE_CHANGE 0xFF |
| 61 | |
| 62 | typedef enum ePmmState |
| 63 | { |
| 64 | ePMM_STATE_INVALID, |
| 65 | ePMM_STATE_READY, |
| 66 | //BMPS |
| 67 | ePMM_STATE_BMPS_WT_INIT_RSP, |
| 68 | ePMM_STATE_BMPS_WT_SLEEP_RSP, |
| 69 | ePMM_STATE_BMPS_SLEEP, |
| 70 | ePMM_STATE_BMPS_WT_WAKEUP_RSP, |
| 71 | ePMM_STATE_BMPS_WAKEUP, |
| 72 | //IMPS |
| 73 | ePMM_STATE_IMPS_WT_SLEEP_RSP, |
| 74 | ePMM_STATE_IMPS_SLEEP, |
| 75 | ePMM_STATE_IMPS_WT_WAKEUP_RSP, |
| 76 | ePMM_STATE_IMPS_WAKEUP, |
| 77 | //UAPSD |
| 78 | ePMM_STATE_UAPSD_WT_SLEEP_RSP, |
| 79 | ePMM_STATE_UAPSD_SLEEP, |
Jeff Johnson | 3c3e178 | 2013-02-27 10:48:42 -0800 | [diff] [blame] | 80 | ePMM_STATE_UAPSD_WT_WAKEUP_RSP, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 81 | |
| 82 | //WOWLAN |
| 83 | ePMM_STATE_WOWLAN, |
| 84 | |
| 85 | ePMM_STATE_ERROR, |
| 86 | ePMM_STATE_LAST, |
| 87 | }tPmmState; |
| 88 | |
| 89 | typedef struct sPmmStaInfo |
| 90 | { |
| 91 | tANI_U16 assocId; |
Jeff Johnson | 3c3e178 | 2013-02-27 10:48:42 -0800 | [diff] [blame] | 92 | tANI_U32 staTxAckCnt; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 93 | }tPmmStaInfo, *tpPmmStaInfo; |
| 94 | |
| 95 | typedef struct sPmmTim |
| 96 | { |
| 97 | tANI_U8 *pTim; /** Tim Bit Array*/ |
| 98 | tANI_U8 minAssocId; |
| 99 | tANI_U8 maxAssocId; |
| 100 | tANI_U8 dtimCount; |
| 101 | /** Remaining Members are needed for LinkMonitaring of the STA in PS*/ |
| 102 | tANI_U8 numStaWithData; /** Number of stations in power save, who have data pending*/ |
| 103 | tpPmmStaInfo pStaInfo; /** Points to 1st Instant of the Array of MaxSTA StaInfo */ |
| 104 | } tPmmTim, *tpPmmTim; |
| 105 | |
| 106 | typedef struct sAniSirPmm |
| 107 | { |
| 108 | |
| 109 | |
| 110 | //tANI_U32 disModeBeforeSleeping; |
| 111 | //tANI_U32 txMCastCtrl; |
| 112 | //tANI_U32 nListenBeforeSleeping; |
| 113 | //tANI_U32 txTrafficIdleThreshold; |
| 114 | //tANI_U32 rxTrafficIdleThreshold; |
| 115 | //tANI_U32 ledInfoBeforeSleeping; |
| 116 | |
| 117 | |
| 118 | tANI_U64 BmpsmaxSleepTime; |
| 119 | tANI_U64 BmpsavgSleepTime; |
| 120 | tANI_U64 BmpsminSleepTime; |
| 121 | tANI_U64 BmpscntSleep; |
| 122 | |
| 123 | tANI_U64 BmpsmaxTimeAwake; |
| 124 | tANI_U64 BmpsavgTimeAwake; |
| 125 | tANI_U64 BmpsminTimeAwake; |
| 126 | tANI_U64 BmpscntAwake; |
| 127 | |
| 128 | tANI_U64 BmpsWakeupTimeStamp; |
| 129 | tANI_U64 BmpsSleepTimeStamp; |
| 130 | |
| 131 | // debug statistics |
| 132 | tANI_U64 BmpsPktDrpInSleepMode; |
| 133 | tANI_U64 BmpsInitFailCnt; |
| 134 | tANI_U64 BmpsSleeReqFailCnt; |
| 135 | tANI_U64 BmpsWakeupReqFailCnt; |
| 136 | tANI_U64 BmpsInvStateCnt; |
| 137 | tANI_U64 BmpsWakeupIndCnt; |
| 138 | tANI_U64 BmpsHalReqFailCnt; |
| 139 | tANI_U64 BmpsReqInInvalidRoleCnt; |
| 140 | |
| 141 | /* Add wakeup and sleep time stamps here */ |
| 142 | tANI_U64 ImpsWakeupTimeStamp; |
| 143 | tANI_U64 ImpsSleepTimeStamp; |
| 144 | |
| 145 | tANI_U64 ImpsMaxTimeAwake; |
| 146 | tANI_U64 ImpsMinTimeAwake; |
| 147 | tANI_U64 ImpsAvgTimeAwake; |
| 148 | tANI_U64 ImpsCntAwake; |
| 149 | |
| 150 | tANI_U64 ImpsCntSleep; |
| 151 | tANI_U64 ImpsMaxSleepTime; |
| 152 | tANI_U64 ImpsMinSleepTime; |
| 153 | tANI_U64 ImpsAvgSleepTime; |
| 154 | |
| 155 | tANI_U64 ImpsSleepErrCnt; |
| 156 | tANI_U64 ImpsWakeupErrCnt; |
| 157 | tANI_U64 ImpsLastErr; |
| 158 | |
| 159 | tANI_U64 ImpsInvalidStateCnt; |
| 160 | tANI_U64 ImpsPktDrpInSleepMode; |
| 161 | |
| 162 | |
| 163 | /// Next STA to be serviced in PS state |
| 164 | tANI_U16 gPmmNextSta; |
| 165 | |
| 166 | /// Next CF-pollable STA to be serviced in PS state |
| 167 | tANI_U16 gPmmNextCFPSta; |
| 168 | |
| 169 | /// Number of STAs in PS state |
| 170 | tANI_U16 gPmmNumSta; |
| 171 | |
| 172 | tANI_U8 gPmmPsPollUpdate:1; // set when any sta state is update due to PS-Poll |
| 173 | tANI_U8 rsvd: 7; |
Jeff Johnson | 3c3e178 | 2013-02-27 10:48:42 -0800 | [diff] [blame] | 174 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 175 | /// STA Power management state array |
| 176 | /** |
| 177 | * An entry in this array records the power save state for an STA |
| 178 | * It also points to the next closest STA in power save state. |
| 179 | */ |
| 180 | |
| 181 | tANI_U32 gPmmBeaconInterval; //pmm keeps its won copy of beacon interval, default to 100ms |
| 182 | tSirPowerSaveCfg gPmmCfg; //pmm keeps a copy of Power Save config parameters sent to softmac. |
| 183 | /// Current PM state of the station |
| 184 | tPmmState gPmmState; |
| 185 | /// Flag to track if we are in a missed beacon scenario |
| 186 | tANI_U8 inMissedBeaconScenario; |
| 187 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 188 | tPmmTim gPmmTim; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 189 | |
| 190 | |
| 191 | //Reason for which PMC is sending an EXIT_BMPS_REQ to PE |
| 192 | tExitBmpsReason gPmmExitBmpsReasonCode; |
| 193 | tANI_U8 sessionId; //This sessio Id is added to know the bsstype , infra/btamp .......in power save mode |
| 194 | |
| 195 | } tAniSirPmm, *tpAniSirPmm; |
| 196 | |
| 197 | #endif |