diff -r 8ab6687fb94c -r 3adadc800673 telephonyprotocols/rawipnif/src/BcaController.cpp --- a/telephonyprotocols/rawipnif/src/BcaController.cpp Thu May 27 14:05:07 2010 +0300 +++ b/telephonyprotocols/rawipnif/src/BcaController.cpp Fri Jun 11 14:49:29 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of "Eclipse Public License v1.0" @@ -19,6 +19,12 @@ @file */ + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "BcaControllerTraces.h" +#endif + #include #include #include @@ -42,7 +48,6 @@ * Constructor. */ : iObserver(aObserver), - iTheLogger(aTheLogger), iTxFlowControl(EFlowControlOff), iTxContextActive(ETrue), iSendState(EIdle), @@ -68,11 +73,13 @@ void CBcaController::BaseConstructL() { - _LOG_L1C1(_L8("CBcaController::BaseConstructL")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_BASECONSTRUCTL_1, "CBcaController::BaseConstructL"); -#ifdef RAWIP_HEADER_APPENDED_TO_PACKETS - iIPTagHeader = new (ELeave) CIPTagHeader(iTheLogger); -#endif // RAWIP_HEADER_APPENDED_TO_PACKETS + #ifdef RAWIP_HEADER_APPENDED_TO_PACKETS + iIPTagHeader = new (ELeave) CIPTagHeader(); + #endif // RAWIP_HEADER_APPENDED_TO_PACKETS + + iIPTagHeader = new (ELeave) CIPTagHeader(iTheLogger); #if defined (__EABI__) // Default value for queue length @@ -91,6 +98,7 @@ UserSvr::HalFunction(EHalGroupEmulator,EEmulatorHalIntProperty,(TAny*)"rawip_KMaxTxIPPacketSize",&iMaxTxPacketSize); UserSvr::HalFunction(EHalGroupEmulator,EEmulatorHalIntProperty,(TAny*)"rawip_KMaxRxIPPacketSize",&iMaxRxPacketSize); #endif + OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_BASECONSTRUCTL_2, "RawIp ini file %S not found. Default values will be used.", KRawIpIniFile); } void CBcaController::UpdateInternalFlowFlag(TFlowControl aValue) @@ -101,13 +109,12 @@ * @param aValue the new state of iInternalFlow */ { - _LOG_L1C3(_L8("CBcaController::UpdateInternalFlowFlag[NewValue=%d, iSendState=%d]"), - aValue, iSendState); + OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_UPDATEINTERNALFLOWFLAG_1, "CBcaController::UpdateInternalFlowFlag[NewValue=%d, iSendState=%d]",aValue, iSendState); if(iTxFlowControl == aValue) { // C32 Sent the same indication signal twice. Nif will ignore it. - _LOG_L2C1(_L8("WARNING CBcaController: Received same indication twice")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_UPDATEINTERNALFLOWFLAG_2, "WARNING CBcaController: Received same indication twice"); return; } @@ -139,8 +146,7 @@ * @param aValue the new state of iTxContextState */ { - _LOG_L1C3(_L8("CBcaController::UpdateContextStateFlag[NewValue=%d, OldValue=%d]"), - aValue, iTxContextActive); + OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_UPDATECONTEXTSTATEFLAG_1, "CBcaController::UpdateContextStateFlag[NewValue=%d, OldValue=%d]",aValue, iTxContextActive); if(iTxContextActive == aValue) { @@ -175,12 +181,12 @@ * @param aPdu a data packet */ { - _LOG_L1C1(_L8(">>CBcaController::Send")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_SEND_1, ">>CBcaController::Send"); // Check if NIF is shutting down if (iSendState == EShuttingDown) { - _LOG_L2C1(_L8(" ERROR: Nif is shutting down")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_SEND_2, " ERROR: Nif is shutting down"); aPdu.Free(); @@ -191,8 +197,8 @@ // add it to our queue if ((aPdu.Length() - aPdu.First()->Length()) > BcaSendBufferLength()) { - _LOG_L2C1(_L8("Packet is too large - discarding")); - _LOG_L1C1(_L8("< Error")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_SEND_3, "Packet is too large - discarding"); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_SEND_4, "< Error"); aPdu.Free(); return KErrArgument; @@ -206,14 +212,14 @@ // queue becomes full the IP layer shouldnt send any more packets until it is told to if (!IsSendQueueFull()) { - _LOG_L1C1(_L8(" Sender busy, appending packet to queue")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_SEND_5, " Sender busy, appending packet to queue"); //We know that flow control is off and context isnt suspended so can add to queue AppendToSendQueue(aPdu); return IsSendQueueFull() ? KStopSending : KContinueSending; } - _LOG_L1C1(_L8(" Queue is full, upper layer is still sending packets, potential memory problems.")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_SEND_6, " Queue is full, upper layer is still sending packets, potential memory problems."); AppendToSendQueue(aPdu); return KStopSending; } @@ -227,12 +233,12 @@ //make sure that we don't change the order of packets! //first send what has already been lined up RMBufChain tmpPdu; - _LOG_L1C1(_L8(" Packet removed from queue to send")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_SEND_7, " Packet removed from queue to send"); RemoveFromSendQueue(tmpPdu); AppendToSendQueue(aPdu); // Update module state - _LOG_L2C1(_L8(" set State to ESending")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_SEND_8, " set State to ESending"); iSendState = ESending; BcaSend(tmpPdu); @@ -240,13 +246,13 @@ else { // Update module state - _LOG_L2C1(_L8(" set State to ESending")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_SEND_9, " set State to ESending"); iSendState = ESending; BcaSend(aPdu); } - _LOG_L2C1(_L8("<>CBcaController::Process")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_PROCESS_1, ">>CBcaController::Process"); TInt ret; @@ -299,7 +304,7 @@ if (ret != KErrNone) { // Couldn't create package. Packet will be ignored... - _LOG_L1C2(_L8("<SetType(aType); } @@ -368,7 +373,7 @@ * Used to add the IP header to the packet before sending to the BCA. */ { - _LOG_L1C1(_L8("CBcaController::AddHeader")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_ADDHEADER_1, "CBcaController::AddHeader"); iIPTagHeader->AddHeader(aDes); } @@ -380,7 +385,7 @@ * @return The IP header that has been removed from the packet */ { - _LOG_L1C1(_L8("CBcaController::RemoveHeader")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_REMOVEHEADER_1, "CBcaController::RemoveHeader"); return (iIPTagHeader->RemoveHeader(aPdu)); }