wlan_bearer/wlanldd/wlan_symbian/wlanldd_symbian/src/WlanLogicalChannel.cpp
branchRCL_3
changeset 3 6524e815f76f
parent 0 c40eb8fe8501
child 10 0abc8c98be24
equal deleted inserted replaced
0:c40eb8fe8501 3:6524e815f76f
     1 /*
     1 /*
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    14 * Description:   Implementation of the DWlanLogicalChannel class.
    14 * Description:   Implementation of the DWlanLogicalChannel class.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 /*
    18 /*
    19 * %version: 56 %
    19 * %version: 57 %
    20 */
    20 */
    21 
    21 
    22 #include "WlLddWlanLddConfig.h"
    22 #include "WlLddWlanLddConfig.h"
    23 #include "wlanlddcommon.h"
    23 #include "wlanlddcommon.h"
    24 #include "WlanLogicalChannel.h"
    24 #include "WlanLogicalChannel.h"
   194         }
   194         }
   195 
   195 
   196     if ( iEthernetFrameMemMngr )
   196     if ( iEthernetFrameMemMngr )
   197         {
   197         {
   198         TraceDump(INIT_LEVEL, ("WLANLDD: deallocate ethernet frame memory pool"));
   198         TraceDump(INIT_LEVEL, ("WLANLDD: deallocate ethernet frame memory pool"));
       
   199         
       
   200         // normally the user side client will do this, but just to be on 
       
   201         // the safe side, make sure it really is done before proceeding with
       
   202         // frame memory mgr destruction
       
   203         OnReleaseEthernetFrameBuffers();
       
   204         
   199         TraceDump(MEMORY, (("WLANLDD: delete DEthernetFrameMemMngr: 0x%08x"), 
   205         TraceDump(MEMORY, (("WLANLDD: delete DEthernetFrameMemMngr: 0x%08x"), 
   200         reinterpret_cast<TUint32>(iEthernetFrameMemMngr)));        
   206         reinterpret_cast<TUint32>(iEthernetFrameMemMngr)));        
   201     
   207     
   202         delete iEthernetFrameMemMngr;
   208         delete iEthernetFrameMemMngr;
   203         iEthernetFrameMemMngr = NULL;
   209         iEthernetFrameMemMngr = NULL;
   842 // 
   848 // 
   843 // ---------------------------------------------------------------------------
   849 // ---------------------------------------------------------------------------
   844 //
   850 //
   845 void DWlanLogicalChannel::UserDataReEnabled()
   851 void DWlanLogicalChannel::UserDataReEnabled()
   846     {
   852     {
   847     if ( !( iFlags & KTxTriggerArmed ) )
   853     if ( ProtocolStackSideClientReady() &&
       
   854          !( iFlags & KTxTriggerArmed ) )
   848         {
   855         {
   849         iFlags |= KTxTriggerArmed;
   856         iFlags |= KTxTriggerArmed;
   850         iTxTriggerDfc.Enque();
   857         iTxTriggerDfc.Enque();
   851         }
   858         }
   852     }
   859     }
   933     // We try to submit Protocol Stack side frames also when this event occurs
   940     // We try to submit Protocol Stack side frames also when this event occurs
   934     // a) to speed up new Tx submission in the case that a frame submitted by
   941     // a) to speed up new Tx submission in the case that a frame submitted by
   935     // someone else than the Protocol Stack Side Client unblocks the WHA Tx
   942     // someone else than the Protocol Stack Side Client unblocks the WHA Tx
   936     // pipeline and
   943     // pipeline and
   937     // b) to avoid the Tx pipe from getting stuck even temporarily
   944     // b) to avoid the Tx pipe from getting stuck even temporarily
   938     if ( !( iFlags & KTxTriggerArmed ) )
   945     if ( ProtocolStackSideClientReady() &&
       
   946          !( iFlags & KTxTriggerArmed ) )
   939         {
   947         {
   940         iFlags |= KTxTriggerArmed;
   948         iFlags |= KTxTriggerArmed;
   941         iTxTriggerDfc.Enque(); // we do this via a DFC
   949         iTxTriggerDfc.Enque(); // we do this via a DFC
   942         }
   950         }
   943     }
   951     }
   955     // a) to speed up new Tx submission in the case that a frame, submitted by
   963     // a) to speed up new Tx submission in the case that a frame, submitted by
   956     // someone else than the Protocol Stack Side Client, gets transmitted &
   964     // someone else than the Protocol Stack Side Client, gets transmitted &
   957     // makes a WHA Txqueue - for which there are packets pending in our Tx 
   965     // makes a WHA Txqueue - for which there are packets pending in our Tx 
   958     // queues - non-full
   966     // queues - non-full
   959     // b) to avoid the Tx pipe from getting stuck even temporarily
   967     // b) to avoid the Tx pipe from getting stuck even temporarily
   960     if ( !( iFlags & KTxTriggerArmed ) )
   968     if ( ProtocolStackSideClientReady() &&
       
   969          !( iFlags & KTxTriggerArmed ) )
   961         {
   970         {
   962         iFlags |= KTxTriggerArmed;
   971         iFlags |= KTxTriggerArmed;
   963         iTxTriggerDfc.Enque(); // we do this via a DFC
   972         iTxTriggerDfc.Enque(); // we do this via a DFC
   964         }
   973         }
   965     }
   974     }
   999         {
  1008         {
  1000         TWhaTxQueueState txQueueState;
  1009         TWhaTxQueueState txQueueState;
  1001         TBool morePackets ( EFalse );
  1010         TBool morePackets ( EFalse );
  1002         iTxActive = ETrue;
  1011         iTxActive = ETrue;
  1003         
  1012         
  1004         while ( iUmac.TxPermitted( txQueueState ) )
  1013         while ( iUmac.TxPermitted( txQueueState ) && iEthernetFrameMemMngr )
  1005             {
  1014             {
  1006             TDataBuffer* metaHeader = 
  1015             TDataBuffer* metaHeader = 
  1007                 iEthernetFrameMemMngr->GetTxFrame( txQueueState, morePackets );
  1016                 iEthernetFrameMemMngr->GetTxFrame( txQueueState, morePackets );
  1008             
  1017             
  1009             if ( metaHeader )
  1018             if ( metaHeader )
  1601 //
  1610 //
  1602 void DWlanLogicalChannel::OnReleaseEthernetFrameBuffers()
  1611 void DWlanLogicalChannel::OnReleaseEthernetFrameBuffers()
  1603     {
  1612     {
  1604     if ( iEthernetFrameMemMngr )
  1613     if ( iEthernetFrameMemMngr )
  1605         {
  1614         {
  1606         iEthernetFrameMemMngr->OnReleaseMemory();    
  1615         iEthernetFrameMemMngr->OnReleaseMemory( *iClient );    
  1607         }
  1616         }
  1608     }
  1617     }
  1609 
  1618 
  1610 // ---------------------------------------------------------------------------
  1619 // ---------------------------------------------------------------------------
  1611 // 
  1620 //