# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1273587488 -10800 # Node ID 4284d6390a828493d1c0fc74c54a562b182b337e # Parent 2492a6e4aed7213087a144605f150b40737a0ac8 Revision: 201019 Kit: 201019 diff -r 2492a6e4aed7 -r 4284d6390a82 telephonyprotocols/csdagt/src/ND_DIRCT.CPP --- a/telephonyprotocols/csdagt/src/ND_DIRCT.CPP Tue Apr 27 17:51:07 2010 +0300 +++ b/telephonyprotocols/csdagt/src/ND_DIRCT.CPP Tue May 11 17:18:08 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2003-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" @@ -90,10 +90,18 @@ iDbAccess->GetCommPortRoleL(role); TInt len; iDbAccess->GetScriptDetailsL(iUseScript,len); + if (!iUseScript || len==0) { // set them consistently iUseScript=EFalse; } + + if (iNdScript != NULL) + { + delete iNdScript; + iNdScript = NULL; + } + iNdScript=CNetDialScript::NewL(iDbAccess,iDlgPrc,commPort,role,len); // create it whatever because we need other stuff } diff -r 2492a6e4aed7 -r 4284d6390a82 telephonyprotocols/csdagt/src/Nd_Bases.cpp --- a/telephonyprotocols/csdagt/src/Nd_Bases.cpp Tue Apr 27 17:51:07 2010 +0300 +++ b/telephonyprotocols/csdagt/src/Nd_Bases.cpp Tue May 11 17:18:08 2010 +0300 @@ -29,7 +29,8 @@ // Netdial SM base class CNetdialSM::CNetdialSM(MAgentNotify& aControllerObserver, CDialogProcessor* aDlgPrc, CCommsDbAccess& aDbAccess) - : CAgentSMBase(aControllerObserver,aDlgPrc,aDbAccess) + : CAgentSMBase(aControllerObserver,aDlgPrc,aDbAccess), + iNdScript(NULL) /** Constructor. diff -r 2492a6e4aed7 -r 4284d6390a82 telephonyprotocols/pdplayer/group/bld.inf --- a/telephonyprotocols/pdplayer/group/bld.inf Tue Apr 27 17:51:07 2010 +0300 +++ b/telephonyprotocols/pdplayer/group/bld.inf Tue May 11 17:18:08 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-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" @@ -30,7 +30,7 @@ PRJ_TESTMMPFILES -#include "..\test\controlplane\group\bld.inf" +#include "../test/controlplane/group/BLD.INF" #endif diff -r 2492a6e4aed7 -r 4284d6390a82 telephonyprotocols/pdplayer/group/pdp.mmp --- a/telephonyprotocols/pdplayer/group/pdp.mmp Tue Apr 27 17:51:07 2010 +0300 +++ b/telephonyprotocols/pdplayer/group/pdp.mmp Tue May 11 17:18:08 2010 +0300 @@ -25,6 +25,9 @@ UID 0x10009D8D 0x102822EF VENDORID 0x70000001 +//PDP logging in commsdbg.ini is enabled with 'LOG SPUD *' +MACRO _INFO_LOG +MACRO _ERROR_LOG SOURCEPATH ../src SOURCE PDPSCPRStates.cpp diff -r 2492a6e4aed7 -r 4284d6390a82 telephonyprotocols/pdplayer/inc/PDPSCPR.h --- a/telephonyprotocols/pdplayer/inc/PDPSCPR.h Tue Apr 27 17:51:07 2010 +0300 +++ b/telephonyprotocols/pdplayer/inc/PDPSCPR.h Tue May 11 17:18:08 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-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" @@ -58,6 +58,7 @@ class TRetrieveSipAddr; class TModifyActivePDPContext; class TSetMbmsParameters; + class TCleanupFSM; } namespace PDPSCprActivities @@ -93,6 +94,7 @@ friend class PDPSCprStates::TRetrieveSipAddr; friend class PDPSCprStates::TSetMbmsParameters; friend class PDPSCprStates::TModifyActivePDPContext; + friend class PDPSCprStates::TCleanupFSM; public: diff -r 2492a6e4aed7 -r 4284d6390a82 telephonyprotocols/pdplayer/inc/PDPSCPRStates.h --- a/telephonyprotocols/pdplayer/inc/PDPSCPRStates.h Tue Apr 27 17:51:07 2010 +0300 +++ b/telephonyprotocols/pdplayer/inc/PDPSCPRStates.h Tue May 11 17:18:08 2010 +0300 @@ -377,6 +377,16 @@ virtual TInt TransitionTag(); DECLARE_SMELEMENT_FOOTER( TNoTagOrProviderStopped ) +DECLARE_SMELEMENT_HEADER( TCleanupFSM, MeshMachine::TStateTransition, NetStateMachine::MStateTransition, PDPSCprStates::TContext) + virtual void DoL(); +DECLARE_SMELEMENT_FOOTER( TCleanupFSM) + +DECLARE_AGGREGATED_TRANSITION2( + TCleanupFSMAndDataClients, + PDPSCprStates::TCleanupFSM, + PRStates::TDestroyOrphanedDataClients + ) + //=========================================================== // Sip Address retrieval diff -r 2492a6e4aed7 -r 4284d6390a82 telephonyprotocols/pdplayer/src/PDPDeftSCPR.cpp --- a/telephonyprotocols/pdplayer/src/PDPDeftSCPR.cpp Tue Apr 27 17:51:07 2010 +0300 +++ b/telephonyprotocols/pdplayer/src/PDPDeftSCPR.cpp Tue May 11 17:18:08 2010 +0300 @@ -65,7 +65,7 @@ NODEACTIVITY_ENTRY(KNoTag, SCprStates::TStopYourFlows, CoreNetStates::TAwaitingDataClientStopped, MeshMachine::TTag) THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KNoDataClientsToStop, MeshMachine::TDoNothing, PDPSCprStates::TNoTagOrProviderStopped) NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TDestroyPDPContext, PDPSCprStates::TAwaitingPDPContextDestroyed, MeshMachine::TTag) - THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PRStates::TDestroyOrphanedDataClients, MeshMachine::TTag) + THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PDPSCprStates::TCleanupFSMAndDataClients, MeshMachine::TTag) LAST_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, MeshMachine::TRaiseActivityError) NODEACTIVITY_END() } @@ -103,21 +103,21 @@ // to TRejoin, whereas TRejoin doesn't mean swap - suggesting to // introduce PDP level msg: TRejoinAndSwap. DECLARE_DEFINE_CUSTOM_NODEACTIVITY(ECFActivityGoneDown, PDPDeftSCprGoneDown, TPDPMessages::TPDPFSMMessage, PDPSCprStates::CPrimaryPDPGoneDownActivity::NewL) - FIRST_NODEACTIVITY_ENTRY(PDPSCprStates::TAwaitingPDPContextGoneDown, MeshMachine::TActiveOrNoTag) - THROUGH_NODEACTIVITY_ENTRY(KNoTag, MeshMachine::TDoNothing, PDPSCprStates::CPrimaryPDPGoneDownActivity::TNoTagOrProviderStopped) + FIRST_NODEACTIVITY_ENTRY(PDPSCprStates::TAwaitingPDPContextGoneDown, MeshMachine::TActiveOrNoTag) + THROUGH_NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TCleanupFSM, PDPSCprStates::CPrimaryPDPGoneDownActivity::TNoTagOrProviderStopped) THROUGH_NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TStoreOriginalDataClient, MeshMachine::TNoTag) - NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TRejoinDataClient, CoreNetStates::TAwaitingRejoinDataClientComplete, MeshMachine::TNoTag) - NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TApplyNewDefault, TAwaitingApplyResponseOrError, MeshMachine::TNoTag) - THROUGH_NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TSwitchToNewDefault, MeshMachine::TNoTag) - NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TStopOriginalDataClient, CoreNetStates::TAwaitingDataClientStopped, MeshMachine::TNoTag) - - LAST_NODEACTIVITY_ENTRY(KNoTag, MeshMachine::TClearError) - THROUGH_NODEACTIVITY_ENTRY(KActiveTag, MeshMachine::TDoNothing, PDPSCprStates::TNoTagOrContentionTag) - //Awaiting for contention result, do not stop the start activity. - LAST_NODEACTIVITY_ENTRY(PDPSCprStates::KContentionTag, MeshMachine::TDoNothing) - - LAST_NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TCancelDataClientStartInPDP) - + NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TRejoinDataClient, CoreNetStates::TAwaitingRejoinDataClientComplete, MeshMachine::TNoTag) + NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TApplyNewDefault, TAwaitingApplyResponseOrError, MeshMachine::TNoTag) + THROUGH_NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TSwitchToNewDefault, MeshMachine::TNoTag) + NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TStopOriginalDataClient, CoreNetStates::TAwaitingDataClientStopped, MeshMachine::TNoTag) + + LAST_NODEACTIVITY_ENTRY(KNoTag, MeshMachine::TClearError) + THROUGH_NODEACTIVITY_ENTRY(KActiveTag, MeshMachine::TDoNothing, PDPSCprStates::TNoTagOrContentionTag) + //Awaiting for contention result, do not stop the start activity. + LAST_NODEACTIVITY_ENTRY(PDPSCprStates::KContentionTag, MeshMachine::TDoNothing) + + LAST_NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TCancelDataClientStartInPDP) + NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, CoreNetStates::TStopSelf, CoreNetStates::TAwaitingDataClientStopped, MeshMachine::TTag) LAST_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PDPSCprStates::TSendGoneDown) NODEACTIVITY_END() diff -r 2492a6e4aed7 -r 4284d6390a82 telephonyprotocols/pdplayer/src/PDPSCPR.cpp --- a/telephonyprotocols/pdplayer/src/PDPSCPR.cpp Tue Apr 27 17:51:07 2010 +0300 +++ b/telephonyprotocols/pdplayer/src/PDPSCPR.cpp Tue May 11 17:18:08 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-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" @@ -91,7 +91,7 @@ NODEACTIVITY_ENTRY(KNoTag, SCprStates::TStopYourFlows, CoreNetStates::TAwaitingDataClientStopped, MeshMachine::TTag) THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KNoDataClientsToStop, MeshMachine::TDoNothing, PDPSCprStates::TNoTagOrProviderStopped) NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TDestroyPDPContext, PDPSCprStates::TAwaitingPDPContextDestroyed, MeshMachine::TTag) - THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PRStates::TDestroyOrphanedDataClients, MeshMachine::TTag) + THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PDPSCprStates::TCleanupFSMAndDataClients, MeshMachine::TTag) LAST_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, MeshMachine::TRaiseActivityError) NODEACTIVITY_END() } @@ -106,7 +106,7 @@ NODEACTIVITY_ENTRY(KNoTag, SCprStates::TStopYourFlows, CoreNetStates::TAwaitingDataClientStopped, MeshMachine::TTag) THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, MeshMachine::TDoNothing, PDPSCprStates::TNoTagOrProviderStopped) NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TDestroyPDPContext, PDPSCprStates::TAwaitingPDPContextDestroyed, MeshMachine::TTag) - THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PRStates::TDestroyOrphanedDataClients, MeshMachine::TTag) + THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PDPSCprStates::TCleanupFSMAndDataClients, MeshMachine::TTag) LAST_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PDPSCprStates::TSendDataClientStopped) NODEACTIVITY_END() } diff -r 2492a6e4aed7 -r 4284d6390a82 telephonyprotocols/pdplayer/src/PDPSCPRStates.cpp --- a/telephonyprotocols/pdplayer/src/PDPSCPRStates.cpp Tue Apr 27 17:51:07 2010 +0300 +++ b/telephonyprotocols/pdplayer/src/PDPSCPRStates.cpp Tue May 11 17:18:08 2010 +0300 @@ -226,7 +226,9 @@ //It's not legal for the qos defaults to be absent. CDefaultPacketQoSProvision* defaultQoS = NULL; + TRAPD(ret, defaultQoS = CDefaultPacketQoSProvision::NewL(aIapView)); + if ((KErrNone == ret) && defaultQoS) { CleanupStack::PushL(defaultQoS); @@ -658,115 +660,192 @@ User::LeaveIfError(tNode.iProvisionFailure); ASSERT(tNode.iPdpFsmInterface); - - iContext.Node().PostToClients( + + tNode.PostToClients( iContext.NodeId(), TCFMessage::TStateChange( Elements::TStateChange(KPsdStartingConfiguration, KErrNone)).CRef(), TClientType(TCFClientType::ECtrlProvider)); - - CGPRSProvision* gprsProvision = const_cast(static_cast( - iContext.Node().AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CGPRSProvision::EUid,CGPRSProvision::ETypeId)))); - - //retrieve QoS (should be provisioned, but can also be overriden with SetParams). - RPacketQoS::TQoSR5Requested qosOverridenParams; - const RPacketQoS::TQoSR5Requested* qosParams = NULL; - if (! iContext.Node().iParameterBundle.IsNull() && ! iContext.Node().iParameterBundle.FindFamily(KSubConQoSFamily).IsNull()) - { - MPDPParamMapper::MapQosParamBundleToEtelL(iContext.Node().iParameterBundle, qosOverridenParams); - qosParams = &qosOverridenParams; - } - else - { - const CDefaultPacketQoSProvision* defaultQoSProvision = static_cast( - iContext.Node().AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CDefaultPacketQoSProvision::EUid,CDefaultPacketQoSProvision::ETypeId))); - qosParams = defaultQoSProvision ? &defaultQoSProvision->iParams : NULL; - + + CGPRSProvision* gprsProvision = const_cast(static_cast( + tNode.AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CGPRSProvision::EUid,CGPRSProvision::ETypeId)))); + + if (gprsProvision == NULL) + { + User::Leave(KErrCorrupt); + } + + //retrieve QoS (should be provisioned, but can also be overriden with SetParams). + RPacketQoS::TQoSR5Requested qosOverridenParams; + + const RPacketQoS::TQoSR5Requested* qosParams = NULL; + + if ((!tNode.iParameterBundle.IsNull()) &&\ + (!tNode.iParameterBundle.FindFamily(KSubConQoSFamily).IsNull())) + { + MPDPParamMapper::MapQosParamBundleToEtelL(tNode.iParameterBundle, qosOverridenParams); + qosParams = &qosOverridenParams; + } + else + { + const CDefaultPacketQoSProvision* defaultQoSProvision = static_cast( + tNode.AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CDefaultPacketQoSProvision::EUid,CDefaultPacketQoSProvision::ETypeId))); + + if (defaultQoSProvision) + { + qosParams = &defaultQoSProvision->iParams; + } + else + { + User::Leave(KErrCorrupt); + } + //Here we're taking the qos defaults from the provision info, hence skipping the iParameterBundle. //The lack of iParameterBundle however and the respective ERequested params is badly tolerated by the rest //of the code (e.g.: when subsequently raising granted params it is assumed something has been requested). - //Let's create a phoney requested params. - //iContext.Node().CreateParameterBundleL(); - //RParameterFamily family = iContext.Node().iParameterBundle.CreateFamilyL(KSubConQoSFamily); //PJLEFT - - RCFParameterFamilyBundle newBundle; - newBundle.CreateL(); - iContext.Node().iParameterBundle.Open(newBundle); - RParameterFamily family = newBundle.CreateFamilyL(KSubConQoSFamily); - CSubConQosGenericParamSet::NewL(family, RParameterFamily::ERequested); - } - TTFTInfo tft; //We'll use empty/thus default TFT - if (gprsProvision == NULL || qosParams == NULL) - { - User::Leave(KErrCorrupt); - } - - const CImsExtProvision* imsprov = static_cast( - iContext.Node().AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CImsExtProvision::EUid, CImsExtProvision::ETypeId))); - - TRAP_IGNORE(iContext.Node().iIsModeGsm = IsModeGsmL()); - - switch (gprsProvision->UmtsGprsRelease()) - { - case TPacketDataConfigBase::KConfigGPRS: - { - SetImsSignallingFlagL(gprsProvision->GetScratchContextAs().iProtocolConfigOption, imsprov->iImsSignalIndicator); + + // These parameter bundles are also used in a situation when a context has failed to create because of a lack + // of modem / network resources, as the SCPR isn't torn down, the parameter bundles need to hold the + // information of the default QoS otherwise bad things happen [bad QoS]. + + RCFParameterFamilyBundle newBundle; + newBundle.CreateL(); + tNode.iParameterBundle.Open(newBundle); + RParameterFamily family = newBundle.CreateFamilyL(KSubConQoSFamily); + + TInt tRelease = gprsProvision->UmtsGprsRelease(); + + CSubConQosR99ParamSet* extRequestedR99 = NULL; + CSubConQosR99ParamSet* extAcceptableR99 = NULL; + CSubConQosR5ParamSet* extRequestedR5 = NULL; + CSubConQosR5ParamSet* extAcceptableR5 = NULL; + + if (tRelease == TPacketDataConfigBase::KConfigRel5) + { + // R5 - basically R4 + a few parameters + + extRequestedR5 = CSubConQosR5ParamSet::NewL(family,RParameterFamily::ERequested); + extAcceptableR5 = CSubConQosR5ParamSet::NewL(family,RParameterFamily::EAcceptable); - // Only request SIP server address retrieval when network not in GSM/GPRS mode - // e.g. UMTS/WCDMA - if (!iContext.Node().iIsModeGsm) - { - SetupSipServerAddrRetrievalL(gprsProvision->GetScratchContextAs().iProtocolConfigOption); - } - - SetChapInformationL(gprsProvision->GetScratchContextAs().iProtocolConfigOption); - - } - break; - - case TPacketDataConfigBase::KConfigRel5: - case TPacketDataConfigBase::KConfigRel99Rel4: - { - SetImsSignallingFlagL(gprsProvision->GetScratchContextAs().iProtocolConfigOption, imsprov->iImsSignalIndicator); - - // Only request SIP server address retrieval when network not in GSM/GPRS mode - // e.g. UMTS/WCDMA - if (!iContext.Node().iIsModeGsm) - { - SetupSipServerAddrRetrievalL(gprsProvision->GetScratchContextAs().iProtocolConfigOption); - } - - SetChapInformationL(gprsProvision->GetScratchContextAs().iProtocolConfigOption); - - } - break; - } - - iContext.Node().iPDPFsmContextId = iContext.Node().iPdpFsmInterface->NewFsmContextL(iContext.Node(),SpudMan::EPrimary); - - iContext.Node().PostToClients( + // Requested QoS Parameters + extRequestedR5->SetSourceStatisticsDescriptor(qosParams->iSourceStatisticsDescriptor); + extRequestedR5->SetSignallingIndicator(qosParams->iSignallingIndication); + + extRequestedR99 = dynamic_cast(extRequestedR5); + + // Acceptable QoS Parameters + + extAcceptableR5->SetSourceStatisticsDescriptor(qosParams->iSourceStatisticsDescriptor); + extAcceptableR5->SetSignallingIndicator(qosParams->iSignallingIndication); + + extAcceptableR99 = dynamic_cast(extAcceptableR5); + + } + else + { + // R4 and R99 + extRequestedR99 = CSubConQosR99ParamSet::NewL(family,RParameterFamily::ERequested); + extAcceptableR99 = CSubConQosR99ParamSet::NewL(family,RParameterFamily::EAcceptable); + } + + // Requested QoS Parameters + extRequestedR99->SetTrafficClass(qosParams->iReqTrafficClass); + extRequestedR99->SetDeliveryOrder(qosParams->iReqDeliveryOrderReqd); + extRequestedR99->SetErroneousSDUDelivery(qosParams->iReqDeliverErroneousSDU); + extRequestedR99->SetResidualBitErrorRatio(qosParams->iReqBER); + extRequestedR99->SetSDUErrorRatio(qosParams->iReqSDUErrorRatio); + extRequestedR99->SetTrafficHandlingPriority(qosParams->iReqTrafficHandlingPriority); + extRequestedR99->SetTransferDelay(qosParams->iReqTransferDelay); + extRequestedR99->SetMaxSduSize(qosParams->iReqMaxSDUSize); + extRequestedR99->SetMaxBitrateUplink(qosParams->iReqMaxRate.iUplinkRate); + extRequestedR99->SetMaxBitrateDownlink(qosParams->iReqMaxRate.iDownlinkRate); + extRequestedR99->SetGuaBitrateUplink(qosParams->iReqGuaranteedRate.iUplinkRate); + extRequestedR99->SetGuaBitrateDownlink(qosParams->iReqGuaranteedRate.iDownlinkRate); + + // Acceptable QoS Parameters + extAcceptableR99->SetTrafficClass(qosParams->iMinTrafficClass); + extAcceptableR99->SetDeliveryOrder(qosParams->iMinDeliveryOrderReqd); + extAcceptableR99->SetErroneousSDUDelivery(qosParams->iMinDeliverErroneousSDU); + extAcceptableR99->SetResidualBitErrorRatio(qosParams->iMaxBER); + extAcceptableR99->SetSDUErrorRatio(qosParams->iMaxSDUErrorRatio); + extAcceptableR99->SetTrafficHandlingPriority(qosParams->iMinTrafficHandlingPriority); + extAcceptableR99->SetTransferDelay(qosParams->iMaxTransferDelay); + extAcceptableR99->SetMaxSduSize(qosParams->iMinAcceptableMaxSDUSize); + extAcceptableR99->SetMaxBitrateUplink(qosParams->iMinAcceptableMaxRate.iUplinkRate); + extAcceptableR99->SetMaxBitrateDownlink(qosParams->iMinAcceptableMaxRate.iDownlinkRate); + extAcceptableR99->SetGuaBitrateUplink(qosParams->iMinGuaranteedRate.iUplinkRate); + extAcceptableR99->SetGuaBitrateDownlink(qosParams->iMinGuaranteedRate.iDownlinkRate); + + } + + TTFTInfo tft; //We'll use empty/thus default TFT + + const CImsExtProvision* imsprov = static_cast( + tNode.AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CImsExtProvision::EUid, CImsExtProvision::ETypeId))); + + TRAP_IGNORE(tNode.iIsModeGsm = IsModeGsmL()); + + switch (gprsProvision->UmtsGprsRelease()) + { + case TPacketDataConfigBase::KConfigGPRS: + { + SetImsSignallingFlagL(gprsProvision->GetScratchContextAs().iProtocolConfigOption, imsprov->iImsSignalIndicator); + + // Only request SIP server address retrieval when network not in GSM/GPRS mode + // e.g. UMTS/WCDMA + if (!tNode.iIsModeGsm) + { + SetupSipServerAddrRetrievalL(gprsProvision->GetScratchContextAs().iProtocolConfigOption); + } + + SetChapInformationL(gprsProvision->GetScratchContextAs().iProtocolConfigOption); + + } + break; + + case TPacketDataConfigBase::KConfigRel5: + case TPacketDataConfigBase::KConfigRel99Rel4: + { + SetImsSignallingFlagL(gprsProvision->GetScratchContextAs().iProtocolConfigOption, imsprov->iImsSignalIndicator); + + // Only request SIP server address retrieval when network not in GSM/GPRS mode + // e.g. UMTS/WCDMA + if (!tNode.iIsModeGsm) + { + SetupSipServerAddrRetrievalL(gprsProvision->GetScratchContextAs().iProtocolConfigOption); + } + + SetChapInformationL(gprsProvision->GetScratchContextAs().iProtocolConfigOption); + + } + break; + } + + tNode.iPDPFsmContextId = tNode.iPdpFsmInterface->NewFsmContextL(tNode,SpudMan::EPrimary); + + tNode.PostToClients( iContext.NodeId(), TCFMessage::TStateChange( Elements::TStateChange(KPsdFinishedConfiguration, KErrNone)).CRef(), TClientType(TCFClientType::ECtrlProvider)); - - iContext.Node().PostToClients( + + tNode.PostToClients( iContext.NodeId(), TCFMessage::TStateChange( Elements::TStateChange(KPsdStartingActivation, KErrNone)).CRef(), TClientType(TCFClientType::ECtrlProvider)); - - ASSERT(iContext.Node().iPDPFsmContextId == KPrimaryContextId); - iContext.Node().iContextType=SpudMan::EPrimary; - iContext.Node().iPdpFsmInterface->Set(KPrimaryContextId, gprsProvision->GetScratchContextAs()); - //Set default QoS - iContext.Node().iPdpFsmInterface->Set(KPrimaryContextId, *qosParams); + + ASSERT(tNode.iPDPFsmContextId == KPrimaryContextId); + tNode.iContextType=SpudMan::EPrimary; + tNode.iPdpFsmInterface->Set(KPrimaryContextId, gprsProvision->GetScratchContextAs()); + //Set default QoS + tNode.iPdpFsmInterface->Set(KPrimaryContextId, *qosParams); //Set default TFTs - iContext.Node().iPdpFsmInterface->Set(KPrimaryContextId, tft); // ignore any error + tNode.iPdpFsmInterface->Set(KPrimaryContextId, tft); // ignore any error //Start the primary. - User::LeaveIfError(iContext.Node().iPdpFsmInterface->Input(KPrimaryContextId, SpudMan::ECreatePrimaryPDPContext)); + User::LeaveIfError(tNode.iPdpFsmInterface->Input(KPrimaryContextId, SpudMan::ECreatePrimaryPDPContext)); iContext.iNodeActivity->ClearPostedTo(); - iContext.Node().iActivityAwaitingResponse = iContext.iNodeActivity->ActivityId(); + tNode.iActivityAwaitingResponse = iContext.iNodeActivity->ActivityId(); } DEFINE_SMELEMENT(TOverrideProvision, NetStateMachine::MStateTransition, PDPSCprStates::TContext) @@ -1464,33 +1543,48 @@ iContext.Node().iActivityAwaitingResponse = iContext.iNodeActivity->ActivityId(); } +DEFINE_SMELEMENT(TCleanupFSM, NetStateMachine::MStateTransition, PDPSCprStates::TContext) +void TCleanupFSM::DoL() + { + CPDPSubConnectionProvider &tNode = static_cast(iContext.Node()); + + if (tNode.iPDPFsmContextId != CPDPSubConnectionProvider::EInvalidContextId) + { + + // removing the memory associated with the context - this should hopefully + // ensure that the memory allocations that happen afterwards can be + // accomplished without OOM errors + + tNode.iPdpFsmInterface->DeleteFsmContext(tNode.iPDPFsmContextId); + + if (tNode.ContentionRequested() == EFalse) + { + CSubConGenEventSubConDown* event = CSubConGenEventSubConDown::NewL(); + CleanupStack::PushL(event); + tNode.NotifyClientsL(*event); + CleanupStack::Pop(event); + } + + if (tNode.iPDPFsmContextId == KPrimaryContextId) + { + tNode.PostToClients( + iContext.NodeId(), + TCFMessage::TStateChange( + Elements::TStateChange(KPsdFinishedDeactivation, KErrNone)).CRef(), + TClientType(TCFClientType::ECtrlProvider)); + } + + tNode.iPDPFsmContextId = CPDPSubConnectionProvider::EInvalidContextId; + + } + } + + DEFINE_SMELEMENT(TAwaitingPDPContextDestroyed, NetStateMachine::MState, PDPSCprStates::TContext) TBool TAwaitingPDPContextDestroyed::Accept() { if (TAwaitingPDPFSMMessage::Accept(KContextDeleteEvent)) { - if (iContext.Node().iPDPFsmContextId != CPDPSubConnectionProvider::EInvalidContextId) - { - if (!iContext.Node().ContentionRequested()) - { - CSubConGenEventSubConDown* event = CSubConGenEventSubConDown::NewL(); - CleanupStack::PushL(event); - iContext.Node().NotifyClientsL(*event); - CleanupStack::Pop(event); - } - - if (iContext.Node().iPDPFsmContextId == KPrimaryContextId) - { - iContext.Node().PostToClients( - iContext.NodeId(), - TCFMessage::TStateChange( - Elements::TStateChange(KPsdFinishedDeactivation, KErrNone)).CRef(), - TClientType(TCFClientType::ECtrlProvider)); - } - - iContext.Node().iPdpFsmInterface->DeleteFsmContext(iContext.Node().iPDPFsmContextId); - iContext.Node().iPDPFsmContextId = CPDPSubConnectionProvider::EInvalidContextId; - } return ETrue; } return EFalse; diff -r 2492a6e4aed7 -r 4284d6390a82 telephonyprotocols/rawipnif/group/RawIPNif.mmp --- a/telephonyprotocols/rawipnif/group/RawIPNif.mmp Tue Apr 27 17:51:07 2010 +0300 +++ b/telephonyprotocols/rawipnif/group/RawIPNif.mmp Tue May 11 17:18:08 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-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" @@ -37,6 +37,8 @@ // DEFFILE RawIp.def +MACRO __BTT_LOGGING__ + SOURCEPATH ../src SOURCE RawIPFlow.cpp diff -r 2492a6e4aed7 -r 4284d6390a82 telephonyprotocols/rawipnif/group/RawIPNif2.mmp --- a/telephonyprotocols/rawipnif/group/RawIPNif2.mmp Tue Apr 27 17:51:07 2010 +0300 +++ b/telephonyprotocols/rawipnif/group/RawIPNif2.mmp Tue May 11 17:18:08 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-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" @@ -31,6 +31,8 @@ // DEFFILE RawIp2.def +MACRO __BTT_LOGGING__ + SOURCEPATH ../rawipnif2/src SOURCE BcaController.cpp SOURCE BinderBase.cpp diff -r 2492a6e4aed7 -r 4284d6390a82 telephonyprotocols/rawipnif/inc/Receiver.h --- a/telephonyprotocols/rawipnif/inc/Receiver.h Tue Apr 27 17:51:07 2010 +0300 +++ b/telephonyprotocols/rawipnif/inc/Receiver.h Tue May 11 17:18:08 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-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" @@ -37,7 +37,9 @@ // Inherited from CActive. virtual void RunL(); + virtual TInt RunError(TInt aError); virtual void DoCancel(); + void StartListening(); private: diff -r 2492a6e4aed7 -r 4284d6390a82 telephonyprotocols/rawipnif/inc/bttlog.h --- a/telephonyprotocols/rawipnif/inc/bttlog.h Tue Apr 27 17:51:07 2010 +0300 +++ b/telephonyprotocols/rawipnif/inc/bttlog.h Tue May 11 17:18:08 2010 +0300 @@ -77,16 +77,22 @@ #endif // __BTT_LOG_3__ #ifdef __BTT_LOG_1__ +#ifndef __BTT_LOGGING__ #define __BTT_LOGGING__ #endif +#endif -#ifdef __BTT_LOG_2__ +#ifdef __BTT_LOG_2__ +#ifndef __BTT_LOGGING__ #define __BTT_LOGGING__ #endif +#endif -#ifdef __BTT_LOG_3__ +#ifdef __BTT_LOG_3__ +#ifndef __BTT_LOGGING__ #define __BTT_LOGGING__ #endif +#endif #ifdef __BTT_LOGGING__ #define _BTT_LEAVEIFERROR(a) iTheLogger->VerboseLeaveL(__FILE__, __LINE__, a) diff -r 2492a6e4aed7 -r 4284d6390a82 telephonyprotocols/rawipnif/rawipnif2/inc/bttlog.h --- a/telephonyprotocols/rawipnif/rawipnif2/inc/bttlog.h Tue Apr 27 17:51:07 2010 +0300 +++ b/telephonyprotocols/rawipnif/rawipnif2/inc/bttlog.h Tue May 11 17:18:08 2010 +0300 @@ -77,16 +77,22 @@ #endif // __BTT_LOG_3__ #ifdef __BTT_LOG_1__ +#ifndef __BTT_LOGGING__ #define __BTT_LOGGING__ #endif +#endif #ifdef __BTT_LOG_2__ +#ifndef __BTT_LOGGING__ #define __BTT_LOGGING__ #endif +#endif #ifdef __BTT_LOG_3__ +#ifndef __BTT_LOGGING__ #define __BTT_LOGGING__ #endif +#endif #ifdef __BTT_LOGGING__ #define _BTT_LEAVEIFERROR(a) iTheLogger->VerboseLeaveL(__FILE__, __LINE__, a) diff -r 2492a6e4aed7 -r 4284d6390a82 telephonyprotocols/rawipnif/src/Receiver.cpp --- a/telephonyprotocols/rawipnif/src/Receiver.cpp Tue Apr 27 17:51:07 2010 +0300 +++ b/telephonyprotocols/rawipnif/src/Receiver.cpp Tue May 11 17:18:08 2010 +0300 @@ -143,6 +143,13 @@ } } +TInt CReceiver::RunError(TInt aError) + { + _LOG_L2C1(_L8("WARNING! CReceiver::RunError Read failed")); + iObserver.Stop(aError); + return KErrNone; + } + void CReceiver::DoCancel() /** * Cancel active request diff -r 2492a6e4aed7 -r 4284d6390a82 telephonyprotocols/rawipnif/version1/inc/bttlog.h --- a/telephonyprotocols/rawipnif/version1/inc/bttlog.h Tue Apr 27 17:51:07 2010 +0300 +++ b/telephonyprotocols/rawipnif/version1/inc/bttlog.h Tue May 11 17:18:08 2010 +0300 @@ -77,16 +77,22 @@ #endif // __BTT_LOG_3__ #ifdef __BTT_LOG_1__ +#ifndef __BTT_LOGGING__ #define __BTT_LOGGING__ #endif +#endif #ifdef __BTT_LOG_2__ +#ifndef __BTT_LOGGING__ #define __BTT_LOGGING__ #endif +#endif #ifdef __BTT_LOG_3__ +#ifndef __BTT_LOGGING__ #define __BTT_LOGGING__ #endif +#endif #ifdef __BTT_LOGGING__ #define _BTT_LEAVEIFERROR(a) iTheLogger->VerboseLeaveL(__FILE__, __LINE__, a) diff -r 2492a6e4aed7 -r 4284d6390a82 telephonyserverplugins/simtsy/inc/CSimMbmsPacketContext.h --- a/telephonyserverplugins/simtsy/inc/CSimMbmsPacketContext.h Tue Apr 27 17:51:07 2010 +0300 +++ b/telephonyserverplugins/simtsy/inc/CSimMbmsPacketContext.h Tue May 11 17:18:08 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-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" @@ -196,7 +196,7 @@ TInt GetMbmsSessionsPhase2(const TTsyReqHandle aTsyReqHandle, TClientId* aClient, TDes8* aBufSize); TInt GetMbmsSessionsCancel(const TTsyReqHandle aTsyReqHandle); - TInt UpdateMbmsSessionListL(const TTsyReqHandle aTsyReqHandle,TMbmsAction* aAction, TUint* aSessionId); + TInt UpdateMbmsSessionList(const TTsyReqHandle aTsyReqHandle,TMbmsAction* aAction, TUint* aSessionId); TInt UpdateMbmsSessionListCancel(const TTsyReqHandle aTsyReqHandle); TInt InitialiseContext(const TTsyReqHandle aTsyReqHandle, TDes8* aDataChannelV2Pckg); // This method supersedes the LoanCommPort() and RecoverCommPort() methods. diff -r 2492a6e4aed7 -r 4284d6390a82 telephonyserverplugins/simtsy/src/CSimMbmsPacketContext.cpp --- a/telephonyserverplugins/simtsy/src/CSimMbmsPacketContext.cpp Tue Apr 27 17:51:07 2010 +0300 +++ b/telephonyserverplugins/simtsy/src/CSimMbmsPacketContext.cpp Tue May 11 17:18:08 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-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" @@ -477,7 +477,7 @@ return GetStatus(aTsyReqHandle, REINTERPRET_CAST(RPacketContext::TContextStatus*, dataPtr)); case EPacketContextUpdateMbmsSessionList: - return UpdateMbmsSessionListL(aTsyReqHandle, + return UpdateMbmsSessionList(aTsyReqHandle, REINTERPRET_CAST(TMbmsAction*, dataPtr), REINTERPRET_CAST(TUint*, dataPtr2)); case EPacketContextInitialiseContext: @@ -1130,7 +1130,7 @@ return KErrNone; } -TInt CSimMbmsPacketContext::UpdateMbmsSessionListL(const TTsyReqHandle aTsyReqHandle,TMbmsAction* aAction, TUint* aSessionId) +TInt CSimMbmsPacketContext::UpdateMbmsSessionList(const TTsyReqHandle aTsyReqHandle,TMbmsAction* aAction, TUint* aSessionId) /** * client's interest in updating the MBMS session's list. * This is achieved by updating the list maintained internally by the context @@ -1141,7 +1141,7 @@ * @return KErrNone */ { - LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionListL called"); + LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionList called"); TInt error=KErrNone; iUpdateSessionHandle = aTsyReqHandle; @@ -1151,29 +1151,34 @@ switch(*aAction) { case SIMTSY_PACKET_MBMS_ADD_ENTRIES: - LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionListL Action: ADD "); - TRAP(error,iSessionIdList->AppendL(*aSessionId)); - if(error == KErrNone) - { - //iSessionIdList->At(0) = ++iNumOfSessionId; - iSessionIdList->Delete(0); - iSessionIdList->InsertL(0,++iNumOfSessionId); - iMbmsUpdateSessionTimer->Start(RandTime(),this,ETimerIdMbmsUpdateSessionId); - } - else + LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionList Action: ADD "); + + // TRAP can contain multiple statments + TRAP(error,iSessionIdList->AppendL(*aSessionId); + //iSessionIdList->At(0) = ++iNumOfSessionId; + iSessionIdList->Delete(0); + iSessionIdList->InsertL(0,++iNumOfSessionId)); + + iMbmsUpdateSessionTimer->Start(RandTime(),this,ETimerIdMbmsUpdateSessionId); + + if(error != KErrNone) { ReqCompleted(iUpdateSessionHandle,error); } break; case SIMTSY_PACKET_MBMS_REM_ENTRIES: - LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionListL Action: REMOVE "); + LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionList Action: REMOVE "); iSessionIdList->Find(*aSessionId,key,position); if(position != -1) { iSessionIdList->Delete(position); //iSessionIdList->At(0) = --iNumOfSessionId; - iSessionIdList->InsertL(0,--iNumOfSessionId); + TRAP(error, iSessionIdList->InsertL(0,--iNumOfSessionId)); + if(error != KErrNone) + { + ReqCompleted(iUpdateSessionHandle,error); + } iMbmsUpdateSessionTimer->Start(RandTime(),this,ETimerIdMbmsUpdateSessionId); } else @@ -1184,16 +1189,20 @@ break; case SIMTSY_PACKET_MBMS_REM_ALL_ENTRIES: - LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionListL Action: REMOVE_ALL "); + LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionList Action: REMOVE_ALL "); iNumOfSessionId=0; //iSessionIdList->At(0) = iNumOfSessionId; - iSessionIdList->InsertL(0,iNumOfSessionId); + TRAP(error, iSessionIdList->InsertL(0,iNumOfSessionId)); + if(error != KErrNone) + { + ReqCompleted(iUpdateSessionHandle,error); + } iSessionIdList->Delete(1,iSessionIdList->Count()); // removing all session ids from the list ReqCompleted(aTsyReqHandle, KErrNone); break; default: - LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionListL Action: Default "); + LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionList Action: Default "); ReqCompleted(aTsyReqHandle,KErrNotFound); break; }