wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/src/wlanmgmtcommandhandler.cpp
changeset 0 c40eb8fe8501
child 3 6524e815f76f
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Handles sending management commands to drivers.
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 37 %
       
    20 */
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <es_ini.h>
       
    25 #include <es_mbuf.h>
       
    26 #include "wlanmgmtcommandhandler.h"
       
    27 #include "am_debug.h"
       
    28 
       
    29 // ============================= LOCAL FUNCTIONS ===============================
       
    30 
       
    31 // -----------------------------------------------------------------------------
       
    32 // os_memcpy
       
    33 // (Declared in 802dot11.h)
       
    34 // -----------------------------------------------------------------------------
       
    35 //
       
    36 TAny* os_memcpy( 
       
    37     TAny* aDest, 
       
    38     const TAny* aSrc, 
       
    39     TUint32 aLengthinBytes )
       
    40     {
       
    41     Mem::Copy( aDest, aSrc, aLengthinBytes );
       
    42     return aDest;
       
    43     }
       
    44 
       
    45 // ================= MEMBER FUNCTIONS =======================
       
    46 
       
    47 // C++ default constructor can NOT contain any code, that
       
    48 // might leave.
       
    49 //
       
    50 CWlanMgmtCommandHandler::CWlanMgmtCommandHandler(
       
    51     RWlanLogicalChannel& aChannel,
       
    52     MWlanMgmtCommandCallback& aClient ):
       
    53     CActive( CActive::EPriorityStandard ),
       
    54     iClient( aClient ),
       
    55     iChannel( aChannel ),
       
    56     iBuffer( NULL, 0, 0 )
       
    57     {
       
    58     }
       
    59 
       
    60 // ---------------------------------------------------------
       
    61 // CWlanMgmtCommandHandler::NewL
       
    62 // ---------------------------------------------------------
       
    63 //
       
    64 CWlanMgmtCommandHandler* CWlanMgmtCommandHandler::NewL(
       
    65     RWlanLogicalChannel& aChannel,
       
    66     MWlanMgmtCommandCallback& aClient )
       
    67     {
       
    68     DEBUG( "CWlanMgmtCommandHandler::NewL()" );
       
    69     CWlanMgmtCommandHandler* self = 
       
    70         new(ELeave) CWlanMgmtCommandHandler( aChannel, aClient );
       
    71     CleanupStack::PushL( self );
       
    72     self->ConstructL();
       
    73     CleanupStack::Pop( self );
       
    74     return self;
       
    75     }
       
    76 
       
    77 // ---------------------------------------------------------
       
    78 // CWlanMgmtCommandHandler::ConstructL
       
    79 // ---------------------------------------------------------
       
    80 //
       
    81 void CWlanMgmtCommandHandler::ConstructL()
       
    82     {
       
    83     DEBUG( "CWlanMgmtFrameHandler::ConstructL()" );
       
    84 
       
    85     CActiveScheduler::Add( this );
       
    86     }
       
    87 
       
    88 // ---------------------------------------------------------
       
    89 // CWlanMgmtCommandHandler::~CWlanMgmtCommandHandler
       
    90 // ---------------------------------------------------------
       
    91 //
       
    92 CWlanMgmtCommandHandler::~CWlanMgmtCommandHandler()
       
    93     {
       
    94     DEBUG( "CWlanMgmtCommandHandler::~CWlanMgmtCommandHandler()" );
       
    95     }
       
    96 
       
    97 // ---------------------------------------------------------
       
    98 // CWlanMgmtCommandHandler::StartIBSS
       
    99 // Start a IBSS network.
       
   100 // ---------------------------------------------------------
       
   101 //
       
   102 void CWlanMgmtCommandHandler::StartIBSS(
       
   103     const TSSID& aSSID,
       
   104     TUint32 aBeaconInterval,
       
   105     TUint32 aChannel,
       
   106     TEncryptionStatus aEncryptionStatus )
       
   107     {
       
   108     DEBUG( "CWlanMgmtCommandHandler::StartIBSS()" );
       
   109 
       
   110     // First, start the adhoc network synchronously
       
   111     TStartIBSSMsg msg;
       
   112     msg.hdr.oid_id = E802_11_START_IBSS;
       
   113     msg.SSID = aSSID;
       
   114     msg.beaconInterval = aBeaconInterval;
       
   115     msg.ATIM = 0; // DEPRECATED, NOT USED ANY MORE
       
   116     msg.channel = aChannel;
       
   117     msg.encryptionStatus = aEncryptionStatus;
       
   118     TPckg<TStartIBSSMsg> buf( msg );
       
   119 
       
   120     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   121     if( err )
       
   122         {
       
   123         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   124         TRequestStatus* status = &iStatus;
       
   125         User::RequestComplete( status, err );
       
   126         SetActive();
       
   127         return;
       
   128         }
       
   129 
       
   130     SetActive();
       
   131     }
       
   132 
       
   133 // ---------------------------------------------------------
       
   134 // CWlanMgmtCommandHandler::Scan
       
   135 // Receive information about surrounding WLAN networks.
       
   136 // ---------------------------------------------------------
       
   137 //
       
   138 void CWlanMgmtCommandHandler::Scan(
       
   139     TScanMode aMode,
       
   140     const TSSID& aSSID,
       
   141     TRate aScanRate,
       
   142     const SChannels& aChannels,
       
   143     TUint32 aMinChannelTime, 
       
   144     TUint32 aMaxChannelTime,
       
   145     TBool aIsSplitScan )
       
   146     {
       
   147     DEBUG( "CWlanMgmtCommandHandler::Scan()" );
       
   148 
       
   149     TScanMsg msg;
       
   150     msg.hdr.oid_id = E802_11_SCAN;
       
   151     msg.mode = aMode;
       
   152     msg.SSID = aSSID;
       
   153     msg.scanRate = aScanRate;
       
   154     msg.channels = aChannels;    
       
   155     DEBUG1( "CWlanMgmtCommandHandler::Scan() - aMinChannelTime %u",
       
   156         aMinChannelTime );
       
   157     DEBUG1( "CWlanMgmtCommandHandler::Scan() - aMaxChannelTime %u",
       
   158         aMaxChannelTime );
       
   159     DEBUG1( "CWlanMgmtCommandHandler::Scan() - aIsSplitScan %u",
       
   160         aIsSplitScan );
       
   161     msg.minChannelTime = aMinChannelTime;
       
   162     msg.maxChannelTime = aMaxChannelTime;
       
   163     msg.splitScan = aIsSplitScan; 
       
   164     TPckg<TScanMsg> buf( msg );
       
   165     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   166     if( err )
       
   167         {
       
   168         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   169         TRequestStatus* status = &iStatus;
       
   170         User::RequestComplete( status, err );
       
   171         SetActive();
       
   172         return;
       
   173         }
       
   174    
       
   175     SetActive();
       
   176     }
       
   177 
       
   178 
       
   179 // ---------------------------------------------------------
       
   180 // CWlanMgmtCommandHandler::StopScan
       
   181 // ---------------------------------------------------------
       
   182 //
       
   183 void CWlanMgmtCommandHandler::StopScan()
       
   184     {
       
   185     DEBUG( "CWlanMgmtCommandHandler::StopScan()" );
       
   186 
       
   187     TStopScanMsg msg;
       
   188     msg.hdr.oid_id = E802_11_STOP_SCAN;
       
   189     TPckg<TStopScanMsg> buf( msg );
       
   190 
       
   191     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   192     if( err )
       
   193         {
       
   194         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   195         TRequestStatus* status = &iStatus;
       
   196         User::RequestComplete( status, err );
       
   197         }
       
   198     SetActive();
       
   199     }
       
   200 
       
   201 // ---------------------------------------------------------
       
   202 // CWlanMgmtCommandHandler::Disconnect
       
   203 // Disconnect from the WLAN.
       
   204 // ---------------------------------------------------------
       
   205 //
       
   206 void CWlanMgmtCommandHandler::Disconnect()
       
   207     {
       
   208     DEBUG( "CWlanMgmtCommandHandler::Disconnect()" );
       
   209 
       
   210     TDisconnectMsg msg;
       
   211     msg.hdr.oid_id = E802_11_DISCONNECT;
       
   212     TPckg<TDisconnectMsg> buf( msg );
       
   213 
       
   214     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   215     if( err )
       
   216         {
       
   217         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   218         TRequestStatus* status = &iStatus;
       
   219         User::RequestComplete( status, err );
       
   220         }
       
   221     SetActive();
       
   222     }
       
   223 
       
   224 // ---------------------------------------------------------
       
   225 // CWlanMgmtCommandHandler::SetPowerMode
       
   226 // Adjust current WLAN power mode.
       
   227 // ---------------------------------------------------------
       
   228 //
       
   229 void CWlanMgmtCommandHandler::SetPowerMode(
       
   230     TPowerMode aMode,
       
   231     TBool aDisableDynamicPs,
       
   232     TWlanWakeUpInterval aWakeUpModeLight,
       
   233     TUint8 aListenIntervalLight,
       
   234     TWlanWakeUpInterval aWakeUpModeDeep,
       
   235     TUint8 aListenIntervalDeep )
       
   236     {
       
   237     DEBUG( "CWlanMgmtCommandHandler::SetPowerMode()" );
       
   238     DEBUG1( "CWlanMgmtCommandHandler::SetPowerMode() - aMode = %u ",
       
   239         aMode );
       
   240     DEBUG1( "CWlanMgmtCommandHandler::SetPowerMode() - aDisableDynamicPs = %u ",
       
   241         aDisableDynamicPs );
       
   242     DEBUG1( "CWlanMgmtCommandHandler::SetPowerMode() - aWakeUpModeLight = %u ",
       
   243         aWakeUpModeLight );
       
   244     DEBUG1( "CWlanMgmtCommandHandler::SetPowerMode() - aListenIntervalLight = %u ",
       
   245         aListenIntervalLight );
       
   246     DEBUG1( "CWlanMgmtCommandHandler::SetPowerMode() - aWakeUpModeDeep = %u ",
       
   247         aWakeUpModeDeep );
       
   248     DEBUG1( "CWlanMgmtCommandHandler::SetPowerMode() - aListenIntervalDeep = %u ",
       
   249         aListenIntervalDeep );
       
   250     
       
   251     TSetPowerModeMsg msg;
       
   252     msg.hdr.oid_id = E802_11_SET_POWER_MODE;
       
   253     msg.powerMode = aMode;
       
   254     msg.disableDynamicPowerModeManagement = aDisableDynamicPs;
       
   255     msg.wakeupModeInLightPs = aWakeUpModeLight;
       
   256     msg.listenIntervalInLightPs = aListenIntervalLight;
       
   257     msg.wakeupModeInDeepPs = aWakeUpModeDeep;
       
   258     msg.listenIntervalInDeepPs = aListenIntervalDeep; 
       
   259     TPckg<TSetPowerModeMsg> buf( msg );
       
   260 
       
   261     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   262     if( err )
       
   263         {
       
   264         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   265         TRequestStatus* status = &iStatus;
       
   266         User::RequestComplete( status, err );
       
   267         }
       
   268     SetActive();        
       
   269     }
       
   270 
       
   271 // ---------------------------------------------------------
       
   272 // CWlanMgmtCommandHandler::SetRCPITriggerLevel
       
   273 // Set RSSI trigger.
       
   274 // When signal level of the current connection goes below
       
   275 // this trigger an event is sent by WLAN drivers.
       
   276 // ---------------------------------------------------------
       
   277 //
       
   278 void CWlanMgmtCommandHandler::SetRCPITriggerLevel( TUint32 aRCPITrigger )
       
   279     {
       
   280     DEBUG( "CWlanMgmtCommandHandler::SetRCPITriggerLevel()" );
       
   281 
       
   282     TSetRcpiTriggerLevelMsg msg;
       
   283     msg.hdr.oid_id = E802_11_SET_RCPI_TRIGGER_LEVEL;
       
   284     msg.RcpiTrigger = aRCPITrigger;
       
   285 
       
   286     TPckg<TSetRcpiTriggerLevelMsg> buf( msg );
       
   287 
       
   288     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   289     if( err )
       
   290         {
       
   291         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   292         TRequestStatus* status = &iStatus;
       
   293         User::RequestComplete( status, err );
       
   294         }
       
   295     SetActive();        
       
   296     }
       
   297 
       
   298 // ---------------------------------------------------------
       
   299 // CWlanMgmtCommandHandler::SetTxPowerLevel
       
   300 // Set WLAN TX power level.
       
   301 // ---------------------------------------------------------
       
   302 //
       
   303 void CWlanMgmtCommandHandler::SetTxPowerLevel( TUint32 aLevel )
       
   304     {
       
   305     DEBUG( "CWlanMgmtCommandHandler::SetTxPowerLevel()" );
       
   306 
       
   307     TSetTxPowerLevelMsg msg;
       
   308     msg.hdr.oid_id = E802_11_SET_TX_POWER_LEVEL;
       
   309     msg.level = aLevel;
       
   310     TPckg<TSetTxPowerLevelMsg> buf( msg );
       
   311 
       
   312     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   313     if( err )
       
   314         {
       
   315         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   316         TRequestStatus* status = &iStatus;
       
   317         User::RequestComplete( status, err );
       
   318         }
       
   319     SetActive();        
       
   320     }
       
   321 
       
   322 // ---------------------------------------------------------
       
   323 // CWlanMgmtCommandHandler::Configure
       
   324 // Configure WLAN chip.
       
   325 // This has to been done before the WLAN even scans.
       
   326 // ---------------------------------------------------------
       
   327 //
       
   328 void CWlanMgmtCommandHandler::Configure( 
       
   329     TUint16 aRTSThreshold,
       
   330     TUint32 aMaxTxMSDULifetime,
       
   331     TUint32 aQoSNullFrameEntryTimeout,
       
   332     TUint32 aQosNullFrameEntryTxCount,
       
   333     TUint32 aQoSNullFrameInterval,
       
   334     TUint32 aQoSNullFrameExitTimeout,
       
   335     TUint32 aKeepAliveInterval,
       
   336     TUint32 aSpRcpiTarget,
       
   337     TUint32 aSpTimeTarget,
       
   338     TUint32 aSpMinIndicationInterval )
       
   339     {
       
   340     DEBUG( "CWlanMgmtCommandHandler::Configure()" );
       
   341 
       
   342     DEBUG1( "CWlanMgmtCommandHandler::Configure() - aRTSThreshold = %u",
       
   343         aRTSThreshold );
       
   344     DEBUG1( "CWlanMgmtCommandHandler::Configure() - aMaxTxMSDULifetime = %u",
       
   345         aMaxTxMSDULifetime );
       
   346     DEBUG1( "CWlanMgmtCommandHandler::Configure() - aQoSNullFrameEntryTimeout = %u",
       
   347         aQoSNullFrameEntryTimeout );
       
   348     DEBUG1( "CWlanMgmtCommandHandler::Configure() - aQosNullFrameEntryTxCount = %u",
       
   349         aQosNullFrameEntryTxCount );
       
   350     DEBUG1( "CWlanMgmtCommandHandler::Configure() - aQoSNullFrameInterval = %u",
       
   351         aQoSNullFrameInterval );
       
   352     DEBUG1( "CWlanMgmtCommandHandler::Configure() - aQoSNullFrameExitTimeout = %u",
       
   353         aQoSNullFrameExitTimeout );
       
   354     DEBUG1( "CWlanMgmtCommandHandler::Configure() - aKeepAliveInterval = %u",
       
   355         aKeepAliveInterval );
       
   356     DEBUG1( "CWlanMgmtCommandHandler::Configure() - aSpRcpiTarget = %u",
       
   357         aSpRcpiTarget );
       
   358     DEBUG1( "CWlanMgmtCommandHandler::Configure() - aSpTimeTarget = %u",
       
   359         aSpTimeTarget );
       
   360     DEBUG1( "CWlanMgmtCommandHandler::Configure() - aSpMinIndicationInterval = %u",
       
   361         aSpMinIndicationInterval );
       
   362 
       
   363     TConfigureMsg msg;
       
   364     msg.hdr.oid_id = E802_11_CONFIGURE;
       
   365     msg.RTSThreshold = aRTSThreshold;
       
   366     msg.maxTxMSDULifetime = aMaxTxMSDULifetime;
       
   367     msg.voiceCallEntryTimeout = aQoSNullFrameEntryTimeout;
       
   368     msg.voiceCallEntryTxThreshold = aQosNullFrameEntryTxCount;
       
   369     msg.voiceNullTimeout = aQoSNullFrameInterval;
       
   370     msg.noVoiceTimeout = aQoSNullFrameExitTimeout;
       
   371     msg.keepAliveTimeout = aKeepAliveInterval;
       
   372     msg.spRcpiIndicationLevel = aSpRcpiTarget;
       
   373     msg.spTimeToCountPrediction = aSpTimeTarget;
       
   374     msg.spMinIndicationInterval = aSpMinIndicationInterval;
       
   375     TPckg<TConfigureMsg> buf( msg );
       
   376 
       
   377     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   378     if( err )
       
   379         {
       
   380         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   381         TRequestStatus* status = &iStatus;
       
   382         User::RequestComplete( status, err );
       
   383         }
       
   384     SetActive();
       
   385     }
       
   386 
       
   387 // ---------------------------------------------------------
       
   388 // CWlanMgmtCommandHandler::GetLastRCPI
       
   389 // Get the signal quality of the last received packet.
       
   390 // ---------------------------------------------------------
       
   391 //
       
   392 void CWlanMgmtCommandHandler::GetLastRCPI( TUint32& aRCPI )
       
   393     {
       
   394     DEBUG( "CWlanMgmtCommandHandler::GetLastRCPI()" );
       
   395 
       
   396     TGetLastRcpiMsg msg;
       
   397     msg.hdr.oid_id = E802_11_GET_LAST_RCPI;
       
   398     TPckg<TGetLastRcpiMsg> outbuf( msg );
       
   399     TPckg<TUint32> inbuf( aRCPI );
       
   400     iBuffer.Set( inbuf );
       
   401 
       
   402     TInt err = iChannel.ManagementCommand( outbuf, &iBuffer, &iStatus );
       
   403     if( err )
       
   404         {
       
   405         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   406         TRequestStatus* status = &iStatus;
       
   407         User::RequestComplete( status, err );
       
   408         }
       
   409     SetActive();
       
   410     }
       
   411 
       
   412 // ---------------------------------------------------------
       
   413 // CWlanMgmtCommandHandler::ConfigureMulticastGroup
       
   414 // Get the signal quality of the last received packet.
       
   415 // ---------------------------------------------------------
       
   416 //
       
   417 void CWlanMgmtCommandHandler::ConfigureMulticastGroup( 
       
   418     TBool aJoinGroup,
       
   419     const TMacAddress& aMulticastAddr )
       
   420     {
       
   421     DEBUG( "CWlanMgmtCommandHandler::ConfigureMulticastGroup()" );
       
   422 
       
   423     TInt err = KErrNone;
       
   424     if( aJoinGroup )
       
   425         {
       
   426         TAddMulticastAddrMsg msg;
       
   427         msg.hdr.oid_id = E802_11_ADD_MULTICAST_ADDR;
       
   428         msg.macAddress = aMulticastAddr;
       
   429         TPckg<TAddMulticastAddrMsg> outbuf( msg );
       
   430         err = iChannel.ManagementCommand( outbuf, NULL, &iStatus );
       
   431         }
       
   432     else
       
   433         {
       
   434         TRemoveMulticastAddrMsg msg;
       
   435         msg.hdr.oid_id = E802_11_REMOVE_MULTICAST_ADDR;
       
   436         msg.macAddress = aMulticastAddr;
       
   437         msg.removeAll = EFalse;
       
   438         TPckg<TRemoveMulticastAddrMsg> outbuf( msg );
       
   439         err = iChannel.ManagementCommand( outbuf, NULL, &iStatus );
       
   440         }
       
   441 
       
   442     if( err )
       
   443         {
       
   444         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   445         TRequestStatus* status = &iStatus;
       
   446         User::RequestComplete( status, err );
       
   447         }
       
   448     SetActive();
       
   449     }
       
   450 
       
   451 // ---------------------------------------------------------
       
   452 // CWlanMgmtCommandHandler::SetBssLostParameters
       
   453 // ---------------------------------------------------------
       
   454 //    
       
   455 void CWlanMgmtCommandHandler::SetBssLostParameters(
       
   456     TUint32 aBssLostCount,
       
   457     TUint8 aFailedTxCount )
       
   458     {
       
   459     DEBUG( "CWlanMgmtCommandHandler::SetBssLostParameters()" );
       
   460 
       
   461     TConfigureBssLostMsg msg;
       
   462     msg.hdr.oid_id = E802_11_CONFIGURE_BSS_LOST;
       
   463     msg.beaconLostCount = aBssLostCount;
       
   464     msg.failedTxPacketCount = aFailedTxCount;
       
   465     TPckg<TConfigureBssLostMsg> buf( msg );
       
   466 
       
   467     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   468     if( err )
       
   469         {
       
   470         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   471         TRequestStatus* status = &iStatus;
       
   472         User::RequestComplete( status, err );
       
   473         }
       
   474     SetActive();    
       
   475     }
       
   476     
       
   477 // ---------------------------------------------------------
       
   478 // CWlanMgmtCommandHandler::SetTxRateAdaptationParameters
       
   479 // ---------------------------------------------------------
       
   480 // 
       
   481 void CWlanMgmtCommandHandler::SetTxRateAdaptationParameters(
       
   482     TUint8 aMinStepUpCheckpoint,
       
   483     TUint8 aMaxStepUpCheckpoint,
       
   484     TUint8 aStepUpCheckpointFactor,
       
   485     TUint8 aStepDownCheckpoint,
       
   486     TUint8 aMinStepUpThreshold,
       
   487     TUint8 aMaxStepUpThreshold,
       
   488     TUint8 aStepUpThresholdIncrement,
       
   489     TUint8 aStepDownThreshold,
       
   490     TBool aDisableProbeHandling )
       
   491     {
       
   492     DEBUG( "CWlanMgmtCommandHandler::SetTxRateAdaptationParameters()" );
       
   493 
       
   494     TSetTxRateAdaptationParamsMsg msg;
       
   495     msg.hdr.oid_id = E802_11_SET_TX_RATE_ADAPT_PARAMS;
       
   496     msg.minStepUpCheckpoint = aMinStepUpCheckpoint;
       
   497     msg.maxStepUpCheckpoint = aMaxStepUpCheckpoint;
       
   498     msg.stepUpCheckpointFactor = aStepUpCheckpointFactor;
       
   499     msg.stepDownCheckpoint = aStepDownCheckpoint;
       
   500     msg.minStepUpThreshold = aMinStepUpThreshold;
       
   501     msg.maxStepUpThreshold = aMaxStepUpThreshold;
       
   502     msg.stepUpThresholdIncrement = aStepUpThresholdIncrement;
       
   503     msg.stepDownThreshold = aStepDownThreshold;
       
   504     msg.disableProbeHandling = aDisableProbeHandling;
       
   505     TPckg<TSetTxRateAdaptationParamsMsg> buf( msg );
       
   506 
       
   507     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   508     if( err )
       
   509         {
       
   510         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   511         TRequestStatus* status = &iStatus;
       
   512         User::RequestComplete( status, err );
       
   513         }
       
   514     SetActive();    
       
   515     }
       
   516     
       
   517 // ---------------------------------------------------------
       
   518 // CWlanMgmtCommandHandler::SetPowerModeMgmtParameters
       
   519 // ---------------------------------------------------------
       
   520 //    
       
   521 void CWlanMgmtCommandHandler::SetPowerModeMgmtParameters(
       
   522     TUint32 aActiveToLightTimeout,
       
   523     TUint16 aActiveToLightThreshold,
       
   524     TUint32 aLightToActiveTimeout,
       
   525     TUint16 aLightToActiveThreshold,
       
   526     TUint32 aLightToDeepTimeout,
       
   527     TUint16 aLightToDeepThreshold,
       
   528     TUint16 aUapsdRxFrameLengthThreshold )
       
   529     {
       
   530     DEBUG( "CWlanMgmtCommandHandler::SetPowerModeMgmtParameters()" );
       
   531 
       
   532     DEBUG1( "CWlanMgmtCommandHandler::SetPowerModeMgmtParameters() - aActiveToLightTimeout = %u",
       
   533         aActiveToLightTimeout );
       
   534     DEBUG1( "CWlanMgmtCommandHandler::SetPowerModeMgmtParameters() - aActiveToLightThreshold = %u",
       
   535         aActiveToLightThreshold );
       
   536     DEBUG1( "CWlanMgmtCommandHandler::SetPowerModeMgmtParameters() - aLightToActiveTimeout = %u",
       
   537         aLightToActiveTimeout );
       
   538     DEBUG1( "CWlanMgmtCommandHandler::SetPowerModeMgmtParameters() - aLightToActiveThreshold = %u",
       
   539         aLightToActiveThreshold );
       
   540     DEBUG1( "CWlanMgmtCommandHandler::SetPowerModeMgmtParameters() - aLightToDeepTimeout = %u",
       
   541         aLightToDeepTimeout );
       
   542     DEBUG1( "CWlanMgmtCommandHandler::SetPowerModeMgmtParameters() - aLightToDeepThreshold = %u",
       
   543         aLightToDeepThreshold );
       
   544     DEBUG1( "CWlanMgmtCommandHandler::SetPowerModeMgmtParameters() - aUapsdRxFrameLengthThreshold = %u",
       
   545         aUapsdRxFrameLengthThreshold );
       
   546     
       
   547     TSetPowerModeMgmtParamsMsg msg;
       
   548     msg.hdr.oid_id = E802_11_SET_POWER_MODE_MGMT_PARAMS;
       
   549     msg.toLightPsTimeout = aActiveToLightTimeout;
       
   550     msg.toLightPsFrameThreshold = aActiveToLightThreshold;
       
   551     msg.toActiveTimeout = aLightToActiveTimeout;
       
   552     msg.toActiveFrameThreshold = aLightToActiveThreshold;
       
   553     msg.toDeepPsTimeout = aLightToDeepTimeout;
       
   554     msg.toDeepPsFrameThreshold = aLightToDeepThreshold;
       
   555     msg.uapsdRxFrameLengthThreshold = aUapsdRxFrameLengthThreshold;
       
   556     TPckg<TSetPowerModeMgmtParamsMsg> buf( msg );
       
   557 
       
   558     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   559     if( err )
       
   560         {
       
   561         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   562         TRequestStatus* status = &iStatus;
       
   563         User::RequestComplete( status, err );
       
   564         }
       
   565     SetActive();          
       
   566     }
       
   567 
       
   568 // ---------------------------------------------------------
       
   569 // CWlanMgmtCommandHandler::SetTxRatePolicies
       
   570 // ---------------------------------------------------------
       
   571 //
       
   572 void CWlanMgmtCommandHandler::SetTxRatePolicies(
       
   573     const TTxRatePolicy& aRatePolicies,
       
   574     const THtMcsPolicy& aMcsPolicies,
       
   575     const TQueue2RateClass& aMappings,
       
   576     const TInitialMaxTxRate4RateClass& aInitialRates,
       
   577     const TTxAutoRatePolicy& aAutoRatePolicies )
       
   578     {
       
   579     DEBUG( "CWlanMgmtCommandHandler::SetTxRatePolicies()" );
       
   580 
       
   581     TConfigureTxRatePoliciesMsg msg;
       
   582     msg.hdr.oid_id = E802_11_CONFIGURE_TX_RATE_POLICIES;
       
   583     msg.ratePolicy = aRatePolicies;
       
   584     Mem::Copy(
       
   585         &msg.htMcsPolicy[0][0],
       
   586         &aMcsPolicies[0][0],
       
   587         sizeof( msg.htMcsPolicy ) );        
       
   588     Mem::Copy(
       
   589         &msg.queue2RateClass[0],
       
   590         &aMappings[0],
       
   591         sizeof( msg.queue2RateClass ) );
       
   592     Mem::Copy(
       
   593         &msg.initialMaxTxRate4RateClass[0],
       
   594         &aInitialRates[0],
       
   595         sizeof( msg.initialMaxTxRate4RateClass ) );
       
   596     Mem::Copy(
       
   597         &msg.autoRatePolicy[0],
       
   598         &aAutoRatePolicies[0],
       
   599         sizeof( msg.autoRatePolicy ) );
       
   600     TPckg<TConfigureTxRatePoliciesMsg> buf( msg );
       
   601 
       
   602 #ifdef _DEBUG
       
   603     DEBUG( "----------------------------------------------" );
       
   604     for ( TUint idx( 0 ); idx < msg.ratePolicy.numOfPolicyObjects; ++idx )
       
   605         {
       
   606         DEBUG1( "TX rate policy ID %u", idx );
       
   607         DEBUG1( "TX rate policy for 54 Mbit/s:   %u", msg.ratePolicy.txRateClass[idx].txPolicy54 );
       
   608         DEBUG1( "TX rate policy for 48 Mbit/s:   %u", msg.ratePolicy.txRateClass[idx].txPolicy48 );
       
   609         DEBUG1( "TX rate policy for 36 Mbit/s:   %u", msg.ratePolicy.txRateClass[idx].txPolicy36 );
       
   610         DEBUG1( "TX rate policy for 33 Mbit/s:   %u", msg.ratePolicy.txRateClass[idx].txPolicy33 );
       
   611         DEBUG1( "TX rate policy for 24 Mbit/s:   %u", msg.ratePolicy.txRateClass[idx].txPolicy24 );
       
   612         DEBUG1( "TX rate policy for 22 Mbit/s:   %u", msg.ratePolicy.txRateClass[idx].txPolicy22 );
       
   613         DEBUG1( "TX rate policy for 18 Mbit/s:   %u", msg.ratePolicy.txRateClass[idx].txPolicy18 );
       
   614         DEBUG1( "TX rate policy for 12 Mbit/s:   %u", msg.ratePolicy.txRateClass[idx].txPolicy12 );
       
   615         DEBUG1( "TX rate policy for 11 Mbit/s:   %u", msg.ratePolicy.txRateClass[idx].txPolicy11 );
       
   616         DEBUG1( "TX rate policy for 9 Mbit/s:    %u", msg.ratePolicy.txRateClass[idx].txPolicy9 );
       
   617         DEBUG1( "TX rate policy for 6 Mbit/s:    %u", msg.ratePolicy.txRateClass[idx].txPolicy6 );
       
   618         DEBUG1( "TX rate policy for 5.5 Mbit/s:  %u", msg.ratePolicy.txRateClass[idx].txPolicy5_5 );
       
   619         DEBUG1( "TX rate policy for 2 Mbit/s:    %u", msg.ratePolicy.txRateClass[idx].txPolicy2 );
       
   620         DEBUG1( "TX rate policy for 1 Mbit/s:    %u", msg.ratePolicy.txRateClass[idx].txPolicy1 );
       
   621         DEBUG1( "TX rate policy shortRetryLimit: %u", msg.ratePolicy.txRateClass[idx].shortRetryLimit );
       
   622         DEBUG1( "TX rate policy longRetryLimit:  %u", msg.ratePolicy.txRateClass[idx].longRetryLimit );
       
   623         DEBUG1( "TX rate policy flags:           0x%08X", msg.ratePolicy.txRateClass[idx].flags );
       
   624         DEBUG1( "TX rate policy initial rate:    0x%08X", msg.initialMaxTxRate4RateClass[idx] );        
       
   625         DEBUG1( "TX auto rate policy rate mask:  0x%08X", msg.autoRatePolicy[idx] );
       
   626         DEBUG( " " );
       
   627         }
       
   628         
       
   629     DEBUG1( "Access Class ELegacy points to policy ID %u", msg.queue2RateClass[ELegacy] );
       
   630     DEBUG1( "Access Class EBackGround points to policy ID %u", msg.queue2RateClass[EBackGround] );
       
   631     DEBUG1( "Access Class EVideo points to policy ID %u", msg.queue2RateClass[EVideo] );
       
   632     DEBUG1( "Access Class EVoice points to policy ID %u", msg.queue2RateClass[EVoice] );
       
   633     DEBUG( "----------------------------------------------" );
       
   634 #endif // _DEBUG
       
   635 
       
   636     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   637     if( err )
       
   638         {
       
   639         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   640         TRequestStatus* status = &iStatus;
       
   641         User::RequestComplete( status, err );
       
   642         }
       
   643     SetActive();          
       
   644     }    
       
   645 
       
   646 // ---------------------------------------------------------
       
   647 // CWlanMgmtCommandHandler::GetPacketStatistics
       
   648 // ---------------------------------------------------------
       
   649 //
       
   650 void CWlanMgmtCommandHandler::GetPacketStatistics(
       
   651     TStatisticsResponse& aStatistics )
       
   652     {
       
   653     DEBUG( "CWlanMgmtCommandHandler::GetPacketStatistics()" );
       
   654 
       
   655     TGetFrameStatisticsMsg msg;
       
   656     msg.hdr.oid_id = E802_11_GET_FRAME_STATISTICS;
       
   657     TPckg<TGetFrameStatisticsMsg> outbuf( msg );
       
   658     TPckg<TStatisticsResponse> inbuf( aStatistics );
       
   659     iBuffer.Set( inbuf );
       
   660 
       
   661     TInt err = iChannel.ManagementCommand( outbuf, &iBuffer, &iStatus );
       
   662     if( err )
       
   663         {
       
   664         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   665         TRequestStatus* status = &iStatus;
       
   666         User::RequestComplete( status, err );
       
   667         }
       
   668     SetActive();
       
   669     }
       
   670 
       
   671 // ---------------------------------------------------------
       
   672 // CWlanMgmtCommandHandler::SetUapsdSettings
       
   673 // ---------------------------------------------------------
       
   674 //
       
   675 void CWlanMgmtCommandHandler::SetUapsdSettings(
       
   676     TMaxServicePeriodLength aMaxServicePeriodLength,
       
   677     TBool aUapsdEnabledForVoice,
       
   678     TBool aUapsdEnabledForVideo,
       
   679     TBool aUapsdEnabledForBestEffort,
       
   680     TBool aUapsdEnabledForBackground )
       
   681     {
       
   682     DEBUG( "CWlanMgmtCommandHandler::SetUapsdSettings()" );
       
   683     
       
   684     TConfigureUapsdMsg msg;
       
   685     msg.hdr.oid_id = E802_11_CONFIGURE_UAPSD;
       
   686     msg.maxServicePeriodLength = aMaxServicePeriodLength;
       
   687     msg.uapsdForVoice = aUapsdEnabledForVoice;
       
   688     msg.uapsdForVideo = aUapsdEnabledForVideo;
       
   689     msg.uapsdForBestEffort = aUapsdEnabledForBestEffort;
       
   690     msg.uapsdForBackground = aUapsdEnabledForBackground;
       
   691     TPckg<TConfigureUapsdMsg> buf( msg );
       
   692 
       
   693 #ifdef _DEBUG
       
   694     DEBUG1( "CWlanMgmtCommandHandler::SetUapsdSettings() - maxServicePeriodLength: 0x%02X",
       
   695         msg.maxServicePeriodLength );
       
   696     DEBUG1( "CWlanMgmtCommandHandler::SetUapsdSettings() - uapsdForVoice: %u",
       
   697         msg.uapsdForVoice );
       
   698     DEBUG1( "CWlanMgmtCommandHandler::SetUapsdSettings() - uapsdForVideo: %u",
       
   699         msg.uapsdForVideo );
       
   700     DEBUG1( "CWlanMgmtCommandHandler::SetUapsdSettings() - uapsdForBestEffort: %u",
       
   701         msg.uapsdForBestEffort );
       
   702     DEBUG1( "CWlanMgmtCommandHandler::SetUapsdSettings() - uapsdForBackground: %u",
       
   703         msg.uapsdForBackground );
       
   704 #endif // _DEBUG            
       
   705 
       
   706     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   707     if( err )
       
   708         {
       
   709         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   710         TRequestStatus* status = &iStatus;
       
   711         User::RequestComplete( status, err );
       
   712         }
       
   713     SetActive();  
       
   714     }
       
   715 
       
   716 // ---------------------------------------------------------
       
   717 // CWlanMgmtCommandHandler::SetPowerSaveSettings
       
   718 // ---------------------------------------------------------
       
   719 //
       
   720 void CWlanMgmtCommandHandler::SetPowerSaveSettings(
       
   721     TBool aStayInUapsdPsModeForVoice,
       
   722     TBool aStayInUapsdPsModeForVideo,
       
   723     TBool aStayInUapsdPsModeForBestEffort,
       
   724     TBool aStayInUapsdPsModeForBackground,
       
   725     TBool aStayInLegacyPsModeForVoice,
       
   726     TBool aStayInLegacyPsModeForVideo,
       
   727     TBool aStayInLegacyPsModeForBestEffort,
       
   728     TBool aStayInLegacyPsModeForBackground )
       
   729     {
       
   730     DEBUG( "CWlanMgmtCommandHandler::SetPowerSaveSettings()" );
       
   731 
       
   732     TConfigurePwrModeMgmtTrafficOverrideMsg msg;
       
   733     msg.hdr.oid_id = E802_11_CONFIGURE_PWR_MODE_MGMT_TRAFFIC_OVERRIDE;
       
   734     msg.stayInPsDespiteUapsdVoiceTraffic = aStayInUapsdPsModeForVoice;
       
   735     msg.stayInPsDespiteUapsdVideoTraffic = aStayInUapsdPsModeForVideo;
       
   736     msg.stayInPsDespiteUapsdBestEffortTraffic = aStayInUapsdPsModeForBestEffort;
       
   737     msg.stayInPsDespiteUapsdBackgroundTraffic = aStayInUapsdPsModeForBackground;
       
   738     msg.stayInPsDespiteLegacyVoiceTraffic = aStayInLegacyPsModeForVoice;
       
   739     msg.stayInPsDespiteLegacyVideoTraffic = aStayInLegacyPsModeForVideo;
       
   740     msg.stayInPsDespiteLegacyBestEffortTraffic = aStayInLegacyPsModeForBestEffort;
       
   741     msg.stayInPsDespiteLegacyBackgroundTraffic = aStayInLegacyPsModeForBackground;
       
   742     TPckg<TConfigurePwrModeMgmtTrafficOverrideMsg> buf( msg );
       
   743 
       
   744 #ifdef _DEBUG
       
   745     DEBUG1( "CWlanMgmtCommandHandler::SetPowerSaveSettings() - stayInPsDespiteUapsdVoiceTraffic: %u",
       
   746         msg.stayInPsDespiteUapsdVoiceTraffic );
       
   747     DEBUG1( "CWlanMgmtCommandHandler::SetPowerSaveSettings() - stayInPsDespiteUapsdVideoTraffic: %u",
       
   748         msg.stayInPsDespiteUapsdVideoTraffic );
       
   749     DEBUG1( "CWlanMgmtCommandHandler::SetPowerSaveSettings() - stayInPsDespiteUapsdBestEffortTraffic: %u",
       
   750         msg.stayInPsDespiteUapsdBestEffortTraffic );
       
   751     DEBUG1( "CWlanMgmtCommandHandler::SetPowerSaveSettings() - stayInPsDespiteUapsdBackgroundTraffic: %u",
       
   752         msg.stayInPsDespiteUapsdBackgroundTraffic );
       
   753     DEBUG1( "CWlanMgmtCommandHandler::SetPowerSaveSettings() - stayInPsDespiteLegacyVoiceTraffic: %u",
       
   754         msg.stayInPsDespiteLegacyVoiceTraffic );
       
   755     DEBUG1( "CWlanMgmtCommandHandler::SetPowerSaveSettings() - stayInPsDespiteLegacyVideoTraffic: %u",
       
   756         msg.stayInPsDespiteLegacyVideoTraffic );
       
   757     DEBUG1( "CWlanMgmtCommandHandler::SetPowerSaveSettings() - stayInPsDespiteLegacyBestEffortTraffic: %u",
       
   758         msg.stayInPsDespiteLegacyBestEffortTraffic );
       
   759     DEBUG1( "CWlanMgmtCommandHandler::SetPowerSaveSettings() - stayInPsDespiteLegacyBackgroundTraffic: %u",
       
   760         msg.stayInPsDespiteLegacyBackgroundTraffic );
       
   761 #endif // _DEBUG            
       
   762 
       
   763     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   764     if( err )
       
   765         {
       
   766         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   767         TRequestStatus* status = &iStatus;
       
   768         User::RequestComplete( status, err );
       
   769         }
       
   770     SetActive();    
       
   771     }
       
   772 
       
   773 // ---------------------------------------------------------
       
   774 // CWlanMgmtCommandHandler::SetTxQueueParameters
       
   775 // ---------------------------------------------------------
       
   776 //
       
   777 void CWlanMgmtCommandHandler::SetTxQueueParameters(
       
   778     TQueueId aQueueId,
       
   779     TUint16 aMediumTime,
       
   780     TUint32 aMaxTxMSDULifetime )
       
   781     {
       
   782     DEBUG( "CWlanMgmtCommandHandler::SetTxQueueParameters()" );
       
   783 
       
   784     TConfigureTxQueueMsg msg;
       
   785     msg.hdr.oid_id = E802_11_CONFIGURE_TX_QUEUE;
       
   786     msg.queueId = aQueueId;
       
   787     msg.mediumTime = aMediumTime;
       
   788     msg.maxTxMSDULifetime = aMaxTxMSDULifetime;
       
   789     TPckg<TConfigureTxQueueMsg> buf( msg );
       
   790 
       
   791 #ifdef _DEBUG
       
   792     DEBUG1( "CWlanMgmtCommandHandler::SetTxQueueParameters() - queueId: %u",
       
   793         msg.queueId );
       
   794     DEBUG1( "CWlanMgmtCommandHandler::SetTxQueueParameters() - mediumTime: %u",
       
   795         msg.mediumTime );
       
   796     DEBUG1( "CWlanMgmtCommandHandler::SetTxQueueParameters() - maxTxMSDULifetime: %u",
       
   797         msg.maxTxMSDULifetime );
       
   798 #endif // _DEBUG            
       
   799 
       
   800     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   801     if( err )
       
   802         {
       
   803         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   804         TRequestStatus* status = &iStatus;
       
   805         User::RequestComplete( status, err );
       
   806         }
       
   807     SetActive();    
       
   808     }
       
   809 
       
   810 // ---------------------------------------------------------
       
   811 // CWlanMgmtCommandHandler::SetBlockAckUsage
       
   812 // ---------------------------------------------------------
       
   813 //
       
   814 void CWlanMgmtCommandHandler::SetBlockAckUsage(
       
   815     TUint8 aTxUsage,
       
   816     TUint8 aRxUsage )
       
   817     {
       
   818     DEBUG( "CWlanMgmtCommandHandler::SetBlockAckUsage()" );
       
   819     
       
   820     TConfigureHtBlockAckMsg msg;
       
   821     msg.hdr.oid_id = E802_11_CONFIGURE_HT_BLOCK_ACK;
       
   822     msg.iTxBlockAckUsage = aTxUsage;
       
   823     msg.iRxBlockAckUsage = aRxUsage;
       
   824     TPckg<TConfigureHtBlockAckMsg> buf( msg );
       
   825 
       
   826     DEBUG1( "CWlanMgmtCommandHandler::SetRcpiTriggerLevel() - aTxUsage is 0x%02X",
       
   827         aTxUsage );
       
   828     DEBUG1( "CWlanMgmtCommandHandler::SetRcpiTriggerLevel() - aRxUsage is 0x%02X",
       
   829         aRxUsage );
       
   830 
       
   831     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   832     if( err )
       
   833         {
       
   834         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   835         TRequestStatus* status = &iStatus;
       
   836         User::RequestComplete( status, err );
       
   837         }
       
   838     SetActive();    
       
   839     }
       
   840 
       
   841 // ---------------------------------------------------------
       
   842 // CWlanMgmtCommandHandler::SetSnapHeaderFilter
       
   843 // ---------------------------------------------------------
       
   844 //
       
   845 void CWlanMgmtCommandHandler::SetSnapHeaderFilter(
       
   846     TSnapHeader aHeader )
       
   847     {
       
   848     DEBUG( "CWlanMgmtCommandHandler::SetSnapHeaderFilter()" );
       
   849     
       
   850     TConfigureProprietarySnapHdrMsg msg;
       
   851     msg.hdr.oid_id = E802_11_CONFIGURE_PROPRIETARY_SNAP_HDR;
       
   852     msg.snapHdr = aHeader;
       
   853     TPckg<TConfigureProprietarySnapHdrMsg> buf( msg );
       
   854 
       
   855     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   856     if( err )
       
   857         {
       
   858         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   859         TRequestStatus* status = &iStatus;
       
   860         User::RequestComplete( status, err );
       
   861         }
       
   862     SetActive();    
       
   863     }
       
   864 
       
   865 // ---------------------------------------------------------
       
   866 // CWlanMgmtCommandHandler::SetRcpiTriggerLevel
       
   867 // ---------------------------------------------------------
       
   868 //
       
   869 void CWlanMgmtCommandHandler::SetRcpiTriggerLevel( 
       
   870     TUint8 aTriggerLevel )
       
   871     {
       
   872     DEBUG( "CWlanMgmtCommandHandler::SetRcpiTriggerLevel()" );
       
   873 
       
   874     TSetRcpiTriggerLevelMsg msg;
       
   875     msg.hdr.oid_id = E802_11_SET_RCPI_TRIGGER_LEVEL;
       
   876     msg.RcpiTrigger = aTriggerLevel;
       
   877     TPckg<TSetRcpiTriggerLevelMsg> buf( msg );
       
   878 
       
   879     DEBUG1( "CWlanMgmtCommandHandler::SetRcpiTriggerLevel() - aTriggerLevel is %u",
       
   880         aTriggerLevel );
       
   881 
       
   882     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   883     if( err )
       
   884         {
       
   885         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   886         TRequestStatus* status = &iStatus;
       
   887         User::RequestComplete( status, err );
       
   888         }
       
   889     SetActive();
       
   890     }
       
   891 
       
   892 // ---------------------------------------------------------
       
   893 // CWlanMgmtCommandHandler::DisableUserData
       
   894 // Block user data.
       
   895 // ---------------------------------------------------------
       
   896 //
       
   897 void CWlanMgmtCommandHandler::DisableUserData()
       
   898     {
       
   899     DEBUG( "CWlanMgmtCommandHandler::DisableUserData()" );
       
   900 
       
   901     TDisableUserDataMsg msg;
       
   902     msg.hdr.oid_id = E802_11_DISABLE_USER_DATA;
       
   903 
       
   904     TPckg<TDisableUserDataMsg> buf( msg );
       
   905 
       
   906     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   907     if( err )
       
   908         {
       
   909         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   910         TRequestStatus* status = &iStatus;
       
   911         User::RequestComplete( status, err );
       
   912         }
       
   913     SetActive();
       
   914     }
       
   915 
       
   916 // ---------------------------------------------------------
       
   917 // CWlanMgmtCommandHandler::EnableUserData
       
   918 // Pass user data through.
       
   919 // ---------------------------------------------------------
       
   920 //
       
   921 void CWlanMgmtCommandHandler::EnableUserData()
       
   922     {
       
   923     DEBUG( "CWlanMgmtCommandHandler::EnableUserData()" );
       
   924 
       
   925     TEnableUserDataMsg msg;
       
   926     msg.hdr.oid_id = E802_11_ENABLE_USER_DATA;
       
   927     TPckg<TEnableUserDataMsg> buf( msg );
       
   928 
       
   929     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
   930     if( err )
       
   931         {
       
   932         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   933         TRequestStatus* status = &iStatus;
       
   934         User::RequestComplete( status, err );
       
   935         }
       
   936     SetActive();
       
   937     }
       
   938 
       
   939 // ---------------------------------------------------------
       
   940 // CWlanMgmtCommandHandler::AddCipherKey
       
   941 // ---------------------------------------------------------
       
   942 //
       
   943 void CWlanMgmtCommandHandler::AddCipherKey(
       
   944     TWlanCipherSuite aCipherSuite,
       
   945     TUint8 aKeyIndex,
       
   946     TUint32 aLength,
       
   947     const TUint8* aData,
       
   948     const TMacAddress& aMacAddr,
       
   949     TBool aUseAsDefault )
       
   950     {
       
   951     DEBUG( "CWlanMgmtCommandHandler::AddCipherKey()" );
       
   952 
       
   953     DEBUG1( "CWlanMgmtCommandHandler::AddCipherKey() - aCipherSuite = %u",
       
   954         aCipherSuite );       
       
   955     DEBUG1( "CWlanMgmtCommandHandler::AddCipherKey() - aKeyIndex = %u",
       
   956         aKeyIndex );
       
   957     DEBUG1( "CWlanMgmtCommandHandler::AddCipherKey() - aUseAsDefault = %u",
       
   958         aUseAsDefault );
       
   959     DEBUG6( "CWlanMgmtCommandHandler::AddCipherKey() - aMacAddr = %02X:%02X:%02X:%02X:%02X:%02X",
       
   960         aMacAddr.iMacAddress[0], aMacAddr.iMacAddress[1], aMacAddr.iMacAddress[2], 
       
   961         aMacAddr.iMacAddress[3], aMacAddr.iMacAddress[4], aMacAddr.iMacAddress[5] );        
       
   962     DEBUG1( "CWlanMgmtCommandHandler::AddCipherKey() - aLength = %u",
       
   963         aLength );
       
   964     DEBUG_BUFFER( aLength, aData );
       
   965 
       
   966     TAddCipherKeyMsg msg;
       
   967     msg.hdr.oid_id = E802_11_ADD_CIPHER_KEY;
       
   968     msg.cipherSuite = aCipherSuite;
       
   969     Mem::Copy( msg.data, aData, aLength );
       
   970     msg.length = aLength;
       
   971     msg.keyIndex = aKeyIndex;
       
   972     msg.macAddress = aMacAddr;
       
   973     msg.useAsDefaultKey = aUseAsDefault;    
       
   974     TPckg<TAddCipherKeyMsg> buf( msg );
       
   975 
       
   976     TInt err = iChannel.ManagementCommand( buf, NULL );
       
   977     if( err )
       
   978         {
       
   979         DEBUG1("ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
   980         }
       
   981     }
       
   982 
       
   983 // ---------------------------------------------------------
       
   984 // CWlanMgmtCommandHandler::Connect
       
   985 // ---------------------------------------------------------
       
   986 //
       
   987 void CWlanMgmtCommandHandler::Connect(
       
   988     const TSSID& aSSID,                 
       
   989     const TMacAddress& aBSSID,          
       
   990     TUint16 aAuthAlgorithm,      
       
   991     TEncryptionStatus aEncryptionStatus,
       
   992     TWlanCipherSuite aPairwiseKeyType,
       
   993     TBool aIsInfra,
       
   994     TUint32 aIeDataLength,
       
   995     const TUint8* aIeData,        
       
   996     TUint32 aScanFrameLength,
       
   997     const TUint8* aScanFrame,
       
   998     TBool aIsPairwiseKeyInvalidated,
       
   999     TBool aIsGroupKeyInvalidated,
       
  1000     TBool aIsRadioMeasurementSupported )
       
  1001     {
       
  1002     DEBUG( "CWlanMgmtCommandHandler::Connect()" );
       
  1003     
       
  1004     DEBUG1( "CWlanMgmtCommandHandler::Connect() - aPairwiseKeyType = %u",
       
  1005         aPairwiseKeyType );
       
  1006 
       
  1007     TConnectMsg msg;
       
  1008     msg.hdr.oid_id = E802_11_CONNECT;
       
  1009     msg.SSID = aSSID;
       
  1010     msg.BSSID = aBSSID;
       
  1011     msg.authAlgorithmNbr = aAuthAlgorithm;
       
  1012     msg.encryptionStatus = aEncryptionStatus;
       
  1013     msg.pairwiseCipher = aPairwiseKeyType;
       
  1014     msg.isInfra = aIsInfra;
       
  1015     msg.scanResponseFrameBodyLength = aScanFrameLength;
       
  1016     msg.scanResponseFrameBody = const_cast<TUint8*>( aScanFrame );
       
  1017     msg.ieDataLength = aIeDataLength;    
       
  1018     msg.ieData = const_cast<TUint8*>( aIeData );
       
  1019     msg.invalidatePairwiseKey = aIsPairwiseKeyInvalidated;
       
  1020     msg.invalidateGroupKey = aIsGroupKeyInvalidated;
       
  1021     msg.radioMeasurement = aIsRadioMeasurementSupported;
       
  1022 
       
  1023     TPckg<TConnectMsg> buf( msg );
       
  1024 
       
  1025     TInt err = iChannel.ManagementCommand( buf, NULL, &iStatus );
       
  1026     if( err )
       
  1027         {
       
  1028         DEBUG1( "ERROR calling RWlanLogicalChannel::ManagementCommand(): %d", err );
       
  1029         TRequestStatus* status = &iStatus;
       
  1030         User::RequestComplete( status, err );
       
  1031         }
       
  1032     SetActive();
       
  1033     }
       
  1034 
       
  1035 // ---------------------------------------------------------
       
  1036 // CWlanMgmtCommandHandler::DoCancel
       
  1037 // ---------------------------------------------------------
       
  1038 //    
       
  1039 void CWlanMgmtCommandHandler::DoCancel()
       
  1040     {
       
  1041     DEBUG( "CWlanMgmtCommandHandler::DoCancel()" );
       
  1042     // RWlanLogicalChannel does not have cancel for ManagementCommand()
       
  1043     }
       
  1044 
       
  1045 // ---------------------------------------------------------
       
  1046 // CWlanMgmtCommandHandler::RunL
       
  1047 // ---------------------------------------------------------
       
  1048 //    
       
  1049 void CWlanMgmtCommandHandler::RunL()
       
  1050     {
       
  1051     DEBUG1( "CWlanMgmtCommandHandler::RunL, status == %d", iStatus.Int() );
       
  1052     iClient.OnRequestComplete( iStatus.Int() );
       
  1053     }
       
  1054 
       
  1055 // End of file