201022
authorhgs
Fri, 04 Jun 2010 12:12:29 +0300
changeset 25 a0fdcd0e4c56
parent 24 e717b8f55620
child 30 7d966ab5304a
201022
wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_operation_get_available_iaps.cpp
wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/conf/wlanengine.confml
wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanticktimer.cpp
wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlmscanrequest.cpp
wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacContextImpl.h
wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacContextImpl.inl
wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacDot11Associated.h
wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacDot11InfrastructureMode.h
wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacDot11State.h
wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacactivemodepowermodemgr.h
wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacactivemodepowermodemgr.inl
wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacdeeppsmodepowermodemgr.h
wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacdot11infrastructurenormalmode.h
wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacdynamicpowermodemgmtcntx.h
wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacdynamicpowermodemgmtcntx.inl
wlan_bearer/wlanldd/wlan_common/umac_common/inc/umaclightpsmodepowermodemgr.h
wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacnullsendcontroller.h
wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacnullsendcontroller.inl
wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacpowermodemgrbase.h
wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacContextImpl.cpp
wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11Associated.cpp
wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11InfrastructureMode.cpp
wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11SoftReset.cpp
wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11State.cpp
wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11Synchronize.cpp
wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacMacState.cpp
wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacWsaConfigure.cpp
wlan_bearer/wlanldd/wlan_common/umac_common/src/umacactivemodepowermodemgr.cpp
wlan_bearer/wlanldd/wlan_common/umac_common/src/umacdeeppsmodepowermodemgr.cpp
wlan_bearer/wlanldd/wlan_common/umac_common/src/umacdot11infrastructurenormalmode.cpp
wlan_bearer/wlanldd/wlan_common/umac_common/src/umacdynamicpowermodemgmtcntx.cpp
wlan_bearer/wlanldd/wlan_common/umac_common/src/umaclightpsmodepowermodemgr.cpp
wlan_bearer/wlanldd/wlan_common/umac_common/src/umacnullsendcontroller.cpp
wlan_bearer/wlanldd/wlan_common/umac_common/src/umacpowermodemgrbase.cpp
wlan_bearer/wlanldd/wlan_symbian/wlanldd_symbian/src/WlanLogicalChannel.cpp
--- a/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_operation_get_available_iaps.cpp	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_operation_get_available_iaps.cpp	Fri Jun 04 12:12:29 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: 41 %
+* %version: 42 %
 */
 
 #include "core_operation_get_available_iaps.h"
@@ -1017,7 +1017,7 @@
         }
     
     u8_t treshold_val = 
-        static_cast<u8_t>(server_m->get_core_settings().rcp_improve_boundary());
+        static_cast<u8_t>( server_m->get_device_settings().rcpi_trigger );
         
     /**
      * Loop through the IAP list.
@@ -1039,22 +1039,30 @@
                 iap->id );            
 
             u32_t* iap_id = new u32_t;
+            bool_t is_match_found( true_t );
             if( iap_id )
                 {
-                if ( server_m->get_core_settings().is_iap_id_in_weak_list( iap->id) ) 
+                if ( server_m->get_core_settings().is_iap_id_in_weak_list( iap->id ) ) 
                     {
                     DEBUG( "core_operation_get_available_iaps_c::remove_matching_iaps() - IAP ID is in weak list" );
                     
                     if ( ap_data.rcpi() > treshold_val )
                         {
-                        DEBUG( "core_operation_get_available_iaps_c::remove_matching_iaps() - RCPI improved enough, remove IAP ID from weak list" );
+                        DEBUG1( "core_operation_get_available_iaps_c::remove_matching_iaps() - RCPI improved enough (%u), remove IAP ID from weak list",
+                            ap_data.rcpi() );
                         *iap_id = iap->id;
                         iap_id_list_m.append( iap_id );
             		    iap_id = NULL;
                         
                         server_m->get_core_settings().remove_iap_id_from_weak_list( iap->id );
                         }
+                    else
+                        {
+                        DEBUG2( "core_operation_get_available_iaps_c::remove_matching_iaps() - RCPI not improved enough (%u vs %u)",
+                            ap_data.rcpi(), treshold_val );
 
+                        is_match_found = false_t;
+                        }
                     }
                 else
                     {
@@ -1066,19 +1074,22 @@
 
             /** Using a temporary pointer to guarantee list iterator working. */
             core_iap_data_s* temp = iap;
-            
             iap = iap_data_list_m.next();
-            core_error_e ret = iap_data_list_m.remove( temp );
-            if( ret != core_error_ok )
+            if( is_match_found )
                 {
-                if( iap )
+                core_error_e ret = iap_data_list_m.remove( temp );
+                if( ret != core_error_ok )
                     {
-                    DEBUG1("core_operation_get_available_iaps_c::remove_matching_iaps() - error while removing IAP entry (%d)",
-                        iap->id );                   
+                    if( iap )
+                        {
+                        DEBUG1("core_operation_get_available_iaps_c::remove_matching_iaps() - error while removing IAP entry (%d)",
+                            iap->id );
+                        }
                     }
+
+                delete temp;
                 }
 
-            delete temp;
             temp = NULL;
             delete iap_id;
             iap_id = NULL;
Binary file wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/conf/wlanengine.confml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanticktimer.cpp	Fri Jun 04 12:12:29 2010 +0300
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2009-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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* This class implements a system tick based timer service.
+*
+*/
+
+/*
+* %version: 2 %
+*/
+
+#include "wlanticktimer.h"
+#include "am_debug.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CWlanTickTimer::CWlanTickTimer( 
+    const TCallBack& aTimerExpiredCB,
+    const TCallBack& aTimerCancelledCB,
+    const TCallBack& aTimerErrorCB ) :
+    CActive( CActive::EPriorityStandard ), 
+    iTimerExpiredCB( aTimerExpiredCB ),
+    iTimerCancelledCB( aTimerCancelledCB ),
+    iTimerErrorCB( aTimerErrorCB )
+    {
+    // No implementation required
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CWlanTickTimer::ConstructL()
+    {
+    User::LeaveIfError( iTimer.CreateLocal() );
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CWlanTickTimer* CWlanTickTimer::NewL(  
+    const TCallBack& aTimerExpiredCB,
+    const TCallBack& aTimerCancelledCB,
+    const TCallBack& aTimerErrorCB )
+    {
+    CWlanTickTimer* self = new (ELeave) CWlanTickTimer(
+        aTimerExpiredCB,
+        aTimerCancelledCB,
+        aTimerErrorCB );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CWlanTickTimer::~CWlanTickTimer()
+    {
+    Cancel();
+    iTimer.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CWlanTickTimer::After(
+    TUint aTicks )
+    {
+    DEBUG1( "CWlanTickTimer::After() - aTicks: %u",
+        aTicks );
+    
+    iTimer.AfterTicks(
+        iStatus,
+        aTicks );
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CWlanTickTimer::RunL()
+    {
+    DEBUG1( "CWlanTickTimer::RunL() - iStatus: %d",
+        iStatus.Int() );
+
+    switch( iStatus.Int() )
+        {
+        case KErrNone: // Timer expired
+            iTimerExpiredCB.CallBack();
+            break;
+        case KErrCancel: // Timer cancelled
+            iTimerCancelledCB.CallBack();
+            break;
+        default: // Timer error code
+            iTimerErrorCB.CallBack();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CWlanTickTimer::RunError(
+    TInt /* aError */ )
+    {
+    DEBUG( "CWlanTickTimer::RunError()" );
+
+    return 0;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CWlanTickTimer::DoCancel()
+    {
+    DEBUG( "CWlanTickTimer::DoCancel()" );
+
+    iTimer.Cancel();
+    }
--- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlmscanrequest.cpp	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlmscanrequest.cpp	Fri Jun 04 12:12:29 2010 +0300
@@ -29,7 +29,7 @@
     {
     DEBUG( "CWlmScanRequest::NewL()" );
 
-    CWlmScanRequest* self = new CWlmScanRequest(
+    CWlmScanRequest* self = new (ELeave) CWlmScanRequest(
         aClient );
     CleanupStack::PushL( self );
     self->ConstructL();
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacContextImpl.h	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacContextImpl.h	Fri Jun 04 12:12:29 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: 105 %
+* %version: 107 %
 */
 
 #ifndef WLANCONTEXTIMPL_H
@@ -945,7 +945,7 @@
     * @since S60 3.2
     * @return length of the frame body
     */
-    inline const TUint16 ScanResponseFrameBodyLength() const;
+    inline TUint16 ScanResponseFrameBodyLength() const;
 
     /**
     * Stores the IE(s) to be included into the (re-)association request.
@@ -1310,11 +1310,13 @@
     * @param aQueueId Id of the queue/AC via which the frame will be 
     *                 transmitted
     * @param aEtherType Ethernet type of the frame
+    * @param aDot11FrameType 802.11 frame type
     * @return To which power management mode to change; if any at all
     */
     inline TPowerMgmtModeChange OnFrameTx( 
         WHA::TQueueId aQueueId,
-        TUint16 aEtherType );
+        TUint16 aEtherType,
+        T802Dot11FrameControlTypeMask aDot11FrameType = E802Dot11FrameTypeData );
 
     /** 
     * To be called when accepting an Rx frame
@@ -1333,6 +1335,16 @@
         TDaType aDaType );
                         
     /**
+    * To be called when receiving the PS Mode Error indication
+    * 
+    * Informs Dynamic Power Mode Manager about the indication.
+    * Determines the need to make a power mode transition.
+    *
+    * @return To which power management mode to change; if any at all
+    */
+    inline TPowerMgmtModeChange OnPsModeErrorIndication();
+    
+    /**
     * Sets the dynamic power mode transition algorithm parameters
     *
     * @since S60 3.1
@@ -1415,6 +1427,12 @@
     inline void FreezePwrModeMgmtTrafficOverride();
 
     /**
+    * Restores the Active mode parameters of dynamic power mode management 
+    * back to their WLAN Mgmt Client provided values
+    */
+    inline void RestorePwrModeMgmtParameters();
+
+    /**
     * To be called upon Active to Light PS timer timeout
     *
     * @since S60 v5.1
@@ -1760,7 +1778,15 @@
     *
     * @since S60 3.2
     */
-    void OnKeepAliveTimerTimeout();    
+    inline void OnKeepAliveTimerTimeout();
+    
+    /** 
+    * Are we currently in Voice over WLAN Call state
+    * 
+    * @return ETrue if we are
+    *         EFalse if we are not
+    */
+    inline TBool InVoiceCallState() const;
     
     /**
      * Insert new RCPI value into the Signal Predictor.
@@ -1804,13 +1830,27 @@
         WHA::TRcpi aRcpiWarnLevel );
 
     /**
-     * Adds a WLAN feature supported by us to the list of those supported
-     * features which are indicated in BSS membership selector
+     * Adds the specified WLAN feature supported by us to the list of those 
+     * supported features which are indicated in BSS membership selector
      *
      * @param aFeature Feature to add
      */
     void AddBssMembershipFeature( T802Dot11BssMembershipSelector aFeature );
-
+    
+    /**
+     * Removes the specified WLAN feature from our list of those supported
+     * features which are indicated in BSS membership selector
+     *
+     * @param aFeature Feature to remove
+     */
+    void RemoveBssMembershipFeature( TUint8 aItem );
+    
+    /**
+     * Clears (i.e. makes empty) our list of features which are indicated 
+     * in BSS membership selector
+     */
+    inline void ClearBssMembershipFeatureList();
+    
     /**
      * Checks if the specified item is a WLAN feature indicated in BSS 
      * membership selector and if it is supported by us
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacContextImpl.inl	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacContextImpl.inl	Fri Jun 04 12:12:29 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: 77 %
+* %version: 79 %
 */
 
 #include "umacconnectcontext.h"
@@ -420,7 +420,7 @@
 // 
 // ---------------------------------------------------------------------------
 //
-inline const TUint16 WlanContextImpl::ScanResponseFrameBodyLength() const
+inline TUint16 WlanContextImpl::ScanResponseFrameBodyLength() const
     {
     return iConnectContext.iScanResponseFrameBodyLength;
     }
@@ -1610,9 +1610,13 @@
 //
 inline TPowerMgmtModeChange WlanContextImpl::OnFrameTx( 
     WHA::TQueueId aQueueId,
-    TUint16 aEtherType )
+    TUint16 aEtherType,
+    T802Dot11FrameControlTypeMask aDot11FrameType )
     {
-    return iDynamicPowerModeCntx.OnFrameTx( aQueueId, aEtherType );
+    return iDynamicPowerModeCntx.OnFrameTx( 
+        aQueueId, 
+        aEtherType, 
+        aDot11FrameType );
     }
 
 // ---------------------------------------------------------------------------
@@ -1636,6 +1640,15 @@
 // 
 // ---------------------------------------------------------------------------
 //
+inline TPowerMgmtModeChange WlanContextImpl::OnPsModeErrorIndication()
+    {
+    return iDynamicPowerModeCntx.OnPsModeErrorIndication();
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
 inline void WlanContextImpl::SetPowerModeManagementParameters(
     TUint32 aToLightPsTimeout,
     TUint16 aToLightPsFrameThreshold,
@@ -1693,6 +1706,15 @@
 // 
 // ---------------------------------------------------------------------------
 //
+inline void WlanContextImpl::RestorePwrModeMgmtParameters()
+    {
+    iDynamicPowerModeCntx.RestoreActiveModeParameters();
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
 inline TBool WlanContextImpl::OnActiveToLightPsTimerTimeout()
     {
     return iDynamicPowerModeCntx.OnActiveToLightPsTimerTimeout();
@@ -2059,6 +2081,15 @@
 // 
 // ---------------------------------------------------------------------------
 //
+inline TBool WlanContextImpl::InVoiceCallState() const
+    {
+    return iNullSendController.InVoiceCallState();
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
 inline TBool WlanContextImpl::InsertNewRcpiIntoPredictor( 
     TInt64 aTimestamp, 
     WHA::TRcpi aRcpi )
@@ -2100,6 +2131,18 @@
         aRcpiWarnLevel );
     }
 
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+inline void WlanContextImpl::ClearBssMembershipFeatureList()
+    {
+    os_memset( 
+        &iOurBssMembershipFeatureArray, 
+        KUnallocated, 
+        sizeof( iOurBssMembershipFeatureArray ) );
+    }
+
 // ---------------------------------------------------------------------------
 // 
 // ---------------------------------------------------------------------------
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacDot11Associated.h	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacDot11Associated.h	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2005-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: 46 %
+* %version: 47 %
 */
 
 #ifndef WLANDOT11ASSOCIATED_H
@@ -511,37 +511,6 @@
         TBool aMulticastData );            
 
     /**
-    * Adds a multicast MAC address and starts to filter (Rx) multicast 
-    * traffic sent to any other MAC addresses than those that have been 
-    * specified using this method
-    * @param aCtxImpl statemachine context
-    * @param aMacAddr The address to be added
-    * @return ETrue if a state change occurred in the state machine 
-    *         EFalse otherwise
-    */
-    virtual TBool AddMulticastAddr(
-        WlanContextImpl& aCtxImpl,
-        const TMacAddress& aMacAddr );
-        
-    /**
-    * Removes a multicast MAC address from multicast (Rx) filtering
-    * configuration. So any packet that we receive and which has been sent
-    * to the multicast address in question is not accepted any more (i.e. 
-    * it is filtered).
-    * However, if there are no addresses left in the multicast (Rx) filtering
-    * configuration after this remove, the multicast filtering is disabled
-    * and all (otherwise acceptable) multicast packets are accepted again.
-    * @param aCtxImpl statemachine context
-    * @param aMacAddr The address to be removed
-    * @return ETrue if a state change occurred in the state machine 
-    *         EFalse otherwise
-    */
-    virtual TBool RemoveMulticastAddr(
-        WlanContextImpl& aCtxImpl,
-        TBool aRemoveAll,
-        const TMacAddress& aMacAddr );
-
-    /**
      * From MWlanUserEvent
      * Add/set (or replace) a broadcast WEP key
      *
@@ -582,16 +551,6 @@
             TUint32 aMaxTxMSDULifetime );
         
     /**
-    * Sets the WHA::KMibDot11GroupAddressesTable MIB
-    * 
-    * @param aCtxImpl statemachine context
-    * @return ETrue if a state change occurred in the state machine 
-    *         EFalse otherwise
-    */
-    TBool SetGroupAddressesTableMib(
-        WlanContextImpl& aCtxImpl );
-
-    /**
     * If the power mgmt mode needs to be changed - based on 
     * aPowerMgmtModeChange - proceeds with the necessary actions
     * 
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacDot11InfrastructureMode.h	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacDot11InfrastructureMode.h	Fri Jun 04 12:12:29 2010 +0300
@@ -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: 34 %
+* %version: 35 %
 */
 
 #ifndef WLANDOT11INFRASTRUCTUREMODE_H
@@ -274,14 +274,6 @@
         WHA::TRcpi aRcpi );
 
     /**
-    * Indicates that the WLAN device has detected problems in the power
-    * save mode operation of the AP
-    * 
-    * @param aCtxImpl global statemachine context
-    */
-    virtual void DoPsModeErrorIndication( WlanContextImpl& aCtxImpl );
-    
-    /**
     * Voice Call Entry timer timeout function
     *
     * @since S60 v3.2
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacDot11State.h	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacDot11State.h	Fri Jun 04 12:12:29 2010 +0300
@@ -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: 57 %
+* %version: 58 %
 */
 
 #ifndef WLANDOT11STATE_H
@@ -859,6 +859,37 @@
         const TMacAddress& aMacAddr );
 
     /**
+    * Adds a multicast MAC address and starts to filter (Rx) multicast 
+    * traffic sent to any other MAC addresses than those that have been 
+    * specified using this method
+    * @param aCtxImpl statemachine context
+    * @param aMacAddr The address to be added
+    * @return ETrue if a state change occurred in the state machine 
+    *         EFalse otherwise
+    */
+    virtual TBool AddMulticastAddr(
+        WlanContextImpl& aCtxImpl,
+        const TMacAddress& aMacAddr );
+        
+    /**
+    * Removes a multicast MAC address from multicast (Rx) filtering
+    * configuration. So any packet that we receive and which has been sent
+    * to the multicast address in question is not accepted any more (i.e. 
+    * it is filtered).
+    * However, if there are no addresses left in the multicast (Rx) filtering
+    * configuration after this remove, the multicast filtering is disabled
+    * and all (otherwise acceptable) multicast packets are accepted again.
+    * @param aCtxImpl statemachine context
+    * @param aMacAddr The address to be removed
+    * @return ETrue if a state change occurred in the state machine 
+    *         EFalse otherwise
+    */
+    virtual TBool RemoveMulticastAddr(
+        WlanContextImpl& aCtxImpl,
+        TBool aRemoveAll,
+        const TMacAddress& aMacAddr );
+
+    /**
     * Set transmission power level. 
     * This has to be legal at the current region.
     * @param aCtxImpl statemachine context
@@ -1122,6 +1153,16 @@
         const TSnapHeader& aSnapHeader );        
 
     /**
+    * Sets the WHA::KMibDot11GroupAddressesTable MIB
+    * 
+    * @param aCtxImpl statemachine context
+    * @return ETrue if a state change occurred in the state machine 
+    *         EFalse otherwise
+    */
+    TBool SetGroupAddressesTableMib(
+        WlanContextImpl& aCtxImpl );
+
+    /**
      * Sets the beacon lost count value
      *
      * @since S60 v3.1
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacactivemodepowermodemgr.h	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacactivemodepowermodemgr.h	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-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: 9 %
+* %version: 10 %
 */
 
 #ifndef WLAN_ACTIVE_MODE_POWER_MODE_MGR
@@ -26,13 +26,22 @@
 
 class WlanContextImpl;
 
+
 /**
 * Class implementing infrastructure mode dynamic power mode management 
 * algorithm for Active mode (CAM)
 */
 class WlanActiveModePowerModeMgr : public WlanPowerModeMgrBase
-    {    
-
+    {
+    
+public:
+    /** 
+    * Default Rx/Tx frame count threshold for considering change to Light 
+    * PS mode.
+    * This value is used if another value hasn't been provided
+    */
+    static const TUint KDefaultToLightPsFrameThreshold = 1;
+    
 public:
     
     /** Ctor */
@@ -62,6 +71,7 @@
     * @param aCtxImpl global statemachine context
     * @param aQueueId Id of the queue/AC via which the frame will be transmitted
     * @param aEtherType Ethernet type of the frame
+    * @param aDot11FrameType 802.11 frame type
     * @param aIgnoreThisFrame shall this frame be ignored from dynamic power 
     *                         mode management perspective
     * @return To which power management mode to change; if any at all
@@ -70,6 +80,7 @@
         WlanContextImpl& aCtxImpl, 
         WHA::TQueueId aQueueId,
         TUint16 aEtherType,
+        T802Dot11FrameControlTypeMask aDot11FrameType,
         TBool aIgnoreThisFrame );
 
     /** 
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacactivemodepowermodemgr.inl	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacactivemodepowermodemgr.inl	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-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: 4 %
+* %version: 5 %
 */
 
 // -----------------------------------------------------------------------------
@@ -27,6 +27,15 @@
     TUint aToLightPsFrameThreshold,
     TUint16 aUapsdRxFrameLengthThreshold )
     {
+    OsTracePrint( KPwrStateTransition, (TUint8*)
+        ("UMAC: WlanActiveModePowerModeMgr::SetParameters: "
+         "aToLightPsFrameThreshold: %d"),
+        aToLightPsFrameThreshold );
+    OsTracePrint( KPwrStateTransition, (TUint8*)
+        ("UMAC: WlanActiveModePowerModeMgr::SetParameters: "
+         "aUapsdRxFrameLengthThreshold: %d"),
+        aUapsdRxFrameLengthThreshold );
+
     iToLightPsFrameThreshold = aToLightPsFrameThreshold;
     iUapsdRxFrameLengthThreshold = aUapsdRxFrameLengthThreshold;    
     }
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacdeeppsmodepowermodemgr.h	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacdeeppsmodepowermodemgr.h	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-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: 3 %
+* %version: 4 %
 */
 
 #ifndef WLAN_DEEP_PS_MODE_POWER_MODE_MGR
@@ -42,6 +42,14 @@
     virtual ~WlanDeepPsModePowerModeMgr();
     
     /**
+    * Sets the dynamic power mode transition algorithm parameters
+    *
+    * @param aUapsdRxFrameLengthThreshold received frame 
+    *        payload length (in bytes) threshold in U-APSD network
+    */
+    void SetParameters( TUint16 aUapsdRxFrameLengthThreshold );
+    
+    /**
     * To be called when transmitting a frame
     *
     * @since S60 5.1
@@ -49,6 +57,7 @@
     * @param aCtxImpl global statemachine context
     * @param aQueueId Id of the queue/AC via which the frame will be transmitted
     * @param aEtherType Ethernet type of the frame
+    * @param aDot11FrameType 802.11 frame type
     * @param aIgnoreThisFrame shall this frame be ignored from dynamic power 
     *                         mode management perspective
     * @return To which power management mode to change; if any at all
@@ -57,6 +66,7 @@
         WlanContextImpl& aCtxImpl, 
         WHA::TQueueId aQueueId,
         TUint16 aEtherType,
+        T802Dot11FrameControlTypeMask aDot11FrameType,
         TBool aIgnoreThisFrame );
 
     /** 
@@ -80,6 +90,15 @@
         TUint aPayloadLength,
         TDaType aDaType );
     
+    /**
+    * From WlanPowerModeMgrBase
+    * To be called upon receiving the PS Mode Error indication
+    * Determines the need to make a power mode transition
+    *
+    * @return To which power management mode to change; if any at all
+    */
+    virtual TPowerMgmtModeChange OnPsModeErrorIndication();
+    
     /** 
     * From WlanPowerModeMgrBase
     * Resets the state of the object 
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacdot11infrastructurenormalmode.h	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacdot11infrastructurenormalmode.h	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2005-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: 10 %
+* %version: 11 %
 */
 
 #ifndef C_WLANDOT11INFRASTRUCTURENORMALMODE_H
@@ -54,6 +54,16 @@
         WlanContextImpl& aCtxImpl );  
         
     /**
+    * Indicates that the WLAN device has detected problems in the power
+    * save mode operation of the AP
+    * 
+    * @param aCtxImpl global statemachine context
+    * @return ETrue if a state change occurred in the state machine
+    *         EFalse otherwise
+    */
+    virtual void DoPsModeErrorIndication( WlanContextImpl& aCtxImpl );
+    
+    /**
     * Active to Light PS timer timeout function
     *
     * @since S60 v5.1
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacdynamicpowermodemgmtcntx.h	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacdynamicpowermodemgmtcntx.h	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-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: 12 %
+* %version: 13 %
 */
 
 #ifndef WLAN_DYNAMIC_POWER_MODE_MGMT_CNTX
@@ -66,11 +66,13 @@
     * @since S60 3.1
     * @param aQueueId Id of the queue/AC via which the frame will be transmitted
     * @param aEtherType Ethernet type of the frame
+    * @param aDot11FrameType 802.11 frame type
     * @return To which power management mode to change; if any at all
     */
     TPowerMgmtModeChange OnFrameTx( 
         WHA::TQueueId aQueueId, 
-        TUint16 aEtherType );
+        TUint16 aEtherType,
+        T802Dot11FrameControlTypeMask aDot11FrameType );
 
     /** 
     * To be called when accepting an Rx frame
@@ -89,6 +91,14 @@
         TDaType aDaType );
                         
     /**
+    * To be called upon receiving the PS Mode Error indication
+    * Determines the need to make a power mode transition
+    *
+    * @return To which power management mode to change; if any at all
+    */
+    TPowerMgmtModeChange OnPsModeErrorIndication();
+    
+    /**
     * To be called upon Active to Light PS timer timeout
     *
     * @since S60 v5.1
@@ -194,6 +204,12 @@
     */
     void FreezeTrafficOverride();
 
+    /**
+    * Restores the Ative mode parameters back to their WLAN Mgmt Client 
+    * provided values
+    */
+    inline void RestoreActiveModeParameters();
+    
 private:
     
     /** 
@@ -322,7 +338,25 @@
     * @return ETrue if Background AC traffic shall be ignored
     */
     inline TBool StayInPsDespiteLegacyBackgroundTraffic() const;
-        
+    
+    /** 
+    * Sets special parameters for the Active mode.
+    * To be used when switching to Active upen receiving PsModeError 
+    * indication from WHA layer.
+    * The Wlan Mgmt Client provided Active mode parameters can be restored
+    * with RestoreActiveModeParameters()
+    */
+    inline void SetPsModeErrorActiveModeParameters();
+
+    /** 
+    * Sets special parameters for the Active mode.
+    * To be used when switching to Active upon transmitting our keep alive 
+    * frame or an ARP frame.
+    * The Wlan Mgmt Client provided Active mode parameters can be restored
+    * with RestoreActiveModeParameters()
+    */
+    inline void SetKeepAliveActiveModeParameters();
+    
     // Prohibit copy constructor
     WlanDynamicPowerModeMgmtCntx( 
         const WlanDynamicPowerModeMgmtCntx& );
@@ -331,7 +365,15 @@
         ( const WlanDynamicPowerModeMgmtCntx& );
 
 private:    // Data
-        
+
+    /** for backing up the parameters related to Active mode */
+    struct SActiveParamsBackup
+        {
+        TUint32 iToLightPsTimeout;
+        TUint16 iToLightPsFrameThreshold;
+        TUint16 iUapsdRxFrameLengthThreshold;
+        };
+    
     /** flag value to store state transition need internally */
     TBool                       iStateChange; 
     /** stores the flags defined below */
@@ -383,18 +425,27 @@
     /** ToDeepPsTimer started */
     static const TUint32 KToDeepPsTimerStarted = ( 1 << 10 );
     
-    // time interval in microseconds after which transition from Active
-    // mode to Light PS mode is considered. 
+    /** 
+    * time interval in microseconds after which transition from Active
+    * mode to Light PS mode is considered.
+    */ 
     TUint32 iToLightPsTimeout;
 
-    // time interval in microseconds after which the frame counter
-    // used when considering transition from Light PS to Active mode is reset.
+    /**
+    * time interval in microseconds after which the frame counter
+    * used when considering transition from Light PS to Active mode is reset.
+    */
     TUint32 iToActiveTimeout;
 
-    // time interval in microseconds after which transition from Light PS
-    // mode to Deep PS mode is considered. 
+    /**
+    * time interval in microseconds after which transition from Light PS
+    * mode to Deep PS mode is considered.
+    */ 
     TUint32 iToDeepPsTimeout;
-
+    
+    /** for backing up the parameters related to Active mode */
+    SActiveParamsBackup iActiveParamsBackup;
+    
     /** currently active power management mode context */
     WlanPowerModeMgrBase*       iActiveCntx;
     /** context for active mode */
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacdynamicpowermodemgmtcntx.inl	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacdynamicpowermodemgmtcntx.inl	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-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,9 +16,21 @@
 */
 
 /*
-* %version: 5 %
+* %version: 6 %
 */
 
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+inline void WlanDynamicPowerModeMgmtCntx::RestoreActiveModeParameters()
+    {
+    iToLightPsTimeout = iActiveParamsBackup.iToLightPsTimeout;
+    iActiveModeCntx.SetParameters( 
+        iActiveParamsBackup.iToLightPsFrameThreshold, 
+        iActiveParamsBackup.iUapsdRxFrameLengthThreshold );
+    }
+
 // -----------------------------------------------------------------------------
 // 
 // -----------------------------------------------------------------------------
@@ -109,3 +121,37 @@
     {    
     return ( iFlags & KStayInPsDespiteLegacyBackgroundTraffic );
     }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+inline void WlanDynamicPowerModeMgmtCntx::SetPsModeErrorActiveModeParameters()
+    {
+    const TUint32 KToLightPsTimeout( 1000000 ); // 1 second
+    const TUint16 KToLightPsFrameThreshold( 4 );
+    const TUint16 KUapsdRxFrameLengthThreshold(
+        WlanPowerModeMgrBase::KDefaultUapsdRxFrameLengthThreshold );
+    
+    iToLightPsTimeout = KToLightPsTimeout;
+    iActiveModeCntx.SetParameters( 
+        KToLightPsFrameThreshold, 
+        KUapsdRxFrameLengthThreshold );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+inline void WlanDynamicPowerModeMgmtCntx::SetKeepAliveActiveModeParameters()
+    {
+    const TUint32 KToLightPsTimeout( 20000 ); // 20ms
+    const TUint16 KToLightPsFrameThreshold( 1 );
+    const TUint16 KUapsdRxFrameLengthThreshold(
+        WlanPowerModeMgrBase::KDefaultUapsdRxFrameLengthThreshold );
+    
+    iToLightPsTimeout = KToLightPsTimeout;
+    iActiveModeCntx.SetParameters( 
+        KToLightPsFrameThreshold, 
+        KUapsdRxFrameLengthThreshold );
+    }
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umaclightpsmodepowermodemgr.h	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umaclightpsmodepowermodemgr.h	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-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: 3 %
+* %version: 4 %
 */
 
 #ifndef WLAN_LIGHT_PS_MODE_POWER_MODE_MGR
@@ -65,6 +65,7 @@
     * @param aCtxImpl global statemachine context
     * @param aQueueId Id of the queue/AC via which the frame will be transmitted
     * @param aEtherType Ethernet type of the frame
+    * @param aDot11FrameType 802.11 frame type
     * @param aIgnoreThisFrame shall this frame be ignored from dynamic power 
     *                         mode management perspective
     * @return To which power management mode to change; if any at all
@@ -73,6 +74,7 @@
         WlanContextImpl& aCtxImpl, 
         WHA::TQueueId aQueueId,
         TUint16 aEtherType,
+        T802Dot11FrameControlTypeMask aDot11FrameType,
         TBool aIgnoreThisFrame );
 
     /** 
@@ -98,6 +100,15 @@
     
     /**
     * From WlanPowerModeMgrBase
+    * To be called upon receiving the PS Mode Error indication
+    * Determines the need to make a power mode transition
+    *
+    * @return To which power management mode to change; if any at all
+    */
+    virtual TPowerMgmtModeChange OnPsModeErrorIndication();
+    
+    /**
+    * From WlanPowerModeMgrBase
     * To be called upon Light PS to Active timer timeout
     *
     * @since S60 5.1
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacnullsendcontroller.h	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacnullsendcontroller.h	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2007-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: 14 %
+* %version: 15 %
 */
 
 #ifndef WLAN_NULL_SEND_CONTROLLER
@@ -172,6 +172,14 @@
     * @since S60 3.2
     */
     void OnKeepAliveTimerTimeout();
+    
+    /** 
+    * Are we currently in Voice over WLAN Call state
+    * 
+    * @return ETrue if we are
+    *         EFalse if we are not
+    */
+    inline TBool InVoiceCallState() const;
 
 private:
     
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacnullsendcontroller.inl	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacnullsendcontroller.inl	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2007-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"
@@ -17,7 +17,7 @@
 */
 
 /*
-* %version: 10 %
+* %version: 11 %
 */
 
 // Default Voice Call Entry timeout
@@ -38,7 +38,7 @@
 
 // Default Keep Alive timeout
 // This value is used if no other value has been provided
-const TUint32 KDefaultKeepAliveTimeout = 200000000; // 200 s
+const TUint32 KDefaultKeepAliveTimeout = 60000000; // 60 s
 
 // Default value for frame payload length threashold of a potential 
 // carrier of downlink Voice over WLAN Call data, which is erroneously 
@@ -221,3 +221,12 @@
         // during a Voice Call
         }
     }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+inline TBool WlanNullSendController::InVoiceCallState() const
+    {
+    return static_cast<TBool>(iFlags & KInVoiceCallState);
+    }
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacpowermodemgrbase.h	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/inc/umacpowermodemgrbase.h	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-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: 12 %
+* %version: 13 %
 */
 
 #ifndef WLAN_POWER_MODE_MGR_BASE_H
@@ -32,6 +32,7 @@
 
 class WlanContextImpl;
 
+
 /**
 * Common base class for classes implementing dynamic power mode transition 
 * algorithm between PS and active mode in infrastructure mode 
@@ -39,6 +40,10 @@
 class WlanPowerModeMgrBase
     {
 public:
+    // Default frame payload length threshold value (in bytes) for U-APSD
+    static const TUint32 KDefaultUapsdRxFrameLengthThreshold = 400;
+
+public:
 
     /** Dtor */
     virtual ~WlanPowerModeMgrBase();
@@ -51,6 +56,7 @@
     * @param aCtxImpl global statemachine context
     * @param aQueueId Id of the queue/AC via which the frame will be transmitted
     * @param aEtherType Ethernet type of the frame
+    * @param aDot11FrameType 802.11 frame type
     * @param aIgnoreThisFrame shall this frame be ignored from dynamic power 
     *                         mode management perspective
     * @return To which power management mode to change; if any at all
@@ -59,6 +65,7 @@
         WlanContextImpl& aCtxImpl, 
         WHA::TQueueId aQueueId,
         TUint16 aEtherType,
+        T802Dot11FrameControlTypeMask aDot11FrameType,
         TBool aIgnoreThisFrame ) = 0;
 
     /** 
@@ -83,6 +90,14 @@
         TDaType aDaType ) = 0;
 
     /**
+    * To be called upon receiving the PS Mode Error indication
+    * Determines the need to make a power mode transition
+    *
+    * @return To which power management mode to change; if any at all
+    */
+    virtual TPowerMgmtModeChange OnPsModeErrorIndication();
+    
+    /**
     * To be called upon Active to Light PS timer timeout
     *
     * @since S60 v5.1
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacContextImpl.cpp	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacContextImpl.cpp	Fri Jun 04 12:12:29 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: 72 %
+* %version: 73 %
 */
 
 #include "config.h"
@@ -104,10 +104,7 @@
 
     os_memset( &iWHASettings, 0, sizeof( iWHASettings ) );
 
-    os_memset( 
-        &iOurBssMembershipFeatureArray, 
-        KUnallocated, 
-        sizeof( iOurBssMembershipFeatureArray ) );
+    ClearBssMembershipFeatureList();
 
     os_memset( 
         &iHtBlockAckConfigure, 
@@ -1770,6 +1767,34 @@
 // 
 // -----------------------------------------------------------------------------
 //
+void WlanContextImpl::RemoveBssMembershipFeature( TUint8 aItem )
+    {
+    TUint8 i ( 0 );
+
+    do
+        {
+        if ( aItem == iOurBssMembershipFeatureArray[i] )
+            {
+            iOurBssMembershipFeatureArray[i] = KUnallocated;
+
+            OsTracePrint( KUmacDetails, (TUint8*)
+                ("UMAC: WlanContextImpl::RemoveBssMembershipFeature: "
+                 "feature %d removed"),
+                aItem );
+
+            break;
+            }
+        else
+            {
+            ++i;
+            }
+        } while ( i != KMaxNumOfWlanFeatures );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
 TBool WlanContextImpl::BssMembershipFeatureSupported( TUint8 aItem ) const
     {
     TBool supported ( EFalse );
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11Associated.cpp	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11Associated.cpp	Fri Jun 04 12:12:29 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: 96 %
+* %version: 99 %
 */
 
 #include "config.h"
@@ -658,8 +658,8 @@
     TUint nbrOfpacketsForMgmtClient ( 0 );
     const TUint KMaxNbrOfPacketsForUsr ( 30 );
     const TUint KMaxNbrOfPacketsForMgmtClient ( 10 );
-    const TDataBuffer* packetsForUsr[KMaxNbrOfPacketsForUsr];
-    const TDataBuffer* packetsForMgmtClient[KMaxNbrOfPacketsForMgmtClient];
+    TDataBuffer* packetsForUsr[KMaxNbrOfPacketsForUsr];
+    TDataBuffer* packetsForMgmtClient[KMaxNbrOfPacketsForMgmtClient];
     // one byte past the last actual payload byte (so excluding the potentially
     // present security trailer) of the MPDU
     const TUint8* const KMpduPayloadEnd ( 
@@ -1006,8 +1006,7 @@
             - aBuffer );                              // buffer beginning
         
         // complete
-        const TDataBuffer* KMetaHdr ( metaHdr );
-        aCtxImpl.iUmac.MgmtDataReceiveComplete( KMetaHdr, 1 );
+        aCtxImpl.iUmac.MgmtDataReceiveComplete( metaHdr, 1 );
         }
     else
         {
@@ -1369,7 +1368,7 @@
     if ( // our client has instructed us not the encrypt this frame under
          // any circumstances OR
          ( aDataBuffer.KeFlags() & TDataBuffer::KTxFrameMustNotBeEncrypted ) ||
-         // no space is reserved for security header on this sw layer. It is
+         // no space is reserved for security trailer on this sw layer. It is
          // done on lower layers; when necessary.
          ( aCtxImpl.WHASettings().iCapability & 
            WHA::SSettings::KNoSecHdrAndTrailer ) )
@@ -1996,7 +1995,7 @@
         const TPowerMgmtModeChange KPowerMgmtModeChange ( 
             aCtxImpl.OnFrameTx( queue_id, etherType ) );
         
-        // if any change change is needed regarding our power mgmt mode,
+        // if any change is needed regarding our power mgmt mode,
         // proceed with it
         stateChange = PowerMgmtModeChange( aCtxImpl, KPowerMgmtModeChange );        
         }
@@ -2157,177 +2156,6 @@
 // 
 // ---------------------------------------------------------------------------
 //
-TBool WlanDot11Associated::AddMulticastAddr(
-    WlanContextImpl& aCtxImpl,
-    const TMacAddress& aMacAddr )
-    {
-    TBool stateTransitionOccurred( EFalse );
-    
-    OsTracePrint( 
-        KWlmCmdDetails, 
-        (TUint8*)
-        ("UMAC: WlanDot11Associated::AddMulticastAddr(): addr to be added:"),
-        aMacAddr);
-
-    if ( aCtxImpl.MulticastFilteringDisAllowed() )
-        {
-        OsTracePrint( 
-            KWlmCmdDetails, 
-            (TUint8*)
-            ("UMAC: WlanDot11Associated::AddMulticastAddr(): Multicast filtering disallowed"));
-            
-        OnOidComplete( aCtxImpl, KErrGeneral );        
-        }
-    else
-        {        
-        if ( aCtxImpl.WHASettings().iNumOfGroupTableEntrys > 
-             aCtxImpl.MulticastAddressCount() )
-            {
-            // wha layer is able to take in an address
-            
-            // 1st try to add the address to our own internal bookkeeping
-            WlanContextImpl::TGroupAddStatus addStatus = 
-                aCtxImpl.AddMulticastAddress( aMacAddr );
-
-            switch ( addStatus )
-                {
-                case WlanContextImpl::EOk:
-                    OsTracePrint( 
-                        KWlmCmdDetails, 
-                        (TUint8*)
-                        ("UMAC: WlanDot11Associated::AddMulticastAddr(): Address will be added to the MIB"));
-                    // the address needed to be added and adding went ok.
-                    // Now update the group addresses MIB
-                    stateTransitionOccurred = SetGroupAddressesTableMib( aCtxImpl ); 
-                    break;
-                case WlanContextImpl::EAlreadyExists: 
-                    OsTracePrint( 
-                        KWlmCmdDetails, 
-                        (TUint8*)
-                        ("UMAC: WlanDot11Associated::AddMulticastAddr(): Address already exists"));
-                    // the specified address already exists so there's no need
-                    // to update the group addresses MIB
-                    // just complete the request with OK status
-                    OnOidComplete( aCtxImpl );
-                    stateTransitionOccurred = EFalse;           
-                    break;
-                case WlanContextImpl::EFull:
-                    OsTracePrint( 
-                        KWlmCmdDetails, 
-                        (TUint8*)
-                        ("UMAC: WlanDot11Associated::AddMulticastAddr(): Internal address table full; disallow multicast filtering"));
-                    // we are not able to take in any more addresses.
-                    // We will totally disable the multicast filtering
-                    // and we won't allow it to be enabled any more during 
-                    // the current nw connection
-                    //
-                    aCtxImpl.ResetMulticastAddresses();               
-                    aCtxImpl.MulticastFilteringDisAllowed( ETrue );
-                    stateTransitionOccurred = 
-                        SetGroupAddressesTableMib( aCtxImpl );
-                    break;
-                default:
-                    // programming error
-                    OsTracePrint( KErrorLevel, (TUint8*)
-                        ("UMAC: addStatus: %d"), addStatus );
-                    OsAssert( (TUint8*)("UMAC: panic"), 
-                        (TUint8*)(WLAN_FILE), __LINE__ );
-                }
-            }
-        else
-            {
-            OsTracePrint( 
-                KWlmCmdDetails, 
-                (TUint8*)
-                ("UMAC: WlanDot11Associated::AddMulticastAddr(): WHA not able to accept address; disallow multicast filtering"));
-            // wha layer is not able to take in an address. Either this is one 
-            // address too many, or it doesn't support even a single address.
-            // In either case we will totally disable the multicast filtering
-            // and we won't allow it to be enabled any more during the current 
-            // nw connection
-            aCtxImpl.ResetMulticastAddresses();               
-            aCtxImpl.MulticastFilteringDisAllowed( ETrue );
-            stateTransitionOccurred = SetGroupAddressesTableMib( aCtxImpl );
-            }
-        }
-
-    // signal caller whether a state transition occurred or not
-    return stateTransitionOccurred;
-    }
-
-// ---------------------------------------------------------------------------
-// 
-// ---------------------------------------------------------------------------
-//
-TBool WlanDot11Associated::RemoveMulticastAddr(
-    WlanContextImpl& aCtxImpl,
-    TBool aRemoveAll,
-    const TMacAddress& aMacAddr )
-    {
-    TBool stateTransitionOccurred( EFalse );
-    
-    OsTracePrint( 
-        KWlmCmdDetails, 
-        (TUint8*)
-        ("UMAC: WlanDot11Associated::RemoveMulticastAddr(): addr to be removed:"),
-        aMacAddr);
-
-    if ( aCtxImpl.MulticastFilteringDisAllowed() )
-        {
-        OsTracePrint( 
-            KWlmCmdDetails, 
-            (TUint8*)
-            ("UMAC: WlanDot11Associated::RemoveMulticastAddr(): Multicast filtering disallowed"));
-        // filtering is not allowed currently so there can't be any addresses
-        // to remove. Just complete the request with OK status            
-        OnOidComplete( aCtxImpl );        
-        }
-    else
-        {
-        if ( aRemoveAll )        
-            {
-            OsTracePrint( 
-                KWlmCmdDetails, 
-                (TUint8*)
-                ("UMAC: WlanDot11Associated::RemoveMulticastAddr(): remove all"));
-            // remove all addresses; naturally will also disable filtering
-            aCtxImpl.ResetMulticastAddresses();
-            stateTransitionOccurred = SetGroupAddressesTableMib( aCtxImpl );            
-            }
-        else
-            {            
-            // 1st remove the specified address from our own internal 
-            // bookkeeping, if it exists
-            if ( aCtxImpl.RemoveMulticastAddress( aMacAddr ) )
-                {
-                OsTracePrint( 
-                    KWlmCmdDetails, 
-                    (TUint8*)
-                    ("UMAC: WlanDot11Associated::RemoveMulticastAddr(): removing the specified address"));
-                // it existed, so update the group addresses MIB, too
-                stateTransitionOccurred = SetGroupAddressesTableMib( aCtxImpl );                 
-                }
-            else
-                {
-                OsTracePrint( 
-                    KWlmCmdDetails, 
-                    (TUint8*)
-                    ("UMAC: WlanDot11Associated::RemoveMulticastAddr(): specified address doesn't exist, nothing to do"));
-                // it did't exist, so there's nothing to remove
-                // Just complete the request with OK status            
-                OnOidComplete( aCtxImpl );                    
-                }
-            }
-        }
-
-    // signal caller whether a state transition occurred or not
-    return stateTransitionOccurred;
-    }
-
-// ---------------------------------------------------------------------------
-// 
-// ---------------------------------------------------------------------------
-//
 TBool WlanDot11Associated::AddBroadcastWepKey(
     WlanContextImpl& aCtxImpl,
     TUint32 aKeyIndex,             
@@ -2395,89 +2223,6 @@
 // 
 // ---------------------------------------------------------------------------
 //
-TBool WlanDot11Associated::SetGroupAddressesTableMib(
-    WlanContextImpl& aCtxImpl )
-    {
-    const TMacAddress* multicastAddresses( NULL );
-    const TUint32 nbrOfAddrs( 
-        aCtxImpl.GetMulticastAddresses( multicastAddresses ) );
-
-    TUint32 mibLength(  
-        // mib header length
-        WHA::Sdot11GroupAddressesTable::KHeaderSize
-        // + mib data length
-        + ( sizeof( TMacAddress ) * nbrOfAddrs ) );
-
-    // align length of MIB to 4-byte boundary
-    mibLength = Align4( mibLength );
-    
-    OsTracePrint( 
-        KWlmCmdDetails, 
-        (TUint8*)
-        ("UMAC: WlanDot11Associated::SetGroupAddressesTableMib(): mibLength: %d"), 
-        mibLength );        
-
-    // allocate memory for the mib to write
-    WHA::Sdot11GroupAddressesTable* mib 
-        = static_cast<WHA::Sdot11GroupAddressesTable*>
-        (os_alloc( mibLength )); 
-
-    if ( !mib )
-        {
-        // allocation failed
-        // simulate macnotresponding error
-        OsTracePrint( KWarningLevel, (TUint8*)
-            ("UMAC: WlanDot11Associated::SetGroupAddressesTableMib(): memory allocating failed") );
-        return DoErrorIndication( aCtxImpl, WHA::KErrorMacNotResponding );
-        }
-    
-    if ( nbrOfAddrs )
-        {
-        // at least one address exists, so enable multicast address filtering
-        mib->iEnable = ETrue;
-        }
-    else
-        {
-        // no addresses, so disable filtering
-        mib->iEnable = EFalse;
-        OsTracePrint( KWlmCmdDetails, (TUint8*)
-            ("UMAC: WlanDot11Associated::SetGroupAddressesTableMib(): no addresses; disable filtering") );
-        }
-
-    mib->iNumOfAddrs = nbrOfAddrs;
-    
-    // copy the multicast addresses after the mib header
-    os_memcpy( mib->iAddrData,
-               reinterpret_cast<TUint8*>(const_cast<TMacAddress*>(
-                    multicastAddresses)),
-               ( sizeof( TMacAddress ) * nbrOfAddrs ) );
-        
-    WlanWsaWriteMib& wha_cmd = aCtxImpl.WsaWriteMib();
-        
-    wha_cmd.Set( 
-        aCtxImpl, 
-        WHA::KMibDot11GroupAddressesTable, 
-        mibLength, 
-        mib );
-        
-    // change global state: entry procedure triggers action
-    ChangeState( aCtxImpl, 
-        *this,              // prev state
-        wha_cmd,            // next state
-        // the ACT
-        KCompleteManagementRequest
-        );   
-
-    os_free( mib ); // release the allocated memory
-
-    // signal caller that a state transition occurred
-    return ETrue;
-    }         
-
-// ---------------------------------------------------------------------------
-// 
-// ---------------------------------------------------------------------------
-//
 TBool WlanDot11Associated::PowerMgmtModeChange(
     WlanContextImpl& aCtxImpl,
     TPowerMgmtModeChange aPowerMgmtModeChange )
@@ -2490,7 +2235,7 @@
         
         if ( aPowerMgmtModeChange == EToActive )
             {
-            aCtxImpl.DesiredDot11PwrMgmtMode( WHA::KPsDisable );                
+            aCtxImpl.DesiredDot11PwrMgmtMode( WHA::KPsDisable );
             }
         else if ( aPowerMgmtModeChange == EToLightPs )
             {
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11InfrastructureMode.cpp	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11InfrastructureMode.cpp	Fri Jun 04 12:12:29 2010 +0300
@@ -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: 63 %
+* %version: 64 %
 */
 
 #include "config.h"
@@ -788,19 +788,6 @@
 // 
 // ---------------------------------------------------------------------------
 //
-void WlanDot11InfrastructureMode::DoPsModeErrorIndication( 
-    WlanContextImpl& aCtxImpl )
-    {
-    OsTracePrint( KWlmIndication, (TUint8*)
-        ("UMAC: WlanDot11InfrastructureMode::DoPsModeErrorIndication") ); 
-    
-    OnInDicationEvent( aCtxImpl, EPsModeError );    
-    }
-
-// ---------------------------------------------------------------------------
-// 
-// ---------------------------------------------------------------------------
-//
 TBool WlanDot11InfrastructureMode::OnVoiceCallEntryTimerTimeout( 
     WlanContextImpl& aCtxImpl )
     {
@@ -925,6 +912,7 @@
     
     TUint32 lengthOfFrame( 0 );
     T802Dot11FrameControlTypeMask frameType( E802Dot11FrameTypeDataNull );
+    WHA::TQueueId queue_id( WHA::ELegacy );
 
     // copy Null Data frame to tx-buffer to correct offset
     // client doesn't need to take care of the tx buffer header space
@@ -972,7 +960,7 @@
             }
 
         // determine Tx queue
-        const WHA::TQueueId queue_id( QueueId( aCtxImpl, start_of_frame ) );
+        queue_id = QueueId( aCtxImpl, start_of_frame );
         
         // send the Null Data frame by pushing it to packet scheduler
         aCtxImpl.PushPacketToPacketScheduler( 
@@ -982,13 +970,24 @@
                 frameType,
                 NULL,
                 EFalse,
-                EFalse );
+                EFalse,
+                ETrue );
         }                
     else
         {
         // we didn't get a Tx buffer so we can't submit a frame send request.
         status = EFalse;
         }
-        
+
+    TUint16 KetherType( 0 ); // N/A in this case
+    // check if we need to change power mgmt mode; no matter whether we 
+    // actually managed to send a frame or not
+    const TPowerMgmtModeChange KPowerMgmtModeChange ( 
+        aCtxImpl.OnFrameTx( queue_id, KetherType, frameType ) );
+    
+    // if any change is needed regarding our power mgmt mode,
+    // proceed with it
+    PowerMgmtModeChange( aCtxImpl, KPowerMgmtModeChange );
+    
     return status;                
     }
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11SoftReset.cpp	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11SoftReset.cpp	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2005-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: 28 %
+* %version: 29 %
 */
 
 #include "config.h"
@@ -137,6 +137,7 @@
     // we are breaking an existing join so we have to reset some
     // state variables and settings
     aCtxImpl.CurrentDot11PwrMgmtMode( WHA::KPsDisable );
+    aCtxImpl.RestorePwrModeMgmtParameters();
     aCtxImpl.Reassociate( EFalse );
     aCtxImpl.QosEnabled( EFalse );
     aCtxImpl.UapsdEnabled( EFalse );
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11State.cpp	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11State.cpp	Fri Jun 04 12:12:29 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: 86 %
+* %version: 89 %
 */
 
 #include "config.h"
@@ -2684,8 +2684,7 @@
             - aBuffer );                              // buffer beginning
                     
         // complete
-        const TDataBuffer* KMetaHdr ( metaHdr );
-        aCtxImpl.iUmac.MgmtDataReceiveComplete( KMetaHdr, 1 );
+        aCtxImpl.iUmac.MgmtDataReceiveComplete( metaHdr, 1 );
         }
     else
         {
@@ -3058,6 +3057,185 @@
     return ret;
     }
 
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TBool WlanDot11State::AddMulticastAddr(
+    WlanContextImpl& aCtxImpl,
+    const TMacAddress& aMacAddr )
+    {
+    TBool stateTransitionOccurred( EFalse );
+    
+    OsTracePrint( 
+        KWlmCmdDetails, 
+        (TUint8*)
+        ("UMAC: WlanDot11State::AddMulticastAddr(): addr to be added:"),
+        aMacAddr);
+
+    if ( aCtxImpl.MulticastFilteringDisAllowed() )
+        {
+        OsTracePrint( 
+            KWlmCmdDetails, 
+            (TUint8*)
+            ("UMAC: WlanDot11State::AddMulticastAddr(): Multicast filtering "
+             "disallowed"));
+            
+        OnOidComplete( aCtxImpl, KErrGeneral );        
+        }
+    else
+        {        
+        if ( aCtxImpl.WHASettings().iNumOfGroupTableEntrys > 
+             aCtxImpl.MulticastAddressCount() )
+            {
+            // wha layer is able to take in an address
+            
+            // 1st try to add the address to our own internal bookkeeping
+            WlanContextImpl::TGroupAddStatus addStatus = 
+                aCtxImpl.AddMulticastAddress( aMacAddr );
+
+            switch ( addStatus )
+                {
+                case WlanContextImpl::EOk:
+                    OsTracePrint( 
+                        KWlmCmdDetails, 
+                        (TUint8*)
+                        ("UMAC: WlanDot11State::AddMulticastAddr(): Address "
+                         "will be added to the MIB"));
+                    // the address needed to be added and adding went ok.
+                    // Now update the group addresses MIB
+                    stateTransitionOccurred = SetGroupAddressesTableMib( aCtxImpl ); 
+                    break;
+                case WlanContextImpl::EAlreadyExists: 
+                    OsTracePrint( 
+                        KWlmCmdDetails, 
+                        (TUint8*)
+                        ("UMAC: WlanDot11State::AddMulticastAddr(): Address "
+                         "already exists"));
+                    // the specified address already exists so there's no need
+                    // to update the group addresses MIB
+                    // just complete the request with OK status
+                    OnOidComplete( aCtxImpl );
+                    stateTransitionOccurred = EFalse;           
+                    break;
+                case WlanContextImpl::EFull:
+                    OsTracePrint( 
+                        KWlmCmdDetails, 
+                        (TUint8*)
+                        ("UMAC: WlanDot11State::AddMulticastAddr(): Internal "
+                         "address table full; disallow multicast filtering"));
+                    // we are not able to take in any more addresses.
+                    // We will totally disable the multicast filtering
+                    // and we won't allow it to be enabled any more during 
+                    // the current nw connection
+                    //
+                    aCtxImpl.ResetMulticastAddresses();               
+                    aCtxImpl.MulticastFilteringDisAllowed( ETrue );
+                    stateTransitionOccurred = 
+                        SetGroupAddressesTableMib( aCtxImpl );
+                    break;
+                default:
+                    // programming error
+                    OsTracePrint( KErrorLevel, (TUint8*)
+                        ("UMAC: addStatus: %d"), addStatus );
+                    OsAssert( (TUint8*)("UMAC: panic"), 
+                        (TUint8*)(WLAN_FILE), __LINE__ );
+                }
+            }
+        else
+            {
+            OsTracePrint( 
+                KWlmCmdDetails, 
+                (TUint8*)
+                ("UMAC: WlanDot11State::AddMulticastAddr(): WHA not able to "
+                 "accept address; disallow multicast filtering"));
+            // wha layer is not able to take in an address. Either this is one 
+            // address too many, or it doesn't support even a single address.
+            // In either case we will totally disable the multicast filtering
+            // and we won't allow it to be enabled any more during the current 
+            // nw connection
+            aCtxImpl.ResetMulticastAddresses();               
+            aCtxImpl.MulticastFilteringDisAllowed( ETrue );
+            stateTransitionOccurred = SetGroupAddressesTableMib( aCtxImpl );
+            }
+        }
+
+    // signal caller whether a state transition occurred or not
+    return stateTransitionOccurred;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TBool WlanDot11State::RemoveMulticastAddr(
+    WlanContextImpl& aCtxImpl,
+    TBool aRemoveAll,
+    const TMacAddress& aMacAddr )
+    {
+    TBool stateTransitionOccurred( EFalse );
+    
+    OsTracePrint( 
+        KWlmCmdDetails, 
+        (TUint8*)
+        ("UMAC: WlanDot11State::RemoveMulticastAddr(): addr to be removed:"),
+        aMacAddr);
+
+    if ( aCtxImpl.MulticastFilteringDisAllowed() )
+        {
+        OsTracePrint( 
+            KWlmCmdDetails, 
+            (TUint8*)
+            ("UMAC: WlanDot11State::RemoveMulticastAddr(): Multicast filtering "
+             "disallowed"));
+        // filtering is not allowed currently so there can't be any addresses
+        // to remove. Just complete the request with OK status            
+        OnOidComplete( aCtxImpl );        
+        }
+    else
+        {
+        if ( aRemoveAll )        
+            {
+            OsTracePrint( 
+                KWlmCmdDetails, 
+                (TUint8*)
+                ("UMAC: WlanDot11State::RemoveMulticastAddr(): remove all"));
+            // remove all addresses; naturally will also disable filtering
+            aCtxImpl.ResetMulticastAddresses();
+            stateTransitionOccurred = SetGroupAddressesTableMib( aCtxImpl );            
+            }
+        else
+            {            
+            // 1st remove the specified address from our own internal 
+            // bookkeeping, if it exists
+            if ( aCtxImpl.RemoveMulticastAddress( aMacAddr ) )
+                {
+                OsTracePrint( 
+                    KWlmCmdDetails, 
+                    (TUint8*)
+                    ("UMAC: WlanDot11State::RemoveMulticastAddr(): removing "
+                     "the specified address"));
+                // it existed, so update the group addresses MIB, too
+                stateTransitionOccurred = SetGroupAddressesTableMib( aCtxImpl );                 
+                }
+            else
+                {
+                OsTracePrint( 
+                    KWlmCmdDetails, 
+                    (TUint8*)
+                    ("UMAC: WlanDot11State::RemoveMulticastAddr(): specified "
+                     "address doesn't exist, nothing to do"));
+                // it did't exist, so there's nothing to remove
+                // Just complete the request with OK status            
+                OnOidComplete( aCtxImpl );                    
+                }
+            }
+        }
+
+    // signal caller whether a state transition occurred or not
+    return stateTransitionOccurred;
+    }
+
 // -----------------------------------------------------------------------------
 // 
 // -----------------------------------------------------------------------------
@@ -3070,6 +3248,16 @@
     OsTracePrint( KUmacDetails, 
         (TUint8*)("UMAC: WlanDot11State::InitNetworkConnect") );
 
+    // 1st clear our BSS Membership feature list
+    aCtxImpl.ClearBssMembershipFeatureList();
+    
+    if ( aCtxImpl.WHASettings().iCapability & WHA::SSettings::KHtOperation )
+        {
+        // wlanpdd indicates HT support. Record that in our BSS Membership
+        // features
+        aCtxImpl.AddBssMembershipFeature( E802Dot11HtPhy );
+        }
+    
     const SScanResponseFixedFields* scanResponseFixedFields = 
         reinterpret_cast<const SScanResponseFixedFields*>( 
             aScanResponseFrameBody );
@@ -3121,9 +3309,6 @@
         return EFalse;
         }
 
-    // network capabilities are met -> proceed
-
-
     // initialize element locator for locating IEs from the scan response 
     // frame body
     WlanElementLocator elementLocator( 
@@ -3133,69 +3318,7 @@
 
     TUint8 elementDatalength( 0 );
     const TUint8* elementData( NULL );
-    
-    //=============================================
-    // do we meet mandatory network rates
-    //=============================================
-
-    // locate supported rates IE
-    if ( elementLocator.InformationElement( 
-        E802Dot11SupportedRatesIE,
-        elementDatalength, 
-        &elementData ) == WlanElementLocator::EWlanLocateOk )
-        {
-        // ...and store it to our context
-        aCtxImpl.GetApSupportedRatesIE().SetIeData( 
-            elementData, 
-            elementDatalength );        
-        }
-    else
-        {
-        OsTracePrint( KWarningLevel, (TUint8*)
-            ("UMAC: WlanDot11State::InitNetworkConnect: supported rates IE not found -> abort") );
-
-        return EFalse;
-        }
-
-    // locate extended supported rates information element
-    if ( elementLocator.InformationElement( 
-        E802Dot11ExtendedRatesIE,
-        elementDatalength, 
-        &elementData ) == WlanElementLocator::EWlanLocateOk )
-        {
-        OsTracePrint( KInfoLevel, (TUint8*)
-            ("UMAC: WlanDot11State::InitNetworkConnect: E802Dot11ExtendedRatesIE present") );
-
-        // ...and store it to our context
-        aCtxImpl.GetApExtendedSupportedRatesIE().SetIeData( elementData, elementDatalength );
-
-        // check if we meet mandatory rates; in this case check also extended supported rates
-        if ( !AreSupportedRatesMet( aCtxImpl, ETrue ) )
-            {
-            OsTracePrint( KWarningLevel, (TUint8*)
-                ("UMAC: WlanDot11State::InitNetworkConnect: rates not met -> abort") );
-
-            return EFalse;
-            }
-        }
-    else
-        {
-        OsTracePrint( KInfoLevel, (TUint8*)
-            ("UMAC: WlanDot11State::InitNetworkConnect: E802Dot11ExtendedRatesIE not present") );
-
-        // check if we meet mandatory rates; in this case extended supported rates 
-        // don't need to be checked
-        if ( !AreSupportedRatesMet( aCtxImpl, EFalse ) )
-            {
-            OsTracePrint( KWarningLevel, 
-                (TUint8*)("UMAC: WlanDot11State::InitNetworkConnect: rates not met -> abort") );
-
-            return EFalse;
-            }            
-        }
-
-    // mandatory network rates are met -> proceed
-    
+        
     //=============================================
     // determine the channel of the network
     //=============================================
@@ -3394,6 +3517,66 @@
         }
 
     //=============================================
+    // do we meet mandatory network rates
+    //=============================================
+
+    // locate supported rates IE
+    if ( elementLocator.InformationElement( 
+        E802Dot11SupportedRatesIE,
+        elementDatalength, 
+        &elementData ) == WlanElementLocator::EWlanLocateOk )
+        {
+        // ...and store it to our context
+        aCtxImpl.GetApSupportedRatesIE().SetIeData( 
+            elementData, 
+            elementDatalength );        
+        }
+    else
+        {
+        OsTracePrint( KWarningLevel, (TUint8*)
+            ("UMAC: WlanDot11State::InitNetworkConnect: supported rates IE not found -> abort") );
+
+        return EFalse;
+        }
+
+    // locate extended supported rates information element
+    if ( elementLocator.InformationElement( 
+        E802Dot11ExtendedRatesIE,
+        elementDatalength, 
+        &elementData ) == WlanElementLocator::EWlanLocateOk )
+        {
+        OsTracePrint( KInfoLevel, (TUint8*)
+            ("UMAC: WlanDot11State::InitNetworkConnect: E802Dot11ExtendedRatesIE present") );
+
+        // ...and store it to our context
+        aCtxImpl.GetApExtendedSupportedRatesIE().SetIeData( elementData, elementDatalength );
+
+        // check if we meet mandatory rates; in this case check also extended supported rates
+        if ( !AreSupportedRatesMet( aCtxImpl, ETrue ) )
+            {
+            OsTracePrint( KWarningLevel, (TUint8*)
+                ("UMAC: WlanDot11State::InitNetworkConnect: rates not met -> abort") );
+
+            return EFalse;
+            }
+        }
+    else
+        {
+        OsTracePrint( KInfoLevel, (TUint8*)
+            ("UMAC: WlanDot11State::InitNetworkConnect: E802Dot11ExtendedRatesIE not present") );
+
+        // check if we meet mandatory rates; in this case extended supported rates 
+        // don't need to be checked
+        if ( !AreSupportedRatesMet( aCtxImpl, EFalse ) )
+            {
+            OsTracePrint( KWarningLevel, 
+                (TUint8*)("UMAC: WlanDot11State::InitNetworkConnect: rates not met -> abort") );
+
+            return EFalse;
+            }            
+        }
+
+    //=============================================
     // determine U-APSD usage for the ACs/Tx queues
     //=============================================
     DetermineAcUapsdUsage( aCtxImpl );
@@ -4091,6 +4274,91 @@
     return EFalse;    
     }
 
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TBool WlanDot11State::SetGroupAddressesTableMib(
+    WlanContextImpl& aCtxImpl )
+    {
+    const TMacAddress* multicastAddresses( NULL );
+    const TUint32 nbrOfAddrs( 
+        aCtxImpl.GetMulticastAddresses( multicastAddresses ) );
+
+    TUint32 mibLength(  
+        // mib header length
+        WHA::Sdot11GroupAddressesTable::KHeaderSize
+        // + mib data length
+        + ( sizeof( TMacAddress ) * nbrOfAddrs ) );
+
+    // align length of MIB to 4-byte boundary
+    mibLength = Align4( mibLength );
+    
+    OsTracePrint( 
+        KWlmCmdDetails, 
+        (TUint8*)
+        ("UMAC: WlanDot11State::SetGroupAddressesTableMib(): mibLength: %d"), 
+        mibLength );        
+
+    // allocate memory for the mib to write
+    WHA::Sdot11GroupAddressesTable* mib 
+        = static_cast<WHA::Sdot11GroupAddressesTable*>
+        (os_alloc( mibLength )); 
+
+    if ( !mib )
+        {
+        // allocation failed
+        // simulate macnotresponding error
+        OsTracePrint( KWarningLevel, (TUint8*)
+            ("UMAC: WlanDot11State::SetGroupAddressesTableMib(): memory "
+             "allocation failed") );
+        return DoErrorIndication( aCtxImpl, WHA::KErrorMacNotResponding );
+        }
+    
+    if ( nbrOfAddrs )
+        {
+        // at least one address exists, so enable multicast address filtering
+        mib->iEnable = ETrue;
+        }
+    else
+        {
+        // no addresses, so disable filtering
+        mib->iEnable = EFalse;
+        OsTracePrint( KWlmCmdDetails, (TUint8*)
+            ("UMAC: WlanDot11State::SetGroupAddressesTableMib(): no addresses; "
+             "disable filtering") );
+        }
+
+    mib->iNumOfAddrs = nbrOfAddrs;
+    
+    // copy the multicast addresses after the mib header
+    os_memcpy( mib->iAddrData,
+               reinterpret_cast<TUint8*>(const_cast<TMacAddress*>(
+                    multicastAddresses)),
+               ( sizeof( TMacAddress ) * nbrOfAddrs ) );
+        
+    WlanWsaWriteMib& wha_cmd = aCtxImpl.WsaWriteMib();
+        
+    wha_cmd.Set( 
+        aCtxImpl, 
+        WHA::KMibDot11GroupAddressesTable, 
+        mibLength, 
+        mib );
+        
+    // change global state: entry procedure triggers action
+    ChangeState( aCtxImpl, 
+        *this,              // prev state
+        wha_cmd,            // next state
+        // the ACT
+        KCompleteManagementRequest
+        );   
+
+    os_free( mib ); // release the allocated memory
+
+    // signal caller that a state transition occurred
+    return ETrue;
+    }
+
 // -----------------------------------------------------------------------------
 // 
 // -----------------------------------------------------------------------------
@@ -4734,6 +5002,9 @@
         // nw supported it. We achieve that by handling the target nw as
         // a non-HT nw
         aCtxImpl.HtSupportedByNw( EFalse );
+        // in this case we need to remove HT also from our BSS membership 
+        // feature list
+        aCtxImpl.RemoveBssMembershipFeature( E802Dot11HtPhy );
         
         OsTracePrint( KInfoLevel, (TUint8*)
             ("UMAC: WlanDot11State::HandleDot11n: TKIP as pairwise cipher "
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11Synchronize.cpp	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11Synchronize.cpp	Fri Jun 04 12:12:29 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: 29 %
+* %version: 30 %
 */
 
 #include "config.h"
@@ -497,6 +497,9 @@
     // Light PS is the initial desired PS mode configuration
     aCtxImpl.SetDesiredPsModeConfig( 
         aCtxImpl.ClientLightPsModeConfig() );
+    // also make sure that the dynamic power mode managemen parameters are in
+    // their WLAN Mgmt Client provided values
+    aCtxImpl.RestorePwrModeMgmtParameters();
     
     // check do we meet the requirements for the network
     // and construct necessary objects for doing the connection
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacMacState.cpp	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacMacState.cpp	Fri Jun 04 12:12:29 2010 +0300
@@ -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: 76 %
+* %version: 77 %
 */
 
 #include "config.h"
@@ -97,13 +97,15 @@
 // -----------------------------------------------------------------------------
 //
 TBool WlanMacState::SetRcpiTriggerLevel(
-    WlanContextImpl& /*aCtxImpl*/,
+    WlanContextImpl& aCtxImpl,
     TUint32 /*aRcpiTrigger*/ )          
     {
     // not supported in default handler
+#ifndef NDEBUG                
     OsAssert( (TUint8*)("UMAC: panic"), (TUint8*)(WLAN_FILE), __LINE__ );
-
-    return EFalse;
+#endif
+    OnOidComplete( aCtxImpl, KErrNotSupported );
+    return EFalse; // no state change
     }
 
 // -----------------------------------------------------------------------------
@@ -111,7 +113,7 @@
 // -----------------------------------------------------------------------------
 //
 TBool WlanMacState::AddBroadcastWepKey(
-    WlanContextImpl& /*aCtxImpl*/,
+    WlanContextImpl& aCtxImpl,
     TUint32 /*aKeyIndex*/, 
     TBool /*aUseAsDefaulKey*/,        
     TUint32 /*aKeyLength*/,                      
@@ -119,8 +121,11 @@
     const TMacAddress& /*aMac*/ )    
     {
     // not supported in default handler
+#ifndef NDEBUG                
     OsAssert( (TUint8*)("UMAC: panic"), (TUint8*)(WLAN_FILE), __LINE__ );
-    return EFalse;
+#endif
+    OnOidComplete( aCtxImpl, KErrNotSupported );
+    return EFalse; // no state change
     }
 
 // -----------------------------------------------------------------------------
@@ -197,7 +202,7 @@
 // ---------------------------------------------------------------------------
 //
 TBool WlanMacState::Connect(
-    WlanContextImpl& /*aCtxImpl*/,
+    WlanContextImpl& aCtxImpl,
     const TSSID& /*aSSID*/,                 
     const TMacAddress& /*aBSSID*/,          
     TUint16 /*aAuthAlgorithmNbr*/,      
@@ -209,19 +214,25 @@
     TUint16 /*aIeDataLength*/ )
     {
     // not supported in default handler
+#ifndef NDEBUG                
     OsAssert( (TUint8*)("UMAC: panic"), (TUint8*)(WLAN_FILE), __LINE__ );
-    return EFalse;
+#endif
+    OnOidComplete( aCtxImpl, KErrNotSupported );
+    return EFalse; // no state change
     }
 
 // -----------------------------------------------------------------------------
 // 
 // -----------------------------------------------------------------------------
 //
-TBool WlanMacState::Disconnect( WlanContextImpl& /*aCtxImpl*/ )
+TBool WlanMacState::Disconnect( WlanContextImpl& aCtxImpl )
     {
     // not supported in default handler
+#ifndef NDEBUG                
     OsAssert( (TUint8*)("UMAC: panic"), (TUint8*)(WLAN_FILE), __LINE__ );
-    return EFalse;
+#endif
+    OnOidComplete( aCtxImpl, KErrNotSupported );
+    return EFalse; // no state change
     }
 
 // -----------------------------------------------------------------------------
@@ -321,7 +332,7 @@
 // -----------------------------------------------------------------------------
 //
 TBool WlanMacState::StartIBSS(
-    WlanContextImpl& /*aCtxImpl*/,
+    WlanContextImpl& aCtxImpl,
     const TSSID& /*aSSID*/,                 
     TUint32 /*aBeaconInterval*/,            
     TUint32 /*aAtim*/,                      
@@ -329,8 +340,11 @@
     TEncryptionStatus /*aEncryptionStatus*/ )
     {
     // not supported in default handler
+#ifndef NDEBUG                
     OsAssert( (TUint8*)("UMAC: panic"), (TUint8*)(WLAN_FILE), __LINE__ );
-    return EFalse;
+#endif
+    OnOidComplete( aCtxImpl, KErrNotSupported );
+    return EFalse; // no state change
     }
 
 // -----------------------------------------------------------------------------
@@ -366,8 +380,7 @@
     TUint32 /*aMaxChannelTime*/,
     TBool /*aSplitScan*/ )
     {
-    OnOidComplete( aCtxImpl, KErrGeneral );
-    
+    OnOidComplete( aCtxImpl, KErrNotSupported );
     return EFalse; // no state change
     }
 
@@ -400,7 +413,7 @@
 // -----------------------------------------------------------------------------
 //
 TBool WlanMacState::Configure(
-    WlanContextImpl& /*aCtxImpl*/,
+    WlanContextImpl& aCtxImpl,
     TUint32 /*aRTSThreshold*/,              
     TUint32 /*aMaxTxMSDULifetime*/,
     TUint32 /*aVoiceCallEntryTimeout*/,
@@ -413,8 +426,11 @@
     TUint32 /*aSpMinIndicationInterval*/ )         
     {
     // not supported in default handler
+#ifndef NDEBUG                
     OsAssert( (TUint8*)("UMAC: panic"), (TUint8*)(WLAN_FILE), __LINE__ );
-    return EFalse;
+#endif
+    OnOidComplete( aCtxImpl, KErrNotSupported );
+    return EFalse; // no state change
     }
 
 // -----------------------------------------------------------------------------
@@ -580,14 +596,17 @@
 // -----------------------------------------------------------------------------
 //
 TBool WlanMacState::ConfigureTxQueueIfNecessary( 
-        WlanContextImpl& /*aCtxImpl*/,
-        TQueueId /*aQueueId*/,
-        TUint16 /*aMediumTime*/,
-        TUint32 /*aMaxTxMSDULifetime*/ )
+    WlanContextImpl& aCtxImpl,
+    TQueueId /*aQueueId*/,
+    TUint16 /*aMediumTime*/,
+    TUint32 /*aMaxTxMSDULifetime*/ )
     {
     // not supported in default handler
+#ifndef NDEBUG                
     OsAssert( (TUint8*)("UMAC: panic"), (TUint8*)(WLAN_FILE), __LINE__ );
-    return EFalse;            
+#endif
+    OnOidComplete( aCtxImpl, KErrNotSupported );
+    return EFalse; // no state change
     }
 
 // -----------------------------------------------------------------------------
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacWsaConfigure.cpp	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacWsaConfigure.cpp	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2005-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 "config.h"
@@ -171,14 +171,7 @@
             ("UMAC: WlanWsaConfigure::Entry: iMcsFeedback: %d"), 
             aCtxImpl.WHASettings().iHtCapabilities.iMcsFeedback );
         }
-#endif
-    
-    if ( aCtxImpl.WHASettings().iCapability & WHA::SSettings::KHtOperation )
-        {
-        // wlanpdd indicates HT support. Record that in our BSS Membership
-        // features
-        aCtxImpl.AddBssMembershipFeature( E802Dot11HtPhy );        
-        }
+#endif    
     }
 
 // -----------------------------------------------------------------------------
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/umacactivemodepowermodemgr.cpp	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/umacactivemodepowermodemgr.cpp	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-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: 13 %
+* %version: 14 %
 */
 
 #include "config.h"
@@ -24,11 +24,6 @@
 #include "UmacContextImpl.h"
 
 
-// Default Rx/Tx frame count threshold for considering change to Light PS mode.
-// This value is used if another value hasn't been provided
-const TUint KDefaultToLightPsFrameThreshold = 1;
-
-
 // ================= MEMBER FUNCTIONS =======================
 
 // ---------------------------------------------------------------------------
@@ -57,6 +52,7 @@
     WlanContextImpl& /*aCtxImpl*/, 
     WHA::TQueueId /*aQueueId*/,
     TUint16 aEtherType,
+    T802Dot11FrameControlTypeMask aDot11FrameType,
     TBool aIgnoreThisFrame )
     {
     if ( aEtherType == KEapolType ||
@@ -69,7 +65,7 @@
         }
     else
         {
-        if ( aIgnoreThisFrame )
+        if ( aIgnoreThisFrame || aDot11FrameType == E802Dot11FrameTypeDataNull )
             { 
             // for these frames we don't increment the Tx counter
     
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/umacdeeppsmodepowermodemgr.cpp	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/umacdeeppsmodepowermodemgr.cpp	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-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: 3 %
+* %version: 4 %
 */
 
 #include "config.h"
@@ -42,32 +42,53 @@
     {
     }
 
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void WlanDeepPsModePowerModeMgr::SetParameters(
+    TUint16 aUapsdRxFrameLengthThreshold )
+    {
+    iUapsdRxFrameLengthThreshold = aUapsdRxFrameLengthThreshold;
+    }
+
 // ---------------------------------------------------------------------------
 // 
 // ---------------------------------------------------------------------------
 //
 TPowerMgmtModeChange WlanDeepPsModePowerModeMgr::OnFrameTx( 
-    WlanContextImpl& /*aCtxImpl*/, 
+    WlanContextImpl& aCtxImpl, 
     WHA::TQueueId /*aQueueId*/,
     TUint16 aEtherType,
-    TBool /*aIgnoreThisFrame*/ )
+    T802Dot11FrameControlTypeMask aDot11FrameType,
+    TBool aIgnoreThisFrame )
     {
     TPowerMgmtModeChange powerMgmtModeChange( ENoChange );
 
     if ( aEtherType == KEapolType ||
-         aEtherType == KWaiType )
+         aEtherType == KWaiType ||
+         aDot11FrameType == E802Dot11FrameTypeDataNull ||
+         ( aEtherType == KArpType && 
+           !(aCtxImpl.UapsdUsedForVoice() && aCtxImpl.InVoiceCallState()) ) ) 
         {
         powerMgmtModeChange = EToActive;
 
         OsTracePrint( KPwrStateTransition, (TUint8*)
-            ("UMAC: WlanDeepPsModePowerModeMgr::OnFrameTx: EAPOL or WAI frame; change to Active") );            
+            ("UMAC: WlanDeepPsModePowerModeMgr::OnFrameTx: EAPOL, WAI or keep "
+             "alive frame or ARP in non- U-APSD WoWLAN call state; change to "
+			 "Active") );
         }
-    else
+    else if ( !aIgnoreThisFrame )
         {
         powerMgmtModeChange = EToLightPs; 
 
         OsTracePrint( KPwrStateTransition, (TUint8*)
-            ("UMAC: WlanDeepPsModePowerModeMgr::OnFrameTx: change to Light PS") );            
+            ("UMAC: WlanDeepPsModePowerModeMgr::OnFrameTx: change to Light"
+             " PS") );            
+        }
+    else
+        {
+        // no action needed
         }
     
     return powerMgmtModeChange;    
@@ -78,11 +99,11 @@
 // ---------------------------------------------------------------------------
 //
 TPowerMgmtModeChange WlanDeepPsModePowerModeMgr::OnFrameRx( 
-    WlanContextImpl& /*aCtxImpl*/,
-    WHA::TQueueId /*aAccessCategory*/,
+    WlanContextImpl& aCtxImpl,
+    WHA::TQueueId aAccessCategory,
     TUint16 aEtherType,
-    TBool /*aIgnoreThisFrame*/,
-    TUint /*aPayloadLength*/,
+    TBool aIgnoreThisFrame,
+    TUint aPayloadLength,
     TDaType aDaType ) 
     {
     TPowerMgmtModeChange powerMgmtModeChange( ENoChange );
@@ -93,22 +114,36 @@
         powerMgmtModeChange = EToActive;
 
         OsTracePrint( KPwrStateTransition, (TUint8*)
-            ("UMAC: WlanDeepPsModePowerModeMgr::OnFrameRx: EAPOL or WAI frame; change to Active") );            
-        }
-    else if ( aDaType == EBroadcastAddress ) 
-        {
-        // no action needed
-        
-        OsTracePrint( KPwrStateTransition, (TUint8*)
-            ("UMAC: WlanDeepPsModePowerModeMgr::OnFrameRx: bcast frame; no state change") );            
+            ("UMAC: WlanDeepPsModePowerModeMgr::OnFrameRx: EAPOL or WAI frame;"
+             " change to Active") );            
         }
     else
         {
-        powerMgmtModeChange = EToLightPs;        
+        if ( CountThisFrame( 
+                aCtxImpl, 
+                aAccessCategory,
+                aEtherType,
+                aIgnoreThisFrame, 
+                aPayloadLength, 
+                iUapsdRxFrameLengthThreshold,
+                aDaType ) )
+            {
+            powerMgmtModeChange = EToLightPs;        
 
-        OsTracePrint( KPwrStateTransition, (TUint8*)
-            ("UMAC: WlanDeepPsModePowerModeMgr::OnFrameRx: change to Light PS") );            
+            OsTracePrint( KPwrStateTransition, (TUint8*)
+                ("UMAC: WlanDeepPsModePowerModeMgr::OnFrameRx: change to Light"
+                 " PS") );            
+            }
         }
     
-    return powerMgmtModeChange;    
+    return powerMgmtModeChange;
     }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TPowerMgmtModeChange WlanDeepPsModePowerModeMgr::OnPsModeErrorIndication()
+    {
+    return EToActive;
+    }
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/umacdot11infrastructurenormalmode.cpp	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/umacdot11infrastructurenormalmode.cpp	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2005-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"
@@ -17,7 +17,7 @@
 */
 
 /*
-* %version: 14 %
+* %version: 15 %
 */
 
 #include "config.h"
@@ -56,6 +56,28 @@
 // 
 // ---------------------------------------------------------------------------
 //
+void WlanDot11InfrastructureNormalMode::DoPsModeErrorIndication( 
+    WlanContextImpl& aCtxImpl )
+    {
+    OsTracePrint( KWlmIndication, (TUint8*)
+        ("UMAC: WlanDot11InfrastructureMode::DoPsModeErrorIndication") );
+    
+    // as the lower layers indicate that there is a problem with the PS
+    // operation of the current AP, we want to be in CAM mode for as long
+    // as there's data activity. So, check if we need a mode change to be
+    // in CAM now
+    const TPowerMgmtModeChange KPowerMgmtModeChange ( 
+        aCtxImpl.OnPsModeErrorIndication() );
+    
+    // if any change is needed regarding our power mgmt mode,
+    // proceed with it
+    PowerMgmtModeChange( aCtxImpl, KPowerMgmtModeChange );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
 TBool WlanDot11InfrastructureNormalMode::OnActiveToLightPsTimerTimeout( 
     WlanContextImpl& aCtxImpl )
     {
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/umacdynamicpowermodemgmtcntx.cpp	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/umacdynamicpowermodemgmtcntx.cpp	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-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: 14 %
+* %version: 15 %
 */
 
 #include "config.h"
@@ -55,6 +55,11 @@
     iActiveCntx( NULL ),
     iWlanContextImpl( aWlanCtxImpl ) 
     {
+    iActiveParamsBackup.iToLightPsTimeout = KDefaultToLightPsTimeout;
+    iActiveParamsBackup.iToLightPsFrameThreshold = 
+        WlanActiveModePowerModeMgr::KDefaultToLightPsFrameThreshold;
+    iActiveParamsBackup.iUapsdRxFrameLengthThreshold = 
+        WlanPowerModeMgrBase::KDefaultUapsdRxFrameLengthThreshold;
     os_memset( iIgnoreTraffic, 0, sizeof( iIgnoreTraffic ) );
     }
 
@@ -158,7 +163,8 @@
 //
 TPowerMgmtModeChange WlanDynamicPowerModeMgmtCntx::OnFrameTx( 
     WHA::TQueueId aQueueId,
-    TUint16 aEtherType )
+    TUint16 aEtherType,
+    T802Dot11FrameControlTypeMask aDot11FrameType )
     {
     TPowerMgmtModeChange powerMgmtModeChange( ENoChange );
 
@@ -172,13 +178,23 @@
                 iWlanContextImpl, 
                 aQueueId,
                 aEtherType,
+                aDot11FrameType,
                 iIgnoreTraffic[aQueueId] );
             
             if ( powerMgmtModeChange != ENoChange )
                 {
+                iStateChange = ETrue;
+            
                 // as we will do a mode change, cancel any possibly running 
                 // power mode management timers
                 CancelTimeouts();
+                
+                if ( aDot11FrameType == E802Dot11FrameTypeDataNull ||
+                     aEtherType == KArpType )
+                    {
+                    // modify temporarily the Active mode parameters
+                    SetKeepAliveActiveModeParameters();
+                    }
                 }
             }        
         else
@@ -230,6 +246,8 @@
             
             if ( powerMgmtModeChange != ENoChange )
                 {
+                iStateChange = ETrue;
+            
                 // as we will do a mode change, cancel any possibly running 
                 // power mode management timers
                 CancelTimeouts();
@@ -260,6 +278,57 @@
 // 
 // ---------------------------------------------------------------------------
 //
+TPowerMgmtModeChange WlanDynamicPowerModeMgmtCntx::OnPsModeErrorIndication()
+    {
+    TPowerMgmtModeChange powerMgmtModeChange( ENoChange );
+
+    if ( iActiveCntx )
+        {
+        // we have an active context, i.e. we are doing power mode mgmt
+        
+        if ( !iStateChange )
+            {
+            powerMgmtModeChange = iActiveCntx->OnPsModeErrorIndication();
+            
+            if ( powerMgmtModeChange != ENoChange )
+                {
+                iStateChange = ETrue;
+                
+                // as we will do a mode change, cancel any possibly running 
+                // power mode management timers
+                CancelTimeouts();
+                
+                // modify temporarily the Active mode parameters
+                SetPsModeErrorActiveModeParameters();
+                }
+            }
+        else
+            {
+            // state change already signalled from this power mode context, 
+            // don't do it more than once. No action needed
+            OsTracePrint( KPwrStateTransition, (TUint8*)
+                ("UMAC: WlanDynamicPowerModeMgmtCntx::OnPsModeErrorIndication: "
+                 "statechange already signalled") );
+            }
+        }
+    else
+        {
+        // dynamic power mode mgmt is not active => "No change" will be 
+        // returned. No action needed
+        }
+        
+    OsTracePrint( KPwrStateTransition, (TUint8*)
+        ("UMAC: WlanDynamicPowerModeMgmtCntx::OnPsModeErrorIndication: "
+         "statechange: %d"),
+        powerMgmtModeChange );
+    
+    return powerMgmtModeChange;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
 TBool WlanDynamicPowerModeMgmtCntx::OnActiveToLightPsTimerTimeout()
     {
     if ( ( iActiveCntx == &iActiveModeCntx ) && 
@@ -274,6 +343,11 @@
             ("UMAC: WlanDynamicPowerModeMgmtCntx::OnActiveToLightPsTimerTimeout: change state: %d"),
             iStateChange );
         
+        // make sure that the WLAN Mgmt Client provided Active mode 
+        // parameter values are again used the next time by default
+        //
+        RestoreActiveModeParameters();
+        
         if ( !iStateChange )
             {
             RegisterToLightPsTimeout();
@@ -292,6 +366,11 @@
         // In all these cases the timeout is not relevant and we take no action
         OsTracePrint( KPwrStateTransition, (TUint8*)
             ("UMAC: WlanDynamicPowerModeMgmtCntx::OnActiveToLightPsTimerTimeout: not relevant timeout") );
+        
+        // however, make sure that the WLAN Mgmt Client provided Active mode
+        // parameter values are again used the next time by default
+        //
+        RestoreActiveModeParameters();        
         }
     
     return iStateChange;
@@ -406,6 +485,15 @@
         aToActiveFrameThreshold,
         aToDeepPsFrameThreshold,
         aUapsdRxFrameLengthThreshold );
+    
+    iDeepPsModeCntx.SetParameters( aUapsdRxFrameLengthThreshold );
+    
+    // take also a backup of the Active mode parameters
+    //
+    iActiveParamsBackup.iToLightPsTimeout = aToLightPsTimeout;
+    iActiveParamsBackup.iToLightPsFrameThreshold = aToLightPsFrameThreshold;
+    iActiveParamsBackup.iUapsdRxFrameLengthThreshold = 
+        aUapsdRxFrameLengthThreshold;    
     }
 
 // ---------------------------------------------------------------------------
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/umaclightpsmodepowermodemgr.cpp	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/umaclightpsmodepowermodemgr.cpp	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-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: 3 %
+* %version: 4 %
 */
 
 #include "config.h"
@@ -59,49 +59,54 @@
 // ---------------------------------------------------------------------------
 //
 TPowerMgmtModeChange WlanLightPsModePowerModeMgr::OnFrameTx( 
-    WlanContextImpl& /*aCtxImpl*/, 
+    WlanContextImpl& aCtxImpl, 
     WHA::TQueueId /*aQueueId*/,
     TUint16 aEtherType,
+    T802Dot11FrameControlTypeMask aDot11FrameType,
     TBool aIgnoreThisFrame )
     {
     TPowerMgmtModeChange powerMgmtModeChange( ENoChange );
 
     if ( aEtherType == KEapolType ||
-         aEtherType == KWaiType )
+         aEtherType == KWaiType ||
+         aDot11FrameType == E802Dot11FrameTypeDataNull ||
+         ( aEtherType == KArpType && 
+           !(aCtxImpl.UapsdUsedForVoice() && aCtxImpl.InVoiceCallState())) )
         {
         powerMgmtModeChange = EToActive;
 
         OsTracePrint( KPwrStateTransition, (TUint8*)
-            ("UMAC: WlanLightPsModePowerModeMgr::OnFrameTx: EAPOL or WAI frame; change to Active") );            
+            ("UMAC: WlanLightPsModePowerModeMgr::OnFrameTx: EAPOL, WAI or keep "
+             "alive frame or ARP in non- U-APSD WoWLAN call state; change to "
+			 "Active") );
+        }
+    else if ( !aIgnoreThisFrame )
+        {
+        OsTracePrint( KPwrStateTransition, (TUint8*)
+            ("UMAC: WlanLightPsModePowerModeMgr::OnFrameTx: count this frame") );
+
+        ++iToActiveFrameCount;
+        ++iToDeepPsFrameCount;
+        
+        if ( iToActiveFrameCount >= iToActiveFrameThreshold )
+            {
+            powerMgmtModeChange = EToActive;
+
+            OsTracePrint( KPwrStateTransition, (TUint8*)
+                ("UMAC: WlanLightPsModePowerModeMgr::OnFrameTx: threshold "
+                 "exceeded; change to Active") );            
+            }
         }
     else
         {
-        if ( !aIgnoreThisFrame )
-            {
-            OsTracePrint( KPwrStateTransition, (TUint8*)
-                ("UMAC: WlanLightPsModePowerModeMgr::OnFrameTx: count this frame") );
-
-            ++iToActiveFrameCount;
-            ++iToDeepPsFrameCount;
-            
-            if ( iToActiveFrameCount >= iToActiveFrameThreshold )
-                {
-                powerMgmtModeChange = EToActive;
-
-                OsTracePrint( KPwrStateTransition, (TUint8*)
-                    ("UMAC: WlanLightPsModePowerModeMgr::OnFrameTx: threshold exceeded; change to Active") );            
-                }
-            }
-        else
-            {
-            OsTracePrint( KPwrStateTransition, (TUint8*)
-                ("UMAC: WlanLightPsModePowerModeMgr::OnFrameTx: do no count this frame") );
-            
-            // no further action needed
-            }
+        OsTracePrint( KPwrStateTransition, (TUint8*)
+            ("UMAC: WlanLightPsModePowerModeMgr::OnFrameTx: do not count "
+             "this frame") );
+        
+        // no action needed
         }
     
-    return powerMgmtModeChange;    
+    return powerMgmtModeChange;
     }
 
 // ---------------------------------------------------------------------------
@@ -157,6 +162,15 @@
 // 
 // ---------------------------------------------------------------------------
 //
+TPowerMgmtModeChange WlanLightPsModePowerModeMgr::OnPsModeErrorIndication()
+    {
+    return EToActive;
+    }
+        
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
 TBool WlanLightPsModePowerModeMgr::OnLightPsToActiveTimerTimeout(
     WlanContextImpl& aCtxImpl )
     {
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/umacnullsendcontroller.cpp	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/umacnullsendcontroller.cpp	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2007-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: 15 %
+* %version: 16 %
 */
 
 #include "config.h"
@@ -397,32 +397,17 @@
     
     iFlags &= ~KKeepAliveTimerArmed;
 
-    TUint32 KTimeAfterLatestTx ( 
-        static_cast<TUint32>(os_systemTime() - iLatestTx) );
-    
-    if ( KTimeAfterLatestTx >= iKeepAliveTimeout )
+    // request a regular Null Data frame to be sent
+    // however, if there is a frame Tx (of any frame) already pending OR
+    // we use U-APSD for Voice and we are on a VoWLAN call
+    // we won't request a new frame to be sent. 
+    if ( !iWlanContextImpl.UnsentTxPackets() &&
+         !( iWlanContextImpl.UapsdUsedForVoice() && InVoiceCallState() ) )
         {
-        // request a regular Null Data frame to be sent
-    
-        // however, if there is a frame Tx (of any frame) already pending, 
-        // we won't request a new frame to be sent. 
-        if ( !iWlanContextImpl.UnsentTxPackets() )
+        if ( !iNullSender.TxNullDataFrame( iWlanContextImpl, EFalse ) )
             {
-            if ( !iNullSender.TxNullDataFrame( iWlanContextImpl, EFalse ) )
-                {
-                // frame was not sent because we didn't get a Tx buffer.
-                // In this case we'll skip the sending
-                // However, we need to re-arm the timer to trigger the next
-                // Null Data frame sending
-                RegisterKeepAliveTimeout( iKeepAliveTimeout );
-                }
-            }
-        else
-            {
-            // frame Tx already pending, so we don't ask a Null Data to be sent
-            OsTracePrint( KUmacDetails, (TUint8*)
-                ("UMAC: WlanNullSendController::OnKeepAliveTimerTimeout: frame Tx already pending. New Null Data Tx request skipped") );
-            
+            // frame was not sent because we didn't get a Tx buffer.
+            // In this case we'll skip the sending
             // However, we need to re-arm the timer to trigger the next
             // Null Data frame sending
             RegisterKeepAliveTimeout( iKeepAliveTimeout );
@@ -430,9 +415,15 @@
         }
     else
         {
-        // No need to send keep alive; yet. Re-arm the timer with 
-        // a suitable timeout relative to the time of the latest frame Tx
-        RegisterKeepAliveTimeout( iKeepAliveTimeout - KTimeAfterLatestTx );        
+        // we don't ask a Null Data to be sent
+        OsTracePrint( KUmacDetails, (TUint8*)
+            ("UMAC: WlanNullSendController::OnKeepAliveTimerTimeout: frame Tx "
+             "already pending OR U-APSD used for Voice and we are in VoWLAN"
+             "call => Null Data Tx request skipped") );
+        
+        // However, we need to re-arm the timer to trigger the next
+        // Null Data frame sending
+        RegisterKeepAliveTimeout( iKeepAliveTimeout );
         }
     }
 
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/umacpowermodemgrbase.cpp	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/umacpowermodemgrbase.cpp	Fri Jun 04 12:12:29 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-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,16 +16,13 @@
 */
 
 /*
-* %version: 8 %
+* %version: 9 %
 */
 
 #include "config.h"
 #include "umacpowermodemgrbase.h"
 #include "UmacContextImpl.h"
 
-// Default frame payload length threshold value (in bytes) for U-APSD
-const TUint32 KUapsdRxFrameLengthThreshold = 400;
-
 
 // ================= MEMBER FUNCTIONS =======================
 
@@ -34,7 +31,7 @@
 // ---------------------------------------------------------------------------
 //
 WlanPowerModeMgrBase::WlanPowerModeMgrBase() : 
-    iUapsdRxFrameLengthThreshold( KUapsdRxFrameLengthThreshold )
+    iUapsdRxFrameLengthThreshold( KDefaultUapsdRxFrameLengthThreshold )
     {
     }
 
@@ -50,6 +47,15 @@
 // 
 // ---------------------------------------------------------------------------
 //
+TPowerMgmtModeChange WlanPowerModeMgrBase::OnPsModeErrorIndication()
+    {
+    return ENoChange;
+    }
+        
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
 TBool WlanPowerModeMgrBase::OnActiveToLightPsTimerTimeout()
     {
     return EFalse;
--- a/wlan_bearer/wlanldd/wlan_symbian/wlanldd_symbian/src/WlanLogicalChannel.cpp	Tue May 25 16:07:06 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_symbian/wlanldd_symbian/src/WlanLogicalChannel.cpp	Fri Jun 04 12:12:29 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: 59 %
+* %version: 61 %
 */
 
 #include "WlLddWlanLddConfig.h"
@@ -41,7 +41,8 @@
 const TUint32 KDmaTxMemSize = 4096; // equals to 1 MMU page on most systems
 
 // ---------------------------------------------------------------------------
-// 
+// Note! This method is executed in the context of the user mode client 
+// thread, but in supervisor mode
 // ---------------------------------------------------------------------------
 //
 #ifndef RD_WLAN_DDK
@@ -271,6 +272,9 @@
     }
 
 // ---------------------------------------------------------------------------
+// Note! This method is executed in the context of the user mode client 
+// thread, but in supervisor mode
+//
 // If an error occurs in this method, we set iPdd to NULL to prevent 
 // PDD object destruction in base class (DLogicalChannelBase) destructor.
 // DLogicalChannelBase destructor gets called as this logical channel instance
@@ -606,10 +610,11 @@
     
 
 // ---------------------------------------------------------------------------
-// 
+// Note! This method is executed in the context of the user mode client 
+// thread, but in supervisor mode
 // ---------------------------------------------------------------------------
 //
-TAny* DWlanLogicalChannel::DoControlFast( TInt aFunction, TAny* param )
+TAny* DWlanLogicalChannel::DoControlFast( TInt aFunction, TAny* aParam )
     {
     TAny* ret( NULL );
     TBool triggerTx ( EFalse );    
@@ -621,9 +626,6 @@
         iClient));
     TraceDump(WLM_CMD_DETAILS, (("WLANLDD: function: 0x%x"), aFunction));
     
-    // Note! We are executing in the context of the client's thread, but
-    // in supervisor mode
-    
     // acquire mutex
     // Enter critical section before requesting the mutex as
     // we are executing in the context of a user mode thread
@@ -633,86 +635,37 @@
 #else
     iOsa->MutexAcquire();
 #endif
-    NKern::ThreadLeaveCS();
     
     TraceDump(MUTEX, 
         (("WLANLDD: DWlanLogicalChannel::DoControlFast: mutex acquired")));
     
-    switch ( aFunction )
+    if ( iUnit == KUnitWlan )
+        {
+        ret = OnMgmtSideControlFast( aFunction, aParam );
+        }
+    else if ( iUnit == KUnitEthernet )
         {
-        case RPcmNetCardIf::EControlFastAllocTxBuffer:
-            ret = iEthernetFrameMemMngr->AllocTxBuffer(
-                reinterpret_cast<TUint>(param) );
-            
-            if ( !ret && iAddTxFrameAllowed )
-                {
-                iAddTxFrameAllowed = EFalse;
-                
-                TraceDump( NWSA_TX, 
-                    ("WLANLDD: DWlanLogicalChannel::DoControlFast: stop flow from protocol stack") );        
-                }
-            break;
-            
-        case RPcmNetCardIf::EControlFastAddTxFrame:
-            {
-#ifndef NDEBUG
-            if ( !iAddTxFrameAllowed )
-                {
-                TraceDump(ERROR_LEVEL, 
-                    ("WLANLDD: DWlanLogicalChannel::DoControlFast: WARNING: AddTxFrame req. when flow ctrl is on"));
-                }
+        ret = OnEthernetSideControlFast( aFunction, aParam, triggerTx );
+        }
+    else
+        {
+        // unknown unit
+#ifndef NDEBUG            
+        TraceDump(ERROR_LEVEL, 
+            ("WLANLDD: DWlanLogicalChannel::DoControlFast: unknown unit"));
+        TraceDump(ERROR_LEVEL, (("WLANLDD: aFunction: %d"), aFunction));
+        TraceDump(ERROR_LEVEL, (("WLANLDD: unit: %d"), iUnit));
+        os_assert( (TUint8*)("WLANLDD: panic"), (TUint8*)(WLAN_FILE), __LINE__ );
 #endif
-            if ( iEthernetFrameMemMngr->AllTxQueuesEmpty() )
-                {
-                triggerTx = ETrue;
-                }
-            
-            TDataBuffer* discardFrame ( NULL );
-            
-            ret = reinterpret_cast<TAny*>(iEthernetFrameMemMngr->AddTxFrame( 
-                reinterpret_cast<TDataBuffer*>(param),
-                discardFrame,
-                iUmac.UserDataTxEnabled() ));
-            
-            if ( discardFrame )
-                {
-                TraceDump( NWSA_TX_DETAILS, 
-                    (("WLANLDD: DWlanLogicalChannel::DoControlFast: have to drop tx frame of UP: %d"),
-                    reinterpret_cast<TDataBuffer*>(param)->UserPriority()) );
-                
-                iEthernetFrameMemMngr->FreeTxPacket( discardFrame );
-                }
-                
-            if ( !ret )
-                {
-                iAddTxFrameAllowed = EFalse;
-
-                TraceDump( NWSA_TX, 
-                    ("WLANLDD: DWlanLogicalChannel::DoControlFast: stop flow from protocol stack") );        
-                }
-            break;
-            }
-        default:
-#ifndef NDEBUG
-            TraceDump(ERROR_LEVEL, (("WLANLDD: unknown request: %d"), 
-                aFunction));
-            os_assert( 
-                (TUint8*)("WLANLDD: panic"), 
-                (TUint8*)(WLAN_FILE), 
-                __LINE__ );            
-#endif
-            break;
         }
     
     // release mutex
-    // Enter critical section before releasing the mutex as
-    // we are executing in the context of a user mode thread
-    NKern::ThreadEnterCS();    
 #ifndef RD_WLAN_DDK
     Kern::MutexSignal( iMutex );
 #else
     iOsa->MutexRelease();
 #endif 
+    // and exit from critical section
     NKern::ThreadLeaveCS();
     
     TraceDump(MUTEX, 
@@ -728,7 +681,7 @@
         // the lower priority thread will get paused and the higher priority 
         // thread will get scheduled (to execute the DFC), we don't want the 
         // higher priority thread to need to wait for the mutex. So we 
-        // released the mutex first in this code block and after that enque 
+        // released the mutex first in this code block and after that enqueue 
         // the DFC request.
         if ( !( iFlags & KTxTriggerArmed ) )
             {
@@ -741,6 +694,162 @@
     }
 
 // ---------------------------------------------------------------------------
+// Note! This method is executed in the context of the user mode client 
+// thread, but in supervisor mode
+// ---------------------------------------------------------------------------
+//
+TAny* DWlanLogicalChannel::OnMgmtSideControlFast( 
+    TInt aFunction, 
+    TAny* aParam )
+    {
+    TAny* ret( NULL );
+    
+    switch ( aFunction )
+        {
+        // ==========================================================
+        // Get Rx frame
+        // ==========================================================        
+        case RWlanLogicalChannel::EWlanControlFastGetRxFrame:
+            if ( iEthernetFrameMemMngr )
+                {
+                ret = iEthernetFrameMemMngr->GetRxFrame( 
+                        reinterpret_cast<TDataBuffer*>(aParam) );
+                }
+            break;
+        // ==========================================================
+        // Unknown request
+        // ==========================================================        
+        default:
+#ifndef NDEBUG
+            TraceDump(ERROR_LEVEL, (("WLANLDD: unknown request: %d"), 
+                aFunction));
+            os_assert( 
+                (TUint8*)("WLANLDD: panic"), 
+                (TUint8*)(WLAN_FILE), 
+                __LINE__ );
+#endif
+            break;
+        }
+    
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// Note! This method is executed in the context of the user mode client 
+// thread, but in supervisor mode
+// ---------------------------------------------------------------------------
+//
+TAny* DWlanLogicalChannel::OnEthernetSideControlFast( 
+    TInt aFunction, 
+    TAny* aParam,
+    TBool& aTriggerTx )
+    {
+    TAny* ret( NULL );    
+    aTriggerTx = EFalse;
+    
+    switch ( aFunction )
+        {
+        // ==========================================================
+        // Alloc Tx buffer
+        // ==========================================================        
+        case RPcmNetCardIf::EControlFastAllocTxBuffer:
+            if ( iEthernetFrameMemMngr )
+                {
+                ret = iEthernetFrameMemMngr->AllocTxBuffer(
+                    reinterpret_cast<TUint>(aParam) );
+                }
+            
+            if ( !ret && iAddTxFrameAllowed )
+                {
+                iAddTxFrameAllowed = EFalse;
+                
+                TraceDump( NWSA_TX, 
+                    ("WLANLDD: DWlanLogicalChannel::OnEthernetSideControlFast: "
+                     "stop flow from protocol stack") );        
+                }
+            break;            
+        // ==========================================================
+        // Add Tx frame
+        // ==========================================================        
+        case RPcmNetCardIf::EControlFastAddTxFrame:
+            {
+#ifndef NDEBUG
+            if ( !iAddTxFrameAllowed )
+                {
+                TraceDump(ERROR_LEVEL, 
+                    ("WLANLDD: DWlanLogicalChannel::OnEthernetSideControlFast: "
+                     "WARNING: AddTxFrame req. when flow ctrl is on"));
+                }
+#endif
+            if ( iEthernetFrameMemMngr && aParam )
+                {
+                if ( iEthernetFrameMemMngr->AllTxQueuesEmpty() )
+                    {
+                    aTriggerTx = ETrue;
+                    }
+                
+                TDataBuffer* discardFrame ( NULL );
+                
+                ret = reinterpret_cast<TAny*>(
+                          iEthernetFrameMemMngr->AddTxFrame( 
+                              reinterpret_cast<TDataBuffer*>(aParam),
+                              discardFrame,
+                              iUmac.UserDataTxEnabled() ));
+                
+                if ( discardFrame )
+                    {
+                    TraceDump( NWSA_TX_DETAILS, 
+                        (("WLANLDD: DWlanLogicalChannel::OnEthernetSideControlFast: "
+                          "have to drop tx frame of UP: %d"),
+                        reinterpret_cast<TDataBuffer*>(
+                            aParam)->UserPriority()) );
+                    
+                    iEthernetFrameMemMngr->FreeTxPacket( discardFrame );
+                    aTriggerTx = EFalse;
+                    }
+                }
+                
+            if ( !ret )
+                {
+                iAddTxFrameAllowed = EFalse;
+
+                TraceDump( NWSA_TX, 
+                    ("WLANLDD: DWlanLogicalChannel::OnEthernetSideControlFast: "
+                     "stop flow from protocol stack") );
+                }
+            break;
+            }            
+        // ==========================================================
+        // Get Rx frame
+        // ==========================================================        
+        case RPcmNetCardIf::EControlFastGetRxFrame:
+            {
+            if ( iEthernetFrameMemMngr )
+                {
+                ret = iEthernetFrameMemMngr->GetRxFrame( 
+                        reinterpret_cast<TDataBuffer*>(aParam) );
+                }
+            }
+            break;
+        // ==========================================================
+        // Unknown request
+        // ==========================================================        
+        default:
+#ifndef NDEBUG
+            TraceDump(ERROR_LEVEL, (("WLANLDD: unknown request: %d"), 
+                aFunction));
+            os_assert( 
+                (TUint8*)("WLANLDD: panic"), 
+                (TUint8*)(WLAN_FILE), 
+                __LINE__ );            
+#endif
+            break;
+        } // switch
+    
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
 // 
 // ---------------------------------------------------------------------------
 //
@@ -748,7 +857,7 @@
     {
     if ( iUnit == KUnitWlan )
         {
-        if ( aMask & ( 1 << EWlanRequestNotify ) )
+        if ( aMask & ( 1 << RWlanLogicalChannel::EWlanRequestNotify ) )
             {
             TraceDump(INFO_LEVEL, 
                 ("WLANLDD: DWlanLogicalChannel::DoCancel: mgmt side notify cancel"));
@@ -758,7 +867,7 @@
                 iClient, iWlanRequestNotifyStatus, KErrServerTerminated );
             iWlanRequestNotifyStatus = NULL;
             }        
-        else if ( aMask & ( 1 << EWlanRequestFrame ) )
+        else if ( aMask & ( 1 << RWlanLogicalChannel::EWlanRequestFrame ) )
             {
             TraceDump(INFO_LEVEL, 
                 ("WLANLDD: DWlanLogicalChannel::DoCancel: mgmt side frame read cancel"));
@@ -770,7 +879,8 @@
         else
             {
             TraceDump(ERROR_LEVEL, 
-                (("WLANLDD: DWlanLogicalChannel::DoCancel: mgmt side unhandled mask panic: 0x%08x"), 
+                (("WLANLDD: DWlanLogicalChannel::DoCancel: mgmt side "
+                  "unhandled mask panic: 0x%08x"), 
                 aMask));
             os_assert( (TUint8*)("WLANLDD: panic"), (TUint8*)(WLAN_FILE), __LINE__ );
             }        
@@ -798,7 +908,8 @@
         else
             {
             TraceDump(ERROR_LEVEL, 
-                (("WLANLDD: DWlanLogicalChannel::DoCancel: user side unhandled mask panic: 0x%08x"), 
+                (("WLANLDD: DWlanLogicalChannel::DoCancel: user side "
+                  "unhandled mask panic: 0x%08x"), 
                 aMask));
             os_assert( (TUint8*)("WLANLDD: panic"), (TUint8*)(WLAN_FILE), __LINE__ );
             }        
@@ -816,11 +927,13 @@
 // ---------------------------------------------------------------------------
 //
 TBool DWlanLogicalChannel::ProtocolStackDataReceiveComplete( 
-    const TDataBuffer*& aBufferStart,
+    TDataBuffer*& aBufferStart,
     TUint32 aNumOfBuffers )
     {
-    if ( iEthernetFrameMemMngr->OnEthernetFrameRxComplete( aBufferStart, 
-        aNumOfBuffers ) )
+    if ( iEthernetFrameMemMngr && 
+         iEthernetFrameMemMngr->OnEthernetFrameRxComplete( 
+             aBufferStart, 
+             aNumOfBuffers ) )
         {
         Kern::RequestComplete( iClient, iEthernetReceiveFrameStatus, KErrNone );
         iEthernetReceiveFrameStatus = NULL;
@@ -903,13 +1016,17 @@
     TraceDump(UMAC_PROTO_CALLBACK, 
         (("WLANLDD: aCompletionCode: %d"), aCompletionCode));
 
-    iEthernetFrameMemMngr->FreeTxPacket( aMetaHeader );
+    if ( iEthernetFrameMemMngr )
+        {
+        iEthernetFrameMemMngr->FreeTxPacket( aMetaHeader );
+        }
 
     TxProtocolStackData();
     
     if ( !iAddTxFrameAllowed )
         {
-        if ( iResumeTxStatus && 
+        if ( iResumeTxStatus &&
+             iEthernetFrameMemMngr &&
              iEthernetFrameMemMngr->ResumeClientTx( 
                  iUmac.UserDataTxEnabled() ) )
             {
@@ -980,18 +1097,24 @@
 //
 void DWlanLogicalChannel::TxManagementData()
     {
-    TDataBuffer* buffer = iEthernetFrameMemMngr->OnWriteEthernetFrame();
-
-    if ( !buffer )
+    TDataBuffer* buffer( NULL );
+    
+    if ( iEthernetFrameMemMngr )
         {
-        TraceDump(ERROR_LEVEL, 
-            ("WLANLDD: DWlanLogicalChannel::TxManagementData: "
-             "panic, no buffer"));
-        os_assert( (TUint8*)("WLANLDD: panic"), (TUint8*)(WLAN_FILE), __LINE__ );
+        buffer = iEthernetFrameMemMngr->OnWriteEthernetFrame();
+        }
+
+    if ( buffer )
+        {
+        iUmac.WriteMgmtFrame( *buffer );
         }
     else
         {
-        iUmac.WriteMgmtFrame( *buffer );
+#ifndef NDEBUG
+        os_assert( (TUint8*)("WLANLDD: panic"), (TUint8*)(WLAN_FILE), __LINE__ );
+#endif
+        Kern::RequestComplete( 
+            iClient, iWlanSendFrameStatus, KErrGeneral );
         }
     }
 
@@ -1001,7 +1124,7 @@
 //
 void DWlanLogicalChannel::TxProtocolStackData()
     {
-#ifndef NDEBUG    
+#ifndef NDEBUG
     TUint packetsSubmitted ( 0 );
 #endif
     
@@ -1049,7 +1172,13 @@
 //
 TBool DWlanLogicalChannel::OnReadEthernetFrameRequest()
     {
-    const TBool ret = iEthernetFrameMemMngr->OnReadRequest();
+    TBool ret( EFalse );
+    
+    if ( iEthernetFrameMemMngr )
+        {
+        ret = iEthernetFrameMemMngr->OnReadRequest();
+        }
+    
     return ret;
     }
 
@@ -1451,17 +1580,17 @@
 
     switch ( aReqNo )
         {
-        case EWlanInitSystem:
+        case RWlanLogicalChannel::EWlanInitSystem:
             // bootup the chip and the system
             iWlanGeneralRequestStatus = aStatus; 
             InitSystem( a1, sizeof(TOpenParam) );
             break;
-        case EWlanFinitSystem:
+        case RWlanLogicalChannel::EWlanFinitSystem:
             // power down the chip and the system
             iWlanGeneralRequestStatus = aStatus; 
             FinitSystem();
             break;
-        case EWlanCommand:
+        case RWlanLogicalChannel::EWlanCommand:
             // management command
             iWlanGeneralRequestStatus = aStatus; 
 
@@ -1502,13 +1631,13 @@
                 output_buffer.iData, 
                 output_buffer.iLen );
             break;
-        case EWlanRequestNotify:
+        case RWlanLogicalChannel::EWlanRequestNotify:
             // store the USER mode indication address;
             iIndicationBuffer = static_cast<TIndication*>(a1);
             iWlanRequestNotifyStatus = aStatus;
             IndicationRequest( static_cast<TIndication*>(a1) );
             break;
-        case EWlanRequestFrame:
+        case RWlanLogicalChannel::EWlanRequestFrame:
             if ( OnReadEthernetFrameRequest() )
                 {
                 // rx data to be completed exists
@@ -1525,7 +1654,7 @@
                 iWlanReceiveFrameStatus = aStatus;
                 }
             break;
-        case EWlanRequestSend:
+        case RWlanLogicalChannel::EWlanRequestSend:
             iWlanSendFrameStatus = aStatus;
 
             TxManagementData();
@@ -1728,7 +1857,7 @@
     TAny* /*a2*/ )
     {
     TInt ret( KErrNone );
-    if ( aFunction == EWlanSvControlInitBuffers )
+    if ( aFunction == RWlanLogicalChannel::EWlanSvControlInitBuffers )
         {
         // initiliaze buffers for wlan mgmt client data xfer
         if ( a1 )
@@ -1749,7 +1878,7 @@
             os_assert( (TUint8*)("WLANLDD: panic"), (TUint8*)(WLAN_FILE), __LINE__ );
             }
         }
-    else if ( aFunction == EWlanSvControlFreeBuffers )
+    else if ( aFunction == RWlanLogicalChannel::EWlanSvControlFreeBuffers )
         {
         // free wlan mgmt client data xfer buffers
         OnReleaseEthernetFrameBuffers();        
@@ -1891,13 +2020,16 @@
     if ( iEthernetFrameMemMngr )
         {
         TraceDump(NWSA_TX_DETAILS, 
-            (("WLANLDD: DWlanLogicalChannel::SetMgmtSideTxOffsets: aEthernetFrameTxOffset: %d"),
+            (("WLANLDD: DWlanLogicalChannel::SetMgmtSideTxOffsets: "
+              "aEthernetFrameTxOffset: %d"),
             aEthernetFrameTxOffset ));
         TraceDump(NWSA_TX_DETAILS, 
-            (("WLANLDD: DWlanLogicalChannel::SetMgmtSideTxOffsets: aDot11FrameTxOffset: %d"),
+            (("WLANLDD: DWlanLogicalChannel::SetMgmtSideTxOffsets: "
+              "aDot11FrameTxOffset: %d"),
             aDot11FrameTxOffset ));
         TraceDump(NWSA_TX_DETAILS, 
-            (("WLANLDD: DWlanLogicalChannel::SetMgmtSideTxOffsets: aSnapFrameTxOffset: %d"),
+            (("WLANLDD: DWlanLogicalChannel::SetMgmtSideTxOffsets: "
+              "aSnapFrameTxOffset: %d"),
             aSnapFrameTxOffset ));
 
         iEthernetFrameMemMngr->SetTxOffsets( 
@@ -1934,12 +2066,13 @@
 // ---------------------------------------------------------------------------
 //
 void DWlanLogicalChannel::MgmtDataReceiveComplete( 
-    const TDataBuffer*& aBufferStart, 
+    TDataBuffer*& aBufferStart, 
     TUint32 aNumOfBuffers )
     {
-    if ( iEthernetFrameMemMngr->OnEthernetFrameRxComplete( 
-        aBufferStart, 
-        aNumOfBuffers ) )
+    if ( iEthernetFrameMemMngr && 
+         ( iEthernetFrameMemMngr->OnEthernetFrameRxComplete( 
+               aBufferStart, 
+               aNumOfBuffers ) ) )
         {
         Kern::RequestComplete( iClient, iWlanReceiveFrameStatus, KErrNone );
         iWlanReceiveFrameStatus = NULL;
@@ -2174,23 +2307,32 @@
 void DWlanLogicalChannel::ReleaseIndicationListEntry(
     TIndicationListEntry* aEntry )
     {
-    aEntry->next = NULL;
-
-    if ( !iFreeIndicationListHead )
+    if ( aEntry )
         {
-        iFreeIndicationListHead = aEntry;
+        aEntry->next = NULL;
+    
+        if ( !iFreeIndicationListHead )
+            {
+            iFreeIndicationListHead = aEntry;
+            }
+        else
+            {
+            TIndicationListEntry* tmp = iFreeIndicationListHead;
+    
+            while ( tmp->next )
+                {
+                tmp = tmp->next;
+                }
+    
+            tmp->next = aEntry;
+            }
         }
+#ifndef NDEBUG
     else
         {
-        TIndicationListEntry* tmp = iFreeIndicationListHead;
-
-        while ( tmp->next )
-            {
-            tmp = tmp->next;
-            }
-
-        tmp->next = aEntry;
+        os_assert( (TUint8*)("WLANLDD: panic"), (TUint8*)(WLAN_FILE), __LINE__ );        
         }
+#endif        
     }
 
 // ---------------------------------------------------------------------------