wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacactivemodepowermodemgr.h
changeset 0 c40eb8fe8501
child 25 a0fdcd0e4c56
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Declaration of the WlanActiveModePowerModeMgr class
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 9 %
       
    20 */
       
    21 
       
    22 #ifndef WLAN_ACTIVE_MODE_POWER_MODE_MGR
       
    23 #define WLAN_ACTIVE_MODE_POWER_MODE_MGR
       
    24 
       
    25 #include "umacpowermodemgrbase.h"
       
    26 
       
    27 class WlanContextImpl;
       
    28 
       
    29 /**
       
    30 * Class implementing infrastructure mode dynamic power mode management 
       
    31 * algorithm for Active mode (CAM)
       
    32 */
       
    33 class WlanActiveModePowerModeMgr : public WlanPowerModeMgrBase
       
    34     {    
       
    35 
       
    36 public:
       
    37     
       
    38     /** Ctor */
       
    39     WlanActiveModePowerModeMgr();   
       
    40         
       
    41     /** Dtor */
       
    42     virtual ~WlanActiveModePowerModeMgr();
       
    43 
       
    44     /**
       
    45     * Sets the dynamic power mode transition algorithm parameters
       
    46     *
       
    47     * @since S60 5.1
       
    48     * @param aToLightPsFrameThreshold frame count threshold for changing to 
       
    49     *        Light PS mode
       
    50     * @param aUapsdRxFrameLengthThreshold received frame 
       
    51     *        payload length (in bytes) threshold in U-APSD network
       
    52     */
       
    53     inline void SetParameters(
       
    54         TUint aToLightPsFrameThreshold,
       
    55         TUint16 aUapsdRxFrameLengthThreshold );
       
    56 
       
    57     /**
       
    58     * To be called when transmitting a frame
       
    59     * Determines the need to make a power mode transition
       
    60     *
       
    61     * @since S60 3.1
       
    62     * @param aCtxImpl global statemachine context
       
    63     * @param aQueueId Id of the queue/AC via which the frame will be transmitted
       
    64     * @param aEtherType Ethernet type of the frame
       
    65     * @param aIgnoreThisFrame shall this frame be ignored from dynamic power 
       
    66     *                         mode management perspective
       
    67     * @return To which power management mode to change; if any at all
       
    68     */
       
    69     virtual TPowerMgmtModeChange OnFrameTx( 
       
    70         WlanContextImpl& aCtxImpl, 
       
    71         WHA::TQueueId aQueueId,
       
    72         TUint16 aEtherType,
       
    73         TBool aIgnoreThisFrame );
       
    74 
       
    75     /** 
       
    76     * To be called when accepting an Rx frame
       
    77     *
       
    78     * @since S60 3.1
       
    79     * @param aCtxImpl global statemachine context
       
    80     * @param aAccessCategory AC/Queue via which the frame was transmitted
       
    81     * @param aEtherType Ethernet type of the received frame
       
    82     * @param aIgnoreThisFrame shall this frame be ignored from dynamic power 
       
    83     *                         mode management perspective
       
    84     * @param aPayloadLength length of the ethernet frame payload
       
    85     * @param aDaType DA type (Unicast, Multicast or Broadcast) of the frame
       
    86     * @return To which power management mode to change; if any at all
       
    87     */
       
    88     virtual TPowerMgmtModeChange OnFrameRx(
       
    89         WlanContextImpl& aCtxImpl,
       
    90         WHA::TQueueId aAccessCategory,
       
    91         TUint16 aEtherType,
       
    92         TBool aIgnoreThisFrame,
       
    93         TUint aPayloadLength,
       
    94         TDaType aDaType );
       
    95 
       
    96     /**
       
    97     * From WlanPowerModeMgrBase
       
    98     * To be called upon Active to Light PS timer timeout
       
    99     *
       
   100     * @since S60 5.1
       
   101     * @return ETrue if power mode transition should be done, 
       
   102     *         EFalse otherwise
       
   103     */
       
   104     virtual TBool OnActiveToLightPsTimerTimeout();
       
   105     
       
   106     /** 
       
   107     * From WlanPowerModeMgrBase
       
   108     * Resets the state of the object 
       
   109     *
       
   110     * @since S60 3.1
       
   111     */
       
   112     virtual void DoReset();
       
   113         
       
   114 private:
       
   115 
       
   116     // Prohibit copy constructor
       
   117     WlanActiveModePowerModeMgr( const WlanActiveModePowerModeMgr& );
       
   118     // Prohibit assignment operator
       
   119     WlanActiveModePowerModeMgr& operator= ( 
       
   120         const WlanActiveModePowerModeMgr& );   
       
   121     
       
   122 private:    // Data
       
   123 
       
   124     /**
       
   125     * Rx/Tx frame counter used when considering change to 
       
   126     * Light PS mode
       
   127     */
       
   128     TUint iToLightPsFrameCount;
       
   129 
       
   130     /**
       
   131     * Rx/Tx frame count threshold used when considering change to 
       
   132     * Light PS mode
       
   133     */
       
   134     TUint iToLightPsFrameThreshold;
       
   135     };
       
   136 
       
   137 #include "umacactivemodepowermodemgr.inl"
       
   138 
       
   139 #endif // WLAN_ACTIVE_MODE_POWER_MODE_MGR