# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1278422640 -10800 # Node ID 1c425781161e61be2f782a7e0485c3dd2a3b9fcd # Parent 5e6ba967244fe52b7e96b20350a2dafa2edafc0c Revision: 201027 Kit: 2010127 diff -r 5e6ba967244f -r 1c425781161e wlan_bearer/wlandbif_cd/src/wdbifwlansettings.cpp --- a/wlan_bearer/wlandbif_cd/src/wdbifwlansettings.cpp Wed Jun 23 20:17:42 2010 +0300 +++ b/wlan_bearer/wlandbif_cd/src/wdbifwlansettings.cpp Tue Jul 06 16:24:00 2010 +0300 @@ -16,7 +16,7 @@ */ /* -* %version: 12.1.1 % +* %version: 14 % */ // INCLUDE FILES @@ -167,7 +167,13 @@ ReadWepKeysL(aSettings); TraceDump(WARNING_LEVEL,(_L("CWlanSettings::GetDataL, Wep keys succesfully read"))); } - else if( aSettings.SecurityMode > Wep) + else if( aSettings.SecurityMode == Wlan8021x ) + { + aSettings.WPAKeyLength = *((CMDBField*)iWLANRecord->GetFieldByIdL(KCDTIdWlanWpaKeyLength)); + TraceDump(WARNING_LEVEL,(_L("CWlanSettings::GetDataL() - aSettings.WPAKeyLength: %d"), + aSettings.WPAKeyLength)); + } + else if( aSettings.SecurityMode > Wlan8021x ) { aSettings.WPAKeyLength = *((CMDBField*)iWLANRecord->GetFieldByIdL(KCDTIdWlanWpaKeyLength)); TraceDump(WARNING_LEVEL,(_L("CWlanSettings::GetDataL() - aSettings.WPAKeyLength: %d"), diff -r 5e6ba967244f -r 1c425781161e wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/bwinscw/wlmserveru.def --- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/bwinscw/wlmserveru.def Wed Jun 23 20:17:42 2010 +0300 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/bwinscw/wlmserveru.def Tue Jul 06 16:24:00 2010 +0300 @@ -1,7 +1,7 @@ EXPORTS ?CancelCreateTrafficStream@RWLMServer@@QAEXXZ @ 1 NONAME ; void RWLMServer::CancelCreateTrafficStream(void) ?GetScanResults@RWLMServer@@QAEXAAVScanList@@ABVTDesC8@@AAHAAIAAVTRequestStatus@@@Z @ 2 NONAME ; void RWLMServer::GetScanResults(class ScanList &, class TDesC8 const &, int &, unsigned int &, class TRequestStatus &) - ?RunProtectedSetup@RWLMServer@@QAEXAAVTRequestStatus@@KAAVTDes8@@@Z @ 3 NONAME ; void RWLMServer::RunProtectedSetup(class TRequestStatus &, unsigned long, class TDes8 &) + ?RunProtectedSetup@RWLMServer@@QAEXAAVTRequestStatus@@ABV?$TBuf8@$0CA@@@ABV?$TBuf8@$07@@AAVTDes8@@@Z @ 3 NONAME ; void RWLMServer::RunProtectedSetup(class TRequestStatus &, class TBuf8<32> const &, class TBuf8<8> const &, class TDes8 &) ?RemoveIapSsidList@RWLMServer@@QAEHI@Z @ 4 NONAME ; int RWLMServer::RemoveIapSsidList(unsigned int) ?ClearPacketStatistics@RWLMServer@@QAEXXZ @ 5 NONAME ; void RWLMServer::ClearPacketStatistics(void) ?AddIapSsidList@RWLMServer@@QAEHIABV?$CArrayFixFlat@V?$TBuf8@$0CA@@@@@@Z @ 6 NONAME ; int RWLMServer::AddIapSsidList(unsigned int, class CArrayFixFlat > const &) diff -r 5e6ba967244f -r 1c425781161e wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/eabi/wlmserveru.def --- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/eabi/wlmserveru.def Wed Jun 23 20:17:42 2010 +0300 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/eabi/wlmserveru.def Tue Jul 06 16:24:00 2010 +0300 @@ -19,7 +19,7 @@ _ZN10RWLMServer17ActivateNotifiesLER10MWLMNotifym @ 18 NONAME _ZN10RWLMServer17GetConnectionRCPIERl @ 19 NONAME _ZN10RWLMServer17RemoveIapSsidListEj @ 20 NONAME - _ZN10RWLMServer17RunProtectedSetupER14TRequestStatusmR5TDes8 @ 21 NONAME + _ZN10RWLMServer17RunProtectedSetupER14TRequestStatusRK5TBuf8ILi32EERKS2_ILi8EER5TDes8 @ 21 NONAME _ZN10RWLMServer18CancelDirectedRoamEv @ 22 NONAME _ZN10RWLMServer18ConfigureMulticastEjRK11TMacAddress @ 23 NONAME _ZN10RWLMServer18GetAcTrafficStatusER11TFixedArrayI19TWlmAcTrafficStatusLi4EE @ 24 NONAME diff -r 5e6ba967244f -r 1c425781161e wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/rwlmserver.h --- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/rwlmserver.h Wed Jun 23 20:17:42 2010 +0300 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/rwlmserver.h Tue Jul 06 16:24:00 2010 +0300 @@ -16,7 +16,7 @@ */ /* -* %version: 25 % +* %version: 27 % */ #ifndef RWLMSERVER_H @@ -365,12 +365,15 @@ /** * Run Protected Setup. * @param aStatus Status of the calling active object. - * @param aId IAP ID of network which user has selected to be configured. + * @param aSsid SSID of the network to configure. + * @param aWpsPin PIN value to be used. "00000000" (string of eight zeros) + * if push button method is used. * @param Results of a successful Protected Setup operation. */ IMPORT_C void RunProtectedSetup( TRequestStatus& aStatus, - TUint32 aId, + const TWlanSsid& aSsid, + const TWlanWpsPin& aWspPin, TDes8& aCredentials ); /** @@ -592,6 +595,13 @@ /** Buffer for storing BSSID to roam to. */ TPckgBuf iRoamBssidPckg; + + /** Buffer for storing SSID for Protected setup. */ + TPckgBuf iWlanSsidPckg; + + /** Buffer for storing pincode for Protected setup. */ + TPckgBuf iWlanWpsPinPckg; + }; #endif // RWLMSERVER_H diff -r 5e6ba967244f -r 1c425781161e wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanconversionutil.h --- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanconversionutil.h Wed Jun 23 20:17:42 2010 +0300 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanconversionutil.h Tue Jul 06 16:24:00 2010 +0300 @@ -16,7 +16,7 @@ */ /* -* %version: 34 % +* %version: 35 % */ #ifndef WLANCONVERSIONUTIL_H @@ -83,6 +83,16 @@ static void ConvertSSID( TSSID& aAmSSID, const core_ssid_s& aCoreSSID ); + + /** + * ConvertWpaPreSharedKey + * @since Series 60 3.0 + * @param aWpaPreSharedKey (OUT) + * @param aWspPin (IN) + */ + static void ConvertWpaPreSharedKey( + core_wpa_preshared_key_s& aWpaPreSharedKey, + const TDesC8& aWspPin ); /** * ConvertScanRate diff -r 5e6ba967244f -r 1c425781161e wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanmgmtimpl.h --- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanmgmtimpl.h Wed Jun 23 20:17:42 2010 +0300 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanmgmtimpl.h Tue Jul 06 16:24:00 2010 +0300 @@ -16,7 +16,7 @@ */ /* -* %version: 21 % +* %version: 22 % */ #ifndef WLANMGMTIMPL_H @@ -307,15 +307,20 @@ /** * (From MWlanMgmtInterface) * Start Protected Setup. + * * @param aStatus Status of the calling active object. On successful * completion contains KErrNone, otherwise one of the * system-wide error codes. - * @param aId Service ID of network which user has selected to be configured. + * @param aSsid SSID of the network to configure. + * @param aWpsPin PIN value to be used. "00000000" (string of eight zeros) + * if push button method is used. * @param aCredentials Results of a successful Protected Setup operation. - */ + * @sa \link psetup Protected Setup-specific error codes \endlink. + */ virtual void RunProtectedSetup( TRequestStatus& aStatus, - TUint32 aId, + const TWlanSsid& aSsid, + const TWlanWpsPin& aWpsPin, CArrayFixSeg& aCredentials ); /** @@ -765,7 +770,8 @@ CProtectedSetupRequest( CWlanMgmtImpl& aCallback, RWLMServer& aServer, - TUint32 aId, + const TWlanSsid& aSsid, + const TWlanWpsPin& aWpsPin, CArrayFixSeg& aCredentials ); /** @@ -811,8 +817,11 @@ // Interface to RWLMServer RWLMServer& iServer; - // Service ID of network which user has selected to be configured. - TUint32 iServiceId; + // SSID of the network to configure. + TWlanSsid iSsid; + + // PIN value to be used. + TWlanWpsPin iWpsPin; // Results of a successful Protected Setup operation. CArrayFixSeg& iCredentials; diff -r 5e6ba967244f -r 1c425781161e wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/rwlmserver.cpp --- a/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/rwlmserver.cpp Wed Jun 23 20:17:42 2010 +0300 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/rwlmserver.cpp Tue Jul 06 16:24:00 2010 +0300 @@ -16,7 +16,7 @@ */ /* -* %version: 28 % +* %version: 30 % */ #include @@ -541,13 +541,18 @@ // EXPORT_C void RWLMServer::RunProtectedSetup( TRequestStatus& aStatus, - TUint32 aId, + const TWlanSsid& aSsid, + const TWlanWpsPin& aWspPin, TDes8& aCredentials ) { DEBUG( "RWLMServer::RunProtectedSetup(TRequestStatus)" ); aStatus = KRequestPending; - TIpcArgs params( aId, &aCredentials ); + + iWlanSsidPckg = aSsid; + iWlanWpsPinPckg = aWspPin; + + TIpcArgs params( &iWlanSsidPckg, &iWlanWpsPinPckg, &aCredentials ); // Send the command SendReceive( ERunProtectedSetup, params, aStatus ); diff -r 5e6ba967244f -r 1c425781161e 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 Wed Jun 23 20:17:42 2010 +0300 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanconversionutil.cpp Tue Jul 06 16:24:00 2010 +0300 @@ -16,7 +16,7 @@ */ /* -* %version: 86 % +* %version: 87 % */ #include @@ -104,6 +104,21 @@ } // --------------------------------------------------------- +// TWlanConversionUtil::ConvertWpaPreSharedKey() +// --------------------------------------------------------- +// +void TWlanConversionUtil::ConvertWpaPreSharedKey( + core_wpa_preshared_key_s& aWpaPreSharedKey, + const TDesC8& aWspPin ) + { + Mem::Copy( + aWpaPreSharedKey.key_data, + aWspPin.Ptr(), + aWspPin.Length() ); + aWpaPreSharedKey.key_length = aWspPin.Length(); + } + +// --------------------------------------------------------- // TWlanConversionUtil::ConvertScanRate() // --------------------------------------------------------- // diff -r 5e6ba967244f -r 1c425781161e 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 Wed Jun 23 20:17:42 2010 +0300 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanmgmtimpl.cpp Tue Jul 06 16:24:00 2010 +0300 @@ -16,7 +16,7 @@ */ /* -* %version: 31 % +* %version: 32 % */ // INCLUDE FILES @@ -530,7 +530,8 @@ // void CWlanMgmtImpl::RunProtectedSetup( TRequestStatus& aStatus, - TUint32 aId, + const TWlanSsid& aSsid, + const TWlanWpsPin& aWpsPin, CArrayFixSeg& aCredentials ) { TraceDump( INFO_LEVEL, ( _L( "CWlanMgmtImpl::RunProtectedSetup()" ) ) ); @@ -540,7 +541,7 @@ aStatus = KRequestPending; iPendingProtectedSetupStatus = &aStatus; - iProtectedSetupRequest = new CProtectedSetupRequest( *this, iServer, aId, aCredentials ); + iProtectedSetupRequest = new CProtectedSetupRequest( *this, iServer, aSsid, aWpsPin, aCredentials ); if ( !iProtectedSetupRequest ) { User::RequestComplete( iPendingProtectedSetupStatus, KErrNoMemory ); @@ -1140,12 +1141,14 @@ CProtectedSetupRequest::CProtectedSetupRequest( CWlanMgmtImpl& aCallback, RWLMServer& aServer, - TUint32 aId, + const TWlanSsid& aSsid, + const TWlanWpsPin& aWpsPin, CArrayFixSeg& aCredentials ) : CActive( CActive::EPriorityStandard ), iCallback( aCallback ), iServer( aServer ), - iServiceId( aId ), + iSsid( aSsid ), + iWpsPin( aWpsPin ), iCredentials ( aCredentials ), iCredentialsBuf( iCredentialsStorage ) { @@ -1168,7 +1171,7 @@ void CProtectedSetupRequest::IssueRequest() { TraceDump( INFO_LEVEL, ( _L( "CProtectedSetupRequest::IssueRequest()" ) ) ); - iServer.RunProtectedSetup( iStatus, iServiceId, iCredentialsBuf ); + iServer.RunProtectedSetup( iStatus, iSsid, iWpsPin, iCredentialsBuf ); SetActive(); } diff -r 5e6ba967244f -r 1c425781161e 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 Wed Jun 23 20:17:42 2010 +0300 +++ b/wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlmserver.cpp Tue Jul 06 16:24:00 2010 +0300 @@ -16,7 +16,7 @@ */ /* -* %version: 108 % +* %version: 109 % */ #include @@ -2396,7 +2396,7 @@ if( IsSessionActive( completedMapEntry ) ) { TPckg outPckg( tmp ); - completedMapEntry.iMessage.Write( 1, outPckg ); + completedMapEntry.iMessage.Write( 2, outPckg ); } if( status == core_error_ok && IsSessionActive( completedMapEntry ) ) @@ -4394,40 +4394,47 @@ aMessage.Complete( wlanState ); return; } - - // Get WlanSettings and secondarySSID list - // (lanServiceId specifies the table row in wlansettings) - SWLANSettings iapData; - RArray secondarySsidList; - TInt lanServiceId = aMessage.Int0(); - TRAPD( err, GetIapSettingsL( lanServiceId, iapData, secondarySsidList ) ) ; - if( err != KErrNone ) + + TPckgBuf ssidPckg; + TInt ret( aMessage.Read( 0, ssidPckg ) ); + if( ret != KErrNone ) { - DEBUG1( "CWlmServer::RunProtectedSetup() - GetIapSettingsL leaved with %d", - err ); - secondarySsidList.Close(); - aMessage.Complete( err ); + aMessage.Complete( ret ); return; } - secondarySsidList.Close(); - - // Type conversion + + TPckgBuf wpsPinPckg; + ret = aMessage.Read( 1, wpsPinPckg ); + if( ret != KErrNone ) + { + aMessage.Complete( ret ); + return; + } + core_iap_data_s* coreIapData = new core_iap_data_s; if( !coreIapData ) { aMessage.Complete( KErrNoMemory ); return; } - - TWLMOverrideSettings override = { 0 }; - TWlanConversionUtil::ConvertIapSettings( - *coreIapData, - iapData, - ETrue, // dhcp usage is not important here - override ); - - - // Create a list for the results. + + coreIapData->id = 0; + coreIapData->op_mode = core_operating_mode_infrastructure; + coreIapData->security_mode = core_security_mode_protected_setup; + coreIapData->wpa_preshared_key_in_use = ETrue; + coreIapData->is_wpa_overriden = ETrue; + + // Type conversion + TWlanConversionUtil::ConvertSSID( + coreIapData->ssid, + ssidPckg() ); + + // Type conversion + TWlanConversionUtil::ConvertWpaPreSharedKey( + coreIapData->wpa_preshared_key, + wpsPinPckg() ); + + // Create a list for the results. core_type_list_c* iapDataList = new core_type_list_c; if( iapDataList == NULL ) { diff -r 5e6ba967244f -r 1c425781161e wlan_plat/wlan_management_api/inc/wlanmgmtcommon.h --- a/wlan_plat/wlan_management_api/inc/wlanmgmtcommon.h Wed Jun 23 20:17:42 2010 +0300 +++ b/wlan_plat/wlan_management_api/inc/wlanmgmtcommon.h Tue Jul 06 16:24:00 2010 +0300 @@ -16,7 +16,7 @@ */ /* -* %version: 10 % +* %version: 11 % */ #ifndef WLANMGMTCOMMON_H @@ -29,6 +29,9 @@ /** The maximum SSID length. */ const TUint KWlanMaxSsidLength = 32; +/** The maximum WPS PIN length. */ +const TUint KWlanMaxWpsPinLength = 8; + /** The maximum BSSID length. */ const TUint KWlanMaxBssidLength = 6; @@ -48,6 +51,9 @@ /** Data structure for storing the SSID of a WLAN network. */ typedef TBuf8 TWlanSsid; +/** Data structure for storing the WPS Pin. */ +typedef TBuf8 TWlanWpsPin; + /** Data structure for storing the BSSID of a BSS. */ typedef TBuf8 TWlanBssid; diff -r 5e6ba967244f -r 1c425781161e wlan_plat/wlan_management_api/inc/wlanmgmtinterface.h --- a/wlan_plat/wlan_management_api/inc/wlanmgmtinterface.h Wed Jun 23 20:17:42 2010 +0300 +++ b/wlan_plat/wlan_management_api/inc/wlanmgmtinterface.h Tue Jul 06 16:24:00 2010 +0300 @@ -16,7 +16,7 @@ */ /* -* %version: 16 % +* %version: 17 % */ #ifndef WLANMGMTINTERFACE_H @@ -215,13 +215,16 @@ * @param aStatus Status of the calling active object. On successful * completion contains KErrNone, otherwise one of the * system-wide error codes. - * @param aId Service ID of network which user has selected to be configured. + * @param aSsid SSID of the network to configure. + * @param aWpsPin PIN value to be used. "00000000" (string of eight zeros) + * if push button method is used. * @param aCredentials Results of a successful Protected Setup operation. * @sa \link psetup Protected Setup-specific error codes \endlink. */ virtual void RunProtectedSetup( TRequestStatus& aStatus, - TUint32 aId, + const TWlanSsid& aSsid, + const TWlanWpsPin& aWpsPin, CArrayFixSeg& aCredentials ) = 0; /** @@ -410,6 +413,7 @@ */ virtual TInt StartAggressiveBgScan( TUint aInterval ) = 0; + }; #endif // WLANMGMTINTERFACE_H