wlan_bearer/wlanldd/wlan_common/umac_common/src/umacwhaconfigureac.cpp
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2002-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 WlanWhaConfigureAc class
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 13 %
       
    20 */
       
    21 
       
    22 #include "config.h"
       
    23 #include "umacwhaconfigureac.h"
       
    24 #include "wha_mibDefaultvalues.h"
       
    25 
       
    26 #ifndef NDEBUG
       
    27 const TInt8 WlanWhaConfigureAc::iName[] = "wha-configureac";
       
    28 #endif
       
    29 
       
    30 // ======== MEMBER FUNCTIONS ========
       
    31 
       
    32 // ---------------------------------------------------------------------------
       
    33 // 
       
    34 // ---------------------------------------------------------------------------
       
    35 //
       
    36 WlanWhaConfigureAc::WlanWhaConfigureAc()
       
    37     {
       
    38     os_memset( iCwMin, 0, sizeof( iCwMin ) );    
       
    39     os_memset( iCwMax, 0, sizeof( iCwMax ) );    
       
    40     os_memset( iAIFS, 0, sizeof( iAIFS ) );    
       
    41     os_memset( iTxOplimit, 0, sizeof( iTxOplimit ) );    
       
    42     }
       
    43 
       
    44 // ---------------------------------------------------------------------------
       
    45 // 
       
    46 // ---------------------------------------------------------------------------
       
    47 //
       
    48 void WlanWhaConfigureAc::Set( 
       
    49     const TCwMinVector& aCwMin,
       
    50     const TCwMaxVector& aCwMax,
       
    51     const TAifsVector& aAIFS,
       
    52     const TTxOplimitVector& aTxOplimit )
       
    53     {
       
    54     os_memcpy( iCwMin, aCwMin, sizeof( iCwMin ) );    
       
    55     os_memcpy( iCwMax, aCwMax, sizeof( iCwMax ) );    
       
    56     os_memcpy( iAIFS, aAIFS, sizeof( iAIFS ) );    
       
    57     os_memcpy( iTxOplimit, aTxOplimit, sizeof( iTxOplimit ) );    
       
    58     }
       
    59 
       
    60 // ---------------------------------------------------------------------------
       
    61 // 
       
    62 // ---------------------------------------------------------------------------
       
    63 //
       
    64 void WlanWhaConfigureAc::Entry( WlanContextImpl& aCtxImpl )
       
    65     {
       
    66     // mark WSA cmd active
       
    67     aCtxImpl.ActivateWsaCmd();
       
    68 
       
    69     OsTracePrint( KWsaCmdStateDetails, 
       
    70         (TUint8*)("UMAC: WlanWhaConfigureAc::Entry") );
       
    71 
       
    72     // currently we always use the default value for maxReceiveLifeTime
       
    73     //
       
    74     TUint16 maxReceiveLifeTime[WHA::Wha::KNumOfEdcaQueues] =
       
    75         { WHA::KDot11MaxReceiveLifeTimeDefault,
       
    76           WHA::KDot11MaxReceiveLifeTimeDefault,
       
    77           WHA::KDot11MaxReceiveLifeTimeDefault,
       
    78           WHA::KDot11MaxReceiveLifeTimeDefault };
       
    79     
       
    80     OsTracePrint( KWsaCmdState, (TUint8*)
       
    81         ("UMAC: WHA-CMD-ConfigureAC") );
       
    82 
       
    83 #ifndef NDEBUG 
       
    84     for ( TUint i = 0; i < WHA::Wha::KNumOfEdcaQueues; ++i )
       
    85         {
       
    86         OsTracePrint( KWsaCmdStateDetails, (TUint8*)
       
    87             ("UMAC: WlanWhaConfigureAc::Entry: iCwMin: %d"),
       
    88             iCwMin[i] );        
       
    89         }
       
    90     for ( TUint i = 0; i < WHA::Wha::KNumOfEdcaQueues; ++i )
       
    91         {
       
    92         OsTracePrint( KWsaCmdStateDetails, (TUint8*)
       
    93             ("UMAC: WlanWhaConfigureAc::Entry: iCwMax: %d"),
       
    94             iCwMax[i] );        
       
    95         }
       
    96     for ( TUint i = 0; i < WHA::Wha::KNumOfEdcaQueues; ++i )
       
    97         {
       
    98         OsTracePrint( KWsaCmdStateDetails, (TUint8*)
       
    99             ("UMAC: WlanWhaConfigureAc::Entry: iAIFS: %d"),
       
   100             iAIFS[i] );        
       
   101         }
       
   102     for ( TUint i = 0; i < WHA::Wha::KNumOfEdcaQueues; ++i )
       
   103         {
       
   104         OsTracePrint( KWsaCmdStateDetails, (TUint8*)
       
   105             ("UMAC: WlanWhaConfigureAc::Entry: iTxOplimit: %d"),
       
   106             iTxOplimit[i] );        
       
   107         }
       
   108     for ( TUint i = 0; i < WHA::Wha::KNumOfEdcaQueues; ++i )
       
   109         {
       
   110         OsTracePrint( KWsaCmdStateDetails, (TUint8*)
       
   111             ("UMAC: WlanWhaConfigureAc::Entry: maxReceiveLifeTime: %d"),
       
   112             maxReceiveLifeTime[i] );        
       
   113         }
       
   114 #endif
       
   115 
       
   116     // execute the command
       
   117     aCtxImpl.Wha().ConfigureAC( 
       
   118         iCwMin, 
       
   119         iCwMax, 
       
   120         iAIFS,
       
   121         iTxOplimit,  
       
   122         maxReceiveLifeTime );
       
   123     }
       
   124 
       
   125 // ---------------------------------------------------------------------------
       
   126 // 
       
   127 // ---------------------------------------------------------------------------
       
   128 //
       
   129 #ifndef NDEBUG 
       
   130 const TInt8* WlanWhaConfigureAc::GetStateName( TUint8& aLength ) const
       
   131     {
       
   132     aLength = sizeof( iName );
       
   133     return iName;
       
   134     }
       
   135 #endif
       
   136 
       
   137 // ---------------------------------------------------------------------------
       
   138 // 
       
   139 // ---------------------------------------------------------------------------
       
   140 //
       
   141 void WlanWhaConfigureAc::CommandResponse( 
       
   142     WlanContextImpl& aCtxImpl, 
       
   143     WHA::TCommandId aCommandId, 
       
   144     WHA::TStatus aStatus,
       
   145     const WHA::UCommandResponseParams& aCommandResponseParams )
       
   146     {
       
   147     if ( aCommandId == WHA::EConfigureACResponse )
       
   148         {
       
   149         TraverseToHistoryState( aCtxImpl, 
       
   150             aCommandId, aStatus, aCommandResponseParams );    
       
   151         }
       
   152     else
       
   153         {
       
   154         OsTracePrint( KErrorLevel, 
       
   155             (TUint8*)("UMAC: aCommandId: %d"), aCommandId );
       
   156         OsAssert( (TUint8*)("UMAC: panic"), (TUint8*)(WLAN_FILE), __LINE__ );
       
   157         }
       
   158     }