wlan_bearer/wlanldd/wlan_symbian/wlanldd_symbian/src/EthernetFrameMemMngr.cpp
branchRCL_3
changeset 3 6524e815f76f
parent 0 c40eb8fe8501
child 22 c6a1762761b8
equal deleted inserted replaced
0:c40eb8fe8501 3:6524e815f76f
     1 /*
     1 /*
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2002-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 DEthernetFrameMemMngr class.
    14 * Description:   Implementation of the DEthernetFrameMemMngr class.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 /*
    18 /*
    19 * %version: 23 %
    19 * %version: 24 %
    20 */
    20 */
    21 
    21 
    22 #include "WlLddWlanLddConfig.h"
    22 #include "WlLddWlanLddConfig.h"
    23 #include "DataFrameMemMngr.h"
    23 #include "DataFrameMemMngr.h"
    24 #include "MgmtFrameMemMngr.h"
    24 #include "MgmtFrameMemMngr.h"
   166 // 
   166 // 
   167 // ---------------------------------------------------------------------------
   167 // ---------------------------------------------------------------------------
   168 //
   168 //
   169 DEthernetFrameMemMngr::~DEthernetFrameMemMngr()
   169 DEthernetFrameMemMngr::~DEthernetFrameMemMngr()
   170     {
   170     {
   171     OnReleaseMemory();
   171     MarkMemFree();
   172     
   172     
   173     iFrameXferBlock = NULL;
   173     iFrameXferBlock = NULL;
   174     iTxDataBuffer = NULL;
   174     iTxDataBuffer = NULL;
   175     iRxDataChunk = NULL;
   175     iRxDataChunk = NULL;
   176     }
       
   177 
       
   178 // ---------------------------------------------------------------------------
       
   179 // 
       
   180 // ---------------------------------------------------------------------------
       
   181 //
       
   182 void DEthernetFrameMemMngr::OnReleaseMemory()
       
   183     {
       
   184     MarkMemFree();      // mark as free
       
   185     }
   176     }
   186 
   177 
   187 // ---------------------------------------------------------------------------
   178 // ---------------------------------------------------------------------------
   188 // 
   179 // 
   189 // ---------------------------------------------------------------------------
   180 // ---------------------------------------------------------------------------
   418 TBool DEthernetFrameMemMngr::AddTxFrame( 
   409 TBool DEthernetFrameMemMngr::AddTxFrame( 
   419     TDataBuffer* aPacketInUserSpace, 
   410     TDataBuffer* aPacketInUserSpace, 
   420     TDataBuffer*& aPacketInKernSpace,
   411     TDataBuffer*& aPacketInKernSpace,
   421     TBool aUserDataTxEnabled )
   412     TBool aUserDataTxEnabled )
   422     {
   413     {
   423     return (static_cast<RFrameXferBlockProtocolStack*>(
   414     if ( IsMemInUse() )
   424         iFrameXferBlock))->AddTxFrame( 
   415         {
   425             aPacketInUserSpace, 
   416         return (static_cast<RFrameXferBlockProtocolStack*>(
   426             aPacketInKernSpace,
   417             iFrameXferBlock))->AddTxFrame( 
   427             aUserDataTxEnabled );
   418                 aPacketInUserSpace, 
       
   419                 aPacketInKernSpace,
       
   420                 aUserDataTxEnabled );
       
   421         }
       
   422     else
       
   423         {
       
   424         return EFalse;
       
   425         }
   428     }
   426     }
   429 
   427 
   430 // ---------------------------------------------------------------------------
   428 // ---------------------------------------------------------------------------
   431 // 
   429 // 
   432 // ---------------------------------------------------------------------------
   430 // ---------------------------------------------------------------------------
   433 //
   431 //
   434 TDataBuffer* DEthernetFrameMemMngr::GetTxFrame( 
   432 TDataBuffer* DEthernetFrameMemMngr::GetTxFrame( 
   435     const TWhaTxQueueState& aTxQueueState,
   433     const TWhaTxQueueState& aTxQueueState,
   436     TBool& aMore )
   434     TBool& aMore )
   437     {
   435     {
   438     if ( IsMemInUse() )
   436     if ( IsMemInUse() && iFrameXferBlock )
   439         {
   437         {
   440         return (static_cast<RFrameXferBlockProtocolStack*>(
   438         return (static_cast<RFrameXferBlockProtocolStack*>(
   441             iFrameXferBlock))->GetTxFrame( aTxQueueState, aMore );
   439             iFrameXferBlock))->GetTxFrame( aTxQueueState, aMore );
   442         }
   440         }
   443     else
   441     else
       
   442         {
   444         return NULL;
   443         return NULL;
       
   444         }
   445     }
   445     }
   446 
   446 
   447 // ---------------------------------------------------------------------------
   447 // ---------------------------------------------------------------------------
   448 // 
   448 // 
   449 // ---------------------------------------------------------------------------
   449 // ---------------------------------------------------------------------------