wlan_bearer/wlanldd/wlan_common/umac_common/src/umacwharelease.cpp
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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 WlanWhaRelease class
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 9 %
       
    20 */
       
    21 
       
    22 #include "config.h"
       
    23 #include "umacwharelease.h"
       
    24 #include "UmacContextImpl.h"
       
    25 
       
    26 #ifndef NDEBUG
       
    27 const TInt8 WlanWhaRelease::iName[] = "wha-release";
       
    28 #endif
       
    29 
       
    30 // ======== MEMBER FUNCTIONS ========
       
    31 
       
    32 // -----------------------------------------------------------------------------
       
    33 // 
       
    34 // -----------------------------------------------------------------------------
       
    35 //
       
    36 void WlanWhaRelease::Entry( WlanContextImpl& aCtxImpl )
       
    37     {
       
    38     // mark WSA cmd active
       
    39     aCtxImpl.ActivateWsaCmd();
       
    40 
       
    41     OsTracePrint( KWsaCmdStateDetails, 
       
    42         (TUint8*)("UMAC: WlanWhaRelease::Entry") );
       
    43 
       
    44     OsTracePrint( KWsaCmdState, (TUint8*)
       
    45         ("UMAC: WHA-CMD-Release") );
       
    46 
       
    47     // execute the command. As we always ask for synchronous execution for
       
    48     // this command (which means that the WHA layer will not call 
       
    49     // CommandResponse()), we need to call CommandResponse() method by 
       
    50     // ourselves
       
    51 
       
    52     const WHA::TStatus status ( aCtxImpl.Wha().Release( ETrue ) );
       
    53 
       
    54     WHA::UCommandResponseParams notRelevant;
       
    55     CommandResponse( aCtxImpl, WHA::EReleaseResponse, status, notRelevant );
       
    56     }
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 // 
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 #ifndef NDEBUG 
       
    63 const TInt8* WlanWhaRelease::GetStateName( TUint8& aLength ) const
       
    64     {
       
    65     aLength = sizeof( iName );
       
    66     return iName;
       
    67     }
       
    68 #endif
       
    69 
       
    70 // -----------------------------------------------------------------------------
       
    71 // 
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 void WlanWhaRelease::CommandResponse( 
       
    75     WlanContextImpl& aCtxImpl, 
       
    76     WHA::TCommandId aCommandId, 
       
    77     WHA::TStatus aStatus,
       
    78     const WHA::UCommandResponseParams& aCommandResponseParams )
       
    79     {
       
    80     if ( aCommandId == WHA::EReleaseResponse )
       
    81         {
       
    82         TraverseToHistoryState( aCtxImpl, 
       
    83             aCommandId, aStatus, aCommandResponseParams );    
       
    84         }
       
    85     else
       
    86         {
       
    87         OsTracePrint( KErrorLevel, 
       
    88             (TUint8*)("UMAC: aCommandId: %d"), aCommandId );
       
    89         OsAssert( (TUint8*)("UMAC: panic"), (TUint8*)(WLAN_FILE), __LINE__ );
       
    90         }
       
    91     }