wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacconfiguretxautoratepolicy.h
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2007-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 WlanConfigureTxAutoRatePolicy class.
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 6 %
       
    20 */
       
    21 
       
    22 #ifndef WLAN_CONFIGURE_TX_AUTO_RATE_POLICY_H
       
    23 #define WLAN_CONFIGURE_TX_AUTO_RATE_POLICY_H
       
    24 
       
    25 #include "UmacWsaComplexCommand.h"
       
    26 #include "umacinternaldefinitions.h"
       
    27 
       
    28 
       
    29 /**
       
    30  *  Configures the relevant txAutoRatePolicy MIB entries to enable the lower
       
    31  *  layers to perform autonomous rate adaptation
       
    32  *
       
    33  *  @lib wlanumac.lib
       
    34  *  @since S60 v5.0
       
    35  */
       
    36 class WlanConfigureTxAutoRatePolicy : public WlanWsaComplexCommand
       
    37     {
       
    38 
       
    39 public: 
       
    40 
       
    41     /**
       
    42     * C++ default constructor.
       
    43     */
       
    44     WlanConfigureTxAutoRatePolicy();
       
    45 
       
    46     /**
       
    47     * Destructor.
       
    48     */
       
    49     virtual ~WlanConfigureTxAutoRatePolicy();
       
    50 
       
    51     /**
       
    52     * Provides the input parameters for this state
       
    53     * 
       
    54     * @since S60 5.0
       
    55     * @param aCompleteMgmtRequest ETrue if WLAN Mgmt Client request needs to be
       
    56     *        completed when we are done; EFalse otherwise
       
    57     */
       
    58     void Set( TBool aCompleteMgmtRequest );
       
    59 
       
    60 private:
       
    61 
       
    62     // Types for the FSM
       
    63 
       
    64     // events for the FSM
       
    65     enum TEvent
       
    66         {
       
    67         ESTATEENTRY,    // state entry action to be executed                        
       
    68         ETXCOMPLETE,    // underlying sw layer tx delivery complete event
       
    69         EABORT,         // abort execution event
       
    70         EEVENTMAX       // defined as an upper bound
       
    71         };
       
    72 
       
    73     // states of the FSM
       
    74     enum TState
       
    75         {
       
    76         EINIT,          // start state of the state machine
       
    77         ESETAUTORATEPOLICY,
       
    78         EFINIT,
       
    79         ESTATEMAX       // defined as an upper bound        
       
    80         }; 
       
    81 
       
    82     /**
       
    83     * Dispatches the internal state machine events
       
    84     *
       
    85     * @since S60 5.0
       
    86     * @param aCtxImpl Global statemachine context
       
    87     * @param aEvent The event to dispatch
       
    88     */
       
    89     void Fsm( 
       
    90         WlanContextImpl& aCtxImpl, 
       
    91         TEvent aEvent ); 
       
    92 
       
    93     /**
       
    94     * Handles the Internal State Entry event
       
    95     *
       
    96     * @since S60 5.0
       
    97     * @param aCtxImpl Global statemachine context
       
    98     */
       
    99     void OnStateEntryEvent( WlanContextImpl& aCtxImpl );
       
   100 
       
   101     /**
       
   102     * Handles the Tx Complete event.
       
   103     *
       
   104     * @since S60 5.0
       
   105     * @param aCtxImpl Global statemachine context
       
   106     */
       
   107     void OnTxCompleteEvent( WlanContextImpl& aCtxImpl );
       
   108 
       
   109     /**
       
   110     * Handles the Abort event.
       
   111     *
       
   112     * @since S60 5.0
       
   113     * @param aCtxImpl Global statemachine context
       
   114     */
       
   115     void OnAbortEvent( WlanContextImpl& aCtxImpl );
       
   116 
       
   117     /**
       
   118     * Handles internal state machine state changes.
       
   119     *
       
   120     * @since S60 5.0
       
   121     * @param aCtxImpl Global statemachine context
       
   122     * @param aNewState The state to change to
       
   123     */
       
   124     void ChangeInternalState( 
       
   125         WlanContextImpl& aCtxImpl, 
       
   126         TState aNewState );
       
   127 
       
   128     /**
       
   129     * ?member_description.
       
   130     *
       
   131     * @since S60 5.0
       
   132     * @param aCtxImpl Global statemachine context
       
   133     */
       
   134     void SetAutoRatePolicy( 
       
   135         WlanContextImpl& aCtxImpl );
       
   136 
       
   137     /**
       
   138      * From WlanMacState.
       
   139      * Performs state entry actions
       
   140      *
       
   141      * @since S60 5.0
       
   142      * @param aCtxImpl Global statemachine context
       
   143      */
       
   144     virtual void Entry( WlanContextImpl& aCtxImpl );
       
   145 
       
   146     /**
       
   147      * From WlanMacState.
       
   148      * Performs state exit actions
       
   149      *
       
   150      * @since S60 5.0
       
   151      * @param aCtxImpl Global statemachine context
       
   152      */
       
   153     virtual void Exit( WlanContextImpl& aCtxImpl);
       
   154 
       
   155     /**
       
   156      * From WlanMacState.
       
   157      * Returns the name of this state.
       
   158      *
       
   159      * @since S60 5.0
       
   160      * @param aLength Length of the returned name buffer
       
   161      */
       
   162 #ifndef NDEBUG 
       
   163         virtual const TInt8* GetStateName( TUint8& aLength ) const;
       
   164 #endif // !NDEBUG 
       
   165 
       
   166     // Prohibit copy constructor.
       
   167     WlanConfigureTxAutoRatePolicy( const WlanConfigureTxAutoRatePolicy& );
       
   168     // Prohibit assignment operator.
       
   169     WlanConfigureTxAutoRatePolicy& operator= 
       
   170         ( const WlanConfigureTxAutoRatePolicy& );
       
   171 
       
   172 private:    // Data
       
   173 
       
   174     /** state of the internal state machine */
       
   175     TState iState;
       
   176     /** 
       
   177      * ETrue if WLAN Mgmt Client request needs to be completed when we are 
       
   178      * done, EFalse otherwise
       
   179      */
       
   180     TBool iCompleteMgmtRequest;
       
   181     // memory handle for TxAutoRatePolicyMib objects. Own
       
   182     WHA::StxAutoRatePolicy* iTxAutoRatePolicyMib;
       
   183     /** number of rate policy classes to configure */
       
   184     TUint iNumberOfPolicyClassesToConfigure;
       
   185     /** ID of the rate policy class being configured */
       
   186     TUint iRatePolicyClass;
       
   187 
       
   188 #ifndef NDEBUG
       
   189     /** max length of state name for tracing */
       
   190     enum { KMaxStateStringLength = 50 };
       
   191     /** max length of event name for tracing */
       
   192     enum { KMaxEventStringLength = KMaxStateStringLength };
       
   193 
       
   194     /** state names for tracing */
       
   195     static const TUint8 iStateName[ESTATEMAX][KMaxStateStringLength];
       
   196     /** event names for tracing */
       
   197     static const TUint8 iEventName[EEVENTMAX][KMaxEventStringLength];
       
   198     static const TInt8  iName[];
       
   199 #endif // !NDEBUG
       
   200 
       
   201     };
       
   202 
       
   203 #endif      // WLAN_CONFIGURE_TX_AUTO_RATE_POLICY_H