wlan_bearer/wlanldd/wlan_common/umac_common/inc/umaceventdispatcher.inl
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2005-2008 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:   Event dispatcher that is used to serialize MAC prototocl
       
    15 *                statemachine access
       
    16 *
       
    17 */
       
    18 
       
    19 /*
       
    20 * %version: 10 %
       
    21 */
       
    22 
       
    23 #include "umacinternaldefinitions.h"
       
    24 
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // 
       
    28 // -----------------------------------------------------------------------------
       
    29 //
       
    30 inline WlanEventDispatcher::~WlanEventDispatcher() 
       
    31     {
       
    32     iOid = NULL;
       
    33     }
       
    34 
       
    35 // -----------------------------------------------------------------------------
       
    36 // 
       
    37 // -----------------------------------------------------------------------------
       
    38 //
       
    39 inline WlanEventDispatcher::TCommandResp::TCommandResp() :
       
    40     iId( static_cast<WHA::TCompleteCommandId>( 0 ) ),
       
    41     iStatus( static_cast<WHA::TStatus>( 0 ) )
       
    42     {
       
    43     os_memset( &iParams, 0, sizeof(iParams) );
       
    44     }
       
    45     
       
    46 // -----------------------------------------------------------------------------
       
    47 // 
       
    48 // -----------------------------------------------------------------------------
       
    49 //
       
    50 void WlanEventDispatcher::Enable( 
       
    51     TChannel aChannelMask )
       
    52     {
       
    53     OsTracePrint( KEventDispatcher, (TUint8*)
       
    54         ("UMAC * eventdispatcher * enable events") );
       
    55 
       
    56     iDisableChannelMask &= ~aChannelMask;
       
    57 
       
    58     OsTracePrint( KEventDispatcher, 
       
    59         (TUint8*)("current mask: 0x%02x"),  iDisableChannelMask );
       
    60     }
       
    61 
       
    62 // -----------------------------------------------------------------------------
       
    63 // 
       
    64 // -----------------------------------------------------------------------------
       
    65 //
       
    66 void WlanEventDispatcher::Disable( 
       
    67     TChannel aChannelMask )
       
    68     {
       
    69     OsTracePrint( KEventDispatcher, (TUint8*)
       
    70         ("UMAC * eventdispatcher * disable events") );
       
    71 
       
    72     iDisableChannelMask |= aChannelMask;
       
    73 
       
    74     OsTracePrint( KEventDispatcher, 
       
    75         (TUint8*)("current mask: 0x%02x"),  iDisableChannelMask );
       
    76     }
       
    77 
       
    78 // -----------------------------------------------------------------------------
       
    79 // 
       
    80 // -----------------------------------------------------------------------------
       
    81 //
       
    82 void WlanEventDispatcher::Register( const TOIDHeader& aOid )
       
    83     {
       
    84     OsTracePrint( KEventDispatcher, (TUint8*)
       
    85         ("UMAC * eventdispatcher * register OID") );
       
    86     OsTracePrint( KEventDispatcher, (TUint8*)("OID id: 0x%08x"), aOid.oid_id );
       
    87 
       
    88     if ( iOid )
       
    89         {
       
    90         // programming error
       
    91         OsAssert( (TUint8*)("UMAC * panic"), (TUint8*)(WLAN_FILE), __LINE__ );
       
    92         }
       
    93 
       
    94     iOid = &aOid;
       
    95     }
       
    96 
       
    97 // -----------------------------------------------------------------------------
       
    98 // 
       
    99 // -----------------------------------------------------------------------------
       
   100 //
       
   101 void WlanEventDispatcher::Register( TInternalEvent aInternalEvent )
       
   102     {
       
   103     OsTracePrint( KEventDispatcher, (TUint8*)
       
   104         ("UMAC: WlanEventDispatcher::Register(): register internal event: %d"),
       
   105         aInternalEvent );
       
   106     iInternalEvents |= aInternalEvent;
       
   107     
       
   108     OsTracePrint( KEventDispatcher, (TUint8*)
       
   109         ("UMAC: WlanEventDispatcher::Register(): iInternalEvents: %d"),
       
   110         iInternalEvents );    
       
   111     }
       
   112 
       
   113 // -----------------------------------------------------------------------------
       
   114 // 
       
   115 // -----------------------------------------------------------------------------
       
   116 //
       
   117 TBool WlanEventDispatcher::ChannelEnabled( 
       
   118     TChannel aChannel ) const 
       
   119     {
       
   120     return !(iDisableChannelMask & aChannel);
       
   121     }
       
   122 
       
   123 // -----------------------------------------------------------------------------
       
   124 // 
       
   125 // -----------------------------------------------------------------------------
       
   126 //
       
   127 inline TBool WlanEventDispatcher::CommandCompletionRegistered( 
       
   128     WHA::TCompleteCommandId aCommandId ) const
       
   129     {
       
   130     return ( iCommandCompletionRegistered && 
       
   131              aCommandId == iWhaCommandCompletionParams.iId );
       
   132     }