wlan_bearer/wlanldd/wlan_symbian/wlanldd_symbian/src/FrameXferBlock.cpp
changeset 0 c40eb8fe8501
child 22 c6a1762761b8
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2002-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 RFrameXferBlock class.
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 16 %
       
    20 */
       
    21 
       
    22 #include "WlLddWlanLddConfig.h"
       
    23 #include "FrameXferBlock.h"
       
    24 #include "wlanlddcommon.h"
       
    25 #include "algorithm.h"
       
    26 #include <kernel.h> // for Kern::SystemTime()
       
    27 
       
    28 
       
    29 // ---------------------------------------------------------------------------
       
    30 // 
       
    31 // ---------------------------------------------------------------------------
       
    32 //
       
    33 void RFrameXferBlockBase::KeInitialize()
       
    34     {
       
    35     iRxDataChunk = NULL;
       
    36 
       
    37     for ( TUint32 i = 0; i < KMaxCompletedRxBufs; ++i )
       
    38         {
       
    39         iRxCompletedBuffers[i] = 0;
       
    40         }
       
    41 
       
    42     for ( TUint j = 0; j < TDataBuffer::KFrameTypeMax; ++j )
       
    43         {
       
    44         iTxOffset[j] = 0;
       
    45         }
       
    46 
       
    47     iNumOfCompleted = 0;
       
    48     iCurrentRxBuffer = 0;
       
    49     iFirstRxBufferToFree = 0;    
       
    50     }
       
    51 
       
    52 // ---------------------------------------------------------------------------
       
    53 // 
       
    54 // ---------------------------------------------------------------------------
       
    55 //
       
    56 void RFrameXferBlockBase::KeRxComplete( 
       
    57     const TUint32* aRxCompletionBuffersArray, 
       
    58     TUint32 aNumOfCompleted )
       
    59     {
       
    60     if ( aNumOfCompleted > KMaxCompletedRxBufs )
       
    61         {
       
    62         os_assert( (TUint8*)("WLANLDD: panic"), (TUint8*)(WLAN_FILE), __LINE__ );
       
    63         }
       
    64 
       
    65     assign( aRxCompletionBuffersArray, iRxCompletedBuffers, aNumOfCompleted );
       
    66     iNumOfCompleted = aNumOfCompleted;
       
    67     iCurrentRxBuffer = 0;
       
    68     iFirstRxBufferToFree = 0;
       
    69 
       
    70     for ( TUint i = 0; i < iNumOfCompleted; ++i )
       
    71         {
       
    72         TraceDump( RX_FRAME, 
       
    73             (("WLANLDD: RFrameXferBlockBase::KeRxComplete: completed offset addr: 0x%08x"), 
       
    74             iRxCompletedBuffers[i]) );
       
    75         }    
       
    76     }
       
    77 
       
    78 // ---------------------------------------------------------------------------
       
    79 // 
       
    80 // ---------------------------------------------------------------------------
       
    81 //
       
    82 void RFrameXferBlockBase::KeGetHandledRxBuffers( 
       
    83     const TUint32*& aRxHandledBuffersArray, 
       
    84     TUint32& aNumOfHandled )
       
    85     { 
       
    86     TUint32 numHandled ( iCurrentRxBuffer - iFirstRxBufferToFree );
       
    87 
       
    88     // make sure that if an Rx buffer is currently being processed by the user
       
    89     // side client, that buffer is not regarded as being already handled
       
    90     numHandled = numHandled ? numHandled - 1 : numHandled;
       
    91     
       
    92     if ( numHandled )
       
    93         {
       
    94         aRxHandledBuffersArray = &(iRxCompletedBuffers[iFirstRxBufferToFree]);
       
    95         aNumOfHandled = numHandled;
       
    96         
       
    97         iFirstRxBufferToFree += numHandled;
       
    98         }
       
    99     }
       
   100 
       
   101 // ---------------------------------------------------------------------------
       
   102 // 
       
   103 // ---------------------------------------------------------------------------
       
   104 //
       
   105 void RFrameXferBlockBase::KeAllUserSideRxBuffersFreed()
       
   106     {
       
   107     iFirstRxBufferToFree = 0;
       
   108     // need to reset also the current index, so that the difference of these
       
   109     // two indexes is zero, and it then correctly indicates, that there are no
       
   110     // Rx buffers which could be freed incrementally
       
   111     iCurrentRxBuffer = 0;
       
   112     }
       
   113 
       
   114 // ---------------------------------------------------------------------------
       
   115 // 
       
   116 // ---------------------------------------------------------------------------
       
   117 //
       
   118 void RFrameXferBlockBase::KeSetTxOffsets( 
       
   119     TUint32 aEthernetFrameTxOffset,
       
   120     TUint32 aDot11FrameTxOffset,
       
   121     TUint32 aSnapFrameTxOffset )
       
   122     {
       
   123     iTxOffset[TDataBuffer::KEthernetFrame] = aEthernetFrameTxOffset;
       
   124     iTxOffset[TDataBuffer::KDot11Frame] = aDot11FrameTxOffset;
       
   125     iTxOffset[TDataBuffer::KSnapFrame] = aSnapFrameTxOffset;
       
   126     iTxOffset[TDataBuffer::KEthernetTestFrame] = aEthernetFrameTxOffset;
       
   127         
       
   128     for ( TUint i = 0; i < TDataBuffer::KFrameTypeMax ; ++i )
       
   129         {
       
   130         TraceDump( RX_FRAME, 
       
   131             (("WLANLDD: RFrameXferBlockBase::KeSetTxOffsets: offset: %d"), 
       
   132             iTxOffset[i]) );        
       
   133         }
       
   134     }
       
   135 
       
   136 // -----------------------------------------------------------------------------
       
   137 // 
       
   138 // -----------------------------------------------------------------------------
       
   139 //
       
   140 void RFrameXferBlockProtocolStack::Initialise()
       
   141     {
       
   142     // perform base class initialization
       
   143     KeInitialize();
       
   144     
       
   145     iThisAddrKernelSpace = reinterpret_cast<TUint32>(this);
       
   146     
       
   147     iVoiceTxQueue.DoInit();
       
   148     iVideoTxQueue.DoInit();
       
   149     iBestEffortTxQueue.DoInit();
       
   150     iBackgroundTxQueue.DoInit();
       
   151     iFreeQueue.DoInit();
       
   152 
       
   153     for ( TUint i = 0; i < KTxPoolSizeInPackets; i++ )
       
   154         {
       
   155         // Set the default values
       
   156         
       
   157         iDataBuffers[i].FrameType( TDataBuffer::KEthernetFrame );
       
   158         iDataBuffers[i].KeClearFlags( TDataBuffer::KTxFrameMustNotBeEncrypted );
       
   159         iDataBuffers[i].SetLength( 0 );
       
   160         iDataBuffers[i].SetUserPriority( 0 );
       
   161         
       
   162         iFreeQueue.PutPacket( &iDataBuffers[i] );
       
   163         }
       
   164     }
       
   165 
       
   166 // -----------------------------------------------------------------------------
       
   167 // 
       
   168 // -----------------------------------------------------------------------------
       
   169 //
       
   170 TDataBuffer* RFrameXferBlockProtocolStack::AllocTxBuffer( 
       
   171     const TUint8* aTxBuf,
       
   172     TUint16 aBufLength )
       
   173     {
       
   174     TDataBuffer* packet( NULL );
       
   175 
       
   176     if ( aTxBuf )
       
   177         {
       
   178         // Get Packet from Free Queue
       
   179         packet = iFreeQueue.GetPacket();
       
   180         
       
   181         TraceDump( NWSA_TX_DETAILS, 
       
   182             (("WLANLDD: RFrameXferBlockProtocolStack::AllocTxBuffer: krn metahdr addr: 0x%08x"), 
       
   183             packet) );
       
   184         
       
   185         if ( packet )
       
   186             {
       
   187             packet->KeSetBufferOffset( 
       
   188                 aTxBuf - reinterpret_cast<TUint8*>(packet) );
       
   189             
       
   190             packet->SetBufLength( aBufLength );
       
   191             
       
   192             // reserve appropriate amount of empty space before the Ethernet
       
   193             // frame so that there is space for all the necessary headers, including
       
   194             // the 802.11 MAC header 
       
   195             packet->KeSetOffsetToFrameBeginning( 
       
   196                 iTxOffset[TDataBuffer::KEthernetFrame] );
       
   197             
       
   198             // return the user space address
       
   199             packet = reinterpret_cast<TDataBuffer*>(
       
   200                 reinterpret_cast<TUint8*>(packet) - iUserToKernAddrOffset);
       
   201             }
       
   202         }
       
   203     
       
   204     TraceDump( NWSA_TX_DETAILS, 
       
   205         (("WLANLDD: RFrameXferBlockProtocolStack::AllocTxBuffer: user metahdr addr: 0x%08x"), 
       
   206         packet) );
       
   207     
       
   208     return packet;
       
   209     }
       
   210 
       
   211 // -----------------------------------------------------------------------------
       
   212 // 
       
   213 // -----------------------------------------------------------------------------
       
   214 //
       
   215 TBool RFrameXferBlockProtocolStack::AddTxFrame( 
       
   216     TDataBuffer* aPacketInUserSpace, 
       
   217     TDataBuffer*& aPacketInKernSpace,
       
   218     TBool aUserDataTxEnabled )
       
   219     {
       
   220     TBool ret( ETrue );
       
   221     aPacketInKernSpace = NULL;
       
   222     TDataBuffer* metaHdrInKernSpace ( reinterpret_cast<TDataBuffer*>(
       
   223         reinterpret_cast<TUint8*>(aPacketInUserSpace) + iUserToKernAddrOffset) );
       
   224     
       
   225     TraceDump( NWSA_TX_DETAILS, 
       
   226         (("WLANLDD: RFrameXferBlockProtocolStack::AddTxFrame: user metahdr addr: 0x%08x"), 
       
   227         aPacketInUserSpace));
       
   228 
       
   229     // put the packet to the correct Tx queue according to the priority to AC
       
   230     // mapping defined in WiFi WMM Specification v1.1
       
   231     
       
   232     if ( aPacketInUserSpace->UserPriority() == 7 || 
       
   233          aPacketInUserSpace->UserPriority() == 6 )
       
   234         {
       
   235         TraceDump( NWSA_TX_DETAILS, 
       
   236             (("WLANLDD: add to VO queue; krn metahdr addr: 0x%08x"), 
       
   237             reinterpret_cast<TUint32>(metaHdrInKernSpace)));
       
   238         
       
   239         ret = iVoiceTxQueue.PutPacket( metaHdrInKernSpace );
       
   240         
       
   241         if ( !ret )
       
   242             {
       
   243             aPacketInKernSpace = metaHdrInKernSpace;
       
   244             }
       
   245         
       
   246         ret = TxFlowControl( EVoice, aUserDataTxEnabled );
       
   247         }
       
   248     else if ( aPacketInUserSpace->UserPriority() == 5 || 
       
   249               aPacketInUserSpace->UserPriority() == 4 )
       
   250         {
       
   251         TraceDump( NWSA_TX_DETAILS, 
       
   252             (("WLANLDD: add to VI queue; krn metahdr addr: 0x%08x"), 
       
   253             reinterpret_cast<TUint32>(metaHdrInKernSpace)));
       
   254         
       
   255         ret = iVideoTxQueue.PutPacket( metaHdrInKernSpace );
       
   256         
       
   257         if ( !ret )
       
   258             {
       
   259             aPacketInKernSpace = metaHdrInKernSpace;
       
   260             }
       
   261         
       
   262         ret = TxFlowControl( EVideo, aUserDataTxEnabled );
       
   263         }
       
   264     else if ( aPacketInUserSpace->UserPriority() == 2 || 
       
   265               aPacketInUserSpace->UserPriority() == 1 )
       
   266         {
       
   267         TraceDump( NWSA_TX_DETAILS, 
       
   268             (("WLANLDD: add to BG queue; krn metahdr addr: 0x%08x"), 
       
   269             reinterpret_cast<TUint32>(metaHdrInKernSpace)));
       
   270         
       
   271         ret = iBackgroundTxQueue.PutPacket( metaHdrInKernSpace );
       
   272         
       
   273         if ( !ret )
       
   274             {
       
   275             aPacketInKernSpace = metaHdrInKernSpace;
       
   276             }
       
   277         
       
   278         ret = TxFlowControl( EBackGround, aUserDataTxEnabled );
       
   279         }
       
   280     else 
       
   281         {
       
   282         // user priority is 3 or 0 or invalid
       
   283         TraceDump( NWSA_TX_DETAILS, 
       
   284             (("WLANLDD: add to BE queue; krn metahdr addr: 0x%08x"), 
       
   285             reinterpret_cast<TUint32>(metaHdrInKernSpace)));
       
   286         
       
   287         ret = iBestEffortTxQueue.PutPacket( metaHdrInKernSpace );
       
   288         
       
   289         if ( !ret )
       
   290             {
       
   291             aPacketInKernSpace = metaHdrInKernSpace;
       
   292             }
       
   293         
       
   294         ret = TxFlowControl( ELegacy, aUserDataTxEnabled );
       
   295         }
       
   296 
       
   297     TraceDump( NWSA_TX_DETAILS, 
       
   298         (("WLANLDD: VO: %d packets"), 
       
   299         iVoiceTxQueue.GetLength()));
       
   300     TraceDump( NWSA_TX_DETAILS, 
       
   301         (("WLANLDD: VI: %d packets"), 
       
   302         iVideoTxQueue.GetLength()));
       
   303     TraceDump( NWSA_TX_DETAILS, 
       
   304         (("WLANLDD: BE: %d packets"), 
       
   305         iBestEffortTxQueue.GetLength()));
       
   306     TraceDump( NWSA_TX_DETAILS, 
       
   307         (("WLANLDD: BG: %d packets"), 
       
   308         iBackgroundTxQueue.GetLength()));
       
   309     
       
   310     return ret;
       
   311     }
       
   312 
       
   313 // -----------------------------------------------------------------------------
       
   314 // 
       
   315 // -----------------------------------------------------------------------------
       
   316 //
       
   317 TDataBuffer* RFrameXferBlockProtocolStack::GetTxFrame(
       
   318     const TWhaTxQueueState& aWhaTxQueueState,
       
   319     TBool& aMore )
       
   320     {
       
   321     TraceDump( NWSA_TX_DETAILS, 
       
   322         ("WLANLDD: RFrameXferBlockProtocolStack::GetTxFrame"));
       
   323     TraceDump( NWSA_TX_DETAILS, (("WLANLDD: VO: %d packets"), 
       
   324         iVoiceTxQueue.GetLength()));
       
   325     TraceDump( NWSA_TX_DETAILS, (("WLANLDD: VI: %d packets"), 
       
   326         iVideoTxQueue.GetLength()));
       
   327     TraceDump( NWSA_TX_DETAILS, (("WLANLDD: BE: %d packets"), 
       
   328         iBestEffortTxQueue.GetLength()));
       
   329     TraceDump( NWSA_TX_DETAILS, (("WLANLDD: BG: %d packets"), 
       
   330         iBackgroundTxQueue.GetLength()));
       
   331     
       
   332     TDataBuffer* packet = NULL;
       
   333     TQueueId queueId ( EQueueIdMax );
       
   334     
       
   335     if ( TxPossible( aWhaTxQueueState, queueId ) )
       
   336         {
       
   337         switch ( queueId )
       
   338             {
       
   339             case EVoice:
       
   340                 packet = iVoiceTxQueue.GetPacket();
       
   341                 break;
       
   342             case EVideo:
       
   343                 packet = iVideoTxQueue.GetPacket();
       
   344                 break;
       
   345             case ELegacy:
       
   346                 packet = iBestEffortTxQueue.GetPacket();
       
   347                 break;
       
   348             case EBackGround:
       
   349                 packet = iBackgroundTxQueue.GetPacket();
       
   350                 break;
       
   351 #ifndef NDEBUG
       
   352             default:
       
   353                 TraceDump(ERROR_LEVEL, (("WLANLDD: queueId: %d"), queueId));
       
   354                 os_assert( 
       
   355                     (TUint8*)("WLANLDD: panic"), 
       
   356                     (TUint8*)(WLAN_FILE), 
       
   357                     __LINE__ );
       
   358 #endif                
       
   359             }
       
   360         
       
   361         aMore = TxPossible( aWhaTxQueueState, queueId );
       
   362         }
       
   363     else
       
   364         {
       
   365         aMore = EFalse;        
       
   366         }
       
   367 
       
   368     TraceDump( NWSA_TX_DETAILS, (("WLANLDD: krn meta hdr: 0x%08x"), 
       
   369         reinterpret_cast<TUint32>(packet)));
       
   370     
       
   371     return packet;
       
   372     }
       
   373 
       
   374 // -----------------------------------------------------------------------------
       
   375 //
       
   376 // -----------------------------------------------------------------------------
       
   377 //
       
   378 TBool RFrameXferBlockProtocolStack::ResumeClientTx( 
       
   379     TBool aUserDataTxEnabled ) const
       
   380     {
       
   381     TBool ret ( EFalse );
       
   382 
       
   383     const TInt64 KTimeNow ( Kern::SystemTime() );
       
   384 
       
   385     if ( aUserDataTxEnabled )
       
   386         {
       
   387         // Note that in what follows below we want to consider resuming the
       
   388         // client Tx flow only based on the highest priority queue which is
       
   389         // currently active. In other words: if we find that some queue is
       
   390         // currently active but we don't want to resume the Tx flow yet
       
   391         // based on its situation, we must not consider resuming the Tx flow
       
   392         // based on any other queue with lower priority.
       
   393         
       
   394         if ( iVoiceTxQueue.IsActive( KTimeNow ) )
       
   395             {
       
   396             if ( iVoiceTxQueue.GetLength() < 
       
   397                  ( KVoiceTxQueueLen / 2 ) )
       
   398                 {
       
   399                 ret = ETrue;
       
   400                 }
       
   401             }
       
   402         else if ( iVideoTxQueue.IsActive( KTimeNow ) )
       
   403             {
       
   404             if ( iVideoTxQueue.GetLength() < 
       
   405                  ( KVideoTxQueueLen / 2 ) )
       
   406                 {
       
   407                 ret = ETrue;
       
   408                 }
       
   409             }
       
   410         else if ( iBestEffortTxQueue.IsActive( KTimeNow ) )
       
   411             {
       
   412             if ( iBestEffortTxQueue.GetLength() < 
       
   413                  ( KBestEffortTxQueueLen / 2 ) )
       
   414                 {
       
   415                 ret = ETrue;
       
   416                 }
       
   417             }
       
   418         else if ( iBackgroundTxQueue.IsActive( KTimeNow ) )
       
   419             {
       
   420             if ( iBackgroundTxQueue.GetLength() < 
       
   421                  ( KBackgroundTxQueueLen / 2 ) )
       
   422                 {
       
   423                 ret = ETrue;
       
   424                 }
       
   425             }
       
   426         else
       
   427             {
       
   428             // none of the Tx queues is currently active (meaning also that
       
   429             // they are all empty), but as this method was called, the
       
   430             // client Tx flow has to be currently stopped. So now - at the
       
   431             // latest - we need to resume the client Tx flow
       
   432             ret = ETrue;
       
   433             }
       
   434         }
       
   435     else
       
   436         {
       
   437         // as client Tx flow has been stopped and user data Tx is disabled
       
   438         // (which probably means that we are roaming), its not feasible to
       
   439         // resume the client Tx flow yet. So, no action needed; 
       
   440         // EFalse is returned
       
   441         }
       
   442     
       
   443 #ifndef NDEBUG
       
   444     if ( ret )
       
   445         {
       
   446         TraceDump( NWSA_TX, 
       
   447             ("WLANLDD: RFrameXferBlockProtocolStack::ResumeClientTx: resume flow from protocol stack"));            
       
   448         }
       
   449 #endif        
       
   450     
       
   451     return ret;
       
   452     }
       
   453 
       
   454 // -----------------------------------------------------------------------------
       
   455 // 
       
   456 // -----------------------------------------------------------------------------
       
   457 //
       
   458 TBool RFrameXferBlockProtocolStack::TxPossible(
       
   459     const TWhaTxQueueState& aWhaTxQueueState,
       
   460     TQueueId& aQueueId )
       
   461     {
       
   462     TBool txPossible ( ETrue );
       
   463     
       
   464     // In queue priority order, try to locate a Tx packet which is for a 
       
   465     // non-full WHA Tx queue
       
   466     
       
   467     if ( aWhaTxQueueState[EVoice] == ETxQueueNotFull && 
       
   468          !iVoiceTxQueue.IsEmpty() )
       
   469         {
       
   470         aQueueId = EVoice;
       
   471         
       
   472         TraceDump( NWSA_TX_DETAILS, 
       
   473             ("WLANLDD: RFrameXferBlockProtocolStack::TxPossible: from VO queue"));
       
   474         }
       
   475     else if ( aWhaTxQueueState[EVideo] == ETxQueueNotFull &&
       
   476               !iVideoTxQueue.IsEmpty() )
       
   477         {
       
   478         aQueueId = EVideo;
       
   479         
       
   480         TraceDump( NWSA_TX_DETAILS, 
       
   481             ("WLANLDD: RFrameXferBlockProtocolStack::TxPossible: from VI queue"));
       
   482         }
       
   483     else if ( aWhaTxQueueState[ELegacy] == ETxQueueNotFull &&
       
   484               !iBestEffortTxQueue.IsEmpty() )
       
   485         {
       
   486         aQueueId = ELegacy;
       
   487         
       
   488         TraceDump( NWSA_TX_DETAILS, 
       
   489             ("WLANLDD: RFrameXferBlockProtocolStack::TxPossible: from BE queue"));
       
   490         }
       
   491     else if ( aWhaTxQueueState[EBackGround] == ETxQueueNotFull &&
       
   492               !iBackgroundTxQueue.IsEmpty() )
       
   493         {
       
   494         aQueueId = EBackGround;
       
   495         
       
   496         TraceDump( NWSA_TX_DETAILS, 
       
   497             ("WLANLDD: RFrameXferBlockProtocolStack::TxPossible: from BG queue"));
       
   498         }
       
   499     else
       
   500         {
       
   501         txPossible = EFalse;
       
   502         
       
   503         TraceDump( NWSA_TX_DETAILS, 
       
   504             ("WLANLDD: RFrameXferBlockProtocolStack::TxPossible: no packet for a non-full wha queue"));
       
   505         }
       
   506     
       
   507     return txPossible;
       
   508     }
       
   509 
       
   510 // -----------------------------------------------------------------------------
       
   511 // 
       
   512 // -----------------------------------------------------------------------------
       
   513 //
       
   514 TBool RFrameXferBlockProtocolStack::TxFlowControl( 
       
   515     TQueueId aTxQueue, 
       
   516     TBool aUserDataTxEnabled )
       
   517     {
       
   518     TInt status ( ETrue );
       
   519     
       
   520     switch ( aTxQueue )
       
   521         {
       
   522         case EVoice:
       
   523             if ( iVoiceTxQueue.IsFull() )
       
   524                 {
       
   525                 status = EFalse;
       
   526                 }
       
   527             break;
       
   528         case EVideo:
       
   529             if ( iVideoTxQueue.IsFull() )
       
   530                 {
       
   531                 if ( !aUserDataTxEnabled )
       
   532                     {
       
   533                     status = EFalse;
       
   534                     }
       
   535                 else if ( !iVoiceTxQueue.IsActive( Kern::SystemTime() ) )
       
   536                     {
       
   537                     status = EFalse;
       
   538                     }
       
   539                 }
       
   540             break;
       
   541         case ELegacy:
       
   542             {
       
   543             const TInt64 KTimeNow ( Kern::SystemTime() );
       
   544             
       
   545             if ( iBestEffortTxQueue.IsFull() )
       
   546                 {
       
   547                 if ( !aUserDataTxEnabled )
       
   548                     {
       
   549                     status = EFalse;
       
   550                     }
       
   551                 else if ( !iVoiceTxQueue.IsActive( KTimeNow ) && 
       
   552                           !iVideoTxQueue.IsActive( KTimeNow ) )
       
   553                     {
       
   554                     status = EFalse;
       
   555                     }
       
   556                 }
       
   557             break;
       
   558             }
       
   559         case EBackGround:
       
   560             {
       
   561             const TInt64 KTimeNow ( Kern::SystemTime() );
       
   562             
       
   563             if ( iBackgroundTxQueue.IsFull() )
       
   564                 {
       
   565                 if ( !aUserDataTxEnabled )
       
   566                     {
       
   567                     status = EFalse;
       
   568                     }
       
   569                 else if ( !iVoiceTxQueue.IsActive( KTimeNow ) && 
       
   570                           !iVideoTxQueue.IsActive( KTimeNow ) && 
       
   571                           !iBestEffortTxQueue.IsActive( KTimeNow ) )
       
   572                     {
       
   573                     status = EFalse;
       
   574                     }
       
   575                 }
       
   576             break;
       
   577             }
       
   578 #ifndef NDEBUG
       
   579         default:
       
   580             TraceDump(ERROR_LEVEL, (("WLANLDD: aTxQueue: %d"), aTxQueue));
       
   581             os_assert( 
       
   582                 (TUint8*)("WLANLDD: panic"), 
       
   583                 (TUint8*)(WLAN_FILE), 
       
   584                 __LINE__ );
       
   585 #endif
       
   586         }
       
   587     
       
   588     return status;
       
   589     }