# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1268650008 -7200 # Node ID e0f767079796ab6d67aac8731b389fce57f64afe # Parent 51a71243e5626ac29480896ace08ebb04c0e28d7 Revision: 201009 Kit: 201010 diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/inc/core_iap_data.h --- a/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/inc/core_iap_data.h Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/inc/core_iap_data.h Mon Mar 15 12:46:48 2010 +0200 @@ -15,6 +15,9 @@ * */ +/* +* %version: 11 % +*/ #ifndef CORE_IAP_DATA_H #define CORE_IAP_DATA_H @@ -264,7 +267,13 @@ */ void remove_mac_from_iap_blacklist( const core_mac_address_s& mac ); - + + /** + * Check whether the IAP data contains a valid + * combination of parameters. + */ + bool_t is_valid() const; + private: // data /** Adaptation side data about the WLAN connection */ diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/inc/core_sub_operation_create_ts.h --- a/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/inc/core_sub_operation_create_ts.h Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/inc/core_sub_operation_create_ts.h Mon Mar 15 12:46:48 2010 +0200 @@ -16,7 +16,7 @@ */ /* -* %version: 4 % +* %version: 5 % */ #ifndef CORE_SUB_OPERATION_CREATE_TS_H @@ -108,6 +108,9 @@ /** The current status of the traffic stream. */ core_traffic_stream_status_e& stream_status_m; + /** How many times AP has rejected our request due to invalid parameters. */ + u8_t invalid_parameters_count_m; + }; #endif // CORE_SUB_OPERATION_CREATE_TS_H diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/inc/core_types.h --- a/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/inc/core_types.h Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/inc/core_types.h Mon Mar 15 12:46:48 2010 +0200 @@ -16,7 +16,7 @@ */ /* -* %version: 95 % +* %version: 95.1.2 % */ #ifndef CORE_TYPES_H @@ -79,10 +79,10 @@ const u32_t REQUEST_ID_CORE_INTERNAL = 0; -const u32_t WEP_KEY1 = 1; -const u32_t WEP_KEY2 = 2; -const u32_t WEP_KEY3 = 3; -const u32_t WEP_KEY4 = 4; +const u32_t WEP_KEY1 = 0; +const u32_t WEP_KEY2 = 1; +const u32_t WEP_KEY3 = 2; +const u32_t WEP_KEY4 = 3; const u32_t EAP_TYPE_NONE = 0; const u32_t EAP_ERROR_NONE = 0; @@ -1421,8 +1421,10 @@ u32_t scan_rate; ///< Data rate used to send probe requests. ///< The rate is defined in units of 500kbit/s. u32_t rcpi_trigger; ///< Roaming is attemped when RCPI value is lower than this. - u32_t active_scan_min_ch_time; ///< Min time (TUs) to listen a channel in active scanning. - u32_t active_scan_max_ch_time; ///< Max time (TUs) to listen a channel in active scanning. + u32_t active_scan_min_ch_time; ///< Min time (TUs) to listen a channel in active direct scanning / during an active connection. + u32_t active_scan_max_ch_time; ///< Max time (TUs) to listen a channel in active direct scanning / during an active connection. + u32_t active_broadcast_scan_min_ch_time; ///< Min time (TUs) to listen a channel in active broadcast scanning when not connected. + u32_t active_broadcast_scan_max_ch_time; ///< Max time (TUs) to listen a channel in active broadcast scanning when not connected. u32_t passive_scan_min_ch_time; ///< Min time (TUs) to listen a channel in passive scanning. u32_t passive_scan_max_ch_time; ///< Max time (TUs) to listen a channel in passive scanning. u32_t max_tx_msdu_life_time; ///< Max time (TUs) to (re-)send one (fragmented) packet. diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_iap_data.cpp --- a/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_iap_data.cpp Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_iap_data.cpp Mon Mar 15 12:46:48 2010 +0200 @@ -15,6 +15,9 @@ * */ +/* +* %version: 14.1.1 % +*/ #include "core_iap_data.h" #include "core_tools.h" @@ -337,3 +340,57 @@ addr = iap_blacklist_m.next(); } } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +bool_t core_iap_data_c::is_valid() const + { + if( iap_data_m.security_mode == core_security_mode_wep ) + { + if( !iap_data_m.wep_key1.key_length && + !iap_data_m.wep_key2.key_length && + !iap_data_m.wep_key3.key_length && + !iap_data_m.wep_key4.key_length ) + { + DEBUG( "core_iap_data_c::is_valid() - security mode is WEP but no keys defined" ); + + return false_t; + } + + if( ( iap_data_m.default_wep_key > WEP_KEY4 ) || + ( iap_data_m.default_wep_key == WEP_KEY1 && + !iap_data_m.wep_key1.key_length ) || + ( iap_data_m.default_wep_key == WEP_KEY2 && + !iap_data_m.wep_key2.key_length ) || + ( iap_data_m.default_wep_key == WEP_KEY3 && + !iap_data_m.wep_key3.key_length ) || + ( iap_data_m.default_wep_key == WEP_KEY4 && + !iap_data_m.wep_key4.key_length ) ) + { + DEBUG( "core_iap_data_c::is_valid() - security mode is WEP but default key not defined" ); + + return false_t; + } + } + + if( iap_data_m.wpa_preshared_key_in_use && + !iap_data_m.wpa_preshared_key.key_length ) + { + DEBUG( "core_iap_data_c::is_valid() - security mode is WPA-PSK but key is not defined" ); + + return false_t; + } + + if( iap_data_m.op_mode == core_operating_mode_ibss && + ( iap_data_m.security_mode != core_security_mode_allow_unsecure && + iap_data_m.security_mode != core_security_mode_wep ) ) + { + DEBUG1( "core_iap_data_c::is_valid() - IBSS mode with security mode %u not supported", + iap_data_m.security_mode ); + + return false_t; + } + + return true_t; + } diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_operation_configure_multicast_group.cpp --- a/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_operation_configure_multicast_group.cpp Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_operation_configure_multicast_group.cpp Mon Mar 15 12:46:48 2010 +0200 @@ -15,6 +15,9 @@ * */ +/* +* %version: 7 % +*/ #include "core_operation_configure_multicast_group.h" #include "core_server.h" @@ -60,11 +63,19 @@ case core_state_init: { operation_state_m = core_state_req_configure_multicast_group; - + + if ( !server_m->get_core_settings().is_connected() ) + { + DEBUG( "core_operation_configure_multicast_group_c::next_state() - not connected, nothing to do" ); + + return core_error_general; + } + drivers_m->configure_multicast_group( request_id_m, is_join_m, multicast_addr_m ); + break; } case core_state_req_configure_multicast_group: diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_operation_connect.cpp --- a/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_operation_connect.cpp Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_operation_connect.cpp Mon Mar 15 12:46:48 2010 +0200 @@ -16,7 +16,7 @@ */ /* -* %version: 40 % +* %version: 41 % */ #include "genscaninfo.h" @@ -97,33 +97,36 @@ if( ret != core_error_ok ) { DEBUG1( "core_operation_connect_c::next_state() - unable to initialize connection data (%d)", ret ); - + return ret; } + if( !server_m->get_connection_data()->iap_data().is_valid() ) + { + DEBUG( "core_operation_connect_c::next_state() - invalid connection settings" ); + + server_m->clear_connection_data(); + + return core_error_illegal_argument; + } + if( server_m->get_connection_data()->iap_data().is_eap_used() && !server_m->create_eapol_instance( core_eapol_operating_mode_wfa ) ) { DEBUG( "core_operation_connect_c::next_state() - unable to instantiate EAPOL (WFA)" ); - return core_error_no_memory; + server_m->clear_connection_data(); + + return core_error_no_memory; } else if( server_m->get_connection_data()->iap_data().is_wapi_used() && !server_m->create_eapol_instance( core_eapol_operating_mode_wapi ) ) { DEBUG( "core_operation_connect_c::next_state() - unable to instantiate EAPOL (WAPI)" ); - return core_error_no_memory; - } - - if( server_m->get_connection_data()->iap_data().operating_mode() == core_operating_mode_ibss && - ( server_m->get_connection_data()->iap_data().security_mode() != core_security_mode_allow_unsecure && - server_m->get_connection_data()->iap_data().security_mode() != core_security_mode_wep ) ) - { - DEBUG1( "core_operation_connect_c::next_state() - ad-hoc with security mode %d not supported", - server_m->get_connection_data()->iap_data().security_mode() ); + server_m->clear_connection_data(); - return core_error_not_supported; + return core_error_no_memory; } server_m->get_core_settings().clear_connection_statistics(); diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_operation_get_available_iaps.cpp --- a/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_operation_get_available_iaps.cpp Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_operation_get_available_iaps.cpp Mon Mar 15 12:46:48 2010 +0200 @@ -16,7 +16,7 @@ */ /* -* %version: 40.1.2 % +* %version: 41 % */ #include "core_operation_get_available_iaps.h" @@ -284,6 +284,14 @@ channels.channels2dot4ghz[1], channels.channels2dot4ghz[0] ); + u32_t min_ch_time( server_m->get_device_settings().active_broadcast_scan_min_ch_time ); + u32_t max_ch_time( server_m->get_device_settings().active_broadcast_scan_max_ch_time ); + if ( server_m->get_core_settings().is_connected() ) + { + min_ch_time = server_m->get_device_settings().active_scan_min_ch_time; + max_ch_time = server_m->get_device_settings().active_scan_max_ch_time; + } + server_m->register_event_handler( this ); server_m->register_frame_handler( this ); @@ -293,8 +301,8 @@ BROADCAST_SSID, server_m->get_device_settings().scan_rate, channels, - server_m->get_device_settings().active_scan_min_ch_time, - server_m->get_device_settings().active_scan_max_ch_time, + min_ch_time, + max_ch_time, is_split_scan_m ); } diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_operation_scan.cpp --- a/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_operation_scan.cpp Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_operation_scan.cpp Mon Mar 15 12:46:48 2010 +0200 @@ -16,6 +16,9 @@ * */ +/* +* %version: 28 % +*/ #include "core_operation_scan.h" #include "core_server.h" @@ -82,7 +85,14 @@ u32_t min_ch_time( server_m->get_device_settings().active_scan_min_ch_time ); u32_t max_ch_time( server_m->get_device_settings().active_scan_max_ch_time ); - if ( scan_mode_m == core_scan_mode_passive ) + if ( scan_mode_m == core_scan_mode_active && + !scan_ssid_m.length && + !server_m->get_core_settings().is_connected() ) + { + min_ch_time = server_m->get_device_settings().active_broadcast_scan_min_ch_time; + max_ch_time = server_m->get_device_settings().active_broadcast_scan_max_ch_time; + } + else if ( scan_mode_m == core_scan_mode_passive ) { min_ch_time = server_m->get_device_settings().passive_scan_min_ch_time; max_ch_time = server_m->get_device_settings().passive_scan_max_ch_time; diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_sub_operation_create_ts.cpp --- a/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_sub_operation_create_ts.cpp Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_sub_operation_create_ts.cpp Mon Mar 15 12:46:48 2010 +0200 @@ -16,7 +16,7 @@ */ /* -* %version: 12 % +* %version: 13 % */ #include "core_sub_operation_create_ts.h" @@ -28,8 +28,12 @@ #include "core_tools_parser.h" #include "am_debug.h" +/** The amount of microseconds to wait for a response to our request. */ const u32_t CORE_AP_RESP_WAITING_TIME = 1000000; +/** The maximum amount of times AP can reject our request due to invalid parameters. */ +const u8_t CORE_MAX_INVALID_PARAMETERS_COUNT = 3; + // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- @@ -51,7 +55,8 @@ tid_m( tid ), user_priority_m( user_priority ), tspec_m( tspec ), - stream_status_m( stream_status ) + stream_status_m( stream_status ), + invalid_parameters_count_m( 0 ) { DEBUG( "core_sub_operation_create_ts_c::core_sub_operation_create_ts_c()" ); @@ -186,6 +191,17 @@ } case core_state_invalid_parameters: { + ++invalid_parameters_count_m; + + if( invalid_parameters_count_m >= CORE_MAX_INVALID_PARAMETERS_COUNT ) + { + server_m->unregister_frame_handler( this ); + + DEBUG( "core_sub_operation_create_ts_c::next_state() - invalid parameters counter exceeded, giving up" ); + + return core_error_general; + } + DEBUG( "core_sub_operation_create_ts_c::next_state() - AP has downgraded our parameters, retrying" ); return goto_state( core_state_init ); @@ -296,6 +312,8 @@ } else if ( wmm_action->status() == core_frame_action_wmm_c::core_dot11_action_wmm_status_invalid_parameters ) { + stream_status_m = core_traffic_stream_status_inactive_invalid_parameters; + asynch_goto( core_state_invalid_parameters, CORE_TIMER_IMMEDIATELY ); } else diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/conf/wlanengine.confml Binary file wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/conf/wlanengine.confml has changed diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/conf/wlanengine_101f8e44.crml Binary file wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/conf/wlanengine_101f8e44.crml has changed diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanbgscan.h --- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanbgscan.h Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanbgscan.h Mon Mar 15 12:46:48 2010 +0200 @@ -16,7 +16,7 @@ */ /* -* %version: 9 % +* %version: 10 % */ #ifndef WLANBGSCAN_H @@ -46,17 +46,7 @@ { public: - - /** - * States for Auto period. - */ - enum TWlanBgScanAutoPeriod - { - EAutoPeriodNone = 0, - EAutoPeriodNight, - EAutoPeriodDay - }; - + /** * Describes relation of time to time range. */ @@ -97,11 +87,13 @@ /** * From MWlanBgScanProvider. - * Issued when WLAN is disconnected. + * Called to indicate that WLAN state has changed. * * @since S60 v5.2 + * + * @param aState New WLAN state */ - void NotConnected(); + void WlanStateChanged( const MWlanBgScanProvider::TWlanBgScanWlanState &aState ); /** * From MWlanBgScanProvider. @@ -118,8 +110,6 @@ * Notification about changed settings. * * @since S60 v5.2 - * - * @param aSettings new settings to be taken into use */ void NotifyChangedSettings( MWlanBgScanProvider::TWlanBgScanSettings& aSettings ); @@ -290,11 +280,6 @@ MWlanBgScanAwsComms* iAwsComms; /** - * Current Auto period. - */ - TWlanBgScanAutoPeriod iAutoPeriod; - - /** * Whether AWS is ok or not. */ TBool iAwsOk; diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanbgscanawscomms.h --- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanbgscanawscomms.h Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanbgscanawscomms.h Mon Mar 15 12:46:48 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -16,7 +16,7 @@ */ /* -* %version: 2 % +* %version: 3 % */ #ifndef WLANBGSCANAWSCOMMS_H @@ -84,14 +84,7 @@ * @since S60 v5.2 */ void SendOrQueueAwsCommand( TAwsMessage& aMessage ); - - /** - * Blocks calling thread until AWS is constructed. - * - * @since S60 v5.2 - */ - //void WaitForAwsStartupToComplete(); - + private: // From CActive /** @@ -131,7 +124,7 @@ * Clean-up ECOM array * * @since S60 v5.2 - * @param aArray ECOM objec array + * @param aArray ECOM object array */ static void CleanupEComArray(TAny* aArray); @@ -204,11 +197,6 @@ TBool iAwsOk; /** - * Synchronization object between WLAN Engine and AWS threads. - */ - //RSemaphore iStartupLock; - - /** * Handle to WLAN Engine thread. */ RThread iWlanEngineThread; diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanbgscanstates.h --- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanbgscanstates.h Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanbgscanstates.h Mon Mar 15 12:46:48 2010 +0200 @@ -16,7 +16,7 @@ */ /* -* %version: 2 % +* %version: 3 % */ #ifndef WLANBGSCANSTATES_H @@ -366,14 +366,7 @@ * @param aInterval new background scan interval to be taken into use */ void SetInterval( TUint32 aInterval ); - - /** - * Refreshes the used background scan interval. - * - * @since S60 v5.2 - */ - void RefreshUsedInterval(); - + protected: /** @@ -413,10 +406,7 @@ * @param aStatus new status * @since S60 v5.2 */ - inline void SetAwsStartupStatus( TInt aStatus ) - { - iAwsStartupStatus = aStatus; - } + inline void SetAwsStartupStatus( TInt aStatus ); /** * Set AWS command status. @@ -425,11 +415,7 @@ * @param aStatus new status * @since S60 v5.2 */ - inline void SetAwsCmdStatus( MWlanBgScanAwsComms::TAwsCommand aCmd, TInt aStatus ) - { - iAwsCmd = aCmd; - iAwsCmdStatus = aStatus; - } + inline void SetAwsCmdStatus( MWlanBgScanAwsComms::TAwsCommand aCmd, TInt aStatus ); /** * Set Auto interval. @@ -437,10 +423,14 @@ * @param aAutoInterval new auto interval * @since S60 v5.2 */ - inline void SetAutoInterval( TUint aAutoInterval ) - { - iAutoInterval = aAutoInterval; - } + inline void SetAutoInterval( TUint aAutoInterval ); + + /** + * Refreshes the used background scan interval. + * + * @since S60 v5.2 + */ + void RefreshUsedInterval(); private: // data @@ -538,7 +528,15 @@ /** * Status code of the completed AWS command. */ - TInt iAwsCommandCompletionCode; + TInt iAwsCommandCompletionCode; + + /** + * Current WLAN state. + */ + MWlanBgScanProvider::TWlanBgScanWlanState iWlanState; + }; +#include "wlanbgscanstates.inl" + #endif // WLANBGSCANSTATES_H diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanbgscanstates.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanbgscanstates.inl Mon Mar 15 12:46:48 2010 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 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: Inline methods of CWlanBgScanStates +* +*/ + +/* +* %version: 1 % +*/ + +// --------------------------------------------------------- +// CWlanBgScanStates::SetAwsStartupStatus +// --------------------------------------------------------- +// +inline void CWlanBgScanStates::SetAwsStartupStatus( TInt aStatus ) + { + iAwsStartupStatus = aStatus; + } + +// --------------------------------------------------------- +// CWlanBgScanStates::SetAwsCmdStatus +// --------------------------------------------------------- +// +inline void CWlanBgScanStates::SetAwsCmdStatus( MWlanBgScanAwsComms::TAwsCommand aCmd, TInt aStatus ) + { + iAwsCmd = aCmd; + iAwsCmdStatus = aStatus; + } + +// --------------------------------------------------------- +// CWlanBgScanStates::SetAutoInterval +// --------------------------------------------------------- +// +inline void CWlanBgScanStates::SetAutoInterval( TUint aAutoInterval ) + { + iAutoInterval = aAutoInterval; + } + +// End of File diff -r 51a71243e562 -r e0f767079796 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 Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlandevicesettings.h Mon Mar 15 12:46:48 2010 +0200 @@ -16,7 +16,7 @@ */ /* -* %version: 21 % +* %version: 22 % */ #ifndef WLANDEVICESETTINGS_H @@ -46,7 +46,7 @@ const TUint32 KWlanDefaultLongRetryLimit = 4; const TUint32 KWlanDefaultRTSThreshold = 2347; const TUint32 KWlanDefaultShortRetryLimit = 7; -const TUint32 KWlanDefaultMinChanneltime = 7; +const TUint32 KWlanDefaultMinChanneltime = 10; const TUint32 KWlanDefaultMaxChanneltime = 30; const TUint32 KWlanDefaultMaxTransmitMSDULifetime = 512; const TUint32 KWlanDefaultMinPassiveChannelTime = 110; @@ -101,6 +101,8 @@ const TUint32 KWlanDefaultBgScanPeakPeriodEnd = 100; // Peak ends at 01:00 o'clock const TUint32 KWlanDefaultBgScanIntervalPeakPeriod = 600; // Background scan interval for peak hours is 600 s const TUint32 KWlanDefaultBgScanIntervalOffPeakPeriod = 1200; // Background scan interval for off-peak hours is 1200 s +const TUint32 KWlanDefaultMinActiveBroadcastChannelTime = 10; +const TUint32 KWlanDefaultMaxActiveBroadcastChannelTime = 110; // The value of backgroundScanInterval to deny periodic scanning const TUint KScanIntervalNever = 0; @@ -128,8 +130,8 @@ TUint32 txPowerLevel; ///< Transmission power level in use. In mWs. TRate scanRate; ///< Data rate used in probe request. TUint32 rcpiTrigger; ///< Default value for RSSI trigger. - TUint32 minActiveChannelTime; ///< Min time to listen channel in active scanning. - TUint32 maxActiveChannelTime; ///< Max time to listen channel in active scanning. + TUint32 minActiveChannelTime; ///< Min time (TUs) to listen a channel in active direct scanning / during an active connection. + TUint32 maxActiveChannelTime; ///< Max time (TUs) to listen a channel in active direct scanning / during an active connection. TUint32 maxTxMSDULifeTime; ///< Max time to send one (fragmented) packet. TBool useDefaultSettings; ///< If ETrue default values are being used, EFalse use the user defined values. TUint32 scanExpirationTimer; ///< Time after a new scan is done if required. Otherwise the last scan result is returned. @@ -192,6 +194,8 @@ TUint32 bgScanIntervalPeak; ///< WLAN background scan interval for peak period. TUint32 bgScanIntervalOffPeak; ///< WLAN background scan interval for off-peak period. TBool automaticTrafficStreamMgmt; ///< Whether admission control traffic stream management is done automatically. + TUint32 minActiveBroadcastChannelTime; ///< Min time (TUs) to listen a channel in active broadcast scanning when not connected. + TUint32 maxActiveBroadcastChannelTime; ///< Max time (TUs) to listen a channel in active broadcast scanning when not connected. TUint32 region; ///< Last known WLAN region that is valid for 5 hours. This value is selected based on the information received from the APs or from cellular network (MCC). TInt32 regionTimestamp; ///< Timestamp for storing the latest WLAN region (region) to CenRep (minutes from 0AD nominal Gregorian). }; diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanscanproviderinterface.h --- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanscanproviderinterface.h Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanscanproviderinterface.h Mon Mar 15 12:46:48 2010 +0200 @@ -16,7 +16,7 @@ */ /* -* %version: 6 % +* %version: 7 % */ @@ -78,6 +78,13 @@ public: + enum TWlanBgScanWlanState + { + EWlanStateConnected = 1, + EWlanStateDisconnected, + EWlanStateMax // not used + }; + struct TWlanBgScanSettings { TUint32 backgroundScanInterval; @@ -120,11 +127,13 @@ virtual void ScanComplete() = 0; /** - * Called to indicate that WLAN is no longer connected. + * Called to indicate that WLAN state has changed. * * @since S60 v5.2 + * + * @param aState New WLAN state */ - virtual void NotConnected() = 0; + virtual void WlanStateChanged( const TWlanBgScanWlanState &aState ) = 0; /** * Whether background scan is enabled. diff -r 51a71243e562 -r e0f767079796 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 Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlmserver.h Mon Mar 15 12:46:48 2010 +0200 @@ -16,7 +16,7 @@ */ /* -* %version: 52 % +* %version: 54 % */ #ifndef WLMSERVER_H @@ -981,27 +981,27 @@ /** * Handles completion routines of an internal request - * @param aIndex index to the request that should be completed. + * @param aRequest request that should be completed. * @param aStatus status of the completed operation. * @param aCompletedWasTriggering value ETrue means that * completed request is the same as the request which * triggered the core operation */ void CompleteInternalRequest( - TUint32 aIndex, + const SRequestMapEntry& aRequest, core_error_e aStatus, TBool aCompletedWasTriggering = ETrue ); /** * Handles completion routines of an external request - * @param aIndex index to the request that should be completed. + * @param aRequest request that should be completed. * @param aStatus status of the completed operation. * @param aTriggerRequest pointer to the request that triggered core operation * value NULL means that completed request is the same as the request which triggered * the core operation */ void CompleteExternalRequest( - TUint32 aIndex, + const SRequestMapEntry& aRequest, core_error_e aStatus, SRequestMapEntry* aTriggerRequest = NULL ); @@ -1293,7 +1293,7 @@ CWlanEapolClient* iEapolClient; /** - * EAPOL callback handler in core. + * EAPOL callback handler in core. Not owned by this pointer. */ abs_wlan_eapol_callback_c* iEapolHandler; diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanbgscan.cpp --- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanbgscan.cpp Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanbgscan.cpp Mon Mar 15 12:46:48 2010 +0200 @@ -16,7 +16,7 @@ */ /* -* %version: 15 % +* %version: 16 % */ #include @@ -80,7 +80,6 @@ CWlanBgScanStates( *this, aProvider, aTimerServices ), iProvider ( aProvider ), iAwsComms( NULL ), - iAutoPeriod( EAutoPeriodNone ), iAwsOk( EFalse ), iCurrentPsmServerMode( 0 ) { @@ -157,18 +156,18 @@ // --------------------------------------------------------------------------- // From class MWlanBgScanProvider. -// CWlanBgScan::NotConnected +// CWlanBgScan::WlanStateChanged // --------------------------------------------------------------------------- // -void CWlanBgScan::NotConnected() +void CWlanBgScan::WlanStateChanged( const MWlanBgScanProvider::TWlanBgScanWlanState &aState ) { - DEBUG1( "CWlanBgScan::NotConnected() - current interval %us", GetBgInterval() ); - - if ( GetBgInterval() != KWlanBgScanIntervalNever ) - { - DEBUG( "CWlanBgScan::NotConnected() - issue a new request with immediate expiry" ); - iProvider.Scan( KWlanBgScanMaxDelayExpireImmediately ); - } + DEBUG2( "CWlanBgScan::WlanStateChanged() - old state: %u, new state: %u", iWlanState, aState ); + + // store state + iWlanState = aState; + + RefreshUsedInterval(); + } // --------------------------------------------------------------------------- diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanbgscanawscomms.cpp --- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanbgscanawscomms.cpp Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanbgscanawscomms.cpp Mon Mar 15 12:46:48 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -16,7 +16,7 @@ */ /* -* %version: 3 % +* %version: 4 % */ #include @@ -66,8 +66,7 @@ iAwsImplUid( 0 ), iCommandHandler( NULL ), iAwsVersion( 0 ), - iPendingCommand( EAwsCommandMax ), - iAwsOk( EFalse ) + iPendingCommand( EAwsCommandMax ) { DEBUG( "CWlanBgScanAwsComms::CWlanBgScanAwsComms()" ); } @@ -89,7 +88,6 @@ iAwsMsgQueue.Close(); Cancel(); iWlanEngineThread.Close(); - //iStartupLock.Close(); } // --------------------------------------------------------------------------- diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanbgscanstates.cpp --- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanbgscanstates.cpp Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanbgscanstates.cpp Mon Mar 15 12:46:48 2010 +0200 @@ -16,7 +16,7 @@ */ /* -* %version: 3 % +* %version: 4 % */ #include @@ -57,7 +57,8 @@ iBgScanState( EBgScanStateMax ), iIntervalChangeRequestId( 0 ), iCompletedAwsCommand( MWlanBgScanAwsComms::EAwsCommandMax ), - iAwsCommandCompletionCode( KErrNone ) + iAwsCommandCompletionCode( KErrNone ), + iWlanState( MWlanBgScanProvider::EWlanStateMax ) { DEBUG( "CWlanBgScanStates::CWlanBgScanStates()" ); } @@ -836,11 +837,17 @@ { TUint oldInterval = iUsedBgScanInterval; - DEBUG2( "CWlanBgScanStates::RefreshUsedInterval() - agg: %u, normal: %u", - iAggressiveBgScanInterval, iBgScanInterval ); + DEBUG4( "CWlanBgScanStates::RefreshUsedInterval() - agg: %u, normal: %u, used: %u, wlan state: %u", + iAggressiveBgScanInterval, iBgScanInterval, iUsedBgScanInterval, iWlanState ); - // Smaller of the two intervals will be taken into use - if( iAggressiveBgScanInterval < iBgScanInterval ) + // If ( WLAN state is connected ) -> use interval: KWlanNoScanning + // Else If ( aggressive interval < normal interval ) -> use interval: aggressive interval + // Otherwise -> use interval: background scan interval + if( iWlanState == MWlanBgScanProvider::EWlanStateConnected ) + { + iUsedBgScanInterval = KWlanNoScanning; + } + else if( iAggressiveBgScanInterval < iBgScanInterval ) { iUsedBgScanInterval = iAggressiveBgScanInterval; } @@ -876,6 +883,8 @@ // else // In case the new interval is bigger than the old one, it // is taken into use after the pending scan request completes. + DEBUG1( "CWlanBgScanStates::RefreshUsedInterval() - using interval: %u", iUsedBgScanInterval ); + } diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanconversionutil.cpp --- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanconversionutil.cpp Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanconversionutil.cpp Mon Mar 15 12:46:48 2010 +0200 @@ -16,7 +16,7 @@ */ /* -* %version: 84 % +* %version: 84.1.2 % */ #include @@ -649,6 +649,8 @@ aCoreSettings.rcpi_trigger = static_cast( aAmSettings.rcpiTrigger ); aCoreSettings.active_scan_min_ch_time = static_cast( aAmSettings.minActiveChannelTime ); aCoreSettings.active_scan_max_ch_time = static_cast( aAmSettings.maxActiveChannelTime ); + aCoreSettings.active_broadcast_scan_min_ch_time = static_cast( aAmSettings.minActiveBroadcastChannelTime ); + aCoreSettings.active_broadcast_scan_max_ch_time = static_cast( aAmSettings.maxActiveBroadcastChannelTime ); aCoreSettings.passive_scan_min_ch_time = static_cast( aAmSettings.minPassiveChannelTime ); aCoreSettings.passive_scan_max_ch_time = static_cast( aAmSettings.maxPassiveChannelTime ); aCoreSettings.max_tx_msdu_life_time = static_cast( aAmSettings.maxTxMSDULifeTime ); @@ -853,8 +855,8 @@ Mem::Copy( aCoreSettings.wpa_preshared_key.key_data, aAmSettings.WPAPreSharedKey.Ptr(), - aAmSettings.WPAKeyLength ); - aCoreSettings.wpa_preshared_key.key_length = aAmSettings.WPAKeyLength; + aAmSettings.WPAPreSharedKey.Length() ); + aCoreSettings.wpa_preshared_key.key_length = aAmSettings.WPAPreSharedKey.Length(); } // Handle diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlandevicesettings.cpp --- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlandevicesettings.cpp Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlandevicesettings.cpp Mon Mar 15 12:46:48 2010 +0200 @@ -16,7 +16,7 @@ */ /* -* %version: 19 % +* %version: 20 % */ // INCLUDE FILES @@ -203,8 +203,10 @@ aSettings.bgScanPeakPeriodEnd = KWlanDefaultBgScanPeakPeriodEnd; aSettings.bgScanIntervalPeak = KWlanDefaultBgScanIntervalPeakPeriod; aSettings.bgScanIntervalOffPeak = KWlanDefaultBgScanIntervalOffPeakPeriod; - aSettings.automaticTrafficStreamMgmt = ETrue; - aSettings.region = KWlanDefaultRegion; + aSettings.automaticTrafficStreamMgmt = ETrue; + aSettings.minActiveBroadcastChannelTime = KWlanDefaultMinActiveBroadcastChannelTime; + aSettings.maxActiveBroadcastChannelTime = KWlanDefaultMaxActiveBroadcastChannelTime; + aSettings.region = KWlanDefaultRegion; aSettings.regionTimestamp = KWlanDefaultRegionTimestamp; } @@ -788,6 +790,20 @@ aSettings.automaticTrafficStreamMgmt = static_cast( temp ); } + // Read KWlanMinActiveBroadcastChannelTime + err = repository->Get( KWlanMinActiveBroadcastChannelTime, temp ); + if( err == KErrNone ) + { + aSettings.minActiveBroadcastChannelTime = temp; + } + + // Read KWlanMaxActiveBroadcastChannelTime + err = repository->Get( KWlanMaxActiveBroadcastChannelTime, temp ); + if( err == KErrNone ) + { + aSettings.maxActiveBroadcastChannelTime = temp; + } + // Read KWlanRegion err = repository->Get( KWlanRegion, temp ); if( err == KErrNone ) @@ -1406,6 +1422,24 @@ DEBUG1( "CWlanDeviceSettings::WritePrivateData() - could not set key 0x%X", KWlanAutomaticTrafficStreamMgmt ); } + // Write KWlanMinActiveBroadcastChannelTime + err = repository->Set( + KWlanMinActiveBroadcastChannelTime, + static_cast( aSettings.minActiveBroadcastChannelTime ) ); + if( err ) + { + DEBUG1( "CWlanDeviceSettings::WritePrivateData() - could not set key 0x%X", KWlanMinActiveBroadcastChannelTime ); + } + + // Write KWlanMaxActiveBroadcastChannelTime + err = repository->Set( + KWlanMaxActiveBroadcastChannelTime, + static_cast( aSettings.maxActiveBroadcastChannelTime ) ); + if( err ) + { + DEBUG1( "CWlanDeviceSettings::WritePrivateData() - could not set key 0x%X", KWlanMaxActiveBroadcastChannelTime ); + } + // Write KWlanRegion err = repository->Set( KWlanRegion, @@ -1679,6 +1713,10 @@ aSettings.bgScanIntervalOffPeak ); DEBUG1( "CWlanDeviceSettings::LogSettings() - automaticTrafficStreamMgmt == %u", static_cast( aSettings.automaticTrafficStreamMgmt ) ); + DEBUG1( "CWlanDeviceSettings::LogSettings() - minActiveBroadcastChannelTime == %d", + aSettings.minActiveBroadcastChannelTime ); + DEBUG1( "CWlanDeviceSettings::LogSettings() - maxActiveBroadcastChannelTime == %d", + aSettings.maxActiveBroadcastChannelTime ); DEBUG1( "CWlanDeviceSettings::LogSettings() - region == %u", aSettings.region ); DEBUG1( "CWlanDeviceSettings::LogSettings() - regionTimestamp == %d", diff -r 51a71243e562 -r e0f767079796 wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanmgmtimpl.cpp --- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanmgmtimpl.cpp Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanmgmtimpl.cpp Mon Mar 15 12:46:48 2010 +0200 @@ -16,7 +16,7 @@ */ /* -* %version: 30 % +* %version: 31 % */ // INCLUDE FILES @@ -563,8 +563,7 @@ iProtectedSetupRequest->IsActive() ) { iProtectedSetupRequest->Cancel(); - - User::RequestComplete( iPendingProtectedSetupStatus, KErrCancel ); + ProtectedSetupComplete( KErrCancel ); } } @@ -580,8 +579,7 @@ iScanRequest->IsActive() ) { iScanRequest->Cancel(); - - User::RequestComplete( iPendingScanStatus, KErrCancel ); + ScanComplete( KErrCancel ); } } @@ -597,8 +595,7 @@ iAvailableIapsRequest->IsActive() ) { iAvailableIapsRequest->Cancel(); - - User::RequestComplete( iPendingAvailableIapsStatus, KErrCancel ); + AvailableIapsComplete( KErrCancel ); } } @@ -808,6 +805,7 @@ TInt aStatus ) { TraceDump( INFO_LEVEL, ( _L( "CWlanMgmtImpl::ScanComplete()" ) ) ); + User::RequestComplete( iPendingScanStatus, aStatus ); delete iScanRequest; iScanRequest = NULL; @@ -822,6 +820,7 @@ TInt aStatus ) { TraceDump( INFO_LEVEL, ( _L( "CWlanMgmtImpl::AvailableIapsComplete()" ) ) ); + User::RequestComplete( iPendingAvailableIapsStatus, aStatus ); delete iAvailableIapsRequest; iAvailableIapsRequest = NULL; diff -r 51a71243e562 -r e0f767079796 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 Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlmserver.cpp Mon Mar 15 12:46:48 2010 +0200 @@ -16,7 +16,7 @@ */ /* -* %version: 99 % +* %version: 102 % */ #include @@ -478,8 +478,9 @@ return; } - DEBUG4( "CWlmServer::Connect() - SecurityMode: %u, WPAKeyLength: %u, EnableWpaPsk: %u, PresharedKeyFormat: %u", - iapData.SecurityMode, iapData.WPAKeyLength, iapData.EnableWpaPsk, iapData.PresharedKeyFormat ); + DEBUG5( "CWlmServer::Connect() - SecurityMode: %u, WPAKeyLength: %u, WPAPreSharedKey: %u, EnableWpaPsk: %u, PresharedKeyFormat: %u", + iapData.SecurityMode, iapData.WPAKeyLength, iapData.WPAPreSharedKey.Length(), + iapData.EnableWpaPsk, iapData.PresharedKeyFormat ); // Check whether WAPI is supported if( iapData.SecurityMode == Wapi && @@ -1127,7 +1128,7 @@ mapEntry.iParam1 = coreSsid; mapEntry.iTime = scanTime; iRequestMap.Append( mapEntry ); - + // Scan scheduling timer needs to be set again if this request needs the results earlier or // if this is the only timed pending request if( scanTime != NULL && ( IsOnlyTimedScanRequestInRequestMap( mapEntry ) || *scanTime < iScanSchedulingTimerExpiration ) ) @@ -1798,9 +1799,10 @@ iAggressiveScanningAfterLinkLoss = EFalse; } - // if background scan is on, this call will cause a background scan - // when the background scan is completed, the icon is updated - iBgScanProvider->NotConnected(); + // If background scan is on, this call will cause a background scan to occur. + // The icon is updated after the background scan is completed. + iBgScanProvider->WlanStateChanged( MWlanBgScanProvider::EWlanStateDisconnected ); + break; case EWlanStateInfrastructure: DEBUG( "CWlmServer::notify() - STATE: EWlanStateInfrastructure" ); @@ -2225,9 +2227,9 @@ DEBUG( "CWlmServer::request_complete() - also additional requests can be completed" ); /* - * Request can be completed using other the results of another request if + * Request can be completed using the results of another request if * this method is related to scan scheduling and results of the triggering request can - * be used also to completed this request + * be used also to complete this request * * Following rules apply: * - GetAvailableIaps results can be used to complete another GetAvailableIaps request, @@ -2251,12 +2253,12 @@ if( iRequestMap[i].iRequestId == KWlanIntCmdBackgroundScan ) { - CompleteInternalRequest( i, status, EFalse ); + CompleteInternalRequest( iRequestMap[i], status, EFalse ); bgScanCompleted = ETrue; } else { - CompleteExternalRequest( i, status, &completedMapEntry ); + CompleteExternalRequest( iRequestMap[i], status, &completedMapEntry ); if( IsSessionActive( iRequestMap[i] ) ) { iRequestMap[i].iMessage.Complete( @@ -2272,34 +2274,28 @@ } } - // clear completedMapEntry as it is not needed anymore - completedMapEntry = SRequestMapEntry(); - - // complete the request which Core has actually handled - TInt triggerIndex = FindRequestIndex( request_id ); - - DEBUG1( "CWlmServer::request_complete() - completing triggering request (ID %u)", iRequestMap[triggerIndex].iRequestId ); + DEBUG1( "CWlmServer::request_complete() - completing triggering request (ID %u)", completedMapEntry.iRequestId ); if( request_id < KWlanExtCmdBase ) { - CompleteInternalRequest( triggerIndex, status ); + CompleteInternalRequest( completedMapEntry, status ); } - else if( iRequestMap[triggerIndex].iFunction == EJoinByProfileId ) + else if( completedMapEntry.iFunction == EJoinByProfileId ) { core_iap_data_s* coreIapData = - reinterpret_cast( iRequestMap[triggerIndex].iParam0 ); + reinterpret_cast( completedMapEntry.iParam0 ); core_type_list_c* coreSsidList = - reinterpret_cast*>( iRequestMap[triggerIndex].iParam1 ); + reinterpret_cast*>( completedMapEntry.iParam1 ); core_connect_status_e* connectionStatus = - reinterpret_cast( iRequestMap[triggerIndex].iParam2 ); - - if( status == core_error_ok && IsSessionActive( iRequestMap[triggerIndex] ) ) + reinterpret_cast( completedMapEntry.iParam2 ); + + if( status == core_error_ok && IsSessionActive( completedMapEntry ) ) { DEBUG2("CONNECT COMPLETED WITH status == %u -> adapt == %d", *connectionStatus, TWlanConversionUtil::ConvertConnectStatus( *connectionStatus, coreIapData->security_mode ) ); - iRequestMap[triggerIndex].iMessage.Complete( + completedMapEntry.iMessage.Complete( TWlanConversionUtil::ConvertConnectStatus( *connectionStatus, coreIapData->security_mode ) ); @@ -2309,14 +2305,21 @@ // aggressive background scanning has to be carried out // in case the connection drops iAggressiveScanningAfterLinkLoss = ETrue; + + // Inform BgScan provider about successful connection. + // If background scan is currently on, background scan + // will be disabled and it's request will be removed + // from the request map. + iBgScanProvider->WlanStateChanged( MWlanBgScanProvider::EWlanStateConnected ); + } } - else if ( IsSessionActive( iRequestMap[triggerIndex] ) ) + else if ( IsSessionActive( completedMapEntry ) ) { DEBUG2("CONNECT COMPLETED WITH error == %u -> adapt == %d", status, TWlanConversionUtil::ConvertErrorCode( status ) ); - iRequestMap[triggerIndex].iMessage.Complete( + completedMapEntry.iMessage.Complete( TWlanConversionUtil::ConvertErrorCode( status ) ); } else @@ -2326,16 +2329,21 @@ delete coreIapData; delete coreSsidList; delete connectionStatus; - iRequestMap.Remove( triggerIndex ); + // re-use idx variable + idx = FindRequestIndex( completedMapEntry.iRequestId ); + if( idx < iRequestMap.Count() ) + { + iRequestMap.Remove( idx ); + } } - else if ( iRequestMap[triggerIndex].iFunction == ERunProtectedSetup ) + else if ( completedMapEntry.iFunction == ERunProtectedSetup ) { core_iap_data_s* iapData = - reinterpret_cast( iRequestMap[triggerIndex].iParam0 ); + reinterpret_cast( completedMapEntry.iParam0 ); core_type_list_c* iapDataList = - reinterpret_cast*>( iRequestMap[triggerIndex].iParam1 ); + reinterpret_cast*>( completedMapEntry.iParam1 ); core_protected_setup_status_e* protectedSetupStatus = - reinterpret_cast( iRequestMap[triggerIndex].iParam2 ); + reinterpret_cast( completedMapEntry.iParam2 ); // Convert the received credentials. TWlmProtectedSetupCredentials tmp; @@ -2353,26 +2361,26 @@ DEBUG1( "CWlmServer::request_complete() - converted %u Protected Setup credential attributes", tmp.count ); - if( IsSessionActive( iRequestMap[triggerIndex] ) ) + if( IsSessionActive( completedMapEntry ) ) { TPckg outPckg( tmp ); - iRequestMap[triggerIndex].iMessage.Write( 1, outPckg ); + completedMapEntry.iMessage.Write( 1, outPckg ); } - if( status == core_error_ok && IsSessionActive( iRequestMap[triggerIndex] ) ) + if( status == core_error_ok && IsSessionActive( completedMapEntry ) ) { - DEBUG2("PROTECTED SETUP COMPLETED WITH status == %d -> adapt == %d", + DEBUG2("PROTECTED SETUP COMPLETED WITH status == %u -> adapt == %d", *protectedSetupStatus, TWlanConversionUtil::ConvertProtectedSetupStatus( *protectedSetupStatus ) ); - iRequestMap[triggerIndex].iMessage.Complete( + completedMapEntry.iMessage.Complete( TWlanConversionUtil::ConvertProtectedSetupStatus( *protectedSetupStatus ) ); } - else if ( IsSessionActive( iRequestMap[triggerIndex] ) ) + else if ( IsSessionActive( completedMapEntry ) ) { - DEBUG2("PROTECTED SETUP COMPLETED WITH error == %d -> adapt == %d", + DEBUG2("PROTECTED SETUP COMPLETED WITH error == %u -> adapt == %d", status, TWlanConversionUtil::ConvertErrorCode( status ) ); - iRequestMap[triggerIndex].iMessage.Complete( + completedMapEntry.iMessage.Complete( TWlanConversionUtil::ConvertErrorCode( status ) ); } else @@ -2383,17 +2391,27 @@ delete iapData; delete iapDataList; delete protectedSetupStatus; - iRequestMap.Remove( triggerIndex ); + // re-use idx variable + idx = FindRequestIndex( completedMapEntry.iRequestId ); + if( idx < iRequestMap.Count() ) + { + iRequestMap.Remove( idx ); + } } else { - CompleteExternalRequest( triggerIndex, status ); - if( IsSessionActive( iRequestMap[triggerIndex] ) ) + CompleteExternalRequest( completedMapEntry, status ); + if( IsSessionActive( completedMapEntry ) ) { - iRequestMap[triggerIndex].iMessage.Complete( + completedMapEntry.iMessage.Complete( TWlanConversionUtil::ConvertErrorCode( status ) ); } - iRequestMap.Remove( triggerIndex ); + // re-use idx variable + idx = FindRequestIndex( completedMapEntry.iRequestId ); + if( idx < iRequestMap.Count() ) + { + iRequestMap.Remove( idx ); + } } // Background scan request needs to be updated only after all the other request have been completed @@ -2420,7 +2438,8 @@ if( requestMapCount ) { DEBUG( "CWlmServer::request_complete() - remaining requests:" ); - for ( TInt idx( 0 ); idx < requestMapCount; ++idx ) + // re-use idx variable + for ( idx = 0; idx < requestMapCount; ++idx ) { DEBUG1( "CWlmServer::request_complete() - ID %u", iRequestMap[idx].iRequestId ); DEBUG1( "CWlmServer::request_complete() - function %d", iRequestMap[idx].iFunction ); @@ -2546,37 +2565,43 @@ // --------------------------------------------------------- // void CWlmServer::CompleteInternalRequest( - TUint32 aIndex, + const SRequestMapEntry& aRequest, core_error_e aStatus, TBool aCompletedWasTriggering ) { - DEBUG1( "CWlmServer::CompleteInternalRequest() - index (%d)", aIndex ); + + TInt idx = FindRequestIndex( aRequest.iRequestId ); - // Take the entry out from queue - SRequestMapEntry requestEntry = iRequestMap[ aIndex ]; - - iRequestMap.Remove( aIndex ); - - switch( requestEntry.iRequestId ) + if( idx >= iRequestMap.Count() ) + { + DEBUG1("CWlmServer::CompleteInternalRequest() - request (ID %u) not in request map", idx ); + return; + } + + DEBUG1( "CWlmServer::CompleteInternalRequest() - index (%d)", idx ); + + iRequestMap.Remove( idx ); + + switch( aRequest.iRequestId ) { case KWlanIntCmdBackgroundScan: { core_type_list_c* iapSsidList = - reinterpret_cast*>( requestEntry.iParam3 ); + reinterpret_cast*>( aRequest.iParam3 ); delete iapSsidList; iapSsidList = NULL; ScanList* scanList = - reinterpret_cast( requestEntry.iParam2 ); + reinterpret_cast( aRequest.iParam2 ); core_type_list_c* idList = - reinterpret_cast*>( requestEntry.iParam1 ); + reinterpret_cast*>( aRequest.iParam1 ); core_type_list_c* iapDataList = - reinterpret_cast*>( requestEntry.iParam0 ); + reinterpret_cast*>( aRequest.iParam0 ); delete iapDataList; iapDataList = NULL; - TTime* completedScanTime = reinterpret_cast( requestEntry.iTime ); + TTime* completedScanTime = reinterpret_cast( aRequest.iTime ); delete completedScanTime; completedScanTime = NULL; @@ -2615,31 +2640,37 @@ // --------------------------------------------------------- // void CWlmServer::CompleteExternalRequest( - TUint32 aIndex, + const SRequestMapEntry& aRequest, core_error_e aStatus, SRequestMapEntry* aTriggerRequest ) { - DEBUG1( "CWlmServer::CompleteExternalRequest() - index (%d)", aIndex ); - - // Take the entry out from queue - SRequestMapEntry requestEntry = iRequestMap[ aIndex ]; + + TInt idx = FindRequestIndex( aRequest.iRequestId ); + + if( idx >= iRequestMap.Count() ) + { + DEBUG1("CWlmServer::CompleteExternalRequest() - request (ID %u) not in request map", idx ); + return; + } + + DEBUG1( "CWlmServer::CompleteExternalRequest() - index (%d)", idx ); // Find out the request type // in order to handle possible return parameters - switch( requestEntry.iFunction ) + switch( aRequest.iFunction ) { case EGetScanResults: { ScanList* tmp( NULL ); - core_ssid_s* ssid = reinterpret_cast( requestEntry.iParam1 ); - TTime* completedScanTime = reinterpret_cast( requestEntry.iTime ); - ScanList* completedScanList = reinterpret_cast( requestEntry.iParam0 ); + core_ssid_s* ssid = reinterpret_cast( aRequest.iParam1 ); + TTime* completedScanTime = reinterpret_cast( aRequest.iTime ); + ScanList* completedScanList = reinterpret_cast( aRequest.iParam0 ); if( aTriggerRequest == NULL ) { DEBUG( "CWlmServer::CompleteExternalRequest() - GetScanResults request handled by core" ); - tmp = reinterpret_cast( requestEntry.iParam0); + tmp = reinterpret_cast( aRequest.iParam0); } else { @@ -2672,10 +2703,10 @@ DEBUG2( "CWlmServer::CompleteExternalRequest() - scan results count is %u, size is %u", tmp->Count(), tmp->Size() ); - if( requestEntry.iSessionId != 0 ) + if( IsSessionActive( aRequest ) ) { - requestEntry.iMessage.Write( 0, ptrScanList ); - requestEntry.iMessage.Write( 2, pckgDynamicScanList ); + aRequest.iMessage.Write( 0, ptrScanList ); + aRequest.iMessage.Write( 2, pckgDynamicScanList ); } // Check whether to cache the results or not @@ -2729,19 +2760,19 @@ core_type_list_c* coreIdList; core_type_list_c* iapDataList; - iapSsidList = reinterpret_cast*>( requestEntry.iParam3 ); - iapDataList = reinterpret_cast*>( requestEntry.iParam0 ); + iapSsidList = reinterpret_cast*>( aRequest.iParam3 ); + iapDataList = reinterpret_cast*>( aRequest.iParam0 ); - TTime* completedScanTime = reinterpret_cast( requestEntry.iTime ); - ScanList* completedScanList = reinterpret_cast( requestEntry.iParam2); - core_type_list_c* completedIdList = reinterpret_cast*>( requestEntry.iParam1 ); + TTime* completedScanTime = reinterpret_cast( aRequest.iTime ); + ScanList* completedScanList = reinterpret_cast( aRequest.iParam2); + core_type_list_c* completedIdList = reinterpret_cast*>( aRequest.iParam1 ); if( aTriggerRequest == NULL ) { DEBUG( "CWlmServer::CompleteExternalRequest() - GetAvailableIaps request handled by core" ); - scanList = reinterpret_cast( requestEntry.iParam2); - coreIdList = reinterpret_cast*>( requestEntry.iParam1 ); + scanList = reinterpret_cast( aRequest.iParam2); + coreIdList = reinterpret_cast*>( aRequest.iParam1 ); } else { @@ -2789,15 +2820,14 @@ tmp.count = idx; - if( requestEntry.iSessionId != 0 ) + if( IsSessionActive( aRequest ) ) { TPckg outPckg( tmp ); - requestEntry.iMessage.Write( 0, outPckg ); + aRequest.iMessage.Write( 0, outPckg ); } if( aTriggerRequest == NULL ) { - DEBUG1("CWlmServer::CompleteExternalRequest() - delete iapIdList (%d)", coreIdList); - + DEBUG("CWlmServer::CompleteExternalRequest() - delete iapIdList" ); delete coreIdList; } else @@ -2841,16 +2871,14 @@ } case EGetCurrentRSSI: { - TUint32 tmp - = *( reinterpret_cast - ( requestEntry.iParam0 ) ); - if( requestEntry.iSessionId != 0 ) + TUint32 tmp = *( reinterpret_cast( aRequest.iParam0 ) ); + if( IsSessionActive( aRequest ) ) { TPckg outPckg( tmp ); - requestEntry.iMessage.Write( 0, outPckg ); + aRequest.iMessage.Write( 0, outPckg ); } iPrevRcpiValue = tmp; - delete reinterpret_cast( requestEntry.iParam0 ); + delete reinterpret_cast( aRequest.iParam0 ); break; } case EGetSystemMode: @@ -2861,39 +2889,38 @@ case EConfigureMulticastGroup: { // no parameters to return - delete reinterpret_cast( requestEntry.iParam0 ); + delete reinterpret_cast( aRequest.iParam0 ); break; } case EGetPacketStatistics: { core_packet_statistics_s* coreStatistics = - reinterpret_cast( requestEntry.iParam0 ); - if( requestEntry.iSessionId != 0 ) + reinterpret_cast( aRequest.iParam0 ); + if( IsSessionActive( aRequest ) ) { TPckgBuf statisticPckg; TWlanConversionUtil::ConvertPacketStatistics( statisticPckg(), *coreStatistics ); - requestEntry.iMessage.Write( 0, statisticPckg ); + aRequest.iMessage.Write( 0, statisticPckg ); } delete coreStatistics; break; } case ECreateTrafficStream: { - u32_t* coreStreamId = - reinterpret_cast( requestEntry.iParam0 ); + u32_t* coreStreamId = reinterpret_cast( aRequest.iParam0 ); core_traffic_stream_status_e* coreStreamStatus = - reinterpret_cast( requestEntry.iParam1 ); - if( requestEntry.iSessionId != 0 && + reinterpret_cast( aRequest.iParam1 ); + if( IsSessionActive( aRequest ) && aStatus == core_error_ok ) { TPckgBuf streamIdPckg( *coreStreamId ); TPckgBuf streamStatusPckg( TWlanConversionUtil::ConvertTrafficStreamStatus( *coreStreamStatus ) ); - requestEntry.iMessage.Write( 2, streamIdPckg ); - requestEntry.iMessage.Write( 3, streamStatusPckg ); + aRequest.iMessage.Write( 2, streamIdPckg ); + aRequest.iMessage.Write( 3, streamStatusPckg ); } delete coreStreamId; delete coreStreamStatus; @@ -2912,7 +2939,7 @@ default: { DEBUG1( "CWlmServer::CompleteExternalRequest() - ERROR: unknown request type (%d)!", - requestEntry.iFunction ); + aRequest.iFunction ); break; } } @@ -3120,7 +3147,7 @@ DEBUG( "CWlmServer::CancelExternalRequest() - this request is not the scan scheduling triggering request" ); DEBUG( "CWlmServer::CancelExternalRequest() - remove the cancelled request" ); - CompleteExternalRequest( i, core_error_cancel ); + CompleteExternalRequest( iRequestMap[i], core_error_cancel ); if( IsSessionActive( iRequestMap[i] ) ) { iRequestMap[i].iMessage.Complete( @@ -5099,6 +5126,7 @@ } } + wlanIapIds.Close(); wlanSettings.Disconnect(); DEBUG( "CWlmServer::GetCurrentIapId() - all done" ); diff -r 51a71243e562 -r e0f767079796 wlan_plat/wlan_device_settings_api/inc/wlandevicesettingsinternalcrkeys.h --- a/wlan_plat/wlan_device_settings_api/inc/wlandevicesettingsinternalcrkeys.h Fri Mar 12 15:51:11 2010 +0200 +++ b/wlan_plat/wlan_device_settings_api/inc/wlandevicesettingsinternalcrkeys.h Mon Mar 15 12:46:48 2010 +0200 @@ -16,7 +16,7 @@ */ /* -* %version: 11.1.1 % +* %version: 11.1.2 % */ #ifndef WLANDEVICESETTINGSINTERNALCRKEYS_H @@ -397,6 +397,16 @@ const TUint32 KWlanAutomaticTrafficStreamMgmt = 0x00000044; /** + * The minimum channel time for active broadcast scan in milliseconds. + */ +const TUint32 KWlanMinActiveBroadcastChannelTime = 0x00000045; + +/** + * The maximum channel time for active broadcast scan in milliseconds. + */ +const TUint32 KWlanMaxActiveBroadcastChannelTime = 0x00000046; + +/** * Cached WLAN region where possible values are: * 0 = Region is unknown * 1 = Region is ETSI