telephonyprotocols/umtsgprsscpr/src/PdpFsmRequest.cpp
author hgs
Thu, 29 Jul 2010 12:12:57 +0100
changeset 56 ab72d5c1d770
parent 44 8b72faa1200f
permissions -rw-r--r--
201029_05
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     1
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     2
// All rights reserved.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     3
// This component and the accompanying materials are made available
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     5
// which accompanies this distribution, and is available
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     7
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     8
// Initial Contributors:
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    10
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    11
// Contributors:
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    12
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    13
// Description:
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    14
// The implementation file for the PDP Context control requests.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    15
// 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    16
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    17
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    18
/**
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    19
 @file
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    20
 @internalComponent
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    21
*/
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    22
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    23
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    24
#include "PdpFsmRequest.h"
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    25
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    26
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    27
//-=========================================================
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    28
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    29
//CModifyActivePDPCtx
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    30
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    31
//-=========================================================
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    32
CModifyActivePDPCtx::CModifyActivePDPCtx(CUmtsGprsSubConnProvd& aProvider, MPdpFsmRequestOwner& aOwner)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    33
:CPdpFsmRequestBase(aProvider, aOwner)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    34
{	
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    35
}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    36
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    37
CModifyActivePDPCtx::~CModifyActivePDPCtx()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    38
{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    39
}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    40
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    41
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    42
TInt CModifyActivePDPCtx::Start()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    43
{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    44
	// Store the Context Id in order to check replies later
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    45
	iContextId = iProvider.GetContextId();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    46
	return iProvider.GetPdpFsmInterface().Input(iContextId, SpudMan::EContextModifyActive);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    47
}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    48
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    49
/**
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    50
@param aEvent The event Id
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    51
@param aParam Data relavent to the event. Usually a system-wide error code
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    52
@return ETrue if the event was consumed, EFalse if it was of no interest and should
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    53
be passed on to SpudMan for processing.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    54
*/
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    55
TBool CModifyActivePDPCtx::PdpFsmEvent(TContextId aContextId, TInt aEvent, TInt aParam)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    56
{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    57
	if (aContextId == iContextId && aEvent == KContextModifyActiveEvent)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    58
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    59
		iOwner.Done(aParam, *this);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    60
		return ETrue;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    61
		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    62
	
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    63
	return EFalse;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    64
}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    65
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    66
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    67
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    68
#ifdef SYMBIAN_NETWORKING_UMTSR5
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    69
//-=========================================================
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    70
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    71
//CModifyR5QoS
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    72
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    73
//-=========================================================
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    74
CModifyR5QoS::CModifyR5QoS(CUmtsGprsSubConnProvd& aProvider, MPdpFsmRequestOwner& aOwner, RPacketQoS::TQoSR5Requested& aParams)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    75
:CPdpFsmRequestBase(aProvider, aOwner),
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    76
 iModifyActive(NULL),
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    77
 i5(aParams)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    78
{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    79
}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    80
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    81
CModifyR5QoS::~CModifyR5QoS()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    82
{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    83
    ASSERT(iModifyActive == NULL || iContextId == 0); 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    84
    //If we assert here is is becuase Start has been called (allocated iContextId), but Done has not been called (cleans iModifyActive)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    85
	delete iModifyActive;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    86
}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    87
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    88
void CModifyR5QoS::GrantedSetupL()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    89
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    90
	CSubConGenEventParamsGranted* event = CSubConGenEventParamsGranted::NewL();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    91
	CleanupStack::PushL (TCleanupItem(SubconEventCleanupFunction, event));
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    92
	event->SetFamily (KSubConQoSFamily);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    93
	RPacketQoS::TQoSR5Negotiated negotiatedQoS;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    94
	iProvider.GetPdpFsmInterface().Get(iProvider.GetContextId(), negotiatedQoS);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    95
	iProvider.MapQosEtelToGrantedParamsL(&negotiatedQoS, *event);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    96
	iProvider.NotifyClientEvent (*event);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    97
	CleanupStack::Pop();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    98
	delete event;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    99
	
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   100
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   101
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   102
void CModifyR5QoS::RejectedSetupL(TInt aResult)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   103
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   104
	CSubConGenEventParamsRejected* event = CSubConGenEventParamsRejected::NewL();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   105
	CleanupStack::PushL (TCleanupItem(SubconEventCleanupFunction, event));
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   106
	event->SetFamilyId (KSubConQoSFamily);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   107
	event->SetError (aResult);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   108
	iProvider.NotifyClientEvent (*event);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   109
	CleanupStack::Pop();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   110
	delete event;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   111
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   112
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   113
void CModifyR5QoS::Done( TInt aResult, CPdpFsmRequestBase&  aThis )
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   114
{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   115
   __ASSERT_ALWAYS(iModifyActive == &aThis, User::Invariant());
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   116
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   117
	if ( aResult == KErrNone )
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   118
   		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   119
		// QoS Modification complete with success.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   120
	  	__FLOG_1(_L("CModifyR5QoS [this=%08x]:\tDone(): QoS Params Granted"), this);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   121
	  	TRAP_IGNORE(GrantedSetupL());
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   122
   		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   123
	else
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   124
	  	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   125
	  	//QoS Modification complete with failure.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   126
	  	__FLOG_2(_L("CModifyR5QoS [this=%08x]:\tDone(): QoS Params Rejected [aResult=%d]"), this, aResult); 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   127
	  	TRAP_IGNORE(RejectedSetupL(aResult));
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   128
	  	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   129
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   130
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   131
   delete iModifyActive;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   132
   iModifyActive = NULL;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   133
   iOwner.Done(aResult, *this);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   134
}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   135
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   136
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   137
TInt CModifyR5QoS::Start()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   138
{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   139
	// Store the Context Id in order to check replies later
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   140
	iContextId = iProvider.GetContextId();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   141
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   142
	TInt result;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   143
	result = iProvider.GetPdpFsmInterface().Set(iContextId, i5);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   144
	if (result == KErrNone)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   145
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   146
		result = iProvider.GetPdpFsmInterface().Input(iContextId, SpudMan::EContextQoSSet);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   147
		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   148
	  
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   149
	return result;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   150
}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   151
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   152
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   153
TBool CModifyR5QoS::PdpFsmEvent(TContextId aContextId, TInt aEvent, TInt aParam)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   154
{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   155
	if (aContextId != iContextId)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   156
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   157
		return EFalse;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   158
		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   159
		
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   160
	TBool handled(EFalse);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   161
	if (aEvent == KContextQoSSetEvent)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   162
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   163
		if (aParam == KErrNone)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   164
			{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   165
			iModifyActive->Start();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   166
			}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   167
		else
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   168
			{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   169
			//QoS Modification complete with failure.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   170
			__FLOG_2(_L("CModifyR5QoS [this=%08x]:\tPdpFsmEvent(): QoS Params Rejected [aParam=%d]"), this, aParam);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   171
	   
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   172
			Done(aParam, *iModifyActive);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   173
			}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   174
		handled = ETrue;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   175
		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   176
	else
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   177
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   178
		handled = iModifyActive->PdpFsmEvent(aContextId, aEvent, aParam);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   179
		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   180
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   181
	return handled;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   182
}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   183
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   184
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   185
void CModifyR5QoS::ConstructL()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   186
{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   187
	iModifyActive = new(ELeave)CModifyActivePDPCtx(iProvider, *this);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   188
}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   189
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   190
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   191
CModifyR5QoS* CModifyR5QoS::NewL(CUmtsGprsSubConnProvd& aProvider, MPdpFsmRequestOwner& aOwner, RPacketQoS::TQoSR5Requested& aParams)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   192
{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   193
	CModifyR5QoS* request = new(ELeave) CModifyR5QoS(aProvider, aOwner, aParams);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   194
	CleanupStack::PushL(request);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   195
	request->ConstructL();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   196
	CleanupStack::Pop(request);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   197
	return request;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   198
}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   199
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   200
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   201
#else
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   202
// !SYMBIAN_NETWORKING_UMTSR5
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   203
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   204
//-=========================================================
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   205
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   206
//CModifyR4QoS
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   207
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   208
//-=========================================================
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   209
CModifyR4QoS::CModifyR4QoS(CUmtsGprsSubConnProvd& aProvider, MPdpFsmRequestOwner& aOwner, RPacketQoS::TQoSR99_R4Requested aParams)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   210
:CPdpFsmRequestBase(aProvider, aOwner),
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   211
 iModifyActive(NULL),
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   212
 i99(aParams)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   213
{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   214
}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   215
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   216
CModifyR4QoS::~CModifyR4QoS()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   217
{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   218
    ASSERT(iModifyActive == NULL || iContextId == 0); 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   219
    //If we assert here is is becuase Start has been called (allocated iContextId), but Done has not been called (cleans iModifyActive)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   220
	delete iModifyActive;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   221
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   222
}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   223
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   224
void CModifyR4QoS::GrantedSetupL()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   225
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   226
	CSubConGenEventParamsGranted* event = CSubConGenEventParamsGranted::NewL();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   227
	CleanupStack::PushL (TCleanupItem(SubconEventCleanupFunction, event));
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   228
	event->SetFamily (KSubConQoSFamily);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   229
	RPacketQoS::TQoSR99_R4Negotiated negotiatedQoS;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   230
	iProvider.GetPdpFsmInterface().Get(iProvider.GetContextId(), negotiatedQoS);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   231
	iProvider.MapQosEtelToGrantedParamsL(&negotiatedQoS, *event);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   232
	iProvider.NotifyClientEvent (*event);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   233
	CleanupStack::Pop();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   234
	delete event;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   235
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   236
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   237
void CModifyR4QoS::RejectedSetupL(TInt aResult)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   238
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   239
	CSubConGenEventParamsRejected* event = CSubConGenEventParamsRejected::NewL();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   240
	CleanupStack::PushL (TCleanupItem(SubconEventCleanupFunction, event));
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   241
	event->SetFamilyId (KSubConQoSFamily);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   242
	event->SetError (aResult);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   243
	iProvider.NotifyClientEvent (*event);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   244
	CleanupStack::Pop();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   245
	delete event;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   246
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   247
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   248
void CModifyR4QoS::Done( TInt aResult, CPdpFsmRequestBase&  aThis )
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   249
{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   250
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   251
	__ASSERT_ALWAYS(iModifyActive == &aThis, User::Invariant());
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   252
   	if ( aResult == KErrNone )
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   253
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   254
		// QoS Modification complete with success.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   255
		__FLOG_1(_L("CModifyR4QoS [this=%08x]:\tDone(): QoS Params Granted"), this);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   256
		TRAP_IGNORE(GrantedSetupL());
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   257
		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   258
	else
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   259
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   260
		//QoS Modification complete with failure.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   261
		__FLOG_2(_L("CModifyR4QoS [this=%08x]:\tDone(): QoS Params Rejected [aResult=%d]"), this, aResult);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   262
		TRAP_IGNORE(RejectedSetupL(aResult));
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   263
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   264
	delete iModifyActive;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   265
	iModifyActive = NULL;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   266
	iOwner.Done(aResult, *this);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   267
}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   268
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   269
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   270
TInt CModifyR4QoS::Start()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   271
{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   272
	// Store the Context Id in order to check replies later
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   273
	iContextId = iProvider.GetContextId();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   274
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   275
	TInt result;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   276
	result = iProvider.GetPdpFsmInterface().Set(iContextId, i99);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   277
	if (result == KErrNone)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   278
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   279
		result = iProvider.GetPdpFsmInterface().Input(iContextId, SpudMan::EContextQoSSet);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   280
		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   281
	  
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   282
	return result;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   283
}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   284
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   285
TBool CModifyR4QoS::PdpFsmEvent(TContextId aContextId, TInt aEvent, TInt aParam)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   286
{   
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   287
	if (aContextId != iContextId)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   288
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   289
		return EFalse;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   290
		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   291
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   292
	TBool handled(EFalse);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   293
	if (aEvent == KContextQoSSetEvent)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   294
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   295
		if (aParam == KErrNone)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   296
			{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   297
		   	iModifyActive->Start();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   298
			}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   299
		else
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   300
			{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   301
			//QoS Modification complete with failure.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   302
			__FLOG_2(_L("CModifyR4QoS [this=%08x]:\tPdpFsmEvent(): QoS Params Rejected [aParam=%d]"), this, aParam);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   303
			Done(aParam, *iModifyActive);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   304
			}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   305
		handled = ETrue;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   306
		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   307
	else
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   308
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   309
		handled = iModifyActive->PdpFsmEvent(aContextId, aEvent, aParam);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   310
		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   311
		
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   312
	return handled;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   313
}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   314
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   315
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   316
void CModifyR4QoS::ConstructL()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   317
{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   318
	iModifyActive = new(ELeave)CModifyActivePDPCtx(iProvider, *this);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   319
}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   320
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   321
CModifyR4QoS* CModifyR4QoS::NewL(CUmtsGprsSubConnProvd& aProvider, MPdpFsmRequestOwner& aOwner, RPacketQoS::TQoSR99_R4Requested aParams)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   322
{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   323
	CModifyR4QoS* request = new(ELeave) CModifyR4QoS(aProvider, aOwner, aParams);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   324
	CleanupStack::PushL(request);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   325
	request->ConstructL();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   326
	CleanupStack::Pop(request);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   327
	return request;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   328
}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   329
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   330
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   331
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   332
#endif 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   333
// SYMBIAN_NETWORKING_UMTSR5
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   334