equal
deleted
inserted
replaced
14 * Description: Implementation of the UmacDot11Synchronize class |
14 * Description: Implementation of the UmacDot11Synchronize class |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 /* |
18 /* |
19 * %version: 30 % |
19 * %version: 31 % |
20 */ |
20 */ |
21 |
21 |
22 #include "config.h" |
22 #include "config.h" |
23 #include "UmacDot11Synchronize.h" |
23 #include "UmacDot11Synchronize.h" |
24 #include "UmacContextImpl.h" |
24 #include "UmacContextImpl.h" |
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)), |
505 // and construct necessary objects for doing the connection |
503 // and construct necessary objects for doing the connection |
506 // |
504 // |
507 return InitNetworkConnect( |
505 return InitNetworkConnect( |
508 aCtxImpl, |
506 aCtxImpl, |
509 aCtxImpl.ScanResponseFrameBodyLength(), |
507 aCtxImpl.ScanResponseFrameBodyLength(), |
510 aCtxImpl.ScanResponseFrameBody() ); |
508 aCtxImpl.ScanResponseFrameBody() ); |
511 } |
509 } |
512 |
510 |
513 // ----------------------------------------------------------------------------- |
511 // ----------------------------------------------------------------------------- |
514 // |
512 // |
515 // ----------------------------------------------------------------------------- |
513 // ----------------------------------------------------------------------------- |
985 OsTracePrint( KWarningLevel, (TUint8*) |
983 OsTracePrint( KWarningLevel, (TUint8*) |
986 ("UMAC: WlanDot11Synchronize::OnWhaCommandResponse(): join failed")); |
984 ("UMAC: WlanDot11Synchronize::OnWhaCommandResponse(): join failed")); |
987 // make a note of the failure and act |
985 // make a note of the failure and act |
988 // accordingly when we |
986 // accordingly when we |
989 // soon again enter this state |
987 // soon again enter this state |
990 iJoinFailed = ETrue; |
988 iJoinStatus = KErrGeneral; |
991 } |
989 } |
992 else |
990 else |
993 { |
991 { |
994 OsTracePrint( KInfoLevel, |
992 OsTracePrint( KInfoLevel, |
995 (TUint8*)("UMAC: WlanDot11Synchronize::OnWhaCommandResponse(): join success")); |
993 (TUint8*)("UMAC: WlanDot11Synchronize::OnWhaCommandResponse(): join success")); |