wlan_bearer/wlanldd/wlan_symbian/wlanldd_symbian/src/EthernetFrameMemMngr.cpp
branchRCL_3
changeset 3 6524e815f76f
parent 0 c40eb8fe8501
child 22 c6a1762761b8
--- a/wlan_bearer/wlanldd/wlan_symbian/wlanldd_symbian/src/EthernetFrameMemMngr.cpp	Tue Feb 02 02:03:13 2010 +0200
+++ b/wlan_bearer/wlanldd/wlan_symbian/wlanldd_symbian/src/EthernetFrameMemMngr.cpp	Sat Feb 20 00:38:18 2010 +0200
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: 23 %
+* %version: 24 %
 */
 
 #include "WlLddWlanLddConfig.h"
@@ -168,7 +168,7 @@
 //
 DEthernetFrameMemMngr::~DEthernetFrameMemMngr()
     {
-    OnReleaseMemory();
+    MarkMemFree();
     
     iFrameXferBlock = NULL;
     iTxDataBuffer = NULL;
@@ -179,15 +179,6 @@
 // 
 // ---------------------------------------------------------------------------
 //
-void DEthernetFrameMemMngr::OnReleaseMemory()
-    {
-    MarkMemFree();      // mark as free
-    }
-
-// ---------------------------------------------------------------------------
-// 
-// ---------------------------------------------------------------------------
-//
 TDataBuffer* DEthernetFrameMemMngr::OnWriteEthernetFrame() const
     {
     if ( iTxDataBuffer->GetLength() >= sizeof( SEthernetHeader ) )
@@ -420,11 +411,18 @@
     TDataBuffer*& aPacketInKernSpace,
     TBool aUserDataTxEnabled )
     {
-    return (static_cast<RFrameXferBlockProtocolStack*>(
-        iFrameXferBlock))->AddTxFrame( 
-            aPacketInUserSpace, 
-            aPacketInKernSpace,
-            aUserDataTxEnabled );
+    if ( IsMemInUse() )
+        {
+        return (static_cast<RFrameXferBlockProtocolStack*>(
+            iFrameXferBlock))->AddTxFrame( 
+                aPacketInUserSpace, 
+                aPacketInKernSpace,
+                aUserDataTxEnabled );
+        }
+    else
+        {
+        return EFalse;
+        }
     }
 
 // ---------------------------------------------------------------------------
@@ -435,13 +433,15 @@
     const TWhaTxQueueState& aTxQueueState,
     TBool& aMore )
     {
-    if ( IsMemInUse() )
+    if ( IsMemInUse() && iFrameXferBlock )
         {
         return (static_cast<RFrameXferBlockProtocolStack*>(
             iFrameXferBlock))->GetTxFrame( aTxQueueState, aMore );
         }
     else
+        {
         return NULL;
+        }
     }
 
 // ---------------------------------------------------------------------------