wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacMacActionState.cpp
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2005-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:   Implementation of the WlanMacActionState class.
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 43 %
       
    20 */
       
    21 
       
    22 #include "config.h"
       
    23 #include "UmacMacActionState.h"
       
    24 #include "UmacDot11IbssMode.h"
       
    25 #include "UmacDot11InfrastructureMode.h"
       
    26 #include "UmacContextImpl.h"
       
    27 #include "UmacWsaComplexCommand.h"
       
    28 #include "UmacWsaCommand.h"
       
    29 
       
    30 // ============================ MEMBER FUNCTIONS ===============================
       
    31 
       
    32 
       
    33 // ---------------------------------------------------------------------------
       
    34 // 
       
    35 // ---------------------------------------------------------------------------
       
    36 //
       
    37 void WlanMacActionState::ChangeState( 
       
    38     WlanContextImpl& aCtxImpl, 
       
    39     WlanDot11State& aPrevState,
       
    40     WlanWsaComplexCommand& aNewState,
       
    41     TUint32 aAct )
       
    42     {
       
    43     aNewState.Dot11History( aPrevState );
       
    44 
       
    45 #ifndef NDEBUG 
       
    46     TUint8 length;
       
    47     const TUint8* ptr = reinterpret_cast<const TUint8*>
       
    48         (aNewState.GetStateName( length ));
       
    49     const TUint8* ptr2 = reinterpret_cast<const TUint8*>
       
    50         (aCtxImpl.iCurrentMacState->GetStateName( length ));
       
    51 
       
    52     OsTracePrint( KUmacProtocolState, (TUint8*)("UMAC: WlanMacActionState::ChangeState(): previous state:") );
       
    53     OsTracePrint( KUmacProtocolState, ptr2 );
       
    54     OsTracePrint( KUmacProtocolState, (TUint8*)("UMAC: WlanMacActionState::ChangeState(): next state:") );
       
    55     OsTracePrint( KUmacProtocolState, ptr );
       
    56 #endif
       
    57 
       
    58     // set ACT 
       
    59     aNewState.Act( aCtxImpl, aAct );
       
    60 
       
    61     aCtxImpl.iCurrentMacState = &aNewState;
       
    62     aCtxImpl.iCurrentMacState->Entry( aCtxImpl );    
       
    63     }
       
    64 
       
    65 // ---------------------------------------------------------------------------
       
    66 // 
       
    67 // ---------------------------------------------------------------------------
       
    68 //
       
    69 void WlanMacActionState::ChangeState( 
       
    70     WlanContextImpl& aCtxImpl, 
       
    71     WlanDot11State& aPrevState,
       
    72     WlanDot11State& aNewState )
       
    73     {
       
    74     aNewState.Dot11History( aPrevState );
       
    75 
       
    76 #ifndef NDEBUG 
       
    77     TUint8 length;
       
    78     const TUint8* ptr = reinterpret_cast<const TUint8*>
       
    79         (aNewState.GetStateName( length ));
       
    80     const TUint8* ptr2 = reinterpret_cast<const TUint8*>
       
    81         (aCtxImpl.iCurrentMacState->GetStateName( length ));
       
    82 
       
    83     OsTracePrint( KDot11StateTransit, (TUint8*)
       
    84         ("UMAC * dot11state to dot11state traversal") );
       
    85     OsTracePrint( KDot11StateTransit, (TUint8*)("previous state:") );
       
    86     OsTracePrint( KDot11StateTransit, ptr2 );
       
    87     OsTracePrint( KDot11StateTransit, (TUint8*)("next state:") );
       
    88     OsTracePrint( KDot11StateTransit, ptr );
       
    89 #endif
       
    90 
       
    91     aPrevState.Exit( aCtxImpl );
       
    92     aCtxImpl.iCurrentMacState = &aNewState;
       
    93     aCtxImpl.iCurrentMacState->Entry( aCtxImpl );    
       
    94     }
       
    95 
       
    96 // ---------------------------------------------------------------------------
       
    97 // 
       
    98 // ---------------------------------------------------------------------------
       
    99 //
       
   100 void WlanMacActionState::ChangeState( 
       
   101     WlanContextImpl& aCtxImpl, 
       
   102     WlanWsaComplexCommand& aPrevState,
       
   103     WlanWsaCommand& aNewState )
       
   104     {
       
   105     aNewState.History( aPrevState );
       
   106 
       
   107 #ifndef NDEBUG 
       
   108     TUint8 length;
       
   109     const TUint8* ptr = reinterpret_cast<const TUint8*>
       
   110         (aNewState.GetStateName( length ));
       
   111     const TUint8* ptr2 = reinterpret_cast<const TUint8*>
       
   112         (aCtxImpl.iCurrentMacState->GetStateName( length ));
       
   113 
       
   114     OsTracePrint( KUmacProtocolState, (TUint8*)("UMAC: WlanMacActionState::ChangeState(): previous state:") );
       
   115     OsTracePrint( KUmacProtocolState, ptr2 );
       
   116     OsTracePrint( KUmacProtocolState, (TUint8*)("UMAC: WlanMacActionState::ChangeState(): next state:") );
       
   117     OsTracePrint( KUmacProtocolState, ptr );
       
   118 #endif
       
   119    
       
   120     aCtxImpl.iCurrentMacState = &aNewState;
       
   121     aCtxImpl.iCurrentMacState->Entry( aCtxImpl );    
       
   122     }
       
   123 
       
   124 // ---------------------------------------------------------------------------
       
   125 // 
       
   126 // ---------------------------------------------------------------------------
       
   127 //
       
   128 void WlanMacActionState::ChangeState( 
       
   129     WlanContextImpl& aCtxImpl, 
       
   130     WlanDot11State& aPrevState,
       
   131     WlanWsaCommand& aNewState,
       
   132     TUint32 aAct )
       
   133     {
       
   134     aNewState.History( aPrevState );
       
   135 
       
   136 #ifndef NDEBUG 
       
   137     TUint8 length;
       
   138     const TUint8* ptr = reinterpret_cast<const TUint8*>
       
   139         (aNewState.GetStateName( length ));
       
   140     const TUint8* ptr2 = reinterpret_cast<const TUint8*>
       
   141         (aCtxImpl.iCurrentMacState->GetStateName( length ));
       
   142 
       
   143     OsTracePrint( KUmacProtocolState, (TUint8*)("UMAC: WlanMacActionState::ChangeState(): previous state:") );
       
   144     OsTracePrint( KUmacProtocolState, ptr2 );
       
   145     OsTracePrint( KUmacProtocolState, (TUint8*)("UMAC: WlanMacActionState::ChangeState(): next state:") );
       
   146     OsTracePrint( KUmacProtocolState, ptr );
       
   147 #endif
       
   148 
       
   149     // set ACT 
       
   150     aNewState.Act( aCtxImpl, aAct );
       
   151     OsTracePrint( 
       
   152         KUmacDetails, 
       
   153         (TUint8*)
       
   154         ("UMAC: WlanMacActionState::ChangeState(): act: %d"), aAct );
       
   155 
       
   156 
       
   157     aCtxImpl.iCurrentMacState = &aNewState;
       
   158     aCtxImpl.iCurrentMacState->Entry( aCtxImpl );    
       
   159     }
       
   160 
       
   161 // ---------------------------------------------------------------------------
       
   162 // 
       
   163 // ---------------------------------------------------------------------------
       
   164 //
       
   165 void WlanMacActionState::ChangeState( 
       
   166     WlanContextImpl& aCtxImpl, 
       
   167     WlanWsaComplexCommand& aPrevState,
       
   168     WlanDot11State& aNewState )
       
   169     {
       
   170 #ifndef NDEBUG 
       
   171     TUint8 length;
       
   172     const TUint8* ptr = reinterpret_cast<const TUint8*>
       
   173         (aNewState.GetStateName( length ));
       
   174     const TUint8* ptr2 = reinterpret_cast<const TUint8*>
       
   175         (aCtxImpl.iCurrentMacState->GetStateName( length ));
       
   176 
       
   177     OsTracePrint( KUmacProtocolState, (TUint8*)("UMAC: WlanMacActionState::ChangeState(): previous state:") );
       
   178     OsTracePrint( KUmacProtocolState, ptr2 );
       
   179     OsTracePrint( KUmacProtocolState, (TUint8*)("UMAC: WlanMacActionState::ChangeState(): next state:") );
       
   180     OsTracePrint( KUmacProtocolState, ptr );
       
   181 #endif
       
   182 
       
   183     aPrevState.Exit( aCtxImpl );
       
   184     aCtxImpl.iCurrentMacState = &aNewState;
       
   185     aCtxImpl.iCurrentMacState->Entry( aCtxImpl );    
       
   186     }
       
   187 
       
   188 // ---------------------------------------------------------------------------
       
   189 // 
       
   190 // ---------------------------------------------------------------------------
       
   191 //
       
   192 void WlanMacActionState::ChangeState( 
       
   193     WlanContextImpl& aCtxImpl, 
       
   194     WlanDot11State& aPrevState,
       
   195     WlanDot11InfrastructureMode& aNewState )
       
   196     {
       
   197     aNewState.Dot11History( aPrevState );
       
   198 
       
   199 #ifndef NDEBUG 
       
   200     TUint8 length;
       
   201     const TUint8* ptr = reinterpret_cast<const TUint8*>
       
   202         (aNewState.GetStateName( length ));
       
   203     const TUint8* ptr2 = reinterpret_cast<const TUint8*>
       
   204         (aCtxImpl.iCurrentMacState->GetStateName( length ));
       
   205 
       
   206     OsTracePrint( KDot11StateTransit, (TUint8*)
       
   207         ("UMAC * dot11state to dot11-infrastructuremode traversal") );
       
   208     OsTracePrint( KDot11StateTransit, (TUint8*)("previous state:") );
       
   209     OsTracePrint( KDot11StateTransit, ptr2 );
       
   210     OsTracePrint( KDot11StateTransit, (TUint8*)("next state:") );
       
   211     OsTracePrint( KDot11StateTransit, ptr );
       
   212 #endif
       
   213 
       
   214     aPrevState.Exit( aCtxImpl );
       
   215     aCtxImpl.iCurrentMacState = &aNewState;
       
   216 
       
   217     // as we are entering dot11infrastructure mode we will
       
   218     // do the network specific configuration here
       
   219     OnDot11InfrastructureModeStateSpaceEntry( aCtxImpl );
       
   220 
       
   221     aCtxImpl.iCurrentMacState->Entry( aCtxImpl );    
       
   222     }
       
   223 
       
   224 // ---------------------------------------------------------------------------
       
   225 // 
       
   226 // ---------------------------------------------------------------------------
       
   227 //
       
   228 void WlanMacActionState::ChangeState( 
       
   229     WlanContextImpl& aCtxImpl, 
       
   230     WlanDot11InfrastructureMode& aPrevState,
       
   231     WlanDot11InfrastructureMode& aNewState )
       
   232     {
       
   233     aNewState.Dot11History( aPrevState );
       
   234 
       
   235 #ifndef NDEBUG 
       
   236     TUint8 length;
       
   237     const TUint8* ptr = reinterpret_cast<const TUint8*>
       
   238         (aNewState.GetStateName( length ));
       
   239     const TUint8* ptr2 = reinterpret_cast<const TUint8*>
       
   240         (aCtxImpl.iCurrentMacState->GetStateName( length ));
       
   241 
       
   242     OsTracePrint( KDot11StateTransit, (TUint8*)
       
   243         ("UMAC * dot11-infrastructuremode to dot11-infrastructuremode") );
       
   244     OsTracePrint( KDot11StateTransit, (TUint8*)("previous state:") );
       
   245     OsTracePrint( KDot11StateTransit, ptr2 );
       
   246     OsTracePrint( KDot11StateTransit, (TUint8*)("next state:") );
       
   247     OsTracePrint( KDot11StateTransit, ptr );
       
   248 #endif
       
   249 
       
   250     aPrevState.Exit( aCtxImpl );
       
   251     aCtxImpl.iCurrentMacState = &aNewState;
       
   252     aCtxImpl.iCurrentMacState->Entry( aCtxImpl );    
       
   253     }
       
   254 
       
   255 // ---------------------------------------------------------------------------
       
   256 // 
       
   257 // ---------------------------------------------------------------------------
       
   258 //
       
   259 void WlanMacActionState::ChangeState( 
       
   260     WlanContextImpl& aCtxImpl, 
       
   261     WlanDot11InfrastructureMode& aPrevState,
       
   262     WlanDot11State& aNewState )
       
   263     {
       
   264     aNewState.Dot11History( aPrevState );
       
   265 
       
   266 #ifndef NDEBUG 
       
   267     TUint8 length;
       
   268     const TUint8* ptr = reinterpret_cast<const TUint8*>
       
   269         (aNewState.GetStateName( length ));
       
   270     const TUint8* ptr2 = reinterpret_cast<const TUint8*>
       
   271         (aCtxImpl.iCurrentMacState->GetStateName( length ));
       
   272 
       
   273     OsTracePrint( KDot11StateTransit, (TUint8*)
       
   274         ("UMAC * dot11-infrastructuremode to dot11-state traversal") );
       
   275     OsTracePrint( KDot11StateTransit, (TUint8*)("previous state:") );
       
   276     OsTracePrint( KDot11StateTransit, ptr2 );
       
   277     OsTracePrint( KDot11StateTransit, (TUint8*)("next state:") );
       
   278     OsTracePrint( KDot11StateTransit, ptr );
       
   279 #endif
       
   280 
       
   281     aPrevState.Exit( aCtxImpl );
       
   282     aCtxImpl.iCurrentMacState = &aNewState;
       
   283 
       
   284     // as we are exiting dot11infrastructuremode state space 
       
   285     // we will do some magic here
       
   286     OnDot11InfrastructureModeStateSpaceExit( aCtxImpl );
       
   287 
       
   288     aCtxImpl.iCurrentMacState->Entry( aCtxImpl );    
       
   289     }
       
   290 
       
   291 // ---------------------------------------------------------------------------
       
   292 // 
       
   293 // ---------------------------------------------------------------------------
       
   294 //
       
   295 void WlanMacActionState::ChangeState( 
       
   296     WlanContextImpl& aCtxImpl, 
       
   297     WlanDot11State& aPrevState,
       
   298     WlanDot11IbssMode& aNewState )
       
   299     {
       
   300     aNewState.Dot11History( aPrevState );
       
   301 
       
   302 #ifndef NDEBUG 
       
   303     TUint8 length;
       
   304     const TUint8* ptr = reinterpret_cast<const TUint8*>
       
   305         (aNewState.GetStateName( length ));
       
   306     const TUint8* ptr2 = reinterpret_cast<const TUint8*>
       
   307         (aCtxImpl.iCurrentMacState->GetStateName( length ));
       
   308 
       
   309     OsTracePrint( KDot11StateTransit, 
       
   310         (TUint8*)("UMAC * dot11-state to dot11-ibssmode traversal") );
       
   311     OsTracePrint( KDot11StateTransit, (TUint8*)("previous state:") );
       
   312     OsTracePrint( KDot11StateTransit, ptr2 );
       
   313     OsTracePrint( KDot11StateTransit, (TUint8*)("next state:") );
       
   314     OsTracePrint( KDot11StateTransit, ptr );
       
   315 #endif
       
   316 
       
   317     aPrevState.Exit( aCtxImpl );
       
   318     aCtxImpl.iCurrentMacState = &aNewState;
       
   319 
       
   320     // as we are entering dot11ibssmode mode we will
       
   321     // do the network specific configuration here
       
   322     OnDot11IbssModeStateSpaceEntry( aCtxImpl );
       
   323 
       
   324     aCtxImpl.iCurrentMacState->Entry( aCtxImpl );      
       
   325     }
       
   326 
       
   327 // ---------------------------------------------------------------------------
       
   328 // 
       
   329 // ---------------------------------------------------------------------------
       
   330 //
       
   331 void WlanMacActionState::ChangeState( 
       
   332     WlanContextImpl& aCtxImpl, 
       
   333     WlanDot11IbssMode& aPrevState,
       
   334     WlanDot11IbssMode& aNewState )
       
   335     {
       
   336     aNewState.Dot11History( aPrevState );
       
   337 
       
   338 #ifndef NDEBUG 
       
   339     TUint8 length;
       
   340     const TUint8* ptr = reinterpret_cast<const TUint8*>
       
   341         (aNewState.GetStateName( length ));
       
   342     const TUint8* ptr2 = reinterpret_cast<const TUint8*>
       
   343         (aCtxImpl.iCurrentMacState->GetStateName( length ));
       
   344 
       
   345     OsTracePrint( KDot11StateTransit, 
       
   346         (TUint8*)("UMAC * dot11-ibssmode to dot11-ibssmode traversal") );
       
   347     OsTracePrint( KDot11StateTransit, (TUint8*)("previous state:") );
       
   348     OsTracePrint( KDot11StateTransit, ptr2 );
       
   349     OsTracePrint( KDot11StateTransit, (TUint8*)("next state:") );
       
   350     OsTracePrint( KDot11StateTransit, ptr );
       
   351 #endif
       
   352 
       
   353     aPrevState.Exit( aCtxImpl );
       
   354     aCtxImpl.iCurrentMacState = &aNewState;
       
   355     aCtxImpl.iCurrentMacState->Entry( aCtxImpl );    
       
   356     }
       
   357 
       
   358 // ---------------------------------------------------------------------------
       
   359 // 
       
   360 // ---------------------------------------------------------------------------
       
   361 //
       
   362 void WlanMacActionState::ChangeState( 
       
   363     WlanContextImpl& aCtxImpl, 
       
   364     WlanDot11IbssMode& aPrevState,
       
   365     WlanDot11State& aNewState )
       
   366     {
       
   367     aNewState.Dot11History( aPrevState );
       
   368 
       
   369 #ifndef NDEBUG 
       
   370     TUint8 length;
       
   371     const TUint8* ptr = reinterpret_cast<const TUint8*>
       
   372         (aNewState.GetStateName( length ));
       
   373     const TUint8* ptr2 = reinterpret_cast<const TUint8*>
       
   374         (aCtxImpl.iCurrentMacState->GetStateName( length ));
       
   375 
       
   376     OsTracePrint( KDot11StateTransit, 
       
   377         (TUint8*)("UMAC * dot11-ibssmode to dot11-state traversal") );
       
   378     OsTracePrint( KDot11StateTransit, (TUint8*)("previous state:") );
       
   379     OsTracePrint( KDot11StateTransit, ptr2 );
       
   380     OsTracePrint( KDot11StateTransit, (TUint8*)("next state:") );
       
   381     OsTracePrint( KDot11StateTransit, ptr );
       
   382 #endif
       
   383 
       
   384     aPrevState.Exit( aCtxImpl );
       
   385     aCtxImpl.iCurrentMacState = &aNewState;
       
   386 
       
   387     // as we are exiting dot11ibssmode state space 
       
   388     // we will do some magic here
       
   389     OnDot11IbssModeStateSpaceExit( aCtxImpl );
       
   390 
       
   391     aCtxImpl.iCurrentMacState->Entry( aCtxImpl );    
       
   392     }
       
   393 
       
   394 // ---------------------------------------------------------------------------
       
   395 // 
       
   396 // ---------------------------------------------------------------------------
       
   397 //
       
   398 void WlanMacActionState::OnWhaCommandResponse( 
       
   399     WlanContextImpl& /*aCtxImpl*/, 
       
   400     WHA::TCommandId /*aCommandId*/, 
       
   401     WHA::TStatus /*aStatus*/,
       
   402     const WHA::UCommandResponseParams& /*aCommandResponseParams*/,
       
   403     TUint32 /*aAct*/ )
       
   404     {
       
   405     // not supported in default handler
       
   406     OsAssert( (TUint8*)("UMAC * panic"), (TUint8*)(WLAN_FILE), __LINE__ );
       
   407     }
       
   408 
       
   409 // ---------------------------------------------------------------------------
       
   410 // 
       
   411 // ---------------------------------------------------------------------------
       
   412 //
       
   413 TBool WlanMacActionState::TxData( 
       
   414     WlanContextImpl& aCtxImpl,
       
   415     TDataBuffer& aDataBuffer,
       
   416     TBool aMore )
       
   417     {
       
   418     // only supported in dot11 state. so forward the call
       
   419     return iDot11HistoryState->TxData( aCtxImpl, aDataBuffer, aMore );
       
   420     }
       
   421 
       
   422 // ---------------------------------------------------------------------------
       
   423 // 
       
   424 // ---------------------------------------------------------------------------
       
   425 //
       
   426 void WlanMacActionState::TxMgmtData( 
       
   427     WlanContextImpl& aCtxImpl,
       
   428     TDataBuffer& aDataBuffer )
       
   429     {
       
   430     // only supported in dot11 state. so forward
       
   431     iDot11HistoryState->TxMgmtData( aCtxImpl, aDataBuffer );
       
   432     }
       
   433 
       
   434 // ---------------------------------------------------------------------------
       
   435 // 
       
   436 // ---------------------------------------------------------------------------
       
   437 //
       
   438 void WlanMacActionState::Indication( 
       
   439     WlanContextImpl& aCtxImpl, 
       
   440     WHA::TIndicationId aIndicationId,
       
   441     const WHA::UIndicationParams& aIndicationParams )
       
   442     {
       
   443     // only supported in dot11 state. so forward
       
   444     iDot11HistoryState->Indication( 
       
   445         aCtxImpl, 
       
   446         aIndicationId, 
       
   447         aIndicationParams );
       
   448     }
       
   449 
       
   450 // ---------------------------------------------------------------------------
       
   451 // 
       
   452 // ---------------------------------------------------------------------------
       
   453 //
       
   454 TAny* WlanMacActionState::RequestForBuffer( 
       
   455     WlanContextImpl& aCtxImpl,             
       
   456     TUint16 aLength )
       
   457     {
       
   458     // only supported in dot11 state. so forward
       
   459     return iDot11HistoryState->RequestForBuffer( 
       
   460         aCtxImpl, 
       
   461         aLength );
       
   462     }
       
   463 
       
   464 // ---------------------------------------------------------------------------
       
   465 // 
       
   466 // ---------------------------------------------------------------------------
       
   467 //
       
   468 void WlanMacActionState::ReceivePacket( 
       
   469             WlanContextImpl& aCtxImpl, 
       
   470             WHA::TStatus aStatus,
       
   471             const void* aFrame,
       
   472             TUint16 aLength,
       
   473             WHA::TRate aRate,
       
   474             WHA::TRcpi aRcpi,
       
   475             WHA::TChannelNumber aChannel,
       
   476             TUint8* aBuffer,
       
   477             TUint32 aFlags )
       
   478     {
       
   479     // only supported in dot11 state. so forward
       
   480     iDot11HistoryState->ReceivePacket( 
       
   481         aCtxImpl, 
       
   482         aStatus,
       
   483         aFrame,
       
   484         aLength,
       
   485         aRate,
       
   486         aRcpi,        
       
   487         aChannel,
       
   488         aBuffer,
       
   489         aFlags );
       
   490     }
       
   491 
       
   492 // ---------------------------------------------------------------------------
       
   493 // 
       
   494 // ---------------------------------------------------------------------------
       
   495 //
       
   496 void WlanMacActionState::OnPacketTransferComplete( 
       
   497     WlanContextImpl& aCtxImpl, 
       
   498     TUint32 aPacketId,
       
   499     TDataBuffer* aMetaHeader )
       
   500     {
       
   501     // only supported in dot11 state. so forward
       
   502     iDot11HistoryState->OnPacketTransferComplete( 
       
   503         aCtxImpl, 
       
   504         aPacketId, 
       
   505         aMetaHeader );
       
   506     }
       
   507 
       
   508 // ---------------------------------------------------------------------------
       
   509 // 
       
   510 // ---------------------------------------------------------------------------
       
   511 //
       
   512 void WlanMacActionState::OnPacketSendComplete(
       
   513     WlanContextImpl& aCtxImpl, 
       
   514     WHA::TStatus aStatus,
       
   515     TUint32 aPacketId,
       
   516     WHA::TRate aRate,
       
   517     TUint32 aPacketQueueDelay,
       
   518     TUint32 aMediaDelay,
       
   519     TUint aTotalTxDelay,
       
   520     TUint8 aAckFailures,
       
   521     WHA::TQueueId aQueueId,
       
   522     WHA::TRate aRequestedRate,
       
   523     TBool aMulticastData )
       
   524     {
       
   525     // only supported in dot11 state. so forward
       
   526     iDot11HistoryState->OnPacketSendComplete( 
       
   527         aCtxImpl, 
       
   528         aStatus, 
       
   529         aPacketId, 
       
   530         aRate, 
       
   531         aPacketQueueDelay,
       
   532         aMediaDelay,
       
   533         aTotalTxDelay,
       
   534         aAckFailures,
       
   535         aQueueId,
       
   536         aRequestedRate,
       
   537         aMulticastData );
       
   538     }
       
   539 
       
   540 // ---------------------------------------------------------------------------
       
   541 // 
       
   542 // ---------------------------------------------------------------------------
       
   543 //
       
   544 void WlanMacActionState::CallPacketSchedule( 
       
   545     WlanContextImpl& aCtxImpl,
       
   546     TBool aMore )
       
   547     {
       
   548     // only supported in dot11 state. so forward
       
   549     iDot11HistoryState->CallPacketSchedule( aCtxImpl, aMore );
       
   550     }
       
   551 
       
   552 // ---------------------------------------------------------------------------
       
   553 // 
       
   554 // ---------------------------------------------------------------------------
       
   555 //
       
   556 void WlanMacActionState::OnPacketPushPossible( 
       
   557     WlanContextImpl& aCtxImpl )
       
   558     {
       
   559     // only supported in dot11 state. so forward
       
   560     iDot11HistoryState->OnPacketPushPossible( aCtxImpl );
       
   561     }
       
   562 
       
   563 // ---------------------------------------------------------------------------
       
   564 // 
       
   565 // ---------------------------------------------------------------------------
       
   566 //
       
   567 void WlanMacActionState::OnDot11InfrastructureModeStateSpaceEntry( 
       
   568     WlanContextImpl& aCtxImpl )
       
   569     {
       
   570     OsTracePrint( KDot11StateTransit, (TUint8*)
       
   571         ("UMAC: WlanMacActionState::OnDot11InfrastructureModeStateSpaceEntry()") );
       
   572 
       
   573     // configure NULL data frame BSSID and DA addresses & to DS bit
       
   574     SNullDataFrame& null_data = aCtxImpl.NullDataFrame();
       
   575     null_data.iAddress1 = aCtxImpl.GetBssId();
       
   576     null_data.iAddress3 = aCtxImpl.GetBssId();
       
   577     null_data.SetToDsBit();
       
   578 
       
   579     // configure QoS NULL data frame BSSID and DA addresses & to DS bit
       
   580     SHtQosNullDataFrame& qosNullData = aCtxImpl.QosNullDataFrame();
       
   581     qosNullData.iQosDataFrameHdr.iHdr.iAddress1 = aCtxImpl.GetBssId();
       
   582     qosNullData.iQosDataFrameHdr.iHdr.iAddress3 = aCtxImpl.GetBssId();
       
   583     qosNullData.iQosDataFrameHdr.iHdr.SetToDsBit();
       
   584     // ... and order bit
       
   585     if ( aCtxImpl.HtSupportedByNw() )
       
   586         {
       
   587         // HT control field needs to be present => order bit needs to be set
       
   588         qosNullData.iQosDataFrameHdr.iHdr.SetOrderBit();
       
   589         }
       
   590     else
       
   591         {
       
   592         // HT control field won't be present => order bit needs to be cleared
       
   593         qosNullData.iQosDataFrameHdr.iHdr.ClearOrderBit();
       
   594         }
       
   595     
       
   596     // set the privacy mode filter
       
   597     aCtxImpl.SetActivePrivacyModeFilter( 
       
   598         aCtxImpl, aCtxImpl.EncryptionStatus() );
       
   599 
       
   600     // set frame Tx offsets
       
   601     SetMgmtSideTxOffsets( aCtxImpl );
       
   602     SetProtocolStackTxOffset( aCtxImpl );
       
   603     }
       
   604 
       
   605 // ---------------------------------------------------------------------------
       
   606 // 
       
   607 // ---------------------------------------------------------------------------
       
   608 //
       
   609 void WlanMacActionState::OnDot11InfrastructureModeStateSpaceExit( 
       
   610     WlanContextImpl& aCtxImpl ) const
       
   611     {
       
   612     // we are departing from dot11infrastructuremode state space
       
   613     
       
   614     OsTracePrint( KDot11StateTransit, 
       
   615         (TUint8*)("UMAC: WlanMacActionState::OnDot11InfrastructureModeStateSpaceExit()") );
       
   616 
       
   617     // reset current dot11 power management mode state.
       
   618     aCtxImpl.CurrentDot11PwrMgmtMode( WHA::KPsDisable );
       
   619     
       
   620     // reset the following items for the (potentially following) next roaming
       
   621     // connection
       
   622     aCtxImpl.ApTestOpportunitySeekStarted( EFalse );
       
   623     aCtxImpl.ApTestOpportunityIndicated( EFalse );
       
   624     
       
   625     // flush packet scheduler from all pending packets
       
   626     aCtxImpl.FlushPacketScheduler();
       
   627 
       
   628     // make sure that Voice over WLAN Call maintenance is not active
       
   629     aCtxImpl.StopVoiceOverWlanCallMaintenance();
       
   630     
       
   631     // stop keeping the WLAN connection alive
       
   632     aCtxImpl.StopKeepAlive();
       
   633     }
       
   634 
       
   635 // ---------------------------------------------------------------------------
       
   636 // 
       
   637 // ---------------------------------------------------------------------------
       
   638 //
       
   639 void WlanMacActionState::OnDot11IbssModeStateSpaceEntry( 
       
   640     WlanContextImpl& aCtxImpl ) const
       
   641     {
       
   642     OsTracePrint( KDot11StateTransit, 
       
   643         (TUint8*)("UMAC * dot11-ibssmode state space entry") );
       
   644 
       
   645     // set the privacy mode filter
       
   646     aCtxImpl.SetActivePrivacyModeFilter( 
       
   647         aCtxImpl, aCtxImpl.EncryptionStatus() );
       
   648 
       
   649     // set frame Tx offsets
       
   650     SetMgmtSideTxOffsets( aCtxImpl );
       
   651     SetProtocolStackTxOffset( aCtxImpl );
       
   652 
       
   653     // complete the user connect request
       
   654     OnOidComplete( aCtxImpl );
       
   655     }
       
   656 
       
   657 // ---------------------------------------------------------------------------
       
   658 // 
       
   659 // ---------------------------------------------------------------------------
       
   660 //
       
   661 void WlanMacActionState::OnDot11IbssModeStateSpaceExit( 
       
   662     WlanContextImpl& aCtxImpl ) const
       
   663     {
       
   664     OsTracePrint( KDot11StateTransit, 
       
   665         (TUint8*)("UMAC * dot11-ibssmode state space exit") );
       
   666 
       
   667     // as we are departing dot11ibssmode state space
       
   668     // flush packet scheduler from all pending packets
       
   669     aCtxImpl.FlushPacketScheduler();
       
   670     }
       
   671     
       
   672 // ---------------------------------------------------------------------------
       
   673 // 
       
   674 // ---------------------------------------------------------------------------
       
   675 //
       
   676 void WlanMacActionState::SetMgmtSideTxOffsets( 
       
   677     WlanContextImpl& aCtxImpl ) const
       
   678     {
       
   679     OsTracePrint( KUmacDetails, (TUint8*)
       
   680         ("UMAC: WlanMacActionState::SetMgmtSideTxOffsets") );
       
   681 
       
   682     TUint32 ethernetFrameTxOffset ( 0 );
       
   683     TUint32 dot11FrameTxOffset ( 0 );
       
   684     TUint32 snapFrameTxOffset ( 0 );
       
   685     
       
   686     DetermineTxOffsets( 
       
   687         aCtxImpl,
       
   688         ethernetFrameTxOffset,
       
   689         dot11FrameTxOffset,
       
   690         snapFrameTxOffset );
       
   691 
       
   692     aCtxImpl.iUmac.SetMgmtSideTxOffsets( 
       
   693         ethernetFrameTxOffset,
       
   694         dot11FrameTxOffset,
       
   695         snapFrameTxOffset );
       
   696     }