Revision: 201017 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 11 May 2010 17:54:03 +0300
branchRCL_3
changeset 11 a9473894c0f1
parent 9 191c8407e577
child 12 af3fb27c7511
Revision: 201017 Kit: 201019
wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/group/wlmserversrv.mmh
wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlandevicesettings.h
wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanticktimer.h
wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlmserver.h
wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlmserver.inl
wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanticktimer.cpp
wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlmserver.cpp
wlan_bearer/wlanldd/wlan_common/osa_common/inc/osaheap.h
wlan_bearer/wlanldd/wlan_common/osa_common/inc/osalist.inl
wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacContextImpl.h
wlan_bearer/wlanldd/wlan_common/umac_common/src/Umac.cpp
wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacContextImpl.cpp
wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11Idle.cpp
wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11InitPhase1.cpp
wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11MacError.cpp
wlan_bearer/wlanldd/wlan_symbian/wlanldd_symbian/inc/WlanLogicalChannel.h
--- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/group/wlmserversrv.mmh	Tue Apr 27 18:30:32 2010 +0300
+++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/group/wlmserversrv.mmh	Tue May 11 17:54:03 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: 10 %
+* %version: 11 %
 */
 
 TARGETTYPE      dll
@@ -144,6 +144,7 @@
 SOURCE          wlanbgscanstates.cpp
 SOURCE          wlantimerservices.cpp
 SOURCE          wlantimer.cpp
+SOURCE          wlanticktimer.cpp
 
 USERINCLUDE     ../inc
 USERINCLUDE     ../../../../inc
@@ -163,5 +164,6 @@
 LIBRARY         wlandbif.lib
 LIBRARY         featmgr.lib
 LIBRARY         commsdat.lib
+LIBRARY         hal.lib
 
 STATICLIBRARY   wlanscanlist.lib
--- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlandevicesettings.h	Tue Apr 27 18:30:32 2010 +0300
+++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlandevicesettings.h	Tue May 11 17:54:03 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: 23 %
+* %version: 24 %
 */
 
 #ifndef WLANDEVICESETTINGS_H
@@ -88,7 +88,7 @@
 const TUint32 KWlanDefaultBssLostRoamNextIntervalFactor = 1;
 const TUint32 KWlanDefaultBssLostRoamNextIntervalAddition = 500000; // 500 ms
 const TUint32 KWlanDefaultBssLostRoamMaxTriesToFindNw = 5;
-const TUint32 KWlanDefaultTrafficStreamCreationTimeout = 1000000;   // 1 minute
+const TUint32 KWlanDefaultTrafficStreamCreationTimeout = 1000000;   // 1 second
 const TUint32 KWlanDefaultBeaconLostThreshold = 15;
 const TUint32 KWlanDefaultBtBeaconLostThreshold = 20;
 const TUint32 KWlanDefaultTxFailThreshold = 4;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanticktimer.h	Tue May 11 17:54:03 2010 +0300
@@ -0,0 +1,139 @@
+/*
+* 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: 1 %
+*/
+
+#ifndef WLANTICKTIMER_H
+#define WLANTICKTIMER_H
+
+#include <e32base.h>
+
+/**
+ *  CWlanTickTimer class.
+ *
+ *  Class providing timer services. The underlaying implementation relies
+ *  on RTimer. Therefore this module has the same limitations as RTimer.
+ * 
+ *  @lib wlmserversrv.dll
+ *  @since S60 v5.2
+ */
+ 
+NONSHARABLE_CLASS( CWlanTickTimer ) : public CActive
+    {
+    
+public: // CWlanTickTimer public methods
+
+    /**
+     * Static constructor.
+     * @param aTimerExpiredCB   Callback for indicating timer expiry.
+     * @param aTimerCancelledCB Callback for indicating timer cancellation.
+     * @param aTimerErrorCB     Callback for indicating timer error.
+     */
+    static CWlanTickTimer* NewL(
+        const TCallBack& aTimerExpiredCB,
+        const TCallBack& aTimerCancelledCB,
+        const TCallBack& aTimerErrorCB );
+
+    /**
+     * Destructor.
+     */
+    ~CWlanTickTimer();
+
+    /**
+     * Requests an event after the specified interval.
+     * @param The time interval in system ticks.
+     */
+    void After(
+        TUint aTicks );
+    
+private: // CWlanTickTimer private methods
+
+    /**
+     * C++ constructor.
+     * @param aTimerExpiredCB   Callback for indicating timer expiry.
+     * @param aTimerCancelledCB Callback for indicating timer cancellation.
+     * @param aTimerErrorCB     Callback for indicating timer error.
+     */
+    CWlanTickTimer(
+        const TCallBack& aTimerExpiredCB,
+        const TCallBack& aTimerCancelledCB,
+        const TCallBack& aTimerErrorCB );
+    
+    /**
+     * Symbian 2nd phase constructor.
+     */
+    void ConstructL();
+
+private: // From CActive
+
+    /**
+     * From CActive.
+     * Called by the active object framework when the request has been completed.
+     */
+    void RunL();
+
+    /**
+     * From CActive.
+     * Called by the framework if RunL leaves.
+     *
+     * @param aError The error code RunL leaved with.
+     * @return KErrNone if leave was handled, one of the system-wide error codes otherwise.
+     */
+    TInt RunError(
+        TInt aError );
+
+    /**
+     * From CActive.
+     * Called by the framework when Cancel() has been called.
+     */
+    void DoCancel();
+
+private: // CWlanTickTimer private data
+
+    /**
+     * Handle to RTimer.
+     */
+    RTimer iTimer;
+
+    /**
+     * TimerExpiredCB.
+     * Registered callback method that is called, when the timer
+     * expires. This is set when CWlanTickTimer instance is created.
+     */   
+    TCallBack iTimerExpiredCB;
+    
+    /**
+     * TimerCancelledCB.
+     * Registered callback method that is called, when the timer
+     * is cancelled by an external event (i.e. cancellation is
+     * not requested by the client). This is set when CWlanTickTimer
+     * instance is created.
+     */
+    TCallBack iTimerCancelledCB;
+    
+    /**
+     * TimerErrorCB.
+     * Registered callback method that is called, when there is
+     * a timer error. This is set when CWlanTickTimer instance is created.
+     */
+    TCallBack iTimerErrorCB;
+    };
+
+#endif // WLANTICKTIMER_H
--- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlmserver.h	Tue Apr 27 18:30:32 2010 +0300
+++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlmserver.h	Tue May 11 17:54:03 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: 55 %
+* %version: 55.1.1 %
 */
 
 #ifndef WLMSERVER_H
@@ -43,6 +43,7 @@
 class CWlmDriverIf;
 class CWlanSsidListDb;
 class CWlanTimerServices;
+class CWlanTickTimer;
 
 /**
  * Command Ids to be used un the asynchronous core service requests
@@ -62,6 +63,9 @@
 /** UID for WLAN Power Save Test Notifier */
 const TUid KUidWlanPowerSaveTestNote = { 0x101F6D4F };
 
+/** Multiplier for converting seconds into microseconds */
+const TUint KWlanSecsToMicrosecsMultiplier( 1000000 );
+
 /**
 * The server for WLAN services. Counterpart of RWLMServer.
 *
@@ -90,7 +94,7 @@
             TAny* iParam1;
             TAny* iParam2;
             TAny* iParam3;
-            TTime* iTime;
+            TUint* iTime;
 
             SRequestMapEntry() :
                 iRequestId( 0 ),
@@ -907,7 +911,21 @@
          * @return error code
          */       
         static TInt ScanSchedulingTimerExpired( TAny* aThisPtr );
-        
+
+        /**
+         * Method called by the scan scheduling timer when it expires.
+         * @param aThisPtr Pointer to the server instance.
+         * @return error code
+         */
+        static TInt ScanSchedulingTimerCanceled( TAny* aThisPtr );
+
+        /**
+         * A callback method that does absolutely nothing.
+         * @param aThisPtr Pointer to the server instance.
+         * @return error code
+         */
+        static TInt EmptyCb( TAny* aThisPtr );
+
         /**
          * Handles the conversion of IAP data list.
          * @param aCoreIapDataList Converted IAP data list.
@@ -949,11 +967,11 @@
 
         /**
          * Updates the scan scheduling timer.
-         * @param aScanTime specifies when the scan should be started.
+         * @param aScanTime specifies when the scan should be started in system ticks.
          * @param aTriggeringRequestId the id of that request which updates the timer.
          */        
         void UpdateScanSchedulingTimer( 
-        	TTime aScantime,
+        	TUint aScantime,
         	TUint aTriggeringRequestId );
 
         /**
@@ -1091,7 +1109,7 @@
          * @param aDelay Number of seconds to add to current moment in time.
          * @return Calculated time.
          */
-        inline TTime CalculateScanStartTime(
+        inline TUint CalculateScanStartTime(
             const TInt aDelay ) const;
 
         /**
@@ -1195,7 +1213,7 @@
          * Timer creating periodic expirations.
          * Used for starting scheduled scans
          */
-        CPeriodic* iScanSchedulingTimer;
+        CWlanTickTimer* iScanSchedulingTimer;
 
         /**
          * Cache for scanresults etc.
@@ -1298,12 +1316,17 @@
          * EAPOL callback handler in core. Not owned by this pointer.
          */        
         abs_wlan_eapol_callback_c* iEapolHandler;
-       
+
+        /** 
+         * The amount of microseconds per a system tick.
+         */
+        TInt iSystemTickPeriod;
+
         /**
-         * Time when the scan scheduling timer is set to expire.
+         * Time in system ticks when the scan scheduling timer is set to expire.
          */
-        TTime iScanSchedulingTimerExpiration;
-        
+        TUint iScanSchedulingTimerExpiration;
+
         /**
          * Request id to that request in the iRequestMap which has set the scan scheduling timer.
          */
--- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlmserver.inl	Tue Apr 27 18:30:32 2010 +0300
+++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlmserver.inl	Tue May 11 17:54:03 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"
@@ -15,6 +15,9 @@
 *
 */
 
+/*
+* %version: 18 %
+*/
 
 #include "am_debug.h"
 
@@ -129,15 +132,13 @@
 // CWlmServer::CalculateScanStartTime
 // ---------------------------------------------------------
 //
-inline TTime CWlmServer::CalculateScanStartTime(
+inline TUint CWlmServer::CalculateScanStartTime(
     const TInt aDelay ) const
     {
-    TTime scanTime;
-    scanTime.UniversalTime();
-    TTimeIntervalSeconds delay( aDelay );
-    scanTime += delay;
+    TUint ticks(
+        aDelay * KWlanSecsToMicrosecsMultiplier / iSystemTickPeriod );
 
-    return scanTime;
+    return User::TickCount() + ticks; 
     }
 
 // ---------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanticktimer.cpp	Tue May 11 17:54:03 2010 +0300
@@ -0,0 +1,133 @@
+/*
+* 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: 1 %
+*/
+
+#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()
+    {
+    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/wlmserver.cpp	Tue Apr 27 18:30:32 2010 +0300
+++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlmserver.cpp	Tue May 11 17:54:03 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: 105 %
+* %version: 105.1.1 %
 */
 
 #include <e32def.h>
@@ -24,6 +24,7 @@
 #include <featmgr.h>
 #include <in_sock.h>
 #include <bldvariant.hrh> // for feature definitions
+#include <hal.h>
 
 #include "wlmserver.h"
 #include "wlmdriverif.h"
@@ -38,6 +39,7 @@
 #include "wlandevicesettingsinternalcrkeys.h"
 #include "wlanbgscan.h"
 #include "wlantimerservices.h"
+#include "wlanticktimer.h"
 #include "am_debug.h"
 
 /** Panic codes for WlanEngine */
@@ -89,9 +91,6 @@
     CWlmServer::EWlanStaticFeature802dot11k |
     CWlmServer::EWlanStaticFeature802dot11n;
 
-/** Multiplier for converting seconds into microseconds */
-const TUint KWlanSecsToMicrosecsMultiplier( 1000000 );
-
 /** Minimum value for aggressive background scan interval, in seconds */
 const TUint KWlanAggressiveBgScanMinInterval( 1 );
 
@@ -141,6 +140,7 @@
     iIsStartupComplete( EFalse ),
     iEapolClient( NULL ),
     iEapolHandler( NULL ),
+    iSystemTickPeriod( 0 ),
     iScanSchedulingTimerExpiration( 0 ),
     iRequestTriggeringScanning( 0 ),
     iCoreHandlingScanRequest( EFalse ),
@@ -164,6 +164,12 @@
     User::LeaveIfError( User::RenameThread( KWLMDataServerName ) );
     StartL( KWLMDataServerName );    
 
+    HAL::Get( HAL::ESystemTickPeriod, iSystemTickPeriod );
+    DEBUG1( "CWlmServer::ConstructL() - system tick period is %d",
+        iSystemTickPeriod );
+    DEBUG1( "CWlmServer::ConstructL() - current system tick count is %u",
+        User::TickCount( ) );
+
     // Consult FeatureManager whether startup is allowed
     FeatureManager::InitializeLibL();
     if( !FeatureManager::FeatureSupported( KFeatureIdProtocolWlan ) )
@@ -220,7 +226,13 @@
 
     // Create scan timer
     DEBUG( "CWlmServer::ConstructL() - create backgroundscan timer" );
-    iScanSchedulingTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+    TCallBack expiredCb( ScanSchedulingTimerExpired, this );
+    TCallBack canceledCb( ScanSchedulingTimerCanceled, this );
+    TCallBack emptyCb( EmptyCb, NULL );
+    iScanSchedulingTimer = CWlanTickTimer::NewL(
+        expiredCb,
+        canceledCb,
+        emptyCb );
 
     // Create scan cache
     iCache = CWlanScanResultCache::NewL();
@@ -1087,15 +1099,15 @@
         return;
         }    
 
-    TTime* scanTime( NULL );
+    TUint* scanTime( NULL );
     if( scanScheduling.maxDelay != KWlmInfiniteScanDelay )
         {
-        scanTime = new TTime(
-            CalculateScanStartTime( scanScheduling.maxDelay ).Int64() );
+        scanTime = new TUint(
+            CalculateScanStartTime( scanScheduling.maxDelay ) );
         if( !scanTime )
             {
-            DEBUG( "CWlmServer::GetScanResult() - unable to instantiate TTime" );
-    
+            DEBUG( "CWlmServer::GetScanResult() - unable to instantiate TUint" );
+
             delete coreSsid;
             delete scanList;
             aMessage.Complete( KErrNoMemory );
@@ -1325,14 +1337,14 @@
         return;
         }
 
-    TTime* scanTime( NULL );
+    TUint* scanTime( NULL );
     if( maxDelayPckg() != KWlmInfiniteScanDelay )
         {
-        scanTime = new TTime(
-            CalculateScanStartTime( maxDelayPckg() ).Int64() );
+        scanTime = new TUint(
+            CalculateScanStartTime( maxDelayPckg() ) );
         if( !scanTime )
             {
-            DEBUG( "CWlmServer::GetAvailableIaps() - unable to instantiate TTime" );
+            DEBUG( "CWlmServer::GetAvailableIaps() - unable to instantiate TUint" );
     
             aMessage.Complete( KErrNoMemory );
             delete iapDataList;
@@ -1542,7 +1554,7 @@
 // ---------------------------------------------------------
 //
 void CWlmServer::UpdateScanSchedulingTimer( 
-	TTime aScanTime, 
+    TUint aScanTime, 
 	TUint aTriggeringRequestId )
     {
     DEBUG1( "CWlmServer::UpdateScanSchedulingTimer() - aTriggeringRequestId = %u ", aTriggeringRequestId );
@@ -1555,32 +1567,22 @@
         return;
         }
 
-    TTime timeNow;
-    timeNow.UniversalTime();
-
-    TTimeIntervalMicroSeconds difference( aScanTime.MicroSecondsFrom( timeNow ) );
-    if( difference.Int64() < 0 )
+    TUint currentTickCount(
+        User::TickCount() );
+    TUint difference( 0 );
+    if( aScanTime > currentTickCount )
         {
-        difference = TTimeIntervalMicroSeconds( 0 );
+        difference = aScanTime - currentTickCount;  
         }
-    TTimeIntervalMicroSeconds32 differenceMicroseconds(
-        difference.Int64() );
 
     iScanSchedulingTimer->Cancel();
     iScanSchedulingTimerExpiration = aScanTime;
     iRequestTriggeringScanning = aTriggeringRequestId;
-    TCallBack callback( ScanSchedulingTimerExpired, this );
-
-	DEBUG1( "CWlmServer::UpdateScanSchedulingTimer() - scheduling the timer to %u second(s)",
-	    differenceMicroseconds.Int() / SECONDS_FROM_MICROSECONDS );
-	
-	TTimeIntervalMicroSeconds32 intervalMicroseconds( KWlmMaxScanDelay * SECONDS_FROM_MICROSECONDS );
-
-    iScanSchedulingTimer->Start(
-            differenceMicroseconds,
-            intervalMicroseconds,
-            callback );
     
+    DEBUG2( "CWlmServer::UpdateScanSchedulingTimer() - scheduling the timer to %u system ticks(s) [%u s]",
+        difference, difference * iSystemTickPeriod / KWlanSecsToMicrosecsMultiplier );
+
+    iScanSchedulingTimer->After( difference );
     }
 
 // ---------------------------------------------------------
@@ -1593,14 +1595,14 @@
     DEBUG( "CWlmServer::FindNextTimedScanSchedulingRequest()" );
     
     TBool pendingScanRequestsFound( EFalse );
-    TTime closestTime = TTime( 0 );
+    TUint closestTime( 0 );
     aTriggeringRequestIndex = 0;
     
     for(TInt i=0; i < iRequestMap.Count(); i++)
         {
         if( IsPendingTimedScanRequest( i ) )
             {
-            TTime* checkedTime = reinterpret_cast<TTime*>( iRequestMap[i].iTime );
+            TUint* checkedTime = reinterpret_cast<TUint*>( iRequestMap[i].iTime );
             if( pendingScanRequestsFound == EFalse || closestTime > *checkedTime )
                 {
                 closestTime = *checkedTime;
@@ -1614,7 +1616,7 @@
         {
         // clear the scan scheduling related variables
         iRequestTriggeringScanning = KWlanIntCmdNull;
-        iScanSchedulingTimerExpiration = TTime( 0 );
+        iScanSchedulingTimerExpiration = 0;
         }
     else
         {
@@ -2443,7 +2445,7 @@
 
     	if( FindNextTimedScanSchedulingRequest( indexNextScan ) )
             {
-            TTime* nextScanTime = reinterpret_cast<TTime*>( iRequestMap[indexNextScan].iTime );
+            TUint* nextScanTime = reinterpret_cast<TUint*>( iRequestMap[indexNextScan].iTime );
             UpdateScanSchedulingTimer( *nextScanTime, iRequestMap[indexNextScan].iRequestId );
             }
         }
@@ -2613,7 +2615,7 @@
             delete iapDataList;
             iapDataList = NULL;
             
-            TTime* completedScanTime = reinterpret_cast<TTime*>( aRequest.iTime );
+            TUint* completedScanTime = reinterpret_cast<TUint*>( aRequest.iTime );
             delete completedScanTime;
             completedScanTime = NULL;
 
@@ -2678,7 +2680,7 @@
             {
             ScanList* tmp( NULL );
             core_ssid_s* ssid = reinterpret_cast<core_ssid_s*>( aRequest.iParam1 );
-            TTime* completedScanTime = reinterpret_cast<TTime*>( aRequest.iTime );
+            TUint* completedScanTime = reinterpret_cast<TUint*>( aRequest.iTime );
             ScanList* completedScanList = reinterpret_cast<ScanList*>( aRequest.iParam0 );
 
             if( aTriggerRequest == NULL )
@@ -2778,7 +2780,7 @@
             iapSsidList = reinterpret_cast<core_type_list_c<core_ssid_entry_s>*>( aRequest.iParam3 );
             iapDataList = reinterpret_cast<core_type_list_c<core_iap_data_s>*>( aRequest.iParam0 );
             
-            TTime* completedScanTime = reinterpret_cast<TTime*>( aRequest.iTime );
+            TUint* completedScanTime = reinterpret_cast<TUint*>( aRequest.iTime );
             ScanList* completedScanList = reinterpret_cast<ScanList*>( aRequest.iParam2);
             core_type_list_c<u32_t>* completedIdList = reinterpret_cast<core_type_list_c<u32_t>*>( aRequest.iParam1 );
             
@@ -3436,11 +3438,11 @@
         return KErrNoMemory;
         }
 
-    TTime* scanTime = new TTime(
-        CalculateScanStartTime( aScanStartInterval ).Int64() );
+    TUint* scanTime = new TUint(
+        CalculateScanStartTime( aScanStartInterval ) );
     if( !scanTime )
         {
-        DEBUG( "CWlmServer::BackgroundScanRequest() - unable to instantiate TTime" );
+        DEBUG( "CWlmServer::BackgroundScanRequest() - unable to instantiate TUint" );
 
         delete iapDataList;
         delete iapSsidList;
@@ -3514,7 +3516,7 @@
 
         ScanList* completedScanList = reinterpret_cast<ScanList*>( self->iRequestMap[index].iParam0 );
         core_ssid_s* completedSsid =  reinterpret_cast<core_ssid_s*>( self->iRequestMap[index].iParam1 );
-        TTime* completedScanTime = reinterpret_cast<TTime*>( self->iRequestMap[index].iTime );
+        TUint* completedScanTime = reinterpret_cast<TUint*>( self->iRequestMap[index].iTime );
         
         // Only the triggering request is completed and then scan scheduling timer is set again 
         TPckgBuf<TUint32> pckgCount( 0 );
@@ -3541,7 +3543,7 @@
 
         if( self->FindNextTimedScanSchedulingRequest( indexNextScan ) )
             {
-            TTime* nextScanTime = reinterpret_cast<TTime*>( self->iRequestMap[indexNextScan].iTime );
+            TUint* nextScanTime = reinterpret_cast<TUint*>( self->iRequestMap[indexNextScan].iTime );
         	self->UpdateScanSchedulingTimer( *nextScanTime, self->iRequestMap[indexNextScan].iRequestId );
             }
         
@@ -3559,7 +3561,7 @@
         core_type_list_c<u32_t>* iapIdList =  reinterpret_cast<core_type_list_c<u32_t>*>( self->iRequestMap[index].iParam1 );
         ScanList* scanList =  reinterpret_cast<ScanList*>( self->iRequestMap[index].iParam2 );
         core_type_list_c<core_ssid_entry_s>* iapSsidList =  reinterpret_cast<core_type_list_c<core_ssid_entry_s>*>( self->iRequestMap[index].iParam3 );
-        TTime* scanTime =  reinterpret_cast<TTime*>( self->iRequestMap[index].iTime );        
+        TUint* scanTime =  reinterpret_cast<TUint*>( self->iRequestMap[index].iTime );        
         
         // If the device is roaming OR there are not WLAN IAPs defined in the device
         // --> return empty list
@@ -3590,7 +3592,7 @@
 
             if( self->FindNextTimedScanSchedulingRequest( indexNextScan ) )
                 {
-                TTime* nextScanTime = reinterpret_cast<TTime*>( self->iRequestMap[indexNextScan].iTime );
+                TUint* nextScanTime = reinterpret_cast<TUint*>( self->iRequestMap[indexNextScan].iTime );
                 self->UpdateScanSchedulingTimer( *nextScanTime, self->iRequestMap[indexNextScan].iRequestId );
                 }
         
@@ -3681,7 +3683,43 @@
         }
     self->iCoreHandlingScanRequest = ETrue;
     return KErrNone;
+   }
+
+// ---------------------------------------------------------
+// CWlmServer::ScanSchedulingTimerCanceled()
+// ---------------------------------------------------------
+//
+TInt CWlmServer::ScanSchedulingTimerCanceled(
+    TAny* aThisPtr )
+    {
+    DEBUG( "CWlmServer::ScanSchedulingTimerCanceled()" );
+
+    CWlmServer* self = reinterpret_cast<CWlmServer*>( aThisPtr );
+
+    /**
+     * Scan scheduling timer was canceled, re-arm the timer. 
+     */
+    TUint indexNextScan( 0 );
+    if( self->FindNextTimedScanSchedulingRequest( indexNextScan ) )
+        {
+        self->UpdateScanSchedulingTimer(
+            *(self->iRequestMap[indexNextScan].iTime),
+            self->iRequestMap[indexNextScan].iRequestId );
+        }
+
+    return 0;
     }
+
+// ---------------------------------------------------------
+// CWlmServer::EmptyCb()
+// ---------------------------------------------------------
+//
+TInt CWlmServer::EmptyCb(
+    TAny* /* aThisPtr */ )
+    {
+    return 0;
+    }
+
     
 // ---------------------------------------------------------
 // CWlmServer::GetIapDataList()
@@ -3897,38 +3935,6 @@
     	iTimerServices->HandleTimeout();
         DEBUG("CWlmServer::SystemTimeChanged() - refreshing settings to BgScan provider");
         iBgScanProvider->NotifyChangedSettings( iBgScanProviderSettings );
-    	
-    	// Pending scan requests should be handled because after the system time change all the
-    	// timestamps are invalid. Change the scan start times to start immediately
-
-        DEBUG("CWlmServer::SystemTimeChanged() - set all pending requests to expire immediately");
-        
-    	TInt i( 0 );
-    	for( i = 0; i < iRequestMap.Count(); i++ )
-    	    {
-    	    if( IsPendingTimedScanRequest(i) )
-    	        {
-                DEBUG1( "CWlmServer::SystemTimeChanged() - setting iTime to current time for request %i",
-                        iRequestMap[i].iRequestId );
-                
-    	        TTime* requestedScanTime = reinterpret_cast<TTime*>( iRequestMap[i].iTime );
-                requestedScanTime->UniversalTime();              
-    	        }
-    	    }
-        if( !iCoreHandlingScanRequest )
-            {
-            // Core is not handling any scan request so update the timer
-            DEBUG("CWlmServer::SystemTimeChanged() - Core is not currently handling any scan requests");
-            DEBUG("CWlmServer::SystemTimeChanged() - Cancel timer and set it again to new value");
-
-            iScanSchedulingTimer->Cancel();
-            TUint indexNextScan;
-            if( FindNextTimedScanSchedulingRequest( indexNextScan ) )
-                {
-                TTime* nextScanTime = reinterpret_cast<TTime*>( iRequestMap[indexNextScan].iTime );
-                UpdateScanSchedulingTimer( *nextScanTime, iRequestMap[indexNextScan].iRequestId );
-                }
-            }
     	}
     }
 
@@ -4074,7 +4080,7 @@
             delete reinterpret_cast<core_type_list_c<u32_t>*>( entry.iParam1 );
             delete reinterpret_cast<ScanList*>( entry.iParam2);
             delete reinterpret_cast<core_type_list_c<core_ssid_entry_s>*>( entry.iParam3 );
-            delete reinterpret_cast<TTime*>( entry.iTime );
+            delete reinterpret_cast<TUint*>( entry.iTime );
             iRequestMap.Remove( index );
 
             DEBUG( "CWlmServer::CancelScan() - find next possible timed scan scheduling request" );
@@ -4111,7 +4117,7 @@
                 delete reinterpret_cast<core_type_list_c<u32_t>*>( entry.iParam1 );
                 delete reinterpret_cast<ScanList*>( entry.iParam2);
                 delete reinterpret_cast<core_type_list_c<core_ssid_entry_s>*>( entry.iParam3 );
-                delete reinterpret_cast<TTime*>( entry.iTime );                
+                delete reinterpret_cast<TUint*>( entry.iTime );                
                 iRequestMap.Remove( index );
                 }
             }
--- a/wlan_bearer/wlanldd/wlan_common/osa_common/inc/osaheap.h	Tue Apr 27 18:30:32 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/osa_common/inc/osaheap.h	Tue May 11 17:54:03 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: 3 %
+* %version: 4 %
 */
 
 #ifndef WLAN_OSA_HEAP_H
@@ -113,7 +113,7 @@
 
     RWlanHeap(TInt aInitialSize, TInt aAllocationUnit );
     
-    TAny* RWlanHeap::operator new(TUint aSize, TAny* aBase);
+    TAny* operator new(TUint aSize, TAny* aBase);
     
     void Initialise();
     
--- a/wlan_bearer/wlanldd/wlan_common/osa_common/inc/osalist.inl	Tue Apr 27 18:30:32 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/osa_common/inc/osalist.inl	Tue May 11 17:54:03 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007-2008 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: 5 %
+* %version: 6 %
 */
 
 #include <wlanosa.h>
@@ -37,7 +37,7 @@
 // -----------------------------------------------------------------------------
 //
 template<class T>
-inline list<T>::iterator list<T>::begin()
+inline typename list<T>::iterator list<T>::begin()
     {
     // for empty ranges begin() == end()
     return ( !(empty()) ? list_iterator<Node, T>( iFirst ) : end() );
@@ -48,7 +48,7 @@
 // -----------------------------------------------------------------------------
 //
 template<class T>
-inline list<T>::const_iterator list<T>::begin() const
+inline typename list<T>::const_iterator list<T>::begin() const
     {
     // for empty ranges begin() == end()
     return ( !(empty()) ? list_iterator<Node, T>( iFirst ) : end() );
@@ -59,7 +59,7 @@
 // -----------------------------------------------------------------------------
 //
 template<class T>
-inline list<T>::iterator list<T>::end()
+inline typename list<T>::iterator list<T>::end()
     {
     return list_iterator<Node, T>();
     }
@@ -69,7 +69,7 @@
 // -----------------------------------------------------------------------------
 //
 template<class T>
-inline list<T>::const_iterator list<T>::end() const
+inline typename list<T>::const_iterator list<T>::end() const
     {
     return list_iterator<Node, T>();
     }
@@ -79,7 +79,7 @@
 // -----------------------------------------------------------------------------
 //
 template<class T>
-inline list<T>::size_type list<T>::size() const
+inline typename list<T>::size_type list<T>::size() const
     {
     return iNumOfElems;
     }
@@ -99,7 +99,7 @@
 // -----------------------------------------------------------------------------
 //
 template<class T>
-inline list<T>::reference list<T>::front()
+inline typename list<T>::reference list<T>::front()
     {
     // front() for empty sequence is undefined so assert
     MWlanOsa::Assert( 
@@ -112,7 +112,7 @@
 // -----------------------------------------------------------------------------
 //
 template<class T>
-inline list<T>::const_reference list<T>::front()  const
+inline typename list<T>::const_reference list<T>::front()  const
     {
     // front() for empty sequence is undefined so assert
     MWlanOsa::Assert( 
@@ -125,7 +125,7 @@
 // -----------------------------------------------------------------------------
 //
 template<class T>
-inline list<T>::reference list<T>::back()
+inline typename list<T>::reference list<T>::back()
     {
     // back() for empty sequence is undefined so assert
     MWlanOsa::Assert( 
@@ -138,7 +138,7 @@
 // -----------------------------------------------------------------------------
 //
 template<class T>
-inline list<T>::const_reference list<T>::back() const
+inline typename list<T>::const_reference list<T>::back() const
     {
     // back() for empty sequence is undefined so assert
     MWlanOsa::Assert( 
@@ -304,7 +304,9 @@
 // -----------------------------------------------------------------------------
 //
 template<class T>
-inline list<T>::iterator list<T>::insert( iterator aPos, const T& aElem )
+inline typename list<T>::iterator list<T>::insert( 
+    iterator aPos, 
+    const T& aElem )
     {
     // allocate a new node for the element
     Node* node = new Node( aElem );
@@ -355,7 +357,7 @@
 // -----------------------------------------------------------------------------
 //
 template<class T>
-inline list<T>::iterator list<T>::erase( iterator aPos )
+inline typename list<T>::iterator list<T>::erase( iterator aPos )
     {
     // extract node to be erased
     Node* node = aPos();
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacContextImpl.h	Tue Apr 27 18:30:32 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacContextImpl.h	Tue May 11 17:54:03 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: 104 %
+* %version: 105 %
 */
 
 #ifndef WLANCONTEXTIMPL_H
@@ -473,7 +473,7 @@
     WlanWhaConfigureQueue&          WhaConfigureQueue();
     WlanWsaSetPsMode&               WsaSetPsMode();
     WlanWhaConfigureAc&             WhaConfigureAc();
-    WlanWhaRelease&                 WlanWhaRelease();
+    WlanWhaRelease&                 WhaRelease();
 
     inline void WHASettings( const WHA::SSettings& aSettings );
     inline WHA::SSettings& WHASettings();
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/Umac.cpp	Tue Apr 27 18:30:32 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/Umac.cpp	Tue May 11 17:54:03 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: 56 %
+* %version: 57 %
 */
 
 #include "config.h"
@@ -267,7 +267,16 @@
     {
     OsTracePrint( KInitLevel, (TUint8*)("UMAC: * FinitSystem()"));  
     iManagementRequestPending = ETrue;
-    iPimpl->CurrentState().FinitSystem( *iPimpl );
+
+    if ( iPimpl )
+        {
+        iPimpl->CurrentState().FinitSystem( *iPimpl );
+        }
+    else
+        {
+        // nothing to do. Just complete the WLAN Mgmt client request 
+        CompleteManagementCommand( KErrNone );
+        }
     }
 
 // ---------------------------------------------------------------------------
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacContextImpl.cpp	Tue Apr 27 18:30:32 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacContextImpl.cpp	Tue May 11 17:54:03 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: 71 %
+* %version: 72 %
 */
 
 #include "config.h"
@@ -60,7 +60,7 @@
     WlanWsaSetPsMode                iWsaSetPsMode;
     WlanWhaConfigureQueue           iWhaConfigureQueue;
     WlanWhaConfigureAc              iWhaConfigureAc;
-    WlanWhaRelease                  iWlanWhaRelease;
+    WlanWhaRelease                  iWhaRelease;
     };
 
 // ================= MEMBER FUNCTIONS =======================
@@ -281,9 +281,9 @@
 // 
 // ---------------------------------------------------------------------------
 //
-WlanWhaRelease& WlanContextImpl::WlanWhaRelease()
+WlanWhaRelease& WlanContextImpl::WhaRelease()
     {
-    return iWsaCommands->iWlanWhaRelease;
+    return iWsaCommands->iWhaRelease;
     }
 
 // ---------------------------------------------------------------------------
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11Idle.cpp	Tue Apr 27 18:30:32 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11Idle.cpp	Tue May 11 17:54:03 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: 41 %
+* %version: 42 %
 */
 
 #include "config.h"
@@ -697,7 +697,7 @@
     // and execute transition
     ChangeState( aCtxImpl, 
         *this,                      // prev state
-        aCtxImpl.WlanWhaRelease()   // next state
+        aCtxImpl.WhaRelease()       // next state
         );      
     }
 
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11InitPhase1.cpp	Tue Apr 27 18:30:32 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11InitPhase1.cpp	Tue May 11 17:54:03 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: 35 %
+* %version: 36 %
 */
 
 #include "config.h"
@@ -416,7 +416,7 @@
             }
         else    // -- aCommandId == WHA::EReadMIBResponse
             {
-            // nothing else is no interest to us
+            // nothing else is of interest to us
             }
         }
     else    // -- aAct != WlanDot11State::KCompleteManagementRequest
@@ -617,6 +617,8 @@
         os_memcpy( iPda, aPda, iPdaLen );
         // set ctx for fw upload
         aCtxImpl.WsaInitiliaze().Set( aCtxImpl, aFw, aFwLength );
+        // manually start the fsm
+        Entry( aCtxImpl );
         }
     else
         {
@@ -625,9 +627,6 @@
             ("UMAC * dot11-initphase * pda memory allocation failure") );
         Fsm( aCtxImpl, EABORT );
         }
-
-    // manually start the fsm
-    Entry( aCtxImpl );
     }
 
 // -----------------------------------------------------------------------------
--- a/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11MacError.cpp	Tue Apr 27 18:30:32 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11MacError.cpp	Tue May 11 17:54:03 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: 22 %
+* %version: 23 %
 */
 
 #include "config.h"
@@ -97,7 +97,7 @@
     // execute transition
     ChangeState( aCtxImpl, 
         *this,                      // prev state
-        aCtxImpl.WlanWhaRelease()   // next state
+        aCtxImpl.WhaRelease()       // next state
         );      
     }
 
--- a/wlan_bearer/wlanldd/wlan_symbian/wlanldd_symbian/inc/WlanLogicalChannel.h	Tue Apr 27 18:30:32 2010 +0300
+++ b/wlan_bearer/wlanldd/wlan_symbian/wlanldd_symbian/inc/WlanLogicalChannel.h	Tue May 11 17:54:03 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: 31 %
+* %version: 32 %
 */
 
 #ifndef DWLANLOGICALCHANNEL_H
@@ -667,12 +667,12 @@
 
 private:    // data
 
-    const TUint32   KFreeOpenParamsMask            = ( 1 << 0 );
-    const TUint32   KFreeScanResponseFramebodyMask = ( 1 << 1 );    
-    const TUint32   KDfcCancelledMask              = ( 1 << 2 );
-    const TUint32   KFreeIeDataMask                = ( 1 << 3 );
-    const TUint32   KPowerHandlerRegistered        = ( 1 << 4 );
-    const TUint32   KTxTriggerArmed                = ( 1 << 5 );
+    static const TUint32   KFreeOpenParamsMask            = ( 1 << 0 );
+    static const TUint32   KFreeScanResponseFramebodyMask = ( 1 << 1 );    
+    static const TUint32   KDfcCancelledMask              = ( 1 << 2 );
+    static const TUint32   KFreeIeDataMask                = ( 1 << 3 );
+    static const TUint32   KPowerHandlerRegistered        = ( 1 << 4 );
+    static const TUint32   KTxTriggerArmed                = ( 1 << 5 );
 
     TOpenParam      iOpenParam;