Revision: 201027
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 06 Jul 2010 16:24:00 +0300
changeset 36 1c425781161e
parent 35 5e6ba967244f
child 37 1ff9bf2737cf
child 39 3d23268b50f6
Revision: 201027 Kit: 2010127
wlan_bearer/wlandbif_cd/src/wdbifwlansettings.cpp
wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/bwinscw/wlmserveru.def
wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/eabi/wlmserveru.def
wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/rwlmserver.h
wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanconversionutil.h
wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlanmgmtimpl.h
wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/rwlmserver.cpp
wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanconversionutil.cpp
wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanmgmtimpl.cpp
wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlmserver.cpp
wlan_plat/wlan_management_api/inc/wlanmgmtcommon.h
wlan_plat/wlan_management_api/inc/wlanmgmtinterface.h
--- 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<TUint32>*)iWLANRecord->GetFieldByIdL(KCDTIdWlanWpaKeyLength));
+        TraceDump(WARNING_LEVEL,(_L("CWlanSettings::GetDataL() - aSettings.WPAKeyLength: %d"),
+            aSettings.WPAKeyLength));
+        }
+    else if( aSettings.SecurityMode > Wlan8021x )
         {
         aSettings.WPAKeyLength = *((CMDBField<TUint32>*)iWLANRecord->GetFieldByIdL(KCDTIdWlanWpaKeyLength));
         TraceDump(WARNING_LEVEL,(_L("CWlanSettings::GetDataL() - aSettings.WPAKeyLength: %d"),
--- 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<class TBuf8<32> > const &)
--- 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
--- 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<TMacAddress> iRoamBssidPckg; 
+
+        /** Buffer for storing SSID for Protected setup. */
+        TPckgBuf<TWlanSsid> iWlanSsidPckg; 
+
+        /** Buffer for storing pincode for Protected setup. */
+        TPckgBuf<TWlanWpsPin> iWlanWpsPinPckg; 
+
     };
 
 #endif // RWLMSERVER_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
--- 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<TWlanProtectedSetupCredentialAttribute>& aCredentials );
 
         /**
@@ -765,7 +770,8 @@
         CProtectedSetupRequest(
             CWlanMgmtImpl& aCallback,
             RWLMServer& aServer,
-            TUint32 aId,
+            const TWlanSsid& aSsid,
+            const TWlanWpsPin& aWpsPin,
             CArrayFixSeg<TWlanProtectedSetupCredentialAttribute>& 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<TWlanProtectedSetupCredentialAttribute>& iCredentials;
--- 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 <in_sock.h>
@@ -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 );
--- 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 <in_sock.h>
@@ -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()
 // ---------------------------------------------------------
 //
--- 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<TWlanProtectedSetupCredentialAttribute>& 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<TWlanProtectedSetupCredentialAttribute>& 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();
     }
 
--- 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 <e32def.h>
@@ -2396,7 +2396,7 @@
         if( IsSessionActive( completedMapEntry ) )
             {
             TPckg<TWlmProtectedSetupCredentials> 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<TWlanSecondarySsid> secondarySsidList;
-    TInt lanServiceId = aMessage.Int0();
-    TRAPD( err, GetIapSettingsL( lanServiceId, iapData, secondarySsidList ) ) ;
-    if( err != KErrNone )
+        
+    TPckgBuf<TWlanSsid> 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<TWlanWpsPin> 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<core_iap_data_s>* iapDataList = new core_type_list_c<core_iap_data_s>;
     if( iapDataList == NULL )
         {
--- 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<KWlanMaxSsidLength> TWlanSsid;
 
+/** Data structure for storing the WPS Pin. */
+typedef TBuf8<KWlanMaxWpsPinLength> TWlanWpsPin;
+
 /** Data structure for storing the BSSID of a BSS. */
 typedef TBuf8<KWlanMaxBssidLength> TWlanBssid;
 
--- 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<TWlanProtectedSetupCredentialAttribute>& aCredentials ) = 0;
 
         /**
@@ -410,6 +413,7 @@
          */
         virtual TInt StartAggressiveBgScan(
             TUint aInterval ) = 0;
+
     };
 
 #endif // WLANMGMTINTERFACE_H