wlan_bearer/wlanldd/wlan_common/umac_common/src/umacnullsendcontroller.cpp
changeset 0 c40eb8fe8501
child 14 13838cf40350
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:   Implementation of the WlanNullSendController class
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 15 %
       
    20 */
       
    21 
       
    22 #include "config.h"
       
    23 #include "umacnullsendcontroller.h"
       
    24 #include "umacnullsender.h"
       
    25 #include "UmacContextImpl.h"
       
    26 
       
    27 
       
    28 // ================= MEMBER FUNCTIONS =======================
       
    29 
       
    30 
       
    31 // ---------------------------------------------------------------------------
       
    32 // 
       
    33 // ---------------------------------------------------------------------------
       
    34 //
       
    35 void WlanNullSendController::StartVoiceOverWlanCallMaintenance()
       
    36     {
       
    37     OsTracePrint( KUmacDetails, (TUint8*)
       
    38         ("UMAC: WlanNullSendController::StartVoiceOverWlanCallMaintenance") );
       
    39 
       
    40     iFlags |= KVoiceOverWlanCallMaintenanceStarted;
       
    41     
       
    42     if ( iFlags & KInVoiceCallState )
       
    43         {
       
    44         RegisterNoVoiceTimeout( iNoVoiceTimeout );
       
    45         
       
    46         if ( ( iWlanContextImpl.UapsdUsedForVoice() ) &&
       
    47              ( iWlanContextImpl.CurrentDot11PwrMgmtMode() == 
       
    48                WHA::KPsEnable ) )
       
    49             {
       
    50             // U-APSD is used for Voice and we are also in PS mode,
       
    51             // so initiate QoS Null Frame sending by arming the timer
       
    52             RegisterNullTimeout( iNullTimeout );
       
    53             }            
       
    54         }
       
    55     }
       
    56 
       
    57 // ---------------------------------------------------------------------------
       
    58 // 
       
    59 // ---------------------------------------------------------------------------
       
    60 //
       
    61 void WlanNullSendController::ResumeQosNullSending()
       
    62     {
       
    63     OsTracePrint( KUmacDetails, (TUint8*)
       
    64         ("UMAC: WlanNullSendController::ResumeQosNullSending") );                
       
    65 
       
    66     if ( ( iWlanContextImpl.UapsdUsedForVoice() )&&
       
    67          ( iFlags & KInVoiceCallState ) &&
       
    68          ( iWlanContextImpl.CurrentDot11PwrMgmtMode() == WHA::KPsEnable ) )
       
    69         {
       
    70         // U-APSD is used for Voice, we are in Voice Call state and in PS
       
    71         // mode, so resume QoS null frame sending by re-arming the timer
       
    72         RegisterNullTimeout( iNullTimeout );
       
    73         }
       
    74     }
       
    75 
       
    76 // ---------------------------------------------------------------------------
       
    77 // 
       
    78 // ---------------------------------------------------------------------------
       
    79 //
       
    80 void WlanNullSendController::OnFrameRx( 
       
    81     WHA::TQueueId aQueueId,
       
    82     TUint aPayloadLength )
       
    83     {
       
    84     OsTracePrint( KUmacDetails, (TUint8*)
       
    85         ("UMAC: WlanNullSendController::OnFrameRx entry: iFlags: 0x%08x"),
       
    86         iFlags );        
       
    87 
       
    88     if ( iFlags & KVoiceOverWlanCallMaintenanceStarted )
       
    89         {
       
    90         if ( iFlags & KInVoiceCallState )
       
    91             {
       
    92             // we are already in Voice Call state
       
    93 
       
    94             const TInt64 KTimeNow( os_systemTime() );
       
    95             
       
    96             if ( aQueueId == WHA::EVoice )
       
    97                 {
       
    98                 // and this is a Voice priority frame.
       
    99                 
       
   100                 iLatestVoiceRxOrTxInVoiceCallState = KTimeNow;
       
   101                 }
       
   102             else if ( ( aQueueId == WHA::ELegacy ) && 
       
   103                       ( aPayloadLength < 
       
   104                         iBestEffortVoiceRxLengthThreshold ) )
       
   105                 {
       
   106                 iBestEffortVoiceRxTimeStamp[iBestEffortVoiceRxInd] = KTimeNow;
       
   107                 iBestEffortVoiceRxInd = 
       
   108                     ( iBestEffortVoiceRxInd == 
       
   109                       KBestEffortVoiceRxTimeStampCnt - 1 ) ? 0 :
       
   110                       ++iBestEffortVoiceRxInd;
       
   111                 }
       
   112             else
       
   113                 {
       
   114                 // no action
       
   115                 }
       
   116             }
       
   117         else if ( iFlags & KVoiceCallEntryPending )
       
   118             {
       
   119             // we are in Voice Call Entry Pending state
       
   120 
       
   121             if ( aQueueId == WHA::EVoice )
       
   122                 {
       
   123                 // this is a Voice priority frame
       
   124                 
       
   125                 ++iVoiceCallEntryRxCount;
       
   126                 
       
   127                 OsTracePrint( KUmacDetails, (TUint8*)
       
   128                     ("UMAC: WlanNullSendController::OnFrameRx: iVoiceCallEntryRxCount is now: %d"),
       
   129                     iVoiceCallEntryRxCount );
       
   130     
       
   131                 if ( iVoiceCallEntryRxCount >= iVoiceCallEntryThreshold )
       
   132                     {
       
   133                     // We will enter the Voice Call state
       
   134                     EnterVoiceCallState();
       
   135                     }
       
   136                 }            
       
   137             }
       
   138         else
       
   139             {
       
   140             // we are neither in Voice Call Entry Pending nor Voice Call state
       
   141     
       
   142             if ( aQueueId == WHA::EVoice )
       
   143                 {
       
   144                 // this is a Voice priority frame. 
       
   145                 
       
   146                 // It is the 1st Voice priority frame in the period starting
       
   147                 // now
       
   148                 iVoiceCallEntryRxCount = 1;
       
   149                 iVoiceCallEntryTxCount = 0;
       
   150                 
       
   151                 // We enter the Voice Call Entry Pending state by arming
       
   152                 // the relevant timer
       
   153     
       
   154                 OsTracePrint( KUmacDetails, (TUint8*)
       
   155                     ("UMAC: WlanNullSendController::OnFrameRx: Enter Voice Call Entry pending state") );
       
   156     
       
   157                 RegisterVoiceCallEntryTimeout();
       
   158                 }
       
   159             }
       
   160         }
       
   161     }
       
   162 
       
   163 // ---------------------------------------------------------------------------
       
   164 // 
       
   165 // ---------------------------------------------------------------------------
       
   166 //
       
   167 void WlanNullSendController::OnFrameTx( WHA::TQueueId aQueueId )
       
   168     {
       
   169     OsTracePrint( KUmacDetails, (TUint8*)
       
   170         ("UMAC: WlanNullSendController::OnFrameTx entry: iFlags: 0x%08x"),
       
   171         iFlags );        
       
   172 
       
   173     iLatestTx = os_systemTime();
       
   174     
       
   175     if ( iFlags & KVoiceOverWlanCallMaintenanceStarted )
       
   176         {
       
   177         if ( iFlags & KInVoiceCallState )
       
   178             {
       
   179             // we are already in Voice Call state
       
   180 
       
   181             if ( aQueueId == WHA::EVoice )
       
   182                 {
       
   183                 // and this is a Voice priority frame.
       
   184                 
       
   185                 iLatestVoiceRxOrTxInVoiceCallState = iLatestTx;
       
   186                 }
       
   187             }
       
   188         else if ( iFlags & KVoiceCallEntryPending )
       
   189             {
       
   190             // we are in Voice Call Entry Pending state
       
   191 
       
   192             if ( aQueueId == WHA::EVoice )
       
   193                 {
       
   194                 // this is a Voice priority frame
       
   195                 
       
   196                 ++iVoiceCallEntryTxCount;
       
   197                 
       
   198                 OsTracePrint( KUmacDetails, (TUint8*)
       
   199                     ("UMAC: WlanNullSendController::OnFrameTx: iVoiceCallEntryTxCount is now: %d"),
       
   200                     iVoiceCallEntryTxCount );
       
   201 
       
   202                 if ( iVoiceCallEntryTxCount >= iVoiceCallEntryThreshold )
       
   203                     {
       
   204                     // We will enter the Voice Call state
       
   205                     EnterVoiceCallState();
       
   206                     }
       
   207                 }            
       
   208             }
       
   209         else
       
   210             {
       
   211             // we are neither in Voice Call Entry Pending nor Voice Call state
       
   212 
       
   213             if ( aQueueId == WHA::EVoice )
       
   214                 {
       
   215                 // this is a Voice priority frame. 
       
   216                 
       
   217                 // It is the 1st Voice priority frame in the period starting
       
   218                 // now
       
   219                 iVoiceCallEntryTxCount = 1;
       
   220                 iVoiceCallEntryRxCount = 0;
       
   221                                 
       
   222                 // We enter the Voice Call Entry Pending state by arming
       
   223                 // the relevant timer
       
   224 
       
   225                 OsTracePrint( KUmacDetails, (TUint8*)
       
   226                     ("UMAC: WlanNullSendController::OnFrameTx: Enter Voice Call Entry pending state") );
       
   227 
       
   228                 RegisterVoiceCallEntryTimeout();
       
   229                 }
       
   230             }
       
   231         }
       
   232     }
       
   233 
       
   234 // ---------------------------------------------------------------------------
       
   235 // 
       
   236 // ---------------------------------------------------------------------------
       
   237 //
       
   238 void WlanNullSendController::OnVoiceCallEntryTimerTimeout()
       
   239     {
       
   240     // as this timer expired we are no more in Voice Call Entry Pending state
       
   241     OsTracePrint( KUmacDetails, (TUint8*)
       
   242         ("UMAC: WlanNullSendController::OnVoiceCallEntryTimerTimeout: exit entry pending (to idle) state") );
       
   243     
       
   244     iFlags &= ~KVoiceCallEntryPending;
       
   245     }
       
   246 
       
   247 // ---------------------------------------------------------------------------
       
   248 // 
       
   249 // ---------------------------------------------------------------------------
       
   250 //
       
   251 void WlanNullSendController::OnNullTimerTimeout()
       
   252     {
       
   253     OsTracePrint( KUmacDetails, (TUint8*)
       
   254         ("UMAC: WlanNullSendController::OnNullTimerTimeout") );
       
   255     
       
   256     iFlags &= ~KNullTimerArmed;
       
   257 
       
   258     if ( iWlanContextImpl.CurrentDot11PwrMgmtMode() == WHA::KPsEnable )
       
   259         {        
       
   260         // we are still in PS mode (as we were when this timer was 
       
   261         // armed)
       
   262         
       
   263         TUint32 KTimeAfterLatestTx ( 
       
   264             static_cast<TUint32>(os_systemTime() - iLatestTx) );
       
   265         
       
   266         if ( KTimeAfterLatestTx >= iNullTimeout )
       
   267             {
       
   268             // request a QoS Null Data frame to be sent.
       
   269             // However, if there is a frame Tx (of any frame) already pending, 
       
   270             // we won't request a new frame to be sent. Note that it can really
       
   271             // be any frame, i.e. for any AC, as we currently always set all the
       
   272             // ACs as trigger enabled if U-APSD is used
       
   273             if ( !iWlanContextImpl.UnsentTxPackets() )
       
   274                 {
       
   275                 if ( !iNullSender.TxNullDataFrame( iWlanContextImpl, ETrue ) )
       
   276                     {
       
   277                     // frame was not sent because we didn't get a Tx buffer.
       
   278                     // In this case we'll skip the sending
       
   279                     // However, we need to re-arm the timer to trigger the next
       
   280                     // QoS Null Data frame sending
       
   281                     RegisterNullTimeout( iNullTimeout );
       
   282                     }
       
   283                 }
       
   284             else
       
   285                 {
       
   286                 // frame Tx already pending, so we don't ask a QoS Null to be sent
       
   287                 OsTracePrint( KUmacDetails, (TUint8*)
       
   288                     ("UMAC: WlanNullSendController::OnNullTimerTimeout: frame Tx already pending. New QoS Null Tx request skipped") );
       
   289                 
       
   290                 // However, we need to re-arm the timer to trigger the next
       
   291                 // QoS Null Data frame sending
       
   292                 RegisterNullTimeout( iNullTimeout );
       
   293                 }
       
   294             }
       
   295         else
       
   296             {
       
   297             // No need to send QoS Null; yet. Re-arm the timer with 
       
   298             // a suitable timeout relative to the time of the latest Tx
       
   299             // in QoS Null frame sending state
       
   300             RegisterNullTimeout( iNullTimeout - KTimeAfterLatestTx );
       
   301             }
       
   302         }
       
   303     }
       
   304 
       
   305 // ---------------------------------------------------------------------------
       
   306 // 
       
   307 // ---------------------------------------------------------------------------
       
   308 //
       
   309 void WlanNullSendController::OnQosNullDataTxCompleted()
       
   310     {
       
   311     OsTracePrint( KUmacDetails, (TUint8*)
       
   312         ("UMAC: WlanNullSendController::OnQosNullDataTxCompleted entry: iFlags: 0x%08x"),
       
   313         iFlags );
       
   314 
       
   315     if ( iFlags & KVoiceOverWlanCallMaintenanceStarted &&
       
   316          iFlags & KInVoiceCallState &&
       
   317          iWlanContextImpl.CurrentDot11PwrMgmtMode() == WHA::KPsEnable )
       
   318         {
       
   319         // we are doing Voice over WLAN Call maintenance, in Voice Call 
       
   320         // state and also in PS mode 
       
   321 
       
   322         // as the previous QoS Null Data, i.e. U-APSD Trigger, Frame has been
       
   323         // transmitted, re-arm the timer for the next round
       
   324         RegisterNullTimeout( iNullTimeout );
       
   325         }
       
   326 
       
   327     iLatestTx = os_systemTime();
       
   328     }
       
   329 
       
   330 // ---------------------------------------------------------------------------
       
   331 // 
       
   332 // ---------------------------------------------------------------------------
       
   333 //
       
   334 void WlanNullSendController::OnNoVoiceTimerTimeout()
       
   335     {
       
   336     OsTracePrint( KUmacDetails, (TUint8*)
       
   337         ("UMAC: WlanNullSendController::OnNoVoiceTimerTimeout entry: iFlags: 0x%08x"),
       
   338         iFlags );    
       
   339 
       
   340     iFlags &= ~KNoVoiceTimerArmed;
       
   341     const TInt64 KTimeNow( os_systemTime() );
       
   342     const TUint32 KTimeAfterLatestVoiceRxOrTxInVoiceCallState ( 
       
   343         static_cast<TUint32>(KTimeNow - 
       
   344                              iLatestVoiceRxOrTxInVoiceCallState) );
       
   345     
       
   346     if ( KTimeAfterLatestVoiceRxOrTxInVoiceCallState >= iNoVoiceTimeout )
       
   347         {
       
   348         // no real Voice priority traffic any more.
       
   349         
       
   350         // check if there still is traffic which may be Voice traffic
       
   351         // erroneously tagged as Best Effort priority 
       
   352         if ( KTimeNow -
       
   353              // the oldest time stamp of these frames that we have in our
       
   354              // records - or zero if such a time stamp doesn't exist
       
   355              iBestEffortVoiceRxTimeStamp[iBestEffortVoiceRxInd] > 
       
   356              iBestEffortVoiceRxTimeWindow )
       
   357             {
       
   358             // exit Voice Call state
       
   359             iFlags &= ~KInVoiceCallState;
       
   360         
       
   361             // Send voice call state change indication to engine
       
   362             iWlanContextImpl.iUmac.OnInDicationEvent( EVoiceCallOff );
       
   363     
       
   364             OsTracePrint( KUmacDetails, (TUint8*)
       
   365                 ("UMAC: WlanNullSendController::OnNoVoiceTimerTimeout: Exit Voice Call state") );
       
   366             
       
   367             // stop the possibly ongoing Null frame sending by canceling the 
       
   368             // Null timer
       
   369             CancelNullTimeout();
       
   370             }
       
   371         else
       
   372             {
       
   373             OsTracePrint( KUmacDetails, (TUint8*)
       
   374                 ("UMAC: WlanNullSendController::OnNoVoiceTimerTimeout: Continue in Voice Call state") );
       
   375             
       
   376             RegisterNoVoiceTimeout( iNoVoiceTimeout );
       
   377             }
       
   378         }
       
   379     else
       
   380         {
       
   381         // don't exit Voice Call state. Re-arm the timer instead with a 
       
   382         // suitable timeout relative to the latest Voice priority frame 
       
   383         // Rx or Tx in Voice Call state 
       
   384         RegisterNoVoiceTimeout( 
       
   385             iNoVoiceTimeout - KTimeAfterLatestVoiceRxOrTxInVoiceCallState );        
       
   386         }
       
   387     }
       
   388 
       
   389 // ---------------------------------------------------------------------------
       
   390 // 
       
   391 // ---------------------------------------------------------------------------
       
   392 //
       
   393 void WlanNullSendController::OnKeepAliveTimerTimeout()
       
   394     {
       
   395     OsTracePrint( KUmacDetails, (TUint8*)
       
   396         ("UMAC: WlanNullSendController::OnKeepAliveTimerTimeout") );
       
   397     
       
   398     iFlags &= ~KKeepAliveTimerArmed;
       
   399 
       
   400     TUint32 KTimeAfterLatestTx ( 
       
   401         static_cast<TUint32>(os_systemTime() - iLatestTx) );
       
   402     
       
   403     if ( KTimeAfterLatestTx >= iKeepAliveTimeout )
       
   404         {
       
   405         // request a regular Null Data frame to be sent
       
   406     
       
   407         // however, if there is a frame Tx (of any frame) already pending, 
       
   408         // we won't request a new frame to be sent. 
       
   409         if ( !iWlanContextImpl.UnsentTxPackets() )
       
   410             {
       
   411             if ( !iNullSender.TxNullDataFrame( iWlanContextImpl, EFalse ) )
       
   412                 {
       
   413                 // frame was not sent because we didn't get a Tx buffer.
       
   414                 // In this case we'll skip the sending
       
   415                 // However, we need to re-arm the timer to trigger the next
       
   416                 // Null Data frame sending
       
   417                 RegisterKeepAliveTimeout( iKeepAliveTimeout );
       
   418                 }
       
   419             }
       
   420         else
       
   421             {
       
   422             // frame Tx already pending, so we don't ask a Null Data to be sent
       
   423             OsTracePrint( KUmacDetails, (TUint8*)
       
   424                 ("UMAC: WlanNullSendController::OnKeepAliveTimerTimeout: frame Tx already pending. New Null Data Tx request skipped") );
       
   425             
       
   426             // However, we need to re-arm the timer to trigger the next
       
   427             // Null Data frame sending
       
   428             RegisterKeepAliveTimeout( iKeepAliveTimeout );
       
   429             }
       
   430         }
       
   431     else
       
   432         {
       
   433         // No need to send keep alive; yet. Re-arm the timer with 
       
   434         // a suitable timeout relative to the time of the latest frame Tx
       
   435         RegisterKeepAliveTimeout( iKeepAliveTimeout - KTimeAfterLatestTx );        
       
   436         }
       
   437     }
       
   438 
       
   439 // ---------------------------------------------------------------------------
       
   440 // 
       
   441 // ---------------------------------------------------------------------------
       
   442 //
       
   443 void WlanNullSendController::RegisterVoiceCallEntryTimeout()
       
   444     {
       
   445     CancelVoiceCallEntryTimeout();
       
   446 
       
   447     iWlanContextImpl.iUmac.RegisterTimeout( 
       
   448         iVoiceCallEntryTimeout, 
       
   449         EWlanVoiceCallEntryTimer );
       
   450 
       
   451     iFlags |= KVoiceCallEntryPending;
       
   452 
       
   453     OsTracePrint( KUmacDetails, (TUint8*)
       
   454         ("UMAC: WlanNullSendController::RegisterVoiceCallEntryTimeout: timer armed") );
       
   455     }
       
   456 
       
   457 
       
   458 // ---------------------------------------------------------------------------
       
   459 // 
       
   460 // ---------------------------------------------------------------------------
       
   461 //
       
   462 void WlanNullSendController::RegisterNullTimeout( 
       
   463     TUint32 aTimeoutInMicroSeconds )
       
   464     {
       
   465     CancelNullTimeout();
       
   466 
       
   467     iWlanContextImpl.iUmac.RegisterTimeout( 
       
   468         aTimeoutInMicroSeconds, 
       
   469         EWlanNullTimer );
       
   470 
       
   471     iFlags |= KNullTimerArmed;
       
   472 
       
   473     OsTracePrint( KUmacDetails, (TUint8*)
       
   474         ("UMAC: WlanNullSendController::RegisterNullTimeout: timer armed") );
       
   475     }
       
   476 
       
   477 // ---------------------------------------------------------------------------
       
   478 // 
       
   479 // ---------------------------------------------------------------------------
       
   480 //
       
   481 void WlanNullSendController::RegisterNoVoiceTimeout( 
       
   482     TUint32 aTimeoutInMicroSeconds )
       
   483     {
       
   484     CancelNoVoiceTimeout();
       
   485     
       
   486     iWlanContextImpl.iUmac.RegisterTimeout( aTimeoutInMicroSeconds, 
       
   487                                             EWlanNoVoiceTimer );
       
   488     iFlags |= KNoVoiceTimerArmed;                                            
       
   489 
       
   490     OsTracePrint( KUmacDetails, (TUint8*)
       
   491         ("UMAC: WlanNullSendController::RegisterNoVoiceTimeout: timer armed") );
       
   492     }
       
   493 
       
   494 // ---------------------------------------------------------------------------
       
   495 // 
       
   496 // ---------------------------------------------------------------------------
       
   497 //
       
   498 void WlanNullSendController::RegisterKeepAliveTimeout( 
       
   499     TUint32 aTimeoutInMicroSeconds )
       
   500     {
       
   501     CancelKeepAliveTimeout();
       
   502 
       
   503     iWlanContextImpl.iUmac.RegisterTimeout( aTimeoutInMicroSeconds, 
       
   504                                             EWlanKeepAliveTimer );
       
   505 
       
   506     iFlags |= KKeepAliveTimerArmed;
       
   507 
       
   508     OsTracePrint( KUmacDetails, (TUint8*)
       
   509         ("UMAC: WlanNullSendController::RegisterKeepAliveTimeout: timer armed") );
       
   510     }
       
   511 
       
   512 // ---------------------------------------------------------------------------
       
   513 // 
       
   514 // ---------------------------------------------------------------------------
       
   515 //
       
   516 void WlanNullSendController::CancelVoiceCallEntryTimeout()
       
   517     {
       
   518     if ( iFlags & KVoiceCallEntryPending )
       
   519         {
       
   520         iWlanContextImpl.iUmac.CancelTimeout( EWlanVoiceCallEntryTimer );        
       
   521         
       
   522         iFlags &= ~KVoiceCallEntryPending;
       
   523 
       
   524         OsTracePrint( KUmacDetails, (TUint8*)
       
   525             ("UMAC: WlanNullSendController::CancelVoiceCallEntryTimeout: timer cancelled") );
       
   526         }
       
   527     }
       
   528 
       
   529 // ---------------------------------------------------------------------------
       
   530 // 
       
   531 // ---------------------------------------------------------------------------
       
   532 //
       
   533 void WlanNullSendController::CancelNullTimeout()
       
   534     {
       
   535     if ( iFlags & KNullTimerArmed )
       
   536         {
       
   537         iWlanContextImpl.iUmac.CancelTimeout( EWlanNullTimer );        
       
   538         
       
   539         iFlags &= ~KNullTimerArmed;
       
   540 
       
   541         OsTracePrint( KUmacDetails, (TUint8*)
       
   542             ("UMAC: WlanNullSendController::CancelNullTimeout: timer cancelled") );
       
   543         }
       
   544     }
       
   545 
       
   546 // ---------------------------------------------------------------------------
       
   547 // 
       
   548 // ---------------------------------------------------------------------------
       
   549 //
       
   550 void WlanNullSendController::CancelNoVoiceTimeout()
       
   551     {
       
   552     if ( iFlags & KNoVoiceTimerArmed )
       
   553         {
       
   554         iWlanContextImpl.iUmac.CancelTimeout( EWlanNoVoiceTimer );    
       
   555         
       
   556         iFlags &= ~KNoVoiceTimerArmed;
       
   557 
       
   558         OsTracePrint( KUmacDetails, (TUint8*)
       
   559             ("UMAC: WlanNullSendController::CancelNoVoiceTimeout: timer cancelled") );
       
   560         }
       
   561     }
       
   562 
       
   563 // ---------------------------------------------------------------------------
       
   564 // 
       
   565 // ---------------------------------------------------------------------------
       
   566 //
       
   567 void WlanNullSendController::CancelKeepAliveTimeout()
       
   568     {
       
   569     if ( iFlags & KKeepAliveTimerArmed )
       
   570         {
       
   571         iWlanContextImpl.iUmac.CancelTimeout( EWlanKeepAliveTimer );        
       
   572         
       
   573         iFlags &= ~KKeepAliveTimerArmed;
       
   574 
       
   575         OsTracePrint( KUmacDetails, (TUint8*)
       
   576             ("UMAC: WlanNullSendController::CancelKeepAliveTimeout: timer cancelled") );
       
   577         }
       
   578     }
       
   579 
       
   580 // ---------------------------------------------------------------------------
       
   581 // 
       
   582 // ---------------------------------------------------------------------------
       
   583 //
       
   584 void WlanNullSendController::EnterVoiceCallState()
       
   585     {
       
   586     OsTracePrint( KUmacDetails, (TUint8*)
       
   587         ("UMAC: WlanNullSendController::EnterVoiceCallState") );
       
   588 
       
   589     CancelVoiceCallEntryTimeout();
       
   590 
       
   591     iFlags |= KInVoiceCallState;
       
   592 
       
   593     // Send voice call state change indication to engine
       
   594     iWlanContextImpl.iUmac.OnInDicationEvent( EVoiceCallOn );
       
   595 
       
   596     // arm the No Voice timer so that we also exit the Voice Call
       
   597     // state at some point
       
   598     iLatestVoiceRxOrTxInVoiceCallState = os_systemTime();
       
   599     RegisterNoVoiceTimeout( iNoVoiceTimeout );
       
   600     
       
   601     if ( ( iWlanContextImpl.UapsdUsedForVoice() ) &&
       
   602          ( iWlanContextImpl.CurrentDot11PwrMgmtMode() == WHA::KPsEnable ) )
       
   603         {
       
   604         // U-APSD is used for Voice and we are also in PS mode,
       
   605         // so initiate QoS Null Frame sending by arming the timer
       
   606         RegisterNullTimeout( iNullTimeout );                        
       
   607         }
       
   608     }