# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1273589643 -10800 # Node ID a9473894c0f15a7f2eadcccc1ccc06dc2bc2358d # Parent 191c8407e577023eb6d0b9957d085cb4531f6f53 Revision: 201017 Kit: 201019 diff -r 191c8407e577 -r a9473894c0f1 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/group/wlmserversrv.mmh --- 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 diff -r 191c8407e577 -r a9473894c0f1 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlandevicesettings.h --- 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; diff -r 191c8407e577 -r a9473894c0f1 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanticktimer.h --- /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 + +/** + * 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 diff -r 191c8407e577 -r a9473894c0f1 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlmserver.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. */ diff -r 191c8407e577 -r a9473894c0f1 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlmserver.inl --- 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; } // --------------------------------------------------------- diff -r 191c8407e577 -r a9473894c0f1 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanticktimer.cpp --- /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(); + } diff -r 191c8407e577 -r a9473894c0f1 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlmserver.cpp --- 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 @@ -24,6 +24,7 @@ #include #include #include // for feature definitions +#include #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( iRequestMap[i].iTime ); + TUint* checkedTime = reinterpret_cast( 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( iRequestMap[indexNextScan].iTime ); + TUint* nextScanTime = reinterpret_cast( iRequestMap[indexNextScan].iTime ); UpdateScanSchedulingTimer( *nextScanTime, iRequestMap[indexNextScan].iRequestId ); } } @@ -2613,7 +2615,7 @@ delete iapDataList; iapDataList = NULL; - TTime* completedScanTime = reinterpret_cast( aRequest.iTime ); + TUint* completedScanTime = reinterpret_cast( aRequest.iTime ); delete completedScanTime; completedScanTime = NULL; @@ -2678,7 +2680,7 @@ { ScanList* tmp( NULL ); core_ssid_s* ssid = reinterpret_cast( aRequest.iParam1 ); - TTime* completedScanTime = reinterpret_cast( aRequest.iTime ); + TUint* completedScanTime = reinterpret_cast( aRequest.iTime ); ScanList* completedScanList = reinterpret_cast( aRequest.iParam0 ); if( aTriggerRequest == NULL ) @@ -2778,7 +2780,7 @@ iapSsidList = reinterpret_cast*>( aRequest.iParam3 ); iapDataList = reinterpret_cast*>( aRequest.iParam0 ); - TTime* completedScanTime = reinterpret_cast( aRequest.iTime ); + TUint* completedScanTime = reinterpret_cast( aRequest.iTime ); ScanList* completedScanList = reinterpret_cast( aRequest.iParam2); core_type_list_c* completedIdList = reinterpret_cast*>( 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( self->iRequestMap[index].iParam0 ); core_ssid_s* completedSsid = reinterpret_cast( self->iRequestMap[index].iParam1 ); - TTime* completedScanTime = reinterpret_cast( self->iRequestMap[index].iTime ); + TUint* completedScanTime = reinterpret_cast( self->iRequestMap[index].iTime ); // Only the triggering request is completed and then scan scheduling timer is set again TPckgBuf pckgCount( 0 ); @@ -3541,7 +3543,7 @@ if( self->FindNextTimedScanSchedulingRequest( indexNextScan ) ) { - TTime* nextScanTime = reinterpret_cast( self->iRequestMap[indexNextScan].iTime ); + TUint* nextScanTime = reinterpret_cast( self->iRequestMap[indexNextScan].iTime ); self->UpdateScanSchedulingTimer( *nextScanTime, self->iRequestMap[indexNextScan].iRequestId ); } @@ -3559,7 +3561,7 @@ core_type_list_c* iapIdList = reinterpret_cast*>( self->iRequestMap[index].iParam1 ); ScanList* scanList = reinterpret_cast( self->iRequestMap[index].iParam2 ); core_type_list_c* iapSsidList = reinterpret_cast*>( self->iRequestMap[index].iParam3 ); - TTime* scanTime = reinterpret_cast( self->iRequestMap[index].iTime ); + TUint* scanTime = reinterpret_cast( 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( self->iRequestMap[indexNextScan].iTime ); + TUint* nextScanTime = reinterpret_cast( 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( 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( 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( iRequestMap[indexNextScan].iTime ); - UpdateScanSchedulingTimer( *nextScanTime, iRequestMap[indexNextScan].iRequestId ); - } - } } } @@ -4074,7 +4080,7 @@ delete reinterpret_cast*>( entry.iParam1 ); delete reinterpret_cast( entry.iParam2); delete reinterpret_cast*>( entry.iParam3 ); - delete reinterpret_cast( entry.iTime ); + delete reinterpret_cast( entry.iTime ); iRequestMap.Remove( index ); DEBUG( "CWlmServer::CancelScan() - find next possible timed scan scheduling request" ); @@ -4111,7 +4117,7 @@ delete reinterpret_cast*>( entry.iParam1 ); delete reinterpret_cast( entry.iParam2); delete reinterpret_cast*>( entry.iParam3 ); - delete reinterpret_cast( entry.iTime ); + delete reinterpret_cast( entry.iTime ); iRequestMap.Remove( index ); } } diff -r 191c8407e577 -r a9473894c0f1 wlan_bearer/wlanldd/wlan_common/osa_common/inc/osaheap.h --- 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(); diff -r 191c8407e577 -r a9473894c0f1 wlan_bearer/wlanldd/wlan_common/osa_common/inc/osalist.inl --- 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 @@ -37,7 +37,7 @@ // ----------------------------------------------------------------------------- // template -inline list::iterator list::begin() +inline typename list::iterator list::begin() { // for empty ranges begin() == end() return ( !(empty()) ? list_iterator( iFirst ) : end() ); @@ -48,7 +48,7 @@ // ----------------------------------------------------------------------------- // template -inline list::const_iterator list::begin() const +inline typename list::const_iterator list::begin() const { // for empty ranges begin() == end() return ( !(empty()) ? list_iterator( iFirst ) : end() ); @@ -59,7 +59,7 @@ // ----------------------------------------------------------------------------- // template -inline list::iterator list::end() +inline typename list::iterator list::end() { return list_iterator(); } @@ -69,7 +69,7 @@ // ----------------------------------------------------------------------------- // template -inline list::const_iterator list::end() const +inline typename list::const_iterator list::end() const { return list_iterator(); } @@ -79,7 +79,7 @@ // ----------------------------------------------------------------------------- // template -inline list::size_type list::size() const +inline typename list::size_type list::size() const { return iNumOfElems; } @@ -99,7 +99,7 @@ // ----------------------------------------------------------------------------- // template -inline list::reference list::front() +inline typename list::reference list::front() { // front() for empty sequence is undefined so assert MWlanOsa::Assert( @@ -112,7 +112,7 @@ // ----------------------------------------------------------------------------- // template -inline list::const_reference list::front() const +inline typename list::const_reference list::front() const { // front() for empty sequence is undefined so assert MWlanOsa::Assert( @@ -125,7 +125,7 @@ // ----------------------------------------------------------------------------- // template -inline list::reference list::back() +inline typename list::reference list::back() { // back() for empty sequence is undefined so assert MWlanOsa::Assert( @@ -138,7 +138,7 @@ // ----------------------------------------------------------------------------- // template -inline list::const_reference list::back() const +inline typename list::const_reference list::back() const { // back() for empty sequence is undefined so assert MWlanOsa::Assert( @@ -304,7 +304,9 @@ // ----------------------------------------------------------------------------- // template -inline list::iterator list::insert( iterator aPos, const T& aElem ) +inline typename list::iterator list::insert( + iterator aPos, + const T& aElem ) { // allocate a new node for the element Node* node = new Node( aElem ); @@ -355,7 +357,7 @@ // ----------------------------------------------------------------------------- // template -inline list::iterator list::erase( iterator aPos ) +inline typename list::iterator list::erase( iterator aPos ) { // extract node to be erased Node* node = aPos(); diff -r 191c8407e577 -r a9473894c0f1 wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacContextImpl.h --- 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(); diff -r 191c8407e577 -r a9473894c0f1 wlan_bearer/wlanldd/wlan_common/umac_common/src/Umac.cpp --- 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 ); + } } // --------------------------------------------------------------------------- diff -r 191c8407e577 -r a9473894c0f1 wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacContextImpl.cpp --- 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; } // --------------------------------------------------------------------------- diff -r 191c8407e577 -r a9473894c0f1 wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11Idle.cpp --- 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 ); } diff -r 191c8407e577 -r a9473894c0f1 wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11InitPhase1.cpp --- 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 ); } // ----------------------------------------------------------------------------- diff -r 191c8407e577 -r a9473894c0f1 wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacDot11MacError.cpp --- 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 ); } diff -r 191c8407e577 -r a9473894c0f1 wlan_bearer/wlanldd/wlan_symbian/wlanldd_symbian/inc/WlanLogicalChannel.h --- 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;