63 // ----------------------------------------------------------------------------- |
63 // ----------------------------------------------------------------------------- |
64 // |
64 // |
65 // ----------------------------------------------------------------------------- |
65 // ----------------------------------------------------------------------------- |
66 // |
66 // |
67 WlanDot11Synchronize::WlanDot11Synchronize() : |
67 WlanDot11Synchronize::WlanDot11Synchronize() : |
68 iState( EINIT ), iJoinFailed ( EFalse ) |
68 iState( EINIT ), iJoinStatus ( KErrNone ) |
69 { |
69 { |
70 } |
70 } |
71 |
71 |
72 // ----------------------------------------------------------------------------- |
72 // ----------------------------------------------------------------------------- |
73 // |
73 // |
186 (TUint8*)("UMAC: WlanDot11Synchronize::OnStateEntryEvent()")); |
186 (TUint8*)("UMAC: WlanDot11Synchronize::OnStateEntryEvent()")); |
187 |
187 |
188 switch ( iState ) |
188 switch ( iState ) |
189 { |
189 { |
190 case EINIT: |
190 case EINIT: |
191 if ( InitActions( aCtxImpl ) ) |
191 if ( ( iJoinStatus = InitActions( aCtxImpl ) ) == KErrNone ) |
192 { |
192 { |
193 // we meet the requirements of the network so we can continue |
193 // we meet the requirements of the network so we can continue |
194 |
194 |
195 // depending if the WLAN vendor specific solution |
195 // depending if the WLAN vendor specific solution |
196 // implements dot11slottime mib we will configure it |
196 // implements dot11slottime mib we will configure it |
212 } |
212 } |
213 } |
213 } |
214 else |
214 else |
215 { |
215 { |
216 // network requirements not met. Take the same action as |
216 // network requirements not met. Take the same action as |
217 // as in the join failed case |
217 // in the join failed case |
218 |
218 |
219 OsTracePrint( |
219 OsTracePrint( |
220 KWarningLevel, (TUint8*) |
220 KWarningLevel, (TUint8*) |
221 ("UMAC: WlanDot11Synchronize::OnStateEntryEvent(): network requirements not met - abort")); |
221 ("UMAC: WlanDot11Synchronize::OnStateEntryEvent(): network requirements not met - abort")); |
222 |
222 |
223 iJoinFailed = ETrue; |
|
224 ChangeInternalState( aCtxImpl, ECONTINUEDOT11TRAVERSE ); |
223 ChangeInternalState( aCtxImpl, ECONTINUEDOT11TRAVERSE ); |
225 } |
224 } |
226 break; |
225 break; |
227 case ESETDOT11SLOTTIME: |
226 case ESETDOT11SLOTTIME: |
228 SetDot11SlotTime( aCtxImpl ); |
227 SetDot11SlotTime( aCtxImpl ); |
406 { |
405 { |
407 OsTracePrint( |
406 OsTracePrint( |
408 KUmacDetails, |
407 KUmacDetails, |
409 (TUint8*)("UMAC: WlanDot11Synchronize::ContinueDot11StateTraversal()")); |
408 (TUint8*)("UMAC: WlanDot11Synchronize::ContinueDot11StateTraversal()")); |
410 |
409 |
411 if ( iJoinFailed ) |
410 if ( iJoinStatus != KErrNone ) |
412 { |
411 { |
413 // set the completion code value to be returned to user mode |
412 // set the completion code value to be returned to user mode |
414 // as the dot11idle state does the OID completion in this case |
413 // as the dot11idle state does the OID completion in this case |
415 aCtxImpl.iStates.iIdleState.Set( KErrGeneral ); |
414 aCtxImpl.iStates.iIdleState.Set( iJoinStatus ); |
416 // ... and proceed to dot11idle state |
415 // ... and proceed to dot11idle state |
417 ChangeState( aCtxImpl, |
416 ChangeState( aCtxImpl, |
418 *this, // prev state |
417 *this, // prev state |
419 aCtxImpl.iStates.iIdleState // next state |
418 aCtxImpl.iStates.iIdleState // next state |
420 ); |
419 ); |
466 |
465 |
467 // ----------------------------------------------------------------------------- |
466 // ----------------------------------------------------------------------------- |
468 // |
467 // |
469 // ----------------------------------------------------------------------------- |
468 // ----------------------------------------------------------------------------- |
470 // |
469 // |
471 TBool WlanDot11Synchronize::InitActions( WlanContextImpl& aCtxImpl ) |
470 TInt WlanDot11Synchronize::InitActions( WlanContextImpl& aCtxImpl ) const |
472 { |
471 { |
473 OsTracePrint( |
472 OsTracePrint( |
474 KUmacDetails, |
473 KUmacDetails, |
475 (TUint8*)("UMAC: WlanDot11Synchronize::InitActions()")); |
474 (TUint8*)("UMAC: WlanDot11Synchronize::InitActions()")); |
476 |
475 |
477 // as we are about to join a new AP, reset BSS Loss indicators |
476 // as we are about to join a new AP, reset BSS Loss indicators |
478 aCtxImpl.ResetBssLossIndications(); |
477 aCtxImpl.ResetBssLossIndications(); |
479 |
478 |
480 iJoinFailed = EFalse; |
|
481 // reset counter for this new AP connection |
479 // reset counter for this new AP connection |
482 aCtxImpl.ResetFailedTxPacketCount(); |
480 aCtxImpl.ResetFailedTxPacketCount(); |
483 |
481 |
484 os_memset( |
482 os_memset( |
485 reinterpret_cast<TUint8*>(&(aCtxImpl.GetNwHtCapabilitiesIe().iData)), |
483 reinterpret_cast<TUint8*>(&(aCtxImpl.GetNwHtCapabilitiesIe().iData)), |
495 |
493 |
496 // in case WLAN Mgmt Client has given us the permission to use PS mode, |
494 // in case WLAN Mgmt Client has given us the permission to use PS mode, |
497 // Light PS is the initial desired PS mode configuration |
495 // Light PS is the initial desired PS mode configuration |
498 aCtxImpl.SetDesiredPsModeConfig( |
496 aCtxImpl.SetDesiredPsModeConfig( |
499 aCtxImpl.ClientLightPsModeConfig() ); |
497 aCtxImpl.ClientLightPsModeConfig() ); |
|
498 // also make sure that the dynamic power mode managemen parameters are in |
|
499 // their WLAN Mgmt Client provided values |
|
500 aCtxImpl.RestorePwrModeMgmtParameters(); |
500 |
501 |
501 // check do we meet the requirements for the network |
502 // check do we meet the requirements for the network |
502 // and construct necessary objects for doing the connection |
503 // and construct necessary objects for doing the connection |
503 // |
504 // |
504 return InitNetworkConnect( |
505 return InitNetworkConnect( |
505 aCtxImpl, |
506 aCtxImpl, |
506 aCtxImpl.ScanResponseFrameBodyLength(), |
507 aCtxImpl.ScanResponseFrameBodyLength(), |
507 aCtxImpl.ScanResponseFrameBody() ); |
508 aCtxImpl.ScanResponseFrameBody() ); |
508 } |
509 } |
509 |
510 |
510 // ----------------------------------------------------------------------------- |
511 // ----------------------------------------------------------------------------- |
511 // |
512 // |
512 // ----------------------------------------------------------------------------- |
513 // ----------------------------------------------------------------------------- |
982 OsTracePrint( KWarningLevel, (TUint8*) |
983 OsTracePrint( KWarningLevel, (TUint8*) |
983 ("UMAC: WlanDot11Synchronize::OnWhaCommandResponse(): join failed")); |
984 ("UMAC: WlanDot11Synchronize::OnWhaCommandResponse(): join failed")); |
984 // make a note of the failure and act |
985 // make a note of the failure and act |
985 // accordingly when we |
986 // accordingly when we |
986 // soon again enter this state |
987 // soon again enter this state |
987 iJoinFailed = ETrue; |
988 iJoinStatus = KErrGeneral; |
988 } |
989 } |
989 else |
990 else |
990 { |
991 { |
991 OsTracePrint( KInfoLevel, |
992 OsTracePrint( KInfoLevel, |
992 (TUint8*)("UMAC: WlanDot11Synchronize::OnWhaCommandResponse(): join success")); |
993 (TUint8*)("UMAC: WlanDot11Synchronize::OnWhaCommandResponse(): join success")); |