diff -r f92a4f87e424 -r 012cc2ee6408 usbmgmt/usbmgr/device/classdrivers/acm/classimplementation/ecacm/src/RegistrationPort.cpp --- a/usbmgmt/usbmgr/device/classdrivers/acm/classimplementation/ecacm/src/RegistrationPort.cpp Tue Aug 31 17:01:47 2010 +0300 +++ b/usbmgmt/usbmgr/device/classdrivers/acm/classimplementation/ecacm/src/RegistrationPort.cpp Wed Sep 01 12:35:00 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 1997-2009 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" @@ -15,18 +15,18 @@ * */ -#include #include "RegistrationPort.h" #include "AcmConstants.h" #include "AcmUtils.h" +#include #include "acmcontroller.h" +#include #include "acmserverconsts.h" -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "RegistrationPortTraces.h" + +#ifdef __FLOG_ACTIVE +_LIT8(KLogComponent, "ECACM"); #endif - CRegistrationPort* CRegistrationPort::NewL(MAcmController& aAcmController, TUint aUnit) /** @@ -37,12 +37,12 @@ * @return Ownership of a newly created CRegistrationPort object */ { - OstTraceFunctionEntry0( CREGISTRATIONPORT_NEWL_ENTRY ); + LOG_STATIC_FUNC_ENTRY + CRegistrationPort* self = new(ELeave) CRegistrationPort(aAcmController); CleanupClosePushL(*self); self->ConstructL(aUnit); CleanupStack::Pop(); - OstTraceFunctionExit0( CREGISTRATIONPORT_NEWL_EXIT ); return self; } @@ -53,16 +53,11 @@ * @param aUnit The port number. */ { - OstTraceFunctionEntry0( CREGISTRATIONPORT_CONSTRUCTL_ENTRY ); + LOG_FUNC + TName name; name.Num(aUnit); - TInt err = SetName(&name); - if (err < 0) - { - OstTrace1( TRACE_NORMAL, CREGISTRATIONPORT_CONSTRUCTL, "CRegistrationPort::ConstructL;err=%d", err ); - User::Leave(err); - } - OstTraceFunctionExit0( CREGISTRATIONPORT_CONSTRUCTL_EXIT ); + LEAVEIFERRORL(SetName(&name)); } CRegistrationPort::CRegistrationPort(MAcmController& aAcmController) @@ -73,8 +68,6 @@ */ : iAcmController(aAcmController) { - OstTraceFunctionEntry0( CREGISTRATIONPORT_CREGISTRATIONPORT_CONS_ENTRY ); - OstTraceFunctionExit0( CREGISTRATIONPORT_CREGISTRATIONPORT_CONS_EXIT ); } void CRegistrationPort::StartRead(const TAny* /*aClientBuffer*/, @@ -86,9 +79,9 @@ * @param aLength number of bytes to read */ { - OstTraceFunctionEntry0( CREGISTRATIONPORT_STARTREAD_ENTRY ); + LOG_FUNC + ReadCompleted(KErrNotSupported); - OstTraceFunctionExit0( CREGISTRATIONPORT_STARTREAD_EXIT ); } void CRegistrationPort::ReadCancel() @@ -96,9 +89,9 @@ * Cancel a read */ { - OstTraceFunctionEntry0( CREGISTRATIONPORT_READCANCEL_ENTRY ); + LOG_FUNC + ReadCompleted(KErrNotSupported); - OstTraceFunctionExit0( CREGISTRATIONPORT_READCANCEL_EXIT ); } @@ -110,8 +103,8 @@ * @return KErrNotSupported always. */ { - OstTraceFunctionEntry0( CREGISTRATIONPORT_QUERYRECEIVEBUFFER_ENTRY ); - OstTraceFunctionExit0( CREGISTRATIONPORT_QUERYRECEIVEBUFFER_EXIT ); + LOG_FUNC + return KErrNotSupported; } @@ -121,8 +114,7 @@ * Not supported. */ { - OstTraceFunctionEntry0( CREGISTRATIONPORT_RESETBUFFERS_ENTRY ); - OstTraceFunctionExit0( CREGISTRATIONPORT_RESETBUFFERS_EXIT ); + LOG_FUNC } void CRegistrationPort::StartWrite(const TAny* /*aClientBuffer*/, @@ -134,9 +126,9 @@ * @param aLength number of bytes to write */ { - OstTraceFunctionEntry0( CREGISTRATIONPORT_STARTWRITE_ENTRY ); + LOG_FUNC + WriteCompleted(KErrNotSupported); - OstTraceFunctionExit0( CREGISTRATIONPORT_STARTWRITE_EXIT ); } void CRegistrationPort::WriteCancel() @@ -144,9 +136,9 @@ * Cancel a pending write */ { - OstTraceFunctionEntry0( CREGISTRATIONPORT_WRITECANCEL_ENTRY ); + LOG_FUNC + WriteCompleted(KErrNotSupported); - OstTraceFunctionExit0( CREGISTRATIONPORT_WRITECANCEL_EXIT ); } void CRegistrationPort::Break(TInt /*aTime*/) @@ -156,9 +148,9 @@ * @param aTime Length of break in microseconds */ { - OstTraceFunctionEntry0( CREGISTRATIONPORT_BREAK_ENTRY ); + LOG_FUNC + BreakCompleted(KErrNotSupported); - OstTraceFunctionExit0( CREGISTRATIONPORT_BREAK_EXIT ); } void CRegistrationPort::BreakCancel() @@ -166,8 +158,7 @@ * Cancel a pending break. */ { - OstTraceFunctionEntry0( CREGISTRATIONPORT_BREAKCANCEL_ENTRY ); - OstTraceFunctionExit0( CREGISTRATIONPORT_BREAKCANCEL_EXIT ); + LOG_FUNC } TInt CRegistrationPort::GetConfig(TDes8& /*aDes*/) const @@ -178,8 +169,8 @@ * @return Error */ { - OstTraceFunctionEntry0( CREGISTRATIONPORT_GETCONFIG_ENTRY ); - OstTraceFunctionExit0( CREGISTRATIONPORT_GETCONFIG_EXIT ); + LOG_FUNC + return KErrNotSupported; } @@ -191,8 +182,8 @@ * @return Error */ { - OstTraceFunctionEntry0( CREGISTRATIONPORT_SETCONFIG_ENTRY ); - OstTraceFunctionExit0( CREGISTRATIONPORT_SETCONFIG_EXIT ); + LOG_FUNC + return KErrNotSupported; } @@ -204,8 +195,8 @@ * @return Error */ { - OstTraceFunctionEntry0( CREGISTRATIONPORT_SETSERVERCONFIG_ENTRY ); - OstTraceFunctionExit0( CREGISTRATIONPORT_SETSERVERCONFIG_EXIT ); + LOG_FUNC + return KErrNotSupported; } @@ -217,8 +208,8 @@ * @return Error */ { - OstTraceFunctionEntry0( CREGISTRATIONPORT_GETSERVERCONFIG_ENTRY ); - OstTraceFunctionExit0( CREGISTRATIONPORT_GETSERVERCONFIG_EXIT ); + LOG_FUNC + return KErrNotSupported; } @@ -230,8 +221,8 @@ * @return Error */ { - OstTraceFunctionEntry0( CREGISTRATIONPORT_GETCAPS_ENTRY ); - OstTraceFunctionExit0( CREGISTRATIONPORT_GETCAPS_EXIT ); + LOG_FUNC + return KErrNotSupported; } @@ -243,8 +234,8 @@ * @return Error */ { - OstTraceFunctionEntry0( CREGISTRATIONPORT_GETSIGNALS_ENTRY ); - OstTraceFunctionExit0( CREGISTRATIONPORT_GETSIGNALS_EXIT ); + LOG_FUNC + return KErrNotSupported; } @@ -260,8 +251,7 @@ * @return Error */ { - OstTraceFunctionEntry0( CREGISTRATIONPORT_SETSIGNALSTOMARK_ENTRY ); - OstTrace1( TRACE_NORMAL, CREGISTRATIONPORT_SETSIGNALSTOMARK, "CRegistrationPort::SetSignalsToMark;aAcmField = 0x%x", aAcmField ); + LOGTEXT2(_L8(">>CRegistrationPort::SetSignalsToMark aAcmField = 0x%x"), aAcmField); // Extract number of interfaces and protocol number // low 2 bytes represent the number of ACMs @@ -275,8 +265,8 @@ protocolNumber = protocolNumber ? protocolNumber : KDefaultAcmProtocolNum; TInt ret = iAcmController.CreateFunctions(interfaces, protocolNumber, KControlIfcName, KDataIfcName); - OstTrace1( TRACE_NORMAL, CREGISTRATIONPORT_SETSIGNALSTOMARK_DUP1, "CRegistrationPort::SetSignalsToMark;ret=%d", ret ); - OstTraceFunctionExit0( CREGISTRATIONPORT_SETSIGNALSTOMARK_EXIT ); + + LOGTEXT2(_L8("<>CRegistrationPort::SetSignalsToSpace aNoAcms = %d"), aNoAcms); + iAcmController.DestroyFunctions(aNoAcms); - OstTrace0( TRACE_NORMAL, CREGISTRATIONPORT_SETSIGNALSTOSPACE_DUP1, "CRegistrationPort::SetSignalsToSpace;ret = KErrNone" ); - OstTraceFunctionExit0( CREGISTRATIONPORT_SETSIGNALSTOSPACE_EXIT ); + + LOGTEXT(_L8("<