1 /* |
1 /* |
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
395 OsTracePrint( KUmacDetails, (TUint8*) |
395 OsTracePrint( KUmacDetails, (TUint8*) |
396 ("UMAC: WlanNullSendController::OnKeepAliveTimerTimeout") ); |
396 ("UMAC: WlanNullSendController::OnKeepAliveTimerTimeout") ); |
397 |
397 |
398 iFlags &= ~KKeepAliveTimerArmed; |
398 iFlags &= ~KKeepAliveTimerArmed; |
399 |
399 |
400 TUint32 KTimeAfterLatestTx ( |
400 // request a regular Null Data frame to be sent |
401 static_cast<TUint32>(os_systemTime() - iLatestTx) ); |
401 // however, if there is a frame Tx (of any frame) already pending OR |
402 |
402 // we use U-APSD for Voice and we are on a VoWLAN call |
403 if ( KTimeAfterLatestTx >= iKeepAliveTimeout ) |
403 // we won't request a new frame to be sent. |
404 { |
404 if ( !iWlanContextImpl.UnsentTxPackets() && |
405 // request a regular Null Data frame to be sent |
405 !( iWlanContextImpl.UapsdUsedForVoice() && InVoiceCallState() ) ) |
406 |
406 { |
407 // however, if there is a frame Tx (of any frame) already pending, |
407 if ( !iNullSender.TxNullDataFrame( iWlanContextImpl, EFalse ) ) |
408 // we won't request a new frame to be sent. |
408 { |
409 if ( !iWlanContextImpl.UnsentTxPackets() ) |
409 // frame was not sent because we didn't get a Tx buffer. |
410 { |
410 // In this case we'll skip the sending |
411 if ( !iNullSender.TxNullDataFrame( iWlanContextImpl, EFalse ) ) |
|
412 { |
|
413 // frame was not sent because we didn't get a Tx buffer. |
|
414 // In this case we'll skip the sending |
|
415 // However, we need to re-arm the timer to trigger the next |
|
416 // Null Data frame sending |
|
417 RegisterKeepAliveTimeout( iKeepAliveTimeout ); |
|
418 } |
|
419 } |
|
420 else |
|
421 { |
|
422 // frame Tx already pending, so we don't ask a Null Data to be sent |
|
423 OsTracePrint( KUmacDetails, (TUint8*) |
|
424 ("UMAC: WlanNullSendController::OnKeepAliveTimerTimeout: frame Tx already pending. New Null Data Tx request skipped") ); |
|
425 |
|
426 // However, we need to re-arm the timer to trigger the next |
411 // However, we need to re-arm the timer to trigger the next |
427 // Null Data frame sending |
412 // Null Data frame sending |
428 RegisterKeepAliveTimeout( iKeepAliveTimeout ); |
413 RegisterKeepAliveTimeout( iKeepAliveTimeout ); |
429 } |
414 } |
430 } |
415 } |
431 else |
416 else |
432 { |
417 { |
433 // No need to send keep alive; yet. Re-arm the timer with |
418 // we don't ask a Null Data to be sent |
434 // a suitable timeout relative to the time of the latest frame Tx |
419 OsTracePrint( KUmacDetails, (TUint8*) |
435 RegisterKeepAliveTimeout( iKeepAliveTimeout - KTimeAfterLatestTx ); |
420 ("UMAC: WlanNullSendController::OnKeepAliveTimerTimeout: frame Tx " |
|
421 "already pending OR U-APSD used for Voice and we are in VoWLAN" |
|
422 "call => Null Data Tx request skipped") ); |
|
423 |
|
424 // However, we need to re-arm the timer to trigger the next |
|
425 // Null Data frame sending |
|
426 RegisterKeepAliveTimeout( iKeepAliveTimeout ); |
436 } |
427 } |
437 } |
428 } |
438 |
429 |
439 // --------------------------------------------------------------------------- |
430 // --------------------------------------------------------------------------- |
440 // |
431 // |