wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacManagementSideUmacCb.cpp
changeset 0 c40eb8fe8501
child 17 a828660c511c
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2006-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 WlanManagementSideUmacCb class.
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 19 %
       
    20 */
       
    21 
       
    22 #include "config.h"
       
    23 #include "UmacManagementSideUmacCb.h"
       
    24 
       
    25 
       
    26 // ================= MEMBER FUNCTIONS =======================
       
    27 
       
    28 // ---------------------------------------------------------------------------
       
    29 // 
       
    30 // ---------------------------------------------------------------------------
       
    31 //
       
    32 WlanManagementSideUmacCb::~WlanManagementSideUmacCb() 
       
    33     {
       
    34     iSelf = NULL;
       
    35     }
       
    36 
       
    37 // ---------------------------------------------------------------------------
       
    38 // 
       
    39 // ---------------------------------------------------------------------------
       
    40 //
       
    41 void WlanManagementSideUmacCb::Attach( 
       
    42     WlanManagementSideUmacCb& aSelf )
       
    43     {
       
    44     iSelf = &aSelf;
       
    45 
       
    46     OsTracePrint( KInitLevel, 
       
    47         (TUint8*)("UMAC: WlanManagementSideUmacCb::Attach: address: 0x%08x"), 
       
    48         reinterpret_cast<TUint32>(iSelf) );    
       
    49     }
       
    50 
       
    51 // ---------------------------------------------------------------------------
       
    52 // 
       
    53 // ---------------------------------------------------------------------------
       
    54 //
       
    55 void WlanManagementSideUmacCb::Detach()
       
    56     {
       
    57     OsTracePrint( KInitLevel, 
       
    58         (TUint8*)("UMAC: WlanManagementSideUmacCb::Detach: address: 0x%08x"), 
       
    59         reinterpret_cast<TUint32>(iSelf) );    
       
    60 
       
    61     iSelf = NULL;
       
    62     }
       
    63 
       
    64 // ---------------------------------------------------------------------------
       
    65 // 
       
    66 // ---------------------------------------------------------------------------
       
    67 //
       
    68 void WlanManagementSideUmacCb::OnOidCompleted( 
       
    69     TInt aReason, 
       
    70     SOidOutputData& OidOutputData )
       
    71     {
       
    72     if ( iSelf )
       
    73         {
       
    74         iSelf->OnOidCompleted( aReason, OidOutputData );
       
    75         }
       
    76     }
       
    77 
       
    78 // ---------------------------------------------------------------------------
       
    79 // 
       
    80 // ---------------------------------------------------------------------------
       
    81 //
       
    82 void WlanManagementSideUmacCb::SetMgmtSideTxOffsets( 
       
    83     TUint32 aEthernetFrameTxOffset,
       
    84     TUint32 aDot11FrameTxOffset,
       
    85     TUint32 aSnapFrameTxOffset )
       
    86     {
       
    87     OsTracePrint( KWsaTxDetails, 
       
    88         (TUint8*)("UMAC: WlanManagementSideUmacCb::SetMgmtSideTxOffsets: iSelf address: 0x%08x"), 
       
    89         reinterpret_cast<TUint32>(iSelf) );    
       
    90 
       
    91     if ( iSelf )
       
    92         {
       
    93         iSelf->SetMgmtSideTxOffsets(
       
    94             aEthernetFrameTxOffset,
       
    95             aDot11FrameTxOffset,
       
    96             aSnapFrameTxOffset );
       
    97         }    
       
    98     }
       
    99         
       
   100 // ---------------------------------------------------------------------------
       
   101 // 
       
   102 // ---------------------------------------------------------------------------
       
   103 //
       
   104 TUint8* WlanManagementSideUmacCb::GetBufferForRxData( 
       
   105     TUint aLengthinBytes )
       
   106     {
       
   107     return (iSelf ? iSelf->GetBufferForRxData( aLengthinBytes ) : NULL);
       
   108     }
       
   109 
       
   110 // ---------------------------------------------------------------------------
       
   111 // 
       
   112 // ---------------------------------------------------------------------------
       
   113 //
       
   114 TUint8* WlanManagementSideUmacCb::DmaPrivateTxMemory()
       
   115     {
       
   116     return (iSelf ? iSelf->DmaPrivateTxMemory() : NULL);
       
   117     }
       
   118 
       
   119 // ---------------------------------------------------------------------------
       
   120 // 
       
   121 // ---------------------------------------------------------------------------
       
   122 //
       
   123 void WlanManagementSideUmacCb::MgmtDataReceiveComplete( 
       
   124     const TDataBuffer*& aBufferStart, 
       
   125     TUint32 aNumOfBuffers )
       
   126     {
       
   127     if ( iSelf )
       
   128         {
       
   129         iSelf->MgmtDataReceiveComplete( aBufferStart, aNumOfBuffers );
       
   130         }
       
   131     }
       
   132 
       
   133 // ---------------------------------------------------------------------------
       
   134 // 
       
   135 // ---------------------------------------------------------------------------
       
   136 //
       
   137 void WlanManagementSideUmacCb::MgmtPathWriteComplete (TInt aErr)
       
   138     {
       
   139     if ( iSelf )
       
   140         {
       
   141         iSelf->MgmtPathWriteComplete( aErr );
       
   142         }
       
   143     }
       
   144 
       
   145 // ---------------------------------------------------------------------------
       
   146 // 
       
   147 // ---------------------------------------------------------------------------
       
   148 //
       
   149 void WlanManagementSideUmacCb::OnInDicationEvent( 
       
   150     TIndication aIndication )
       
   151     {
       
   152     if ( iSelf )
       
   153         {
       
   154         iSelf->OnInDicationEvent( aIndication );
       
   155         }
       
   156     }
       
   157 
       
   158 // ---------------------------------------------------------------------------
       
   159 // 
       
   160 // ---------------------------------------------------------------------------
       
   161 //
       
   162 void WlanManagementSideUmacCb::MarkRxBufFree( TUint8* aBufferToFree )
       
   163     {
       
   164     if ( iSelf )
       
   165         {
       
   166         iSelf->MarkRxBufFree( aBufferToFree );
       
   167         }
       
   168     }
       
   169 
       
   170 // ---------------------------------------------------------------------------
       
   171 // 
       
   172 // ---------------------------------------------------------------------------
       
   173 //
       
   174 void WlanManagementSideUmacCb::RegisterTimeout( 
       
   175     TUint32 aTimeoutInMicroSeconds,
       
   176     TWlanTimer aTimer )
       
   177     {
       
   178     if ( iSelf )
       
   179         {
       
   180         iSelf->RegisterTimeout( aTimeoutInMicroSeconds, aTimer );
       
   181         }
       
   182     else
       
   183         {
       
   184         // implementation error; catch it
       
   185         OsAssert( (TUint8*)("UMAC: panic"),(TUint8*)(WLAN_FILE), __LINE__ );
       
   186         }
       
   187     }
       
   188 
       
   189 // ---------------------------------------------------------------------------
       
   190 // 
       
   191 // ---------------------------------------------------------------------------
       
   192 //
       
   193 void WlanManagementSideUmacCb::CancelTimeout( TWlanTimer aTimer )
       
   194     {
       
   195     if ( iSelf )
       
   196         {
       
   197         iSelf->CancelTimeout( aTimer );
       
   198         }
       
   199     }
       
   200 
       
   201 // ---------------------------------------------------------------------------
       
   202 // 
       
   203 // ---------------------------------------------------------------------------
       
   204 //
       
   205 void WlanManagementSideUmacCb::RegisterDfc( TAny* aCntx )
       
   206     {
       
   207     if ( iSelf )
       
   208         {
       
   209         iSelf->RegisterDfc( aCntx );
       
   210         }
       
   211     else
       
   212         {
       
   213         // implementation error; catch it
       
   214         OsAssert( (TUint8*)("UMAC: panic"),(TUint8*)(WLAN_FILE), __LINE__ );
       
   215         }
       
   216     }
       
   217 
       
   218 // ---------------------------------------------------------------------------
       
   219 // 
       
   220 // ---------------------------------------------------------------------------
       
   221 //
       
   222 void WlanManagementSideUmacCb::CancelDfc()
       
   223     {
       
   224     if ( iSelf )
       
   225         {
       
   226         iSelf->CancelDfc();
       
   227         }
       
   228     }
       
   229 
       
   230 // ---------------------------------------------------------------------------
       
   231 // 
       
   232 // ---------------------------------------------------------------------------
       
   233 //
       
   234 TDataBuffer* WlanManagementSideUmacCb::GetRxFrameMetaHeader()
       
   235     {
       
   236     return (iSelf ? iSelf->GetRxFrameMetaHeader() : NULL);
       
   237     }
       
   238 
       
   239 // ---------------------------------------------------------------------------
       
   240 // 
       
   241 // ---------------------------------------------------------------------------
       
   242 //
       
   243 void WlanManagementSideUmacCb::FreeRxFrameMetaHeader( TDataBuffer* aMetaHeader )
       
   244     {
       
   245     if ( iSelf )
       
   246         {
       
   247         iSelf->FreeRxFrameMetaHeader( aMetaHeader );
       
   248         }
       
   249     }