24
|
1 |
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
// INCLUDE FILES
|
|
19 |
#include "Cmmpacketcontexttsy.h"
|
|
20 |
#include "Cmmpacketcontextlist.h"
|
|
21 |
#include "cmmpacketservicegsmwcdmaext.h"
|
|
22 |
#include "CMmPacketTsy.h"
|
|
23 |
#include <ctsy/tflogger.h>
|
|
24 |
#include "MmTsy_timeoutdefs.h"
|
|
25 |
#include "MmTsy_numberOfSlots.h"
|
|
26 |
|
|
27 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
28 |
|
|
29 |
|
|
30 |
CMmPacketContextTsy::CMmPacketContextTsy():
|
|
31 |
iReqHandleType(EMultimodePacketContextReqHandleUnknown)
|
|
32 |
{
|
|
33 |
}
|
|
34 |
|
|
35 |
CMmPacketContextTsy* CMmPacketContextTsy::NewL(
|
|
36 |
CMmPacketServiceTsy* const aMmPacketService,
|
|
37 |
const TInfoName& aHostCID,
|
|
38 |
const TDes& aName,
|
|
39 |
const TUint8 aProxyId )
|
|
40 |
{
|
|
41 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::NewL. Context name:%S", &aName );
|
|
42 |
|
|
43 |
CMmPacketContextTsy* packetContext = new ( ELeave ) CMmPacketContextTsy();
|
|
44 |
|
|
45 |
CleanupClosePushL( *packetContext );
|
|
46 |
packetContext->iMmPacketService = aMmPacketService;
|
|
47 |
packetContext->iContextName = aName;
|
|
48 |
packetContext->iProxyId = aProxyId;
|
|
49 |
packetContext->iHostCID = aHostCID;
|
|
50 |
packetContext->ConstructL();
|
|
51 |
CleanupStack::Pop();
|
|
52 |
|
|
53 |
return packetContext;
|
|
54 |
}
|
|
55 |
|
|
56 |
void CMmPacketContextTsy::ConstructL()
|
|
57 |
{
|
|
58 |
InitModulesL();
|
|
59 |
InitInternalAttributes();
|
|
60 |
}
|
|
61 |
|
|
62 |
CMmPacketContextTsy::~CMmPacketContextTsy()
|
|
63 |
{
|
|
64 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::~CMmPacketContextTsy. Context name: %S", &iContextName );
|
|
65 |
|
|
66 |
if( iMmPacketService )
|
|
67 |
{
|
|
68 |
|
|
69 |
iMmPacketService->PacketContextList()->RemoveObject( this );
|
|
70 |
|
|
71 |
// Set Dynamic Caps
|
|
72 |
iMmPacketService->ActivePacketServiceExtension()->SetDynamicCapsFlag(
|
|
73 |
RPacketService::KCapsActivate, EFalse );
|
|
74 |
|
|
75 |
if ( iIsDialUpContext )
|
|
76 |
{
|
|
77 |
iMmPacketService->ResetPointerToDialUpContext( iContextName );
|
|
78 |
}
|
|
79 |
|
|
80 |
}
|
|
81 |
|
|
82 |
delete iMmPacketContextGsmWcdmaExt;
|
|
83 |
delete iTsyReqHandleStore;
|
|
84 |
|
|
85 |
}
|
|
86 |
|
|
87 |
// ---------------------------------------------------------------------------
|
|
88 |
// CMmPacketContextTsy::InitModulesL
|
|
89 |
// Initialises extension modules for CMmPacketContextTsy
|
|
90 |
// (other items were commented in a header).
|
|
91 |
// ---------------------------------------------------------------------------
|
|
92 |
//
|
|
93 |
void CMmPacketContextTsy::InitModulesL()
|
|
94 |
{
|
|
95 |
|
|
96 |
iMmPacketContextGsmWcdmaExt =
|
|
97 |
CMmPacketContextGsmWcdmaExt::NewL( this, iMmPacketService );
|
|
98 |
|
|
99 |
#ifdef REQHANDLE_TIMER
|
|
100 |
// Create req handle store
|
|
101 |
iTsyReqHandleStore = CMmTsyReqHandleStore::NewL( this,
|
|
102 |
iMmPacketService->PhoneTsy(), EMaxNumOfPacketContextRequests,
|
|
103 |
iPacketContextReqHandles );
|
|
104 |
|
|
105 |
#else
|
|
106 |
// Create req handle store
|
|
107 |
iTsyReqHandleStore = CMmTsyReqHandleStore::NewL(
|
|
108 |
EMaxNumOfPacketContextRequests, iPacketContextReqHandles );
|
|
109 |
|
|
110 |
#endif // REQHANDLE_TIMER
|
|
111 |
|
|
112 |
}
|
|
113 |
|
|
114 |
// ---------------------------------------------------------------------------
|
|
115 |
// CMmPacketContextTsy::InitInternalAttributes
|
|
116 |
// Initialises miscellaneous internal attributes.
|
|
117 |
// (other items were commented in a header).
|
|
118 |
// ---------------------------------------------------------------------------
|
|
119 |
//
|
|
120 |
void CMmPacketContextTsy::InitInternalAttributes()
|
|
121 |
{
|
|
122 |
iQoSProfile = NULL;
|
|
123 |
iQoSProfileName.Zero();
|
|
124 |
|
|
125 |
iLastErrorCause = KErrNone;
|
|
126 |
iContextStatus = RPacketContext::EStatusUnknown;
|
|
127 |
iContextStatusBeforeSuspending = RPacketContext::EStatusUnknown;
|
|
128 |
iConnectionSpeed = 0;
|
|
129 |
iNotifyConnectionSpeed = 0;
|
|
130 |
iIsDialUpContext = EFalse;
|
|
131 |
|
|
132 |
if ( iContextName.Compare( KStringExternal )== 0
|
|
133 |
|| iContextName.Compare( KStringExternal2 )== 0 )
|
|
134 |
{
|
|
135 |
iIsDialUpContext = ETrue;
|
|
136 |
}
|
|
137 |
}
|
|
138 |
|
|
139 |
// ---------------------------------------------------------------------------
|
|
140 |
// CMmPacketContextTsy::Init
|
|
141 |
// Initialisation method that is called from ETel Server.
|
|
142 |
// ---------------------------------------------------------------------------
|
|
143 |
//
|
|
144 |
void CMmPacketContextTsy::Init()
|
|
145 |
{
|
|
146 |
}
|
|
147 |
|
|
148 |
// ---------------------------------------------------------------------------
|
|
149 |
// CMmPacketContextTsy::ExtFunc
|
|
150 |
// TRAP's all CMmPacketContextTsy related MM Packet API requests in case that
|
|
151 |
// they fail. This method functions only as a centralized TRAP for the
|
|
152 |
// DoExtFuncL method that does the actual mapping of IPC number to TSY method
|
|
153 |
// call.
|
|
154 |
// (other items were commented in a header).
|
|
155 |
// ---------------------------------------------------------------------------
|
|
156 |
//
|
|
157 |
TInt CMmPacketContextTsy::ExtFunc(
|
|
158 |
const TTsyReqHandle aTsyReqHandle,
|
|
159 |
const TInt aIpc,
|
|
160 |
const TDataPackage& aPackage )
|
|
161 |
{
|
|
162 |
TFLOGSTRING3( "TSY: CMmPacketContextTsy::ExtFunc. IPC: %d Context name:%S", aIpc, &iContextName );
|
|
163 |
|
|
164 |
TInt ret( KErrNone );
|
|
165 |
TInt trapError( KErrNone );
|
|
166 |
|
|
167 |
#ifdef ADD_REMOVE_PACKETFILTER_DEFECT_FIXED // search for this up from bottom of file
|
|
168 |
// Ensure the ReqHandleType is unset.
|
|
169 |
// This will detect cases where this method indirectly calls itself
|
|
170 |
// (e.g. servicing a client call that causes a self-reposting notification to complete and thus repost).
|
|
171 |
// Such cases are not supported because iReqHandleType is in the context of this class instance,
|
|
172 |
// not this request, and we don't want the values set by the inner request and the outer request
|
|
173 |
// interfering with each other.
|
|
174 |
__ASSERT_DEBUG(iReqHandleType==EMultimodePacketContextReqHandleUnknown, User::Invariant());
|
|
175 |
#else
|
|
176 |
// Reset last tsy request type
|
|
177 |
iReqHandleType = EMultimodePacketContextReqHandleUnknown;
|
|
178 |
#endif
|
|
179 |
|
|
180 |
// Trap the call of DoExtFuncL
|
|
181 |
TRAP( trapError, ret = DoExtFuncL( aTsyReqHandle, aIpc, aPackage ) );
|
|
182 |
|
|
183 |
if ( KErrNone != trapError )
|
|
184 |
{
|
|
185 |
ReqCompleted( aTsyReqHandle, trapError );
|
|
186 |
}
|
|
187 |
|
|
188 |
else if ( KErrNone != ret )
|
|
189 |
{
|
|
190 |
ReqCompleted( aTsyReqHandle, ret );
|
|
191 |
}
|
|
192 |
|
|
193 |
if ( EMultimodePacketContextReqHandleUnknown != iReqHandleType )
|
|
194 |
{
|
|
195 |
#ifdef REQHANDLE_TIMER
|
|
196 |
SetTypeOfResponse( iReqHandleType, aTsyReqHandle );
|
|
197 |
#else
|
|
198 |
iTsyReqHandleStore->SetTsyReqHandle( iReqHandleType, aTsyReqHandle );
|
|
199 |
#endif // REQHANDLE_TIMER
|
|
200 |
#ifdef ADD_REMOVE_PACKETFILTER_DEFECT_FIXED // search for this up from bottom of file
|
|
201 |
// We've finished with this value now. Clear it so it doesn't leak
|
|
202 |
// up to any other instances of this method down the call stack
|
|
203 |
iReqHandleType = EMultimodePacketContextReqHandleUnknown;
|
|
204 |
#endif
|
|
205 |
}
|
|
206 |
|
|
207 |
return KErrNone;
|
|
208 |
}
|
|
209 |
|
|
210 |
// ---------------------------------------------------------------------------
|
|
211 |
// CMmPacketContextTsy::DoExtFuncL
|
|
212 |
// Packet Data specific functionality of CMmPacketContextTsy::ExtFunc
|
|
213 |
// ---------------------------------------------------------------------------
|
|
214 |
//
|
|
215 |
TInt CMmPacketContextTsy::DoExtFuncL(
|
|
216 |
const TTsyReqHandle aTsyReqHandle,
|
|
217 |
const TInt aIpc,
|
|
218 |
const TDataPackage& aPackage )
|
|
219 |
{
|
|
220 |
TFLOGSTRING3( "TSY: CMmPacketContextTsy::DoExtFuncL. IPC: %d Handle:%d",
|
|
221 |
aIpc, aTsyReqHandle );
|
|
222 |
|
|
223 |
TInt ret( KErrNotSupported );
|
|
224 |
|
|
225 |
TAny* dataPtr = aPackage.Ptr1();
|
|
226 |
TAny* dataPtr2 = aPackage.Ptr2();
|
|
227 |
|
|
228 |
switch ( aIpc )
|
|
229 |
{
|
|
230 |
case EPacketContextNotifyStatusChange:
|
|
231 |
ret = NotifyStatusChange(
|
|
232 |
REINTERPRET_CAST( RPacketContext::TContextStatus*, dataPtr ) );
|
|
233 |
break;
|
|
234 |
case EPacketContextNotifyConfigChanged:
|
|
235 |
ret = NotifyConfigChanged(
|
|
236 |
REINTERPRET_CAST( TPacketDataConfigBase*, dataPtr ) );
|
|
237 |
break;
|
|
238 |
case EPacketContextNotifyConnectionSpeedChange:
|
|
239 |
ret = NotifyConnectionSpeedChange(
|
|
240 |
REINTERPRET_CAST( TUint*, dataPtr ) );
|
|
241 |
break;
|
|
242 |
case EPacketContextInitialiseContext:
|
|
243 |
{
|
|
244 |
TDes8* paramData = aPackage.Des1n();
|
|
245 |
|
|
246 |
if(paramData != NULL)
|
|
247 |
{
|
|
248 |
if(sizeof(RPacketContext::TDataChannelV2) > paramData->MaxLength())
|
|
249 |
{
|
|
250 |
ret = KErrArgument;
|
|
251 |
}
|
|
252 |
else
|
|
253 |
{
|
|
254 |
ret = InitialiseContextL( reinterpret_cast< RPacketContext::TDataChannelV2*>( dataPtr ));
|
|
255 |
}
|
|
256 |
}
|
|
257 |
else
|
|
258 |
{
|
|
259 |
ret = KErrArgument;
|
|
260 |
}
|
|
261 |
break;
|
|
262 |
}
|
|
263 |
case EPacketContextSetConfig:
|
|
264 |
ret = SetConfigL(
|
|
265 |
REINTERPRET_CAST( TPacketDataConfigBase*, dataPtr ) );
|
|
266 |
break;
|
|
267 |
case EPacketContextActivate:
|
|
268 |
ret = ActivateL();
|
|
269 |
break;
|
|
270 |
case EPacketContextDeactivate:
|
|
271 |
ret = DeactivateL();
|
|
272 |
break;
|
|
273 |
case EPacketContextDelete:
|
|
274 |
ret = DeleteL();
|
|
275 |
break;
|
|
276 |
case EPacketContextGetStatus:
|
|
277 |
ret = GetStatus( aTsyReqHandle,
|
|
278 |
REINTERPRET_CAST( RPacketContext::TContextStatus*, dataPtr ) );
|
|
279 |
break;
|
|
280 |
case EPacketContextGetConfig:
|
|
281 |
ret = GetConfig( aTsyReqHandle,
|
|
282 |
REINTERPRET_CAST( TPacketDataConfigBase*, dataPtr ) );
|
|
283 |
break;
|
|
284 |
case EPacketContextGetProfileName:
|
|
285 |
ret = GetProfileName( aTsyReqHandle,
|
|
286 |
REINTERPRET_CAST( TInfoName*, dataPtr ) );
|
|
287 |
break;
|
|
288 |
case EPacketContextGetConnectionSpeed:
|
|
289 |
ret = GetConnectionSpeed( aTsyReqHandle,
|
|
290 |
REINTERPRET_CAST( TUint*, dataPtr ) );
|
|
291 |
break;
|
|
292 |
case EPacketContextGetLastErrorCause:
|
|
293 |
ret = GetLastErrorCause( aTsyReqHandle,
|
|
294 |
REINTERPRET_CAST( TInt*, dataPtr ) );
|
|
295 |
break;
|
|
296 |
case EPacketContextGetDataVolumeTransferred:
|
|
297 |
ret = GetDataVolumeTransferredL( aTsyReqHandle,
|
|
298 |
REINTERPRET_CAST( RPacketContext::TDataVolume*, dataPtr ) );
|
|
299 |
break;
|
|
300 |
case EPacketContextEnumeratePacketFilters:
|
|
301 |
ret = EnumeratePacketFilters( aTsyReqHandle,
|
|
302 |
REINTERPRET_CAST( TInt*, dataPtr ) );
|
|
303 |
break;
|
|
304 |
case EPacketContextGetPacketFilterInfo:
|
|
305 |
{
|
|
306 |
TDes8* paramData = aPackage.Des2n();
|
|
307 |
|
|
308 |
if (paramData)
|
|
309 |
{
|
|
310 |
TInt paramLength = paramData->MaxLength();
|
|
311 |
|
|
312 |
RPacketContext::TPacketFilterV2 temp;
|
|
313 |
RPacketContext::TPacketFilterV2Pckg tempPckg(temp);
|
|
314 |
|
|
315 |
TInt expectedLength = tempPckg.MaxLength();
|
|
316 |
|
|
317 |
if (paramLength == expectedLength)
|
|
318 |
{
|
|
319 |
ret = GetPacketFilterInfo( aTsyReqHandle, REINTERPRET_CAST( TInt*, dataPtr ), REINTERPRET_CAST( TPacketBase*, dataPtr2 ) );
|
|
320 |
}
|
|
321 |
else
|
|
322 |
{
|
|
323 |
ret = KErrArgument;
|
|
324 |
}
|
|
325 |
}
|
|
326 |
else
|
|
327 |
{
|
|
328 |
ret = KErrArgument;
|
|
329 |
}
|
|
330 |
|
|
331 |
}
|
|
332 |
break;
|
|
333 |
case EPacketContextAddPacketFilter:
|
|
334 |
ret = AddPacketFilterL( aTsyReqHandle, aPackage.Des1n() );
|
|
335 |
break;
|
|
336 |
case EPacketContextRemovePacketFilter:
|
|
337 |
#ifdef USING_CTSY_DISPATCHER
|
|
338 |
ret = RemovePacketFilter( REINTERPRET_CAST( TInt*, dataPtr ) );
|
|
339 |
#else
|
|
340 |
ret = RemovePacketFilter( aTsyReqHandle,
|
|
341 |
REINTERPRET_CAST( TInt*, dataPtr ) );
|
|
342 |
#endif
|
|
343 |
break;
|
|
344 |
case EPacketContextModifyActiveContext:
|
|
345 |
ret = ModifyActiveContextL();
|
|
346 |
break;
|
|
347 |
case EPacketContextGetDNSInfo:
|
|
348 |
ret = GetDnsInfo( aTsyReqHandle, aPackage.Des1n() );
|
|
349 |
break;
|
|
350 |
case EPacketAddMediaAuthorization:
|
|
351 |
ret = AddMediaAuthorizationL( aTsyReqHandle, aPackage.Des1n() );
|
|
352 |
break;
|
|
353 |
case EPacketRemoveMediaAuthorization:
|
|
354 |
ret = RemoveMediaAuthorization( aTsyReqHandle,
|
|
355 |
REINTERPRET_CAST( RPacketContext::TAuthorizationToken*,
|
|
356 |
dataPtr ) );
|
|
357 |
break;
|
|
358 |
#ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
359 |
case EPacketContextGetConnectionInfo:
|
|
360 |
ret = GetConnectionInfo( aTsyReqHandle,
|
|
361 |
reinterpret_cast<TConnectionInfoBase*>( dataPtr ) );
|
|
362 |
break;
|
|
363 |
case EPacketContextNotifyConnectionInfoChange:
|
|
364 |
ret = NotifyConnectionInfoChange(
|
|
365 |
reinterpret_cast<TConnectionInfoBase*>( dataPtr ) );
|
|
366 |
break;
|
|
367 |
#endif // SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
368 |
// These requests currently not supported
|
|
369 |
//case EPacketContextLoanCommPort:
|
|
370 |
//case EPacketContextRecoverCommPort:
|
|
371 |
//case EPacketContextNotifyDataTransferred:
|
|
372 |
default:
|
|
373 |
break;
|
|
374 |
}
|
|
375 |
|
|
376 |
return ret;
|
|
377 |
}
|
|
378 |
|
|
379 |
// ---------------------------------------------------------------------------
|
|
380 |
// CMmPacketContextTsy::ReqModeL
|
|
381 |
// Returns request mode for given IPC.
|
|
382 |
// ---------------------------------------------------------------------------
|
|
383 |
//
|
|
384 |
CTelObject::TReqMode CMmPacketContextTsy::ReqModeL(
|
|
385 |
const TInt aIpc )
|
|
386 |
{
|
|
387 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::ReqModeL. IPC: %d", aIpc );
|
|
388 |
|
|
389 |
CTelObject::TReqMode reqMode( 0 );
|
|
390 |
TBool doLeave( EFalse );
|
|
391 |
|
|
392 |
switch ( aIpc )
|
|
393 |
{
|
|
394 |
// All disabled
|
|
395 |
// TSYs wishing to implement their own buffering algorithm will place
|
|
396 |
// all requests in this category.
|
|
397 |
|
|
398 |
// Get methods that do not use DOS and return immediately.
|
|
399 |
// Flow control not required.
|
|
400 |
case EPacketContextGetConnectionSpeed:
|
|
401 |
case EPacketContextGetLastErrorCause:
|
|
402 |
case EPacketContextGetProfileName:
|
|
403 |
case EPacketContextEnumeratePacketFilters:
|
|
404 |
case EPacketContextGetPacketFilterInfo:
|
|
405 |
#ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
406 |
case EPacketContextGetConnectionInfo:
|
|
407 |
#endif // SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
408 |
|
|
409 |
// Other methods that do not use DOS and return immediately.
|
|
410 |
// Flow control not required.
|
|
411 |
|
|
412 |
// Methods that can propably take a long time and cannot therefore be
|
|
413 |
// flow controlled. Solution: All these methods must check req handle
|
|
414 |
// table before handling the request. In case that the request table
|
|
415 |
// indicates that same method has been called and has not been
|
|
416 |
// completed, the method should return KErrServerBusy.
|
|
417 |
if ( iIsDialUpContext )
|
|
418 |
{
|
|
419 |
doLeave = ETrue;
|
|
420 |
break;
|
|
421 |
}
|
|
422 |
case EPacketContextGetStatus:
|
|
423 |
case EPacketContextGetConfig:
|
|
424 |
break;
|
|
425 |
|
|
426 |
// KReqModeFlowControlObeyed
|
|
427 |
// Commands that change the state of the phone, e.g. clearing the AoC
|
|
428 |
// counter, are commands that the TSY should only deal with one at
|
|
429 |
// a time.
|
|
430 |
|
|
431 |
case EPacketContextInitialiseContext:
|
|
432 |
case EPacketContextActivate:
|
|
433 |
case EPacketContextDelete:
|
|
434 |
case EPacketContextSetConfig:
|
|
435 |
case EPacketContextAddPacketFilter:
|
|
436 |
case EPacketContextRemovePacketFilter:
|
|
437 |
case EPacketContextModifyActiveContext:
|
|
438 |
case EPacketContextGetDNSInfo:
|
|
439 |
case EPacketAddMediaAuthorization:
|
|
440 |
case EPacketRemoveMediaAuthorization:
|
|
441 |
if ( iIsDialUpContext )
|
|
442 |
{
|
|
443 |
doLeave = ETrue;
|
|
444 |
break;
|
|
445 |
}
|
|
446 |
case EPacketContextDeactivate:
|
|
447 |
case EPacketContextGetDataVolumeTransferred:
|
|
448 |
|
|
449 |
{
|
|
450 |
reqMode = KReqModeFlowControlObeyed;
|
|
451 |
break;
|
|
452 |
}
|
|
453 |
|
|
454 |
// KReqModeMultipleCompletionEnabled | ReqModePostImmediately
|
|
455 |
// Requests that notify a client about a change of state.
|
|
456 |
// Since these requests do not require the issuing of any modem
|
|
457 |
// commands, they do not have to obey flow control.
|
|
458 |
// The TSY never gets more than one of these outstanding.
|
|
459 |
case EPacketContextNotifyConfigChanged:
|
|
460 |
case EPacketContextNotifyConnectionSpeedChange:
|
|
461 |
if ( iIsDialUpContext )
|
|
462 |
{
|
|
463 |
doLeave = ETrue;
|
|
464 |
break;
|
|
465 |
}
|
|
466 |
case EPacketContextNotifyStatusChange:
|
|
467 |
#ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
468 |
case EPacketContextNotifyConnectionInfoChange:
|
|
469 |
#endif // SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
470 |
reqMode = KReqModeMultipleCompletionEnabled |
|
|
471 |
KReqModeRePostImmediately;
|
|
472 |
break;
|
|
473 |
|
|
474 |
// Cancel Requests
|
|
475 |
// It's not necessary to include the Cancel methods in ReqModeL at all.
|
|
476 |
// The ETel server never calls ReqModeL with a Cancel IPC.
|
|
477 |
|
|
478 |
// Other variations of return values are unusable.
|
|
479 |
// Following requests are not supported
|
|
480 |
//case EPacketContextNotifyDataTransferred:
|
|
481 |
//case EPacketContextLoanCommPort:
|
|
482 |
//case EPacketContextRecoverCommPort:
|
|
483 |
// Default
|
|
484 |
default:
|
|
485 |
doLeave = ETrue;
|
|
486 |
break;
|
|
487 |
}
|
|
488 |
|
|
489 |
if ( doLeave )
|
|
490 |
{
|
|
491 |
User::Leave( KErrNotSupported );
|
|
492 |
}
|
|
493 |
|
|
494 |
return reqMode;
|
|
495 |
}
|
|
496 |
|
|
497 |
// ---------------------------------------------------------------------------
|
|
498 |
// CMmPacketContextTsy::NumberOfSlotsL
|
|
499 |
// Returns number of slots to be used for given IPC.
|
|
500 |
// (other items were commented in a header).
|
|
501 |
// ---------------------------------------------------------------------------
|
|
502 |
//
|
|
503 |
TInt CMmPacketContextTsy::NumberOfSlotsL(
|
|
504 |
const TInt aIpc )
|
|
505 |
{
|
|
506 |
TInt numberOfSlots( 0 );
|
|
507 |
|
|
508 |
switch ( aIpc )
|
|
509 |
{
|
|
510 |
case EPacketContextNotifyStatusChange:
|
|
511 |
numberOfSlots = KMmPacketContextNotifyStatusChangeSlots;
|
|
512 |
break;
|
|
513 |
case EPacketContextNotifyConfigChanged:
|
|
514 |
numberOfSlots = KMmPacketContextNotifyConfigChangedSlots;
|
|
515 |
break;
|
|
516 |
case EPacketContextNotifyConnectionSpeedChange:
|
|
517 |
numberOfSlots = KMmPacketContextNotifyConnectionSpeedChangeSlots;
|
|
518 |
break;
|
|
519 |
#ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
520 |
case EPacketContextNotifyConnectionInfoChange:
|
|
521 |
numberOfSlots = KMmPacketContextNotifyConnectionInfoChangeSlots;
|
|
522 |
break;
|
|
523 |
#endif // SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
524 |
default:
|
|
525 |
// Unknown or invalid IPC
|
|
526 |
User::Leave( KErrNotSupported );
|
|
527 |
break;
|
|
528 |
|
|
529 |
}
|
|
530 |
TFLOGSTRING3( "TSY: CMmPacketContextTsy::NumberOfSlotsL. IPC: %d Number of slots: %d",
|
|
531 |
aIpc, numberOfSlots );
|
|
532 |
|
|
533 |
return numberOfSlots;
|
|
534 |
|
|
535 |
}
|
|
536 |
|
|
537 |
// ---------------------------------------------------------------------------
|
|
538 |
// CMmPacketContextTsy::CancelService
|
|
539 |
// Cancel the outstanding request.ETel Server when it is "cleaning-up" any
|
|
540 |
// outstanding asynchronous requests before closing a client's sub-session.
|
|
541 |
// This will happen if a client closes its R-class handle without cancelling
|
|
542 |
// outstanding asynchronous requests. Only Packet API requests are handled
|
|
543 |
// here. Client can also cancel a request by calling CancelAsyncRequest
|
|
544 |
// (defined in etel.h). The ETel server passes this kind of cancel requests
|
|
545 |
// to CancelService.
|
|
546 |
// (other items were commented in a header).
|
|
547 |
// ---------------------------------------------------------------------------
|
|
548 |
//
|
|
549 |
TInt CMmPacketContextTsy::CancelService(
|
|
550 |
const TInt aIpc,
|
|
551 |
const TTsyReqHandle aTsyReqHandle )
|
|
552 |
{
|
|
553 |
TFLOGSTRING3( "TSY: CMmPacketContextTsy::CancelService. IPC: %d Handle:%d",
|
|
554 |
aIpc, aTsyReqHandle );
|
|
555 |
|
|
556 |
TInt ret( KErrNone );
|
|
557 |
TTsyReqHandle reqHandle( NULL );
|
|
558 |
|
|
559 |
#ifdef ADD_REMOVE_PACKETFILTER_DEFECT_FIXED // search for this up from bottom of file
|
|
560 |
// Ensure the ReqHandleType is unset.
|
|
561 |
// This will detect cases where this method indirectly calls itself
|
|
562 |
// (e.g. servicing a client call that causes a self-reposting notification to complete and thus repost).
|
|
563 |
// Such cases are not supported because iReqHandleType is in the context of this class instance,
|
|
564 |
// not this request, and we don't want the values set by the inner request and the outer request
|
|
565 |
// interfering with each other.
|
|
566 |
__ASSERT_DEBUG(iReqHandleType==EMultimodePacketContextReqHandleUnknown, User::Invariant());
|
|
567 |
#else
|
|
568 |
// Reset last tsy request type
|
|
569 |
iReqHandleType = EMultimodePacketContextReqHandleUnknown;
|
|
570 |
#endif
|
|
571 |
|
|
572 |
switch ( aIpc )
|
|
573 |
{
|
|
574 |
// TSY has started a request and it is not possible to then cancel
|
|
575 |
// this request. The best thing for the TSY to do in this case is to
|
|
576 |
// proceed as though the Cancel never happened. The server's call to
|
|
577 |
// the TSY cancel function will return synchronously. The TSY then
|
|
578 |
// continues to wait for the original acknowledgement and when it
|
|
579 |
// receives it, the TSY will complete the original request.
|
|
580 |
case EPacketContextInitialiseContext:
|
|
581 |
case EPacketContextActivate:
|
|
582 |
case EPacketContextDeactivate:
|
|
583 |
case EPacketContextDelete:
|
|
584 |
case EPacketContextSetConfig:
|
|
585 |
case EPacketContextGetConfig:
|
|
586 |
case EPacketContextGetConnectionSpeed:
|
|
587 |
case EPacketContextGetDataVolumeTransferred:
|
|
588 |
case EPacketContextEnumeratePacketFilters:
|
|
589 |
case EPacketContextGetPacketFilterInfo:
|
|
590 |
case EPacketContextAddPacketFilter:
|
|
591 |
case EPacketContextRemovePacketFilter:
|
|
592 |
case EPacketContextModifyActiveContext:
|
|
593 |
case EPacketContextGetDNSInfo:
|
|
594 |
case EPacketAddMediaAuthorization:
|
|
595 |
case EPacketRemoveMediaAuthorization:
|
|
596 |
#ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
597 |
case EPacketContextGetConnectionInfo:
|
|
598 |
#endif // SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
599 |
break;
|
|
600 |
// Notification Cancels, no special requirements.
|
|
601 |
case EPacketContextNotifyStatusChange:
|
|
602 |
iRetNotifyStatus = NULL;
|
|
603 |
iReqHandleType = EMultimodePacketContextNotifyStatusChange;
|
|
604 |
break;
|
|
605 |
case EPacketContextNotifyConfigChanged:
|
|
606 |
reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
|
|
607 |
EMultimodePacketContextNotifyConfigChanged );
|
|
608 |
if ( aTsyReqHandle == reqHandle )
|
|
609 |
{
|
|
610 |
iRetNotifyConfig = NULL;
|
|
611 |
iReqHandleType = EMultimodePacketContextNotifyConfigChanged;
|
|
612 |
}
|
|
613 |
else
|
|
614 |
{
|
|
615 |
reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
|
|
616 |
EMultimodePacketContextNotifyConfigChanged99 );
|
|
617 |
if ( aTsyReqHandle == reqHandle )
|
|
618 |
{
|
|
619 |
iRetNotifyConfig2 = NULL;
|
|
620 |
iReqHandleType =
|
|
621 |
EMultimodePacketContextNotifyConfigChanged99;
|
|
622 |
}
|
|
623 |
}
|
|
624 |
break;
|
|
625 |
case EPacketContextNotifyConnectionSpeedChange:
|
|
626 |
iRetNotifyConnectionSpeed = NULL;
|
|
627 |
iReqHandleType =
|
|
628 |
EMultimodePacketContextNotifyConnectionSpeedChange;
|
|
629 |
break;
|
|
630 |
#ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
631 |
case EPacketContextNotifyConnectionInfoChange:
|
|
632 |
iRetNotifyConnectionInfo = NULL;
|
|
633 |
iReqHandleType =
|
|
634 |
EMultimodePacketContextNotifyConnectionInfoChange;
|
|
635 |
break;
|
|
636 |
#endif // SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
637 |
// IPCs that are not supported
|
|
638 |
//case EPacketContextLoanCommPort:
|
|
639 |
//case EPacketContextRecoverCommPort:
|
|
640 |
//case EPacketContextNotifyDataTransferred:
|
|
641 |
// Default
|
|
642 |
default:
|
|
643 |
ret = KErrNotSupported;
|
|
644 |
break;
|
|
645 |
}
|
|
646 |
|
|
647 |
if ( EMultimodePacketContextReqHandleUnknown != iReqHandleType )
|
|
648 |
{
|
|
649 |
// Reset tsy request handle
|
|
650 |
iTsyReqHandleStore->ResetTsyReqHandle( iReqHandleType );
|
|
651 |
|
|
652 |
// Complete request
|
|
653 |
CMmPacketContextTsy::ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
654 |
#ifdef ADD_REMOVE_PACKETFILTER_DEFECT_FIXED // search for this up from bottom of file
|
|
655 |
// We've finished with this value now. Clear it so it doesn't leak
|
|
656 |
// up to any other instances of this method down the call stack
|
|
657 |
iReqHandleType = EMultimodePacketContextReqHandleUnknown;
|
|
658 |
#endif
|
|
659 |
}
|
|
660 |
|
|
661 |
return ret;
|
|
662 |
}
|
|
663 |
|
|
664 |
// ---------------------------------------------------------------------------
|
|
665 |
// CMmPacketContextTsy::RegisterNotification
|
|
666 |
// Register notification. RegisterNotification is called when the ETel Server
|
|
667 |
// recognises that this notification is being posted for the first time on
|
|
668 |
// this subsession object.It enables the TSY to "turn on" any regular
|
|
669 |
// notification messages that it may receive from DOS. If this object is
|
|
670 |
// Dial-Up context only supported notification is
|
|
671 |
// EPacketContextNotifyStatusChange.
|
|
672 |
// (other items were commented in a header).
|
|
673 |
// ---------------------------------------------------------------------------
|
|
674 |
//
|
|
675 |
TInt CMmPacketContextTsy::RegisterNotification(
|
|
676 |
const TInt aIpc )
|
|
677 |
{
|
|
678 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::RegisterNotification. IPC: %d", aIpc );
|
|
679 |
|
|
680 |
TInt ret( KErrNone );
|
|
681 |
|
|
682 |
switch ( aIpc )
|
|
683 |
{
|
|
684 |
case EPacketContextNotifyConfigChanged:
|
|
685 |
case EPacketContextNotifyConnectionSpeedChange:
|
|
686 |
if ( iIsDialUpContext )
|
|
687 |
{
|
|
688 |
ret = KErrNotSupported;
|
|
689 |
break;
|
|
690 |
}
|
|
691 |
case EPacketContextNotifyStatusChange:
|
|
692 |
#ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
693 |
case EPacketContextNotifyConnectionInfoChange:
|
|
694 |
#endif // SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
695 |
break;
|
|
696 |
//case EPacketContextNotifyDataTransferred:
|
|
697 |
default:
|
|
698 |
// Not supported
|
|
699 |
ret = KErrNotSupported;
|
|
700 |
break;
|
|
701 |
}
|
|
702 |
|
|
703 |
return ret;
|
|
704 |
}
|
|
705 |
|
|
706 |
// ---------------------------------------------------------------------------
|
|
707 |
// CMmPacketContextTsy::DeregisterNotification
|
|
708 |
// Deregister notification. DeregisterNotification is called when the ETel
|
|
709 |
// Server recognises that this notification will not be posted again because
|
|
710 |
// the last client to have a handle on this sub-session object has just closed
|
|
711 |
// the handle. It enables the TSY to "turn off" any regular notification
|
|
712 |
// messages that it may receive from DOS. If this object is Dial-Up context
|
|
713 |
// only supported notification is EPacketContextNotifyStatusChange.
|
|
714 |
// (other items were commented in a header).
|
|
715 |
// ---------------------------------------------------------------------------
|
|
716 |
//
|
|
717 |
TInt CMmPacketContextTsy::DeregisterNotification(
|
|
718 |
const TInt aIpc )
|
|
719 |
{
|
|
720 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::DeregisterNotification. IPC: %d", aIpc );
|
|
721 |
|
|
722 |
TInt ret( KErrNone );
|
|
723 |
|
|
724 |
switch ( aIpc )
|
|
725 |
{
|
|
726 |
case EPacketContextNotifyConfigChanged:
|
|
727 |
case EPacketContextNotifyConnectionSpeedChange:
|
|
728 |
if ( iIsDialUpContext )
|
|
729 |
{
|
|
730 |
ret = KErrNotSupported;
|
|
731 |
break;
|
|
732 |
}
|
|
733 |
case EPacketContextNotifyStatusChange:
|
|
734 |
#ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
735 |
case EPacketContextNotifyConnectionInfoChange:
|
|
736 |
#endif // SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
737 |
break;
|
|
738 |
//case EPacketContextNotifyDataTransferred:
|
|
739 |
default:
|
|
740 |
// Not supported
|
|
741 |
ret = KErrNotSupported;
|
|
742 |
break;
|
|
743 |
}
|
|
744 |
|
|
745 |
return ret;
|
|
746 |
}
|
|
747 |
|
|
748 |
// ---------------------------------------------------------------------------
|
|
749 |
// CMmPacketContextTsy::OpenNewObjectL
|
|
750 |
// Create new QoS object and return a pointer to it.
|
|
751 |
// (other items were commented in a header).
|
|
752 |
// ---------------------------------------------------------------------------
|
|
753 |
//
|
|
754 |
CTelObject* CMmPacketContextTsy::OpenNewObjectL(
|
|
755 |
TDes& aNewName )
|
|
756 |
{
|
|
757 |
TFLOGSTRING( "TSY: CMmPacketContextTsy::OpenNewObjectL." );
|
|
758 |
|
|
759 |
// Each context can have only one QoS
|
|
760 |
if ( NULL != iQoSProfile )
|
|
761 |
{
|
|
762 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::OpenNewObjectL. Leaves with: %d", KErrAlreadyExists );
|
|
763 |
User::Leave( KErrAlreadyExists );
|
|
764 |
}
|
|
765 |
|
|
766 |
else
|
|
767 |
{
|
|
768 |
// Create new QoS object
|
|
769 |
iQoSProfile = CMmPacketQoSTsy::NewL( iMmPacketService, this );
|
|
770 |
|
|
771 |
iQoSProfileName.Copy( iContextName );
|
|
772 |
aNewName.Copy( iQoSProfileName );
|
|
773 |
}
|
|
774 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::OpenNewObjectL. aNewName: %S", &aNewName );
|
|
775 |
|
|
776 |
return iQoSProfile;
|
|
777 |
}
|
|
778 |
|
|
779 |
// ---------------------------------------------------------------------------
|
|
780 |
// CMmPacketContextTsy::OpenNewObjectByNameL
|
|
781 |
// Return a pointer to QoS if it exists. The ETel Server calls this method
|
|
782 |
// after some client has requested to open existing QoS object. The TSY
|
|
783 |
// classes must not use this method.
|
|
784 |
// (other items were commented in a header).
|
|
785 |
// ---------------------------------------------------------------------------
|
|
786 |
//
|
|
787 |
CTelObject* CMmPacketContextTsy::OpenNewObjectByNameL(
|
|
788 |
const TDesC& aName )
|
|
789 |
{
|
|
790 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::OpenNewObjectByNameL. aName: %S", &aName );
|
|
791 |
|
|
792 |
if ( aName != iQoSProfileName )
|
|
793 |
{
|
|
794 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::OpenNewObjectByNameL. Leaves with: %d", KErrNotFound );
|
|
795 |
User::Leave( KErrNotFound );
|
|
796 |
}
|
|
797 |
|
|
798 |
return iQoSProfile;
|
|
799 |
}
|
|
800 |
|
|
801 |
// ---------------------------------------------------------------------------
|
|
802 |
// CMmPacketContextTsy::InitialiseContextL
|
|
803 |
// This function initialises the context created previously.
|
|
804 |
// (other items were commented in a header).
|
|
805 |
// ---------------------------------------------------------------------------
|
|
806 |
//
|
|
807 |
TInt CMmPacketContextTsy::InitialiseContextL(RPacketContext::TDataChannelV2* aDataChannel )
|
|
808 |
{
|
|
809 |
TFLOGSTRING( "TSY: CMmPacketContextTsy::InitialiseContextL." );
|
|
810 |
|
|
811 |
TInt ret( KErrNone );
|
|
812 |
|
|
813 |
// Initialise Context
|
|
814 |
ret = iMmPacketContextGsmWcdmaExt->InitialiseContextL(aDataChannel);
|
|
815 |
|
|
816 |
if ( KErrNone == ret )
|
|
817 |
{
|
|
818 |
// Store the request handle
|
|
819 |
iReqHandleType = EMultimodePacketContextInitialiseContext;
|
|
820 |
}
|
|
821 |
|
|
822 |
return ret;
|
|
823 |
}
|
|
824 |
|
|
825 |
// ---------------------------------------------------------------------------
|
|
826 |
// CMmPacketContextTsy::CompleteInitialiseContext
|
|
827 |
// Complete the asynchronous InitialiseContext request.
|
|
828 |
// (other items were commented in a header).
|
|
829 |
// ---------------------------------------------------------------------------
|
|
830 |
//
|
|
831 |
void CMmPacketContextTsy::CompleteInitialiseContext(const TInt aResult )
|
|
832 |
{
|
|
833 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::CompleteInitialiseContext. Error: %d", aResult );
|
|
834 |
|
|
835 |
// Reset the req handle. Returns the deleted req handle
|
|
836 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
837 |
EMultimodePacketContextInitialiseContext );
|
|
838 |
|
|
839 |
if ( EMultimodePacketContextReqHandleUnknown != reqHandle )
|
|
840 |
{
|
|
841 |
// Complete the client request
|
|
842 |
CMmPacketContextTsy::ReqCompleted( reqHandle, aResult );
|
|
843 |
}
|
|
844 |
|
|
845 |
}
|
|
846 |
|
|
847 |
// ---------------------------------------------------------------------------
|
|
848 |
// CMmPacketContextTsy::ActivateL
|
|
849 |
// Activate a context. This function activates a context that has been
|
|
850 |
// previously configured using the SetConfig() method from RPacketContext.
|
|
851 |
// Once this function completes, the context will remain in an 'Activating'
|
|
852 |
// state until PPP has been successfully negotiated between the phone & the
|
|
853 |
// packet network gateway.Once PPP is negotiated, the context can be
|
|
854 |
// considered to be 'Activated'.
|
|
855 |
// (other items were commented in a header).
|
|
856 |
// ---------------------------------------------------------------------------
|
|
857 |
//
|
|
858 |
TInt CMmPacketContextTsy::ActivateL()
|
|
859 |
{
|
|
860 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::ActivateL. Context name:%S", &iContextName );
|
|
861 |
|
|
862 |
TInt ret( KErrGprsServicesNotAllowed );
|
|
863 |
|
|
864 |
if ( iMmPacketService->IsActivationAllowed() )
|
|
865 |
{
|
|
866 |
// Call ActivateL
|
|
867 |
ret = iMmPacketContextGsmWcdmaExt->ActivateL();
|
|
868 |
}
|
|
869 |
|
|
870 |
if ( KErrNone == ret )
|
|
871 |
{
|
|
872 |
// Store the request handle
|
|
873 |
iReqHandleType = EMultimodePacketContextActivate;
|
|
874 |
}
|
|
875 |
|
|
876 |
return ret;
|
|
877 |
}
|
|
878 |
|
|
879 |
// ---------------------------------------------------------------------------
|
|
880 |
// CMmPacketContextTsy::CompleteActivate
|
|
881 |
// Complete the asynchronous Activate request.
|
|
882 |
// (other items were commented in a header).
|
|
883 |
// ---------------------------------------------------------------------------
|
|
884 |
//
|
|
885 |
void CMmPacketContextTsy::CompleteActivate(
|
|
886 |
const TInt aResult )
|
|
887 |
{
|
|
888 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::CompleteActivate. Error: %d", aResult );
|
|
889 |
// Reset the req handle. Returns the deleted req handle
|
|
890 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
891 |
EMultimodePacketContextActivate );
|
|
892 |
|
|
893 |
if ( EMultimodePacketContextReqHandleUnknown != reqHandle )
|
|
894 |
{
|
|
895 |
|
|
896 |
// Complete the client request
|
|
897 |
CMmPacketContextTsy::ReqCompleted( reqHandle, aResult );
|
|
898 |
}
|
|
899 |
}
|
|
900 |
|
|
901 |
// ---------------------------------------------------------------------------
|
|
902 |
// CMmPacketContextTsy::Deactivate
|
|
903 |
// Deactivate a context previously configured on the phone.
|
|
904 |
// (other items were commented in a header).
|
|
905 |
// ---------------------------------------------------------------------------
|
|
906 |
//
|
|
907 |
TInt CMmPacketContextTsy::DeactivateL()
|
|
908 |
{
|
|
909 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::DeactivateL. Context name:%S", &iContextName );
|
|
910 |
TInt ret( KErrNone );
|
|
911 |
|
|
912 |
// Call Deactivate
|
|
913 |
ret = iMmPacketContextGsmWcdmaExt->DeactivateL();
|
|
914 |
|
|
915 |
if ( KErrNone == ret )
|
|
916 |
{
|
|
917 |
// Store the request handle
|
|
918 |
iReqHandleType = EMultimodePacketContextDeactivate;
|
|
919 |
}
|
|
920 |
|
|
921 |
return ret;
|
|
922 |
}
|
|
923 |
|
|
924 |
// ---------------------------------------------------------------------------
|
|
925 |
// CMmPacketContextTsy::CompleteDeactivate
|
|
926 |
// Complete the asynchronous Deactivate request.
|
|
927 |
// (other items were commented in a header).
|
|
928 |
// ---------------------------------------------------------------------------
|
|
929 |
//
|
|
930 |
void CMmPacketContextTsy::CompleteDeactivate(
|
|
931 |
const TInt aResult )
|
|
932 |
{
|
|
933 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::CompleteDeactivate. Error: %d", aResult );
|
|
934 |
// Reset the req handle. Returns the deleted req handle
|
|
935 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
936 |
EMultimodePacketContextDeactivate );
|
|
937 |
|
|
938 |
if ( EMultimodePacketContextReqHandleUnknown != reqHandle )
|
|
939 |
{
|
|
940 |
|
|
941 |
// Complete the client request
|
|
942 |
CMmPacketContextTsy::ReqCompleted( reqHandle, aResult );
|
|
943 |
}
|
|
944 |
}
|
|
945 |
|
|
946 |
// ---------------------------------------------------------------------------
|
|
947 |
// CMmPacketContextTsy::DeleteL
|
|
948 |
// Delete a context id previously created on the phone.
|
|
949 |
// Note that although the context is considered as 'deleted', the
|
|
950 |
// client's RPacketContext subsession remains. To remove this, a client must
|
|
951 |
// call Close() from RPacketContext.
|
|
952 |
// (other items were commented in a header).
|
|
953 |
// ---------------------------------------------------------------------------
|
|
954 |
//
|
|
955 |
TInt CMmPacketContextTsy::DeleteL()
|
|
956 |
{
|
|
957 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::DeleteL. Context name:%S", &iContextName );
|
|
958 |
|
|
959 |
TInt ret( KErrNone );
|
|
960 |
|
|
961 |
// Call DeleteL
|
|
962 |
ret = iMmPacketContextGsmWcdmaExt->DeleteL();
|
|
963 |
|
|
964 |
if ( KErrNone == ret )
|
|
965 |
{
|
|
966 |
// Store the request handle
|
|
967 |
iReqHandleType = EMultimodePacketContextDelete;
|
|
968 |
}
|
|
969 |
|
|
970 |
return ret;
|
|
971 |
}
|
|
972 |
|
|
973 |
// ---------------------------------------------------------------------------
|
|
974 |
// CMmPacketContextTsy::CompleteDelete
|
|
975 |
// Complete the asynchronous Delete request.
|
|
976 |
// (other items were commented in a header).
|
|
977 |
// ---------------------------------------------------------------------------
|
|
978 |
//
|
|
979 |
void CMmPacketContextTsy::CompleteDelete(
|
|
980 |
const TInt aResult )
|
|
981 |
{
|
|
982 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::CompleteDelete. Error: %d", aResult );
|
|
983 |
// Reset the req handle. Returns the deleted req handle
|
|
984 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
985 |
EMultimodePacketContextDelete );
|
|
986 |
|
|
987 |
if ( EMultimodePacketContextReqHandleUnknown != reqHandle )
|
|
988 |
{
|
|
989 |
// Complete the client request
|
|
990 |
CMmPacketContextTsy::ReqCompleted( reqHandle, aResult );
|
|
991 |
}
|
|
992 |
}
|
|
993 |
|
|
994 |
// ---------------------------------------------------------------------------
|
|
995 |
// CMmPacketContextTsy::GetConfig
|
|
996 |
// Requests the current configuration of the context.
|
|
997 |
// (other items were commented in a header).
|
|
998 |
// ---------------------------------------------------------------------------
|
|
999 |
//
|
|
1000 |
TInt CMmPacketContextTsy::GetConfig(
|
|
1001 |
const TTsyReqHandle aTsyReqHandle,
|
|
1002 |
TPacketDataConfigBase* const aConfig )
|
|
1003 |
{
|
|
1004 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::GetConfig. Context name:%S", &iContextName );
|
|
1005 |
|
|
1006 |
// Get config
|
|
1007 |
TInt ret = iMmPacketContextGsmWcdmaExt->GetConfig( aConfig );
|
|
1008 |
|
|
1009 |
// Complete Request
|
|
1010 |
CMmPacketContextTsy::ReqCompleted( aTsyReqHandle, ret );
|
|
1011 |
|
|
1012 |
return KErrNone;
|
|
1013 |
}
|
|
1014 |
|
|
1015 |
// ---------------------------------------------------------------------------
|
|
1016 |
// CMmPacketContextTsy::GetConnectionSpeed
|
|
1017 |
// Allows a client to get the current connection speed.
|
|
1018 |
// (other items were commented in a header).
|
|
1019 |
// ---------------------------------------------------------------------------
|
|
1020 |
//
|
|
1021 |
TInt CMmPacketContextTsy::GetConnectionSpeed(
|
|
1022 |
const TTsyReqHandle aTsyReqHandle,
|
|
1023 |
TUint* const aRate )
|
|
1024 |
{
|
|
1025 |
TFLOGSTRING3( "TSY: CMmPacketContextTsy::GetConnectionSpeed. Context name: %S Connection Speed:%d bps",
|
|
1026 |
&iContextName, iConnectionSpeed );
|
|
1027 |
|
|
1028 |
// Get current connection speed rate
|
|
1029 |
*aRate = iConnectionSpeed;
|
|
1030 |
|
|
1031 |
// Complete Request
|
|
1032 |
CMmPacketContextTsy::ReqCompleted( aTsyReqHandle, KErrNone );
|
|
1033 |
|
|
1034 |
return KErrNone;
|
|
1035 |
}
|
|
1036 |
|
|
1037 |
// ---------------------------------------------------------------------------
|
|
1038 |
// CMmPacketContextTsy::GetDataVolumeTransferred
|
|
1039 |
// This function gets the data volume transferred.
|
|
1040 |
// (other items were commented in a header).
|
|
1041 |
// ---------------------------------------------------------------------------
|
|
1042 |
//
|
|
1043 |
TInt CMmPacketContextTsy::GetDataVolumeTransferredL(
|
|
1044 |
const TTsyReqHandle aTsyReqHandle,
|
|
1045 |
RPacketContext::TDataVolume* const aVolume )
|
|
1046 |
{
|
|
1047 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::GetDataVolumeTransferredL. Context name:%S", &iContextName );
|
|
1048 |
|
|
1049 |
TInt ret( KErrNone );
|
|
1050 |
|
|
1051 |
if ( RPacketContext::EStatusDeleted != iContextStatus )
|
|
1052 |
{
|
|
1053 |
// Get data volume transferred
|
|
1054 |
ret = iMmPacketContextGsmWcdmaExt->GetDataVolumeTransferredL();
|
|
1055 |
|
|
1056 |
if ( KErrNone == ret )
|
|
1057 |
{
|
|
1058 |
// Store pointer
|
|
1059 |
iRetDataVolume = aVolume;
|
|
1060 |
// Store the request handle type
|
|
1061 |
iReqHandleType = EMultimodePacketContextGetDataVolumeTransferred;
|
|
1062 |
}
|
|
1063 |
}
|
|
1064 |
else
|
|
1065 |
{
|
|
1066 |
// Get current data volume
|
|
1067 |
*aVolume = iDataVolume;
|
|
1068 |
// Complete request
|
|
1069 |
CMmPacketContextTsy::ReqCompleted( aTsyReqHandle, KErrNone );
|
|
1070 |
}
|
|
1071 |
|
|
1072 |
return ret;
|
|
1073 |
}
|
|
1074 |
|
|
1075 |
// ---------------------------------------------------------------------------
|
|
1076 |
// CMmPacketContextTsy::CompleteGetDataVolumeTransferred
|
|
1077 |
// Complete the asynchronous GetDataVolumeTransferred request.
|
|
1078 |
// (other items were commented in a header).
|
|
1079 |
// ---------------------------------------------------------------------------
|
|
1080 |
//
|
|
1081 |
void CMmPacketContextTsy::CompleteGetDataVolumeTransferred(
|
|
1082 |
const TInt aResult )
|
|
1083 |
{
|
|
1084 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::CompleteGetDataVolumeTransferred. Error: %d", aResult );
|
|
1085 |
|
|
1086 |
// Reset the req handle. Returns the deleted req handle
|
|
1087 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1088 |
EMultimodePacketContextGetDataVolumeTransferred );
|
|
1089 |
|
|
1090 |
if ( EMultimodePacketContextReqHandleUnknown != reqHandle )
|
|
1091 |
{
|
|
1092 |
|
|
1093 |
if ( KErrNone == aResult )
|
|
1094 |
{
|
|
1095 |
*iRetDataVolume = iDataVolume;
|
|
1096 |
}
|
|
1097 |
|
|
1098 |
// Null ret pointer
|
|
1099 |
iRetDataVolume = NULL;
|
|
1100 |
|
|
1101 |
// Complete the client request
|
|
1102 |
CMmPacketContextTsy::ReqCompleted( reqHandle, aResult );
|
|
1103 |
}
|
|
1104 |
|
|
1105 |
}
|
|
1106 |
|
|
1107 |
// ---------------------------------------------------------------------------
|
|
1108 |
// CMmPacketContextTsy::GetLastErrorCause
|
|
1109 |
// This function retrieves the last error cause to have occurred.
|
|
1110 |
// (other items were commented in a header).
|
|
1111 |
// ---------------------------------------------------------------------------
|
|
1112 |
//
|
|
1113 |
TInt CMmPacketContextTsy::GetLastErrorCause(
|
|
1114 |
const TTsyReqHandle aTsyReqHandle,
|
|
1115 |
TInt* const aError )
|
|
1116 |
{
|
|
1117 |
TFLOGSTRING3( "TSY: CMmPacketContextTsy::GetLastErrorCause. Context name:%S Last error cause: %d",
|
|
1118 |
&iContextName, iLastErrorCause );
|
|
1119 |
|
|
1120 |
*aError = iLastErrorCause;
|
|
1121 |
CMmPacketContextTsy::ReqCompleted( aTsyReqHandle, KErrNone );
|
|
1122 |
|
|
1123 |
return KErrNone;
|
|
1124 |
}
|
|
1125 |
|
|
1126 |
// ---------------------------------------------------------------------------
|
|
1127 |
// CMmPacketContextTsy::GetProfileName
|
|
1128 |
// Allows a client to retrieve the name of the QoS profile. The QoS profile is
|
|
1129 |
// associated with the context. If no QoS profile has been defined by the
|
|
1130 |
// client, the name to be returned will be NULL.
|
|
1131 |
// (other items were commented in a header).
|
|
1132 |
// ---------------------------------------------------------------------------
|
|
1133 |
//
|
|
1134 |
TInt CMmPacketContextTsy::GetProfileName(
|
|
1135 |
const TTsyReqHandle aTsyReqHandle,
|
|
1136 |
TInfoName* const aQoSProfile )
|
|
1137 |
{
|
|
1138 |
if ( NULL != iQoSProfile )
|
|
1139 |
{
|
|
1140 |
*aQoSProfile = iQoSProfileName;
|
|
1141 |
}
|
|
1142 |
else
|
|
1143 |
{
|
|
1144 |
// QoS profile not found
|
|
1145 |
aQoSProfile->Zero();
|
|
1146 |
}
|
|
1147 |
|
|
1148 |
TFLOGSTRING3( "TSY: CMmPacketContextTsy::GetProfileName. Context name: %S QoS Profile Name: %S",
|
|
1149 |
&iContextName, aQoSProfile );
|
|
1150 |
|
|
1151 |
CMmPacketContextTsy::ReqCompleted( aTsyReqHandle, KErrNone );
|
|
1152 |
return KErrNone;
|
|
1153 |
}
|
|
1154 |
|
|
1155 |
// ---------------------------------------------------------------------------
|
|
1156 |
// CMmPacketContextTsy::GetStatus
|
|
1157 |
// Allows a client to get the current status of the context.
|
|
1158 |
// (other items were commented in a header).
|
|
1159 |
// ---------------------------------------------------------------------------
|
|
1160 |
//
|
|
1161 |
TInt CMmPacketContextTsy::GetStatus(
|
|
1162 |
const TTsyReqHandle aTsyReqHandle,
|
|
1163 |
RPacketContext::TContextStatus* const aContextStatus )
|
|
1164 |
{
|
|
1165 |
TFLOGSTRING3( "TSY: CMmPacketContextTsy::GetStatus. Context name: %S Context Status:%d",
|
|
1166 |
&iContextName, iContextStatus );
|
|
1167 |
*aContextStatus = iContextStatus;
|
|
1168 |
CMmPacketContextTsy::ReqCompleted( aTsyReqHandle, KErrNone );
|
|
1169 |
|
|
1170 |
return KErrNone;
|
|
1171 |
}
|
|
1172 |
|
|
1173 |
// ---------------------------------------------------------------------------
|
|
1174 |
// CMmPacketContextTsy::NotifyConfigChanged
|
|
1175 |
// Requests notification when configuration of context changes.
|
|
1176 |
// (other items were commented in a header).
|
|
1177 |
// ---------------------------------------------------------------------------
|
|
1178 |
//
|
|
1179 |
TInt CMmPacketContextTsy::NotifyConfigChanged(
|
|
1180 |
TPacketDataConfigBase* const aConfig )
|
|
1181 |
{
|
|
1182 |
TFLOGSTRING( "TSY: CMmPacketContextTsy::NotifyConfigChanged." );
|
|
1183 |
|
|
1184 |
// Call NotifyConfigChanged from extension
|
|
1185 |
TInt ret = iMmPacketContextGsmWcdmaExt->NotifyConfigChanged( *aConfig );
|
|
1186 |
|
|
1187 |
if ( KErrNone == ret )
|
|
1188 |
{
|
|
1189 |
if ( TPacketDataConfigBase::KConfigGPRS == aConfig->ExtensionId() )
|
|
1190 |
{
|
|
1191 |
// Store pointer
|
|
1192 |
iRetNotifyConfig = aConfig;
|
|
1193 |
// Store req handle type
|
|
1194 |
iReqHandleType = EMultimodePacketContextNotifyConfigChanged;
|
|
1195 |
}
|
|
1196 |
|
|
1197 |
else
|
|
1198 |
{
|
|
1199 |
// Store pointer
|
|
1200 |
iRetNotifyConfig2 = aConfig;
|
|
1201 |
// Store req handle type
|
|
1202 |
iReqHandleType = EMultimodePacketContextNotifyConfigChanged99;
|
|
1203 |
}
|
|
1204 |
}
|
|
1205 |
|
|
1206 |
return ret;
|
|
1207 |
}
|
|
1208 |
|
|
1209 |
// ---------------------------------------------------------------------------
|
|
1210 |
// CMmPacketContextTsy::CompleteNotifyConfigChanged
|
|
1211 |
// Complete notification when the context configuration changes.
|
|
1212 |
// (other items were commented in a header).
|
|
1213 |
// ---------------------------------------------------------------------------
|
|
1214 |
//
|
|
1215 |
void CMmPacketContextTsy::CompleteNotifyConfigChanged()
|
|
1216 |
{
|
|
1217 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::CompleteNotifyConfigChanged. Context name:%S",
|
|
1218 |
&iContextName );
|
|
1219 |
|
|
1220 |
// Get and reset req handle for R97/98 config notify
|
|
1221 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1222 |
EMultimodePacketContextNotifyConfigChanged );
|
|
1223 |
|
|
1224 |
if ( EMultimodePacketContextReqHandleUnknown != reqHandle )
|
|
1225 |
{
|
|
1226 |
// Get current configuration
|
|
1227 |
iMmPacketContextGsmWcdmaExt->GetConfig( iRetNotifyConfig );
|
|
1228 |
// Null ret pointer
|
|
1229 |
iRetNotifyConfig = NULL;
|
|
1230 |
// Complete the client request
|
|
1231 |
CMmPacketContextTsy::ReqCompleted( reqHandle, KErrNone );
|
|
1232 |
}
|
|
1233 |
|
|
1234 |
// Get and reset req handle for R99_R4 config notify
|
|
1235 |
reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1236 |
EMultimodePacketContextNotifyConfigChanged99 );
|
|
1237 |
|
|
1238 |
if ( EMultimodePacketContextReqHandleUnknown != reqHandle )
|
|
1239 |
{
|
|
1240 |
// Get current configuration
|
|
1241 |
iMmPacketContextGsmWcdmaExt->GetConfig( iRetNotifyConfig2 );
|
|
1242 |
// Null ret pointer
|
|
1243 |
iRetNotifyConfig2 = NULL;
|
|
1244 |
// Complete the client request
|
|
1245 |
CMmPacketContextTsy::ReqCompleted( reqHandle, KErrNone );
|
|
1246 |
}
|
|
1247 |
}
|
|
1248 |
|
|
1249 |
// ---------------------------------------------------------------------------
|
|
1250 |
// CMmPacketContextTsy::NotifyConnectionSpeedChange
|
|
1251 |
// Requests notification when connection speed changes.
|
|
1252 |
// (other items were commented in a header).
|
|
1253 |
// ---------------------------------------------------------------------------
|
|
1254 |
//
|
|
1255 |
TInt CMmPacketContextTsy::NotifyConnectionSpeedChange(
|
|
1256 |
TUint* const aRate )
|
|
1257 |
{
|
|
1258 |
TFLOGSTRING( "TSY: CMmPacketContextTsy::NotifyConnectionSpeedChange." );
|
|
1259 |
|
|
1260 |
// Store pointer
|
|
1261 |
iRetNotifyConnectionSpeed = aRate;
|
|
1262 |
// Store req handle type
|
|
1263 |
iReqHandleType = EMultimodePacketContextNotifyConnectionSpeedChange;
|
|
1264 |
|
|
1265 |
return KErrNone;
|
|
1266 |
}
|
|
1267 |
|
|
1268 |
// ---------------------------------------------------------------------------
|
|
1269 |
// CMmPacketContextTsy::CompleteNotifyConnectionSpeedChange
|
|
1270 |
// Complete the notification when the connection speed changes.
|
|
1271 |
// (other items were commented in a header).
|
|
1272 |
// ---------------------------------------------------------------------------
|
|
1273 |
//
|
|
1274 |
void CMmPacketContextTsy::CompleteNotifyConnectionSpeedChange(
|
|
1275 |
TInt const aConnectionSpeed )
|
|
1276 |
{
|
|
1277 |
iConnectionSpeed = aConnectionSpeed;
|
|
1278 |
|
|
1279 |
if ( iNotifyConnectionSpeed != iConnectionSpeed )
|
|
1280 |
{
|
|
1281 |
TFLOGSTRING3( "TSY: CMmPacketContextTsy::CompleteNotifyConnectionSpeedChange. Context name:%S Connection Speed:%d bps",
|
|
1282 |
&iContextName, iConnectionSpeed );
|
|
1283 |
|
|
1284 |
// Store the connection speed internally
|
|
1285 |
iNotifyConnectionSpeed = iConnectionSpeed;
|
|
1286 |
|
|
1287 |
// Get and reset req handle
|
|
1288 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1289 |
EMultimodePacketContextNotifyConnectionSpeedChange );
|
|
1290 |
|
|
1291 |
if ( EMultimodePacketContextReqHandleUnknown != reqHandle )
|
|
1292 |
{
|
|
1293 |
// Get current connection speed
|
|
1294 |
*iRetNotifyConnectionSpeed = iNotifyConnectionSpeed;
|
|
1295 |
// Null ret pointer
|
|
1296 |
iRetNotifyConnectionSpeed = NULL;
|
|
1297 |
// Complete the client request
|
|
1298 |
CMmPacketContextTsy::ReqCompleted( reqHandle, KErrNone );
|
|
1299 |
}
|
|
1300 |
}
|
|
1301 |
}
|
|
1302 |
|
|
1303 |
// ---------------------------------------------------------------------------
|
|
1304 |
// CMmPacketContextTsy::NotifyStatusChange
|
|
1305 |
// Requests notification when the status of the context changes.
|
|
1306 |
// (other items were commented in a header).
|
|
1307 |
// ---------------------------------------------------------------------------
|
|
1308 |
//
|
|
1309 |
TInt CMmPacketContextTsy::NotifyStatusChange(
|
|
1310 |
RPacketContext::TContextStatus* const aContextStatus )
|
|
1311 |
{
|
|
1312 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::NotifyStatusChange. Context name:%S", &iContextName );
|
|
1313 |
iRetNotifyStatus = aContextStatus;
|
|
1314 |
iReqHandleType = EMultimodePacketContextNotifyStatusChange;
|
|
1315 |
|
|
1316 |
return KErrNone;
|
|
1317 |
}
|
|
1318 |
|
|
1319 |
// ---------------------------------------------------------------------------
|
|
1320 |
// CMmPacketContextTsy::CompleteNotifyStatusChange
|
|
1321 |
// Complete the notification when the context status changes.
|
|
1322 |
// (other items were commented in a header).
|
|
1323 |
// ---------------------------------------------------------------------------
|
|
1324 |
//
|
|
1325 |
void CMmPacketContextTsy::CompleteNotifyStatusChange(
|
|
1326 |
const RPacketContext::TContextStatus aContextStatus )
|
|
1327 |
{
|
|
1328 |
|
|
1329 |
if ( aContextStatus != iContextStatus )
|
|
1330 |
{
|
|
1331 |
iContextStatus = aContextStatus;
|
|
1332 |
TFLOGSTRING3( "TSY: CMmPacketContextTsy::CompleteNotifyStatusChange. Context name: %S Context status:%d",
|
|
1333 |
&iContextName, iContextStatus );
|
|
1334 |
|
|
1335 |
if ( RPacketContext::EStatusActive == iContextStatus ||
|
|
1336 |
RPacketContext::EStatusInactive == iContextStatus ||
|
|
1337 |
RPacketContext::EStatusDeleted == iContextStatus )
|
|
1338 |
{
|
|
1339 |
iMmPacketService->ContextStatusChanged( iContextStatus );
|
|
1340 |
if( RPacketContext::EStatusDeleted == iContextStatus )
|
|
1341 |
{
|
|
1342 |
iMmPacketContextGsmWcdmaExt->SetContextStatusBeforeDeactivation(
|
|
1343 |
RPacketContext::EStatusDeleted );
|
|
1344 |
}
|
|
1345 |
}
|
|
1346 |
|
|
1347 |
// Reset req handle. Returns the deleted req handle
|
|
1348 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1349 |
EMultimodePacketContextNotifyStatusChange );
|
|
1350 |
|
|
1351 |
if ( EMultimodePacketContextReqHandleUnknown != reqHandle )
|
|
1352 |
{
|
|
1353 |
// Get current status
|
|
1354 |
*iRetNotifyStatus = aContextStatus;
|
|
1355 |
// Null ret pointer
|
|
1356 |
iRetNotifyStatus = NULL;
|
|
1357 |
// Complete the client request
|
|
1358 |
CMmPacketContextTsy::ReqCompleted( reqHandle, KErrNone );
|
|
1359 |
}
|
|
1360 |
}
|
|
1361 |
}
|
|
1362 |
|
|
1363 |
// ---------------------------------------------------------------------------
|
|
1364 |
// CMmPacketContextTsy::SetConfigL
|
|
1365 |
// Configure a context to the phone.
|
|
1366 |
// (other items were commented in a header).
|
|
1367 |
// ---------------------------------------------------------------------------
|
|
1368 |
//
|
|
1369 |
TInt CMmPacketContextTsy::SetConfigL(
|
|
1370 |
TPacketDataConfigBase* const aConfig )
|
|
1371 |
{
|
|
1372 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::SetConfigL. Context name:%S", &iContextName );
|
|
1373 |
|
|
1374 |
// Call SetConfigL
|
|
1375 |
TInt ret = iMmPacketContextGsmWcdmaExt->SetConfigL( aConfig );
|
|
1376 |
|
|
1377 |
if ( KErrNone == ret )
|
|
1378 |
{
|
|
1379 |
// Store the request handle type
|
|
1380 |
iReqHandleType = EMultimodePacketContextSetConfig;
|
|
1381 |
}
|
|
1382 |
|
|
1383 |
return ret;
|
|
1384 |
}
|
|
1385 |
|
|
1386 |
// ---------------------------------------------------------------------------
|
|
1387 |
// CMmPacketContextTsy::CompleteSetConfig
|
|
1388 |
// Complete the asynchronous SetConfig request.
|
|
1389 |
// (other items were commented in a header).
|
|
1390 |
// ---------------------------------------------------------------------------
|
|
1391 |
//
|
|
1392 |
void CMmPacketContextTsy::CompleteSetConfig(
|
|
1393 |
const TInt aError,
|
|
1394 |
TBool aIsAddMediaAuthorizationCalled )
|
|
1395 |
{
|
|
1396 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::CompleteSetConfig. Error: %d", aError );
|
|
1397 |
|
|
1398 |
TTsyReqHandle reqHandle( EMultimodePacketContextReqHandleUnknown );
|
|
1399 |
//if context exists eg. its name length is bigger than zero
|
|
1400 |
if( 0 == CMmPacketContextTsy::HostCID().Length() )
|
|
1401 |
{
|
|
1402 |
reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1403 |
EMultimodePacketContextSetConfig );
|
|
1404 |
}
|
|
1405 |
|
|
1406 |
else
|
|
1407 |
{
|
|
1408 |
if( aIsAddMediaAuthorizationCalled )
|
|
1409 |
{
|
|
1410 |
reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1411 |
EMultimodePacketContextAddMediaAuthorization );
|
|
1412 |
}
|
|
1413 |
else
|
|
1414 |
{
|
|
1415 |
#ifdef USING_CTSY_DISPATCHER
|
|
1416 |
// Distinguish between RemovePacketFilter and AddPacketFilter..
|
|
1417 |
|
|
1418 |
// There is a hang defect lurking here.
|
|
1419 |
//
|
|
1420 |
// To show the defect, add and run the following test case (you could
|
|
1421 |
// copy from CCTsyPacketServicesFU::TestUseCase0007L):
|
|
1422 |
// - Add a packet filter. Wait for the request to complete.
|
|
1423 |
// - Remove the packet filter. (don't wait for completion)
|
|
1424 |
// - Add another packet filter.
|
|
1425 |
// - Wait for removal to complete (WILL HANG but obviously shouldn't).
|
|
1426 |
//
|
|
1427 |
// The reason for this hang is that there's a single completion method
|
|
1428 |
// for both Add and Remove packet filter functions down in the CTSY
|
|
1429 |
// (dispatcher mode only).
|
|
1430 |
//
|
|
1431 |
// If a client calls RemovePacketFilter, then immediately
|
|
1432 |
// calls AddPacketFilter (before the RemovePacketFilter has
|
|
1433 |
// completed), the iReqHandleType data member will already have been
|
|
1434 |
// updated to be EMultimodePacketContextAddPacketFilter..
|
|
1435 |
// So the code under the else below (that searches for the
|
|
1436 |
// RemovePacketFilter reqHandle and completes it) will never get run.
|
|
1437 |
// Thus the RemovePacketFilter call will hang.
|
|
1438 |
//
|
|
1439 |
// Fixing this requires that some other variable (NOT iReqHandleType)
|
|
1440 |
// is used to record that an add or a remove action is outstanding.
|
|
1441 |
//
|
|
1442 |
// When this defect has been addressed, please treat all the sections marked
|
|
1443 |
// ADD_REMOVE_PACKETFILTER_DEFECT_FIXED above as defined, and delete any
|
|
1444 |
// else blocks. This will then assert that the iReqHandleType doesn't
|
|
1445 |
// leak between calls. Which will protect us against any other such hang
|
|
1446 |
// bugs in the future.
|
|
1447 |
// This is the change that I was trying to apply when I ran into this defect.
|
|
1448 |
// See Perforce CL#1755436
|
|
1449 |
// Rob Lundie Hill
|
|
1450 |
|
|
1451 |
if (iReqHandleType == EMultimodePacketContextRemovePacketFilter)
|
|
1452 |
{
|
|
1453 |
reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( EMultimodePacketContextRemovePacketFilter );
|
|
1454 |
}
|
|
1455 |
else
|
|
1456 |
{
|
|
1457 |
reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( EMultimodePacketContextAddPacketFilter );
|
|
1458 |
}
|
|
1459 |
#else
|
|
1460 |
reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1461 |
EMultimodePacketContextAddPacketFilter );
|
|
1462 |
#endif //USING_CTSY_DISPATCHER
|
|
1463 |
}
|
|
1464 |
}
|
|
1465 |
|
|
1466 |
if ( EMultimodePacketContextReqHandleUnknown != reqHandle )
|
|
1467 |
{
|
|
1468 |
|
|
1469 |
// Complete the client request
|
|
1470 |
CMmPacketContextTsy::ReqCompleted( reqHandle, aError );
|
|
1471 |
}
|
|
1472 |
}
|
|
1473 |
|
|
1474 |
// ---------------------------------------------------------------------------
|
|
1475 |
// CMmPacketContextTsy::SetDataVolume
|
|
1476 |
// Set the volume of transferred data.
|
|
1477 |
// (other items were commented in a header).
|
|
1478 |
// ---------------------------------------------------------------------------
|
|
1479 |
//
|
|
1480 |
void CMmPacketContextTsy::SetDataVolume(
|
|
1481 |
const TInt /* aResult */,
|
|
1482 |
RPacketContext::TDataVolume dataVolume )
|
|
1483 |
{
|
|
1484 |
|
|
1485 |
TFLOGSTRING( "TSY: CMmPacketContextTsy::SetDataVolume" );
|
|
1486 |
|
|
1487 |
if ( dataVolume.iBytesSent < iDataVolume.iBytesSent )
|
|
1488 |
{
|
|
1489 |
// The value of sent data has turned around the 4 GB
|
|
1490 |
iDataVolume.iOverflowCounterSent++;
|
|
1491 |
}
|
|
1492 |
iDataVolume.iBytesSent = dataVolume.iBytesSent;
|
|
1493 |
|
|
1494 |
|
|
1495 |
if ( dataVolume.iBytesReceived < iDataVolume.iBytesReceived )
|
|
1496 |
{
|
|
1497 |
// The value of received data has turned around the 4 GB
|
|
1498 |
iDataVolume.iOverflowCounterReceived++;
|
|
1499 |
}
|
|
1500 |
iDataVolume.iBytesReceived = dataVolume.iBytesReceived;
|
|
1501 |
|
|
1502 |
}
|
|
1503 |
|
|
1504 |
// ---------------------------------------------------------------------------
|
|
1505 |
// CMmPacketContextTsy::SetLastErrorCause
|
|
1506 |
// Set the last error cause.
|
|
1507 |
// (other items were commented in a header).
|
|
1508 |
// ---------------------------------------------------------------------------
|
|
1509 |
//
|
|
1510 |
void CMmPacketContextTsy::SetLastErrorCause(
|
|
1511 |
const TInt aErrorCause )
|
|
1512 |
{
|
|
1513 |
if ( RPacketContext::EStatusActivating == iContextStatus ||
|
|
1514 |
RPacketContext::EStatusDeactivating == iContextStatus )
|
|
1515 |
{
|
|
1516 |
iLastErrorCause = aErrorCause;
|
|
1517 |
}
|
|
1518 |
|
|
1519 |
TFLOGSTRING3( "TSY: CMmPacketContextTsy::SetLastErrorCause. aErrorCause: %d iLastErrorCause:%d",
|
|
1520 |
aErrorCause, iLastErrorCause );
|
|
1521 |
|
|
1522 |
}
|
|
1523 |
|
|
1524 |
// ---------------------------------------------------------------------------
|
|
1525 |
// CMmPacketContextTsy::ContextStatus
|
|
1526 |
// Return current context status.
|
|
1527 |
// (other items were commented in a header).
|
|
1528 |
// ---------------------------------------------------------------------------
|
|
1529 |
//
|
|
1530 |
RPacketContext::TContextStatus CMmPacketContextTsy::ContextStatus() const
|
|
1531 |
{
|
|
1532 |
return iContextStatus;
|
|
1533 |
}
|
|
1534 |
|
|
1535 |
// ---------------------------------------------------------------------------
|
|
1536 |
// CMmPacketContextTsy::ContextSuspended
|
|
1537 |
// Suspend the context.
|
|
1538 |
// (other items were commented in a header).
|
|
1539 |
// ---------------------------------------------------------------------------
|
|
1540 |
//
|
|
1541 |
void CMmPacketContextTsy::ContextSuspended()
|
|
1542 |
{
|
|
1543 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::ContextSuspended. Context status before suspending: %d",
|
|
1544 |
iContextStatus );
|
|
1545 |
|
|
1546 |
if ( ( RPacketContext::EStatusActivating == iContextStatus ) ||
|
|
1547 |
( RPacketContext::EStatusActive == iContextStatus ) ||
|
|
1548 |
( RPacketContext::EStatusDeactivating == iContextStatus ) )
|
|
1549 |
{
|
|
1550 |
iContextStatusBeforeSuspending = iContextStatus;
|
|
1551 |
CMmPacketContextTsy::CompleteNotifyStatusChange(
|
|
1552 |
RPacketContext::EStatusSuspended );
|
|
1553 |
}
|
|
1554 |
}
|
|
1555 |
|
|
1556 |
// ---------------------------------------------------------------------------
|
|
1557 |
// CMmPacketContextTsy::ContextResumed
|
|
1558 |
// Resume the suspended context.
|
|
1559 |
// (other items were commented in a header).
|
|
1560 |
// ---------------------------------------------------------------------------
|
|
1561 |
//
|
|
1562 |
void CMmPacketContextTsy::ContextResumed()
|
|
1563 |
{
|
|
1564 |
if ( RPacketContext::EStatusSuspended == iContextStatus )
|
|
1565 |
{
|
|
1566 |
CMmPacketContextTsy::CompleteNotifyStatusChange(
|
|
1567 |
iContextStatusBeforeSuspending );
|
|
1568 |
}
|
|
1569 |
|
|
1570 |
iContextStatusBeforeSuspending = RPacketContext::EStatusUnknown;
|
|
1571 |
|
|
1572 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::ContextResumed. Context status when resumed: %d",
|
|
1573 |
iContextStatus );
|
|
1574 |
|
|
1575 |
}
|
|
1576 |
|
|
1577 |
// ---------------------------------------------------------------------------
|
|
1578 |
// CMmPacketContextTsy::PacketContextGsmWcdmaExt
|
|
1579 |
// Return pointer to the CMmPacketContextGsmWcdmaExt.
|
|
1580 |
// (other items were commented in a header).
|
|
1581 |
// ---------------------------------------------------------------------------
|
|
1582 |
//
|
|
1583 |
CMmPacketContextGsmWcdmaExt* CMmPacketContextTsy::PacketContextGsmWcdmaExt() const
|
|
1584 |
{
|
|
1585 |
return iMmPacketContextGsmWcdmaExt;
|
|
1586 |
}
|
|
1587 |
|
|
1588 |
// ---------------------------------------------------------------------------
|
|
1589 |
// CMmPacketContextTsy::PacketQoSTsy
|
|
1590 |
// Return a pointer to the PacketQoSTsy.
|
|
1591 |
// (other items were commented in a header).
|
|
1592 |
// ---------------------------------------------------------------------------
|
|
1593 |
//
|
|
1594 |
CMmPacketQoSTsy* CMmPacketContextTsy::PacketQoSTsy() const
|
|
1595 |
{
|
|
1596 |
return iQoSProfile;
|
|
1597 |
}
|
|
1598 |
|
|
1599 |
// ---------------------------------------------------------------------------
|
|
1600 |
// CMmPacketContextTsy::RemoveQoS
|
|
1601 |
// Remove the pointer to PacketQoSTsy.
|
|
1602 |
// (other items were commented in a header).
|
|
1603 |
// ---------------------------------------------------------------------------
|
|
1604 |
//
|
|
1605 |
void CMmPacketContextTsy::RemoveQoS()
|
|
1606 |
{
|
|
1607 |
TFLOGSTRING( "TSY: CMmPacketContextTsy::RemoveQoS." );
|
|
1608 |
|
|
1609 |
iQoSProfile = NULL;
|
|
1610 |
iQoSProfileName.Zero();
|
|
1611 |
}
|
|
1612 |
|
|
1613 |
// ---------------------------------------------------------------------------
|
|
1614 |
// CMmPacketContextTsy::ReqCompleted
|
|
1615 |
// Overloads CTelObject::ReqCompleted.
|
|
1616 |
// (other items were commented in a header).
|
|
1617 |
// ---------------------------------------------------------------------------
|
|
1618 |
//
|
|
1619 |
void CMmPacketContextTsy::ReqCompleted(
|
|
1620 |
const TTsyReqHandle aTsyReqHandle,
|
|
1621 |
const TInt aError )
|
|
1622 |
{
|
|
1623 |
TFLOGSTRING3( "TSY: CMmPacketContextTsy::ReqCompleted. Handle:%d Error:%d",
|
|
1624 |
aTsyReqHandle, aError );
|
|
1625 |
|
|
1626 |
// Set last error cause
|
|
1627 |
if ( KErrNone != aError )
|
|
1628 |
{
|
|
1629 |
iLastErrorCause = aError;
|
|
1630 |
}
|
|
1631 |
|
|
1632 |
CTelObject::ReqCompleted( aTsyReqHandle, aError );
|
|
1633 |
|
|
1634 |
}
|
|
1635 |
|
|
1636 |
#ifdef REQHANDLE_TIMER
|
|
1637 |
|
|
1638 |
|
|
1639 |
// ---------------------------------------------------------------------------
|
|
1640 |
// CMmPacketContextTsy::SetTypeOfResponse
|
|
1641 |
// Sets the type of response for a given request handle. Automatic mode
|
|
1642 |
// includes an automatic response in case of non response from the DOS in a
|
|
1643 |
// specified time. This method is used only if REQHANDLE_TIMER is in use.
|
|
1644 |
// ---------------------------------------------------------------------------
|
|
1645 |
//
|
|
1646 |
void CMmPacketContextTsy::SetTypeOfResponse(
|
|
1647 |
const TInt aReqHandleType,
|
|
1648 |
const TTsyReqHandle aTsyReqHandle )
|
|
1649 |
{
|
|
1650 |
TInt timeOut( 0 );
|
|
1651 |
|
|
1652 |
// Set timeout by req handle type
|
|
1653 |
switch ( aReqHandleType )
|
|
1654 |
{
|
|
1655 |
case EMultimodePacketContextInitialiseContext:
|
|
1656 |
timeOut = KMmPacketContextInitialiseContextTimeOut;
|
|
1657 |
break;
|
|
1658 |
case EMultimodePacketContextSetConfig:
|
|
1659 |
timeOut = KMmPacketContextSetConfigTimeOut;
|
|
1660 |
break;
|
|
1661 |
case EMultimodePacketContextActivate:
|
|
1662 |
timeOut = KMmPacketContextActivateTimeOut;
|
|
1663 |
break;
|
|
1664 |
case EMultimodePacketContextDeactivate:
|
|
1665 |
timeOut = KMmPacketContextDeactivateTimeOut;
|
|
1666 |
break;
|
|
1667 |
case EMultimodePacketContextDelete:
|
|
1668 |
timeOut = KMmPacketContextDeleteTimeOut;
|
|
1669 |
break;
|
|
1670 |
case EMultimodePacketContextGetDataVolumeTransferred:
|
|
1671 |
timeOut = KMmPacketContextGetDataVolumeTransferredTimeOut;
|
|
1672 |
break;
|
|
1673 |
case EMultimodePacketContextModifyActiveContext:
|
|
1674 |
timeOut = KMmPacketContextModifyActiveContext;
|
|
1675 |
break;
|
|
1676 |
case EMultimodePacketContextAddMediaAuthorization:
|
|
1677 |
timeOut = KMmPacketContextAddMediaAuthorization;
|
|
1678 |
break;
|
|
1679 |
|
|
1680 |
// Can't use timer:
|
|
1681 |
// - all notifications
|
|
1682 |
//case EMultimodePacketContextNotifyConfigChanged:
|
|
1683 |
//case EMultimodePacketContextNotifyConnectionSpeedChange:
|
|
1684 |
//case EMultimodePacketContextNotifyStatusChange:
|
|
1685 |
default:
|
|
1686 |
// Do not use timer
|
|
1687 |
iTsyReqHandleStore->SetTsyReqHandle( aReqHandleType,
|
|
1688 |
aTsyReqHandle );
|
|
1689 |
break;
|
|
1690 |
}
|
|
1691 |
|
|
1692 |
if ( 0 < timeOut )
|
|
1693 |
{
|
|
1694 |
// The timeout parameter is given in seconds.
|
|
1695 |
iTsyReqHandleStore->SetTsyReqHandle( aReqHandleType, aTsyReqHandle,
|
|
1696 |
timeOut );
|
|
1697 |
}
|
|
1698 |
|
|
1699 |
}
|
|
1700 |
|
|
1701 |
// ---------------------------------------------------------------------------
|
|
1702 |
// CMmPacketContextTsy::Complete
|
|
1703 |
// Completes the request due the timer expiration. This method is used only if
|
|
1704 |
// REQHANDLE_TIMER is in use.
|
|
1705 |
// ---------------------------------------------------------------------------
|
|
1706 |
//
|
|
1707 |
void CMmPacketContextTsy::Complete(
|
|
1708 |
const TInt aReqHandleType,
|
|
1709 |
const TInt aError )
|
|
1710 |
{
|
|
1711 |
// All possible TSY req handle types are listed in the
|
|
1712 |
// switch case below.
|
|
1713 |
switch ( aReqHandleType )
|
|
1714 |
{
|
|
1715 |
case EMultimodePacketContextInitialiseContext:
|
|
1716 |
CMmPacketContextTsy::CompleteInitialiseContext( aError );
|
|
1717 |
break;
|
|
1718 |
case EMultimodePacketContextSetConfig:
|
|
1719 |
CMmPacketContextTsy::CompleteSetConfig( aError );
|
|
1720 |
break;
|
|
1721 |
case EMultimodePacketContextActivate:
|
|
1722 |
CMmPacketContextTsy::CompleteActivate( aError );
|
|
1723 |
break;
|
|
1724 |
case EMultimodePacketContextDeactivate:
|
|
1725 |
CMmPacketContextTsy::CompleteDeactivate( aError );
|
|
1726 |
break;
|
|
1727 |
case EMultimodePacketContextDelete:
|
|
1728 |
CMmPacketContextTsy::CompleteDelete( aError );
|
|
1729 |
break;
|
|
1730 |
case EMultimodePacketContextGetDataVolumeTransferred:
|
|
1731 |
CMmPacketContextTsy::CompleteGetDataVolumeTransferred( aError );
|
|
1732 |
break;
|
|
1733 |
case EMultimodePacketContextModifyActiveContext:
|
|
1734 |
CMmPacketContextTsy::CompleteModifyActiveContext( aError );
|
|
1735 |
break;
|
|
1736 |
case EMultimodePacketContextAddMediaAuthorization:
|
|
1737 |
CMmPacketContextTsy::CompleteSetConfig( aError, ETrue );
|
|
1738 |
break;
|
|
1739 |
|
|
1740 |
// Can't use timer:
|
|
1741 |
// - all notifications
|
|
1742 |
//case EMultimodePacketContextNotifyConfigChanged:
|
|
1743 |
//case EMultimodePacketContextNotifyConnectionSpeedChange:
|
|
1744 |
//case EMultimodePacketContextNotifyStatusChange:
|
|
1745 |
default:
|
|
1746 |
CMmPacketContextTsy::ReqCompleted( iTsyReqHandleStore->
|
|
1747 |
ResetTsyReqHandle( aReqHandleType ), aError );
|
|
1748 |
break;
|
|
1749 |
}
|
|
1750 |
|
|
1751 |
}
|
|
1752 |
|
|
1753 |
#endif // REQHANDLE_TIMER
|
|
1754 |
|
|
1755 |
// ---------------------------------------------------------------------------
|
|
1756 |
// CMmPacketContextTsy::IsDialUpContext
|
|
1757 |
// Return ETrue if this is dial-up context, otherwise EFalse.
|
|
1758 |
// (other items were commented in a header).
|
|
1759 |
// ---------------------------------------------------------------------------
|
|
1760 |
//
|
|
1761 |
TBool CMmPacketContextTsy::IsDialUpContext(
|
|
1762 |
const TInfoName* const aContextName ) const
|
|
1763 |
{
|
|
1764 |
|
|
1765 |
TBool ret( EFalse );
|
|
1766 |
|
|
1767 |
if ( NULL != aContextName )
|
|
1768 |
{
|
|
1769 |
if ( *aContextName == iContextName )
|
|
1770 |
{
|
|
1771 |
ret = ETrue;
|
|
1772 |
}
|
|
1773 |
}
|
|
1774 |
else
|
|
1775 |
{
|
|
1776 |
ret = iIsDialUpContext;
|
|
1777 |
}
|
|
1778 |
|
|
1779 |
return ret;
|
|
1780 |
}
|
|
1781 |
|
|
1782 |
// ---------------------------------------------------------------------------
|
|
1783 |
// CMmPacketContextTsy::ResetDialUpContext
|
|
1784 |
// Reset the externally created dial-up context's data.
|
|
1785 |
// ---------------------------------------------------------------------------
|
|
1786 |
//
|
|
1787 |
void CMmPacketContextTsy::ResetDialUpContext()
|
|
1788 |
{
|
|
1789 |
|
|
1790 |
TFLOGSTRING( "TSY: CMmPacketContextTsy::ResetDialUpContext." );
|
|
1791 |
|
|
1792 |
iDataVolume.iOverflowCounterSent = 0;
|
|
1793 |
iDataVolume.iBytesSent = 0;
|
|
1794 |
iDataVolume.iOverflowCounterReceived = 0;
|
|
1795 |
iDataVolume.iBytesReceived = 0;
|
|
1796 |
|
|
1797 |
iContextStatus = RPacketContext::EStatusInactive;
|
|
1798 |
|
|
1799 |
}
|
|
1800 |
|
|
1801 |
// ---------------------------------------------------------------------------
|
|
1802 |
// CMmPacketContextTsy::HostCID
|
|
1803 |
// Return the host context name
|
|
1804 |
// (other items were commented in a header).
|
|
1805 |
// ---------------------------------------------------------------------------
|
|
1806 |
//
|
|
1807 |
TInfoName CMmPacketContextTsy::HostCID() const
|
|
1808 |
{
|
|
1809 |
|
|
1810 |
return iHostCID;
|
|
1811 |
}
|
|
1812 |
|
|
1813 |
// ---------------------------------------------------------------------------
|
|
1814 |
// CMmPacketContextTsy::AddPacketFilterL
|
|
1815 |
// This method sets up a packet filter in the TFT belonging to this context,
|
|
1816 |
// with the Id specified in the packet filter information. New packet filter
|
|
1817 |
// info is stored in CMmPacketContextGsmWcdmaExt. This method takes care of
|
|
1818 |
// adding packet filter info and storing this information.
|
|
1819 |
// (other items were commented in a header).
|
|
1820 |
// ---------------------------------------------------------------------------
|
|
1821 |
//
|
|
1822 |
TInt CMmPacketContextTsy::AddPacketFilterL(
|
|
1823 |
const TTsyReqHandle aTsyReqHandle,
|
|
1824 |
TDes8* const aPacketFilter )
|
|
1825 |
{
|
|
1826 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::AddPacketFilterL. Context name:%S", &iContextName );
|
|
1827 |
|
|
1828 |
TInt ret( KErrGeneral );
|
|
1829 |
|
|
1830 |
if ( (0 < iHostCID.Length()) && (aPacketFilter->Length() > 0) )
|
|
1831 |
{
|
|
1832 |
ret = iMmPacketContextGsmWcdmaExt->AddPacketFilterL( aPacketFilter );
|
|
1833 |
|
|
1834 |
if ( KErrNone == ret )
|
|
1835 |
{
|
|
1836 |
// if operation is meant for already configurated context
|
|
1837 |
if ( RPacketContext::EStatusUnknown != ContextStatus() &&
|
|
1838 |
RPacketContext::EStatusInactive != ContextStatus() )
|
|
1839 |
{
|
|
1840 |
// request must complete to client
|
|
1841 |
CMmPacketContextTsy::ReqCompleted( aTsyReqHandle, KErrNone );
|
|
1842 |
}
|
|
1843 |
|
|
1844 |
// else operation is context configuration and complete method
|
|
1845 |
// handles request complete
|
|
1846 |
else
|
|
1847 |
{
|
|
1848 |
// Store the request handle type
|
|
1849 |
iReqHandleType = EMultimodePacketContextAddPacketFilter;
|
|
1850 |
}
|
|
1851 |
}
|
|
1852 |
}
|
|
1853 |
|
|
1854 |
return ret;
|
|
1855 |
}
|
|
1856 |
|
|
1857 |
// ---------------------------------------------------------------------------
|
|
1858 |
// CMmPacketContextTsy::RemovePacketFilter
|
|
1859 |
// This method removes a packet filter from the TFT belonging to this context.
|
|
1860 |
// (other items were commented in a header).
|
|
1861 |
// ---------------------------------------------------------------------------
|
|
1862 |
//
|
|
1863 |
#ifndef USING_CTSY_DISPATCHER
|
|
1864 |
TInt CMmPacketContextTsy::RemovePacketFilter(
|
|
1865 |
const TTsyReqHandle aTsyReqHandle,
|
|
1866 |
TInt *aID )
|
|
1867 |
{
|
|
1868 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::RemovePacketFilter. RemovedFilter:%d", *aID );
|
|
1869 |
|
|
1870 |
TInt ret( KErrArgument );
|
|
1871 |
|
|
1872 |
// id must be value from 1 to 8
|
|
1873 |
if ( 0 < *aID && 8 >= *aID )
|
|
1874 |
{
|
|
1875 |
ret = iMmPacketContextGsmWcdmaExt->RemovePacketFilter( *aID );
|
|
1876 |
}
|
|
1877 |
|
|
1878 |
CMmPacketContextTsy::ReqCompleted( aTsyReqHandle, ret );
|
|
1879 |
|
|
1880 |
return KErrNone;
|
|
1881 |
}
|
|
1882 |
#endif // #ifndef USING_CTSY_DISPATCHER
|
|
1883 |
|
|
1884 |
// ---------------------------------------------------------------------------
|
|
1885 |
// CMmPacketContextTsy::ModifyActiveContextL
|
|
1886 |
// Invokes context modification. This method invokes MS-initiated
|
|
1887 |
// modification of an active context in the network.
|
|
1888 |
// (other items were commented in a header).
|
|
1889 |
// ---------------------------------------------------------------------------
|
|
1890 |
//
|
|
1891 |
TInt CMmPacketContextTsy::ModifyActiveContextL()
|
|
1892 |
{
|
|
1893 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::ModifyActiveContextL. Context name:%S", &iContextName );
|
|
1894 |
|
|
1895 |
TInt ret( KErrNotReady );
|
|
1896 |
|
|
1897 |
if ( RPacketContext::EStatusUnknown != ContextStatus() &&
|
|
1898 |
RPacketContext::EStatusInactive != ContextStatus() &&
|
|
1899 |
RPacketContext::EStatusDeleted != ContextStatus() )
|
|
1900 |
{
|
|
1901 |
ret = iMmPacketContextGsmWcdmaExt->ModifyActiveContextL();
|
|
1902 |
}
|
|
1903 |
|
|
1904 |
if ( KErrNone == ret )
|
|
1905 |
{
|
|
1906 |
// Store the request handle type
|
|
1907 |
iReqHandleType = EMultimodePacketContextModifyActiveContext;
|
|
1908 |
}
|
|
1909 |
|
|
1910 |
return ret;
|
|
1911 |
}
|
|
1912 |
|
|
1913 |
// ---------------------------------------------------------------------------
|
|
1914 |
// CMmPacketContextTsy::CompleteModifyActiveContext
|
|
1915 |
// When all Tft operations are done method completes to client
|
|
1916 |
// (other items were commented in a header).
|
|
1917 |
// ---------------------------------------------------------------------------
|
|
1918 |
//
|
|
1919 |
void CMmPacketContextTsy::CompleteModifyActiveContext(
|
|
1920 |
const TInt aResult )
|
|
1921 |
{
|
|
1922 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::CompleteModifyActiveContext. Context name:%S", &iContextName );
|
|
1923 |
|
|
1924 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1925 |
EMultimodePacketContextModifyActiveContext );
|
|
1926 |
|
|
1927 |
if ( EMultimodePacketContextReqHandleUnknown != reqHandle )
|
|
1928 |
{
|
|
1929 |
|
|
1930 |
CMmPacketContextTsy::ReqCompleted( reqHandle, aResult );
|
|
1931 |
|
|
1932 |
}
|
|
1933 |
}
|
|
1934 |
|
|
1935 |
// ---------------------------------------------------------------------------
|
|
1936 |
// CMmPacketContextTsy::EnumeratePacketFilters
|
|
1937 |
// Returns number of defined packet filters to client
|
|
1938 |
// (other items were commented in a header).
|
|
1939 |
// ---------------------------------------------------------------------------
|
|
1940 |
//
|
|
1941 |
TInt CMmPacketContextTsy::EnumeratePacketFilters(
|
|
1942 |
const TTsyReqHandle aTsyReqHandle,
|
|
1943 |
TInt *aCount )
|
|
1944 |
{
|
|
1945 |
TInt ret = iMmPacketContextGsmWcdmaExt->EnumeratePacketFilters ( aCount );
|
|
1946 |
|
|
1947 |
CMmPacketContextTsy::ReqCompleted( aTsyReqHandle, ret );
|
|
1948 |
|
|
1949 |
return KErrNone;
|
|
1950 |
}
|
|
1951 |
|
|
1952 |
// ---------------------------------------------------------------------------
|
|
1953 |
// CMmPacketContextTsy::GetPacketFilterInfo
|
|
1954 |
// Gives information about the packet filter specified by aIndex
|
|
1955 |
// ---------------------------------------------------------------------------
|
|
1956 |
//
|
|
1957 |
TInt CMmPacketContextTsy::GetPacketFilterInfo(
|
|
1958 |
const TTsyReqHandle aTsyReqHandle,
|
|
1959 |
TInt* aIndex,
|
|
1960 |
TPacketBase* aPacketFilterInfo )
|
|
1961 |
{
|
|
1962 |
TInt ret = iMmPacketContextGsmWcdmaExt->GetPacketFilterInfo ( *aIndex,
|
|
1963 |
aPacketFilterInfo);
|
|
1964 |
|
|
1965 |
CMmPacketContextTsy::ReqCompleted( aTsyReqHandle, ret );
|
|
1966 |
|
|
1967 |
return KErrNone;
|
|
1968 |
}
|
|
1969 |
|
|
1970 |
// ---------------------------------------------------------------------------
|
|
1971 |
// CMmPacketContextTsy::GetDnsInfo
|
|
1972 |
// This method gets the DNS info for Etel side request.
|
|
1973 |
// (other items were commented in a header).
|
|
1974 |
// ---------------------------------------------------------------------------
|
|
1975 |
//
|
|
1976 |
TInt CMmPacketContextTsy::GetDnsInfo(
|
|
1977 |
const TTsyReqHandle aTsyReqHandle,
|
|
1978 |
TDes8* const aDnsInfo )
|
|
1979 |
{
|
|
1980 |
ASSERT(aDnsInfo);
|
|
1981 |
|
|
1982 |
RPacketContext::TDnsInfoV2 temp;
|
|
1983 |
RPacketContext::TTDnsInfoV2Pckg tempPckg(temp);
|
|
1984 |
|
|
1985 |
TInt ret = KErrArgument;
|
|
1986 |
if (tempPckg.MaxLength() == aDnsInfo->MaxLength() )
|
|
1987 |
{
|
|
1988 |
ret = iMmPacketContextGsmWcdmaExt->GetDnsInfoEtel( aDnsInfo );
|
|
1989 |
}
|
|
1990 |
|
|
1991 |
CMmPacketContextTsy::ReqCompleted( aTsyReqHandle, ret );
|
|
1992 |
|
|
1993 |
return KErrNone;
|
|
1994 |
}
|
|
1995 |
|
|
1996 |
|
|
1997 |
// ---------------------------------------------------------------------------
|
|
1998 |
// CMmPacketContextTsy::ContextName
|
|
1999 |
// This method returns name of this context
|
|
2000 |
// (other items were commented in a header).
|
|
2001 |
// ---------------------------------------------------------------------------
|
|
2002 |
//
|
|
2003 |
TInfoName CMmPacketContextTsy::ContextName() const
|
|
2004 |
{
|
|
2005 |
return iContextName;
|
|
2006 |
}
|
|
2007 |
|
|
2008 |
|
|
2009 |
// ---------------------------------------------------------------------------
|
|
2010 |
// CMmPacketContextTsy::AddMediaAuthorizationL
|
|
2011 |
// Makes request for adding authorization params to licensee tsy
|
|
2012 |
// (other items were commented in a header).
|
|
2013 |
// ---------------------------------------------------------------------------
|
|
2014 |
//
|
|
2015 |
TInt CMmPacketContextTsy::AddMediaAuthorizationL(
|
|
2016 |
const TTsyReqHandle aTsyReqHandle,
|
|
2017 |
TDes8* aMediaAuthorization )
|
|
2018 |
{
|
|
2019 |
|
|
2020 |
TInt ret( KErrArgument );
|
|
2021 |
TBool hasMediaAuthorizationBeenCached=EFalse;
|
|
2022 |
|
|
2023 |
|
|
2024 |
//Can be done only for secondary context
|
|
2025 |
if ( 0 < iHostCID.Length() )
|
|
2026 |
{
|
|
2027 |
|
|
2028 |
//Create buffers
|
|
2029 |
RPacketContext::CTFTMediaAuthorizationV3* mediaAuthorization =
|
|
2030 |
RPacketContext::CTFTMediaAuthorizationV3::NewL();
|
|
2031 |
CleanupStack::PushL( mediaAuthorization );
|
|
2032 |
mediaAuthorization->InternalizeL( *aMediaAuthorization );
|
|
2033 |
|
|
2034 |
ret = iMmPacketContextGsmWcdmaExt->AddMediaAuthorizationL(
|
|
2035 |
mediaAuthorization, hasMediaAuthorizationBeenCached);
|
|
2036 |
|
|
2037 |
//Cleanup created object. If it has been cached we do not delete it, because
|
|
2038 |
// the array (cache) will be cleaned in the destructor
|
|
2039 |
// If we were unable to cache it, we need to destroy it, otherwise we will leak
|
|
2040 |
// memory.
|
|
2041 |
if(hasMediaAuthorizationBeenCached)
|
|
2042 |
{
|
|
2043 |
CleanupStack::Pop(mediaAuthorization);
|
|
2044 |
}
|
|
2045 |
else
|
|
2046 |
{
|
|
2047 |
CleanupStack::PopAndDestroy(mediaAuthorization);
|
|
2048 |
}
|
|
2049 |
|
|
2050 |
if ( KErrNone == ret )
|
|
2051 |
{
|
|
2052 |
//
|
|
2053 |
if ( RPacketContext::EStatusUnknown != ContextStatus() &&
|
|
2054 |
RPacketContext::EStatusInactive != ContextStatus() )
|
|
2055 |
{
|
|
2056 |
// request must complete to client
|
|
2057 |
CMmPacketContextTsy::ReqCompleted( aTsyReqHandle, KErrNone );
|
|
2058 |
}
|
|
2059 |
|
|
2060 |
// else operation is context configuration and complete method
|
|
2061 |
// handles request complete
|
|
2062 |
else
|
|
2063 |
{
|
|
2064 |
// Store the request handle type
|
|
2065 |
iReqHandleType = EMultimodePacketContextAddMediaAuthorization;
|
|
2066 |
}
|
|
2067 |
}
|
|
2068 |
}
|
|
2069 |
return ret;
|
|
2070 |
|
|
2071 |
}
|
|
2072 |
|
|
2073 |
// ---------------------------------------------------------------------------
|
|
2074 |
// CMmPacketContextTsy::RemoveMediaAuthorization
|
|
2075 |
// Makes request for removing authorization params to licensee tsy
|
|
2076 |
// (other items were commented in a header).
|
|
2077 |
// ---------------------------------------------------------------------------
|
|
2078 |
//
|
|
2079 |
TInt CMmPacketContextTsy::RemoveMediaAuthorization(
|
|
2080 |
const TTsyReqHandle aTsyReqHandle,
|
|
2081 |
RPacketContext::TAuthorizationToken* const aAuthorizationToken )
|
|
2082 |
{
|
|
2083 |
TInt ret( KErrGeneral );
|
|
2084 |
|
|
2085 |
//Can be done only for secondary context
|
|
2086 |
if ( 0 < iHostCID.Length() )
|
|
2087 |
{
|
|
2088 |
|
|
2089 |
ret = iMmPacketContextGsmWcdmaExt->RemoveMediaAuthorization(
|
|
2090 |
aAuthorizationToken );
|
|
2091 |
|
|
2092 |
}
|
|
2093 |
|
|
2094 |
CMmPacketContextTsy::ReqCompleted( aTsyReqHandle, ret );
|
|
2095 |
|
|
2096 |
return KErrNone;
|
|
2097 |
}
|
|
2098 |
|
|
2099 |
// ---------------------------------------------------------------------------
|
|
2100 |
// CMmPacketContextTsy::ContextType
|
|
2101 |
// return the context type
|
|
2102 |
// (other items were commented in a header).
|
|
2103 |
// ---------------------------------------------------------------------------
|
|
2104 |
//
|
|
2105 |
CMmPacketContextTsy::TPacketContextType CMmPacketContextTsy::ContextType() const
|
|
2106 |
{
|
|
2107 |
return EContextTypePacketContext;
|
|
2108 |
}
|
|
2109 |
|
|
2110 |
#ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
2111 |
// ---------------------------------------------------------------------------
|
|
2112 |
// CMmPacketContextTsy::GetConnectionInfo
|
|
2113 |
// Gets the current connection information.
|
|
2114 |
// (other items were commented in a header).
|
|
2115 |
// ---------------------------------------------------------------------------
|
|
2116 |
//
|
|
2117 |
TInt CMmPacketContextTsy::GetConnectionInfo(
|
|
2118 |
const TTsyReqHandle aTsyReqHandle,
|
|
2119 |
TConnectionInfoBase* const aInfo )
|
|
2120 |
{
|
|
2121 |
TFLOGSTRING2( "TSY: CMmPacketContextTsy::GetConnectionInfo. Context name:%S", &iContextName );
|
|
2122 |
|
|
2123 |
// Get config
|
|
2124 |
TInt ret = FillConnectionInfo( aInfo );
|
|
2125 |
|
|
2126 |
// Complete Request
|
|
2127 |
CMmPacketContextTsy::ReqCompleted( aTsyReqHandle, ret );
|
|
2128 |
|
|
2129 |
return KErrNone;
|
|
2130 |
}
|
|
2131 |
|
|
2132 |
// ---------------------------------------------------------------------------
|
|
2133 |
// CMmPacketContextTsy::NotifyConnectionInfoChange
|
|
2134 |
// Requests notification when connection information changes.
|
|
2135 |
// (other items were commented in a header).
|
|
2136 |
// ---------------------------------------------------------------------------
|
|
2137 |
//
|
|
2138 |
TInt CMmPacketContextTsy::NotifyConnectionInfoChange(
|
|
2139 |
TConnectionInfoBase* const aInfo )
|
|
2140 |
{
|
|
2141 |
TFLOGSTRING( "TSY: CMmPacketContextTsy::NotifyConnectionInfoChange." );
|
|
2142 |
|
|
2143 |
// Store pointer
|
|
2144 |
iRetNotifyConnectionInfo = aInfo;
|
|
2145 |
// Store req handle type
|
|
2146 |
iReqHandleType = EMultimodePacketContextNotifyConnectionInfoChange;
|
|
2147 |
|
|
2148 |
return KErrNone;
|
|
2149 |
}
|
|
2150 |
|
|
2151 |
// ---------------------------------------------------------------------------
|
|
2152 |
// CMmPacketContextTsy::CompleteNotifyConnectionInfoChange
|
|
2153 |
// Complete notification when the connection information changes.
|
|
2154 |
// (other items were commented in a header).
|
|
2155 |
// ---------------------------------------------------------------------------
|
|
2156 |
//
|
|
2157 |
void CMmPacketContextTsy::CompleteNotifyConnectionInfoChange(
|
|
2158 |
TConnectionInfoBase* const aInfo )
|
|
2159 |
{
|
|
2160 |
TFLOGSTRING( "TSY: CMmPacketContextTsy::CompleteNotifyConnectionInfoChange." );
|
|
2161 |
|
|
2162 |
if ( NULL != aInfo &&
|
|
2163 |
TConnectionInfoBase::KConnectionInfoV1 == aInfo->ExtensionId() )
|
|
2164 |
{
|
|
2165 |
RPacketContext::TConnectionInfoV1 connectionInfoV1;
|
|
2166 |
connectionInfoV1 = *( static_cast<RPacketContext::TConnectionInfoV1*>( aInfo ) );
|
|
2167 |
|
|
2168 |
//Check if connection info has changed
|
|
2169 |
if ( iConnectionInfo.iHSDPACategory != connectionInfoV1.iHSDPACategory ||
|
|
2170 |
iConnectionInfo.iHSUPACategory != connectionInfoV1.iHSUPACategory ||
|
|
2171 |
iConnectionInfo.iValid != connectionInfoV1.iValid )
|
|
2172 |
{
|
|
2173 |
//Set new connection info
|
|
2174 |
iConnectionInfo = connectionInfoV1;
|
|
2175 |
|
|
2176 |
//Get req handle
|
|
2177 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
|
|
2178 |
EMultimodePacketContextNotifyConnectionInfoChange );
|
|
2179 |
|
|
2180 |
if ( EMultimodePacketContextReqHandleUnknown != reqHandle )
|
|
2181 |
{
|
|
2182 |
// Fill current connection information
|
|
2183 |
TInt ret = FillConnectionInfo( iRetNotifyConnectionInfo );
|
|
2184 |
|
|
2185 |
if ( KErrNone == ret )
|
|
2186 |
{
|
|
2187 |
//reset req handle
|
|
2188 |
iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2189 |
EMultimodePacketContextNotifyConnectionInfoChange );
|
|
2190 |
// Null ret pointer
|
|
2191 |
iRetNotifyConnectionInfo = NULL;
|
|
2192 |
// Complete the client request
|
|
2193 |
CMmPacketContextTsy::ReqCompleted( reqHandle, KErrNone );
|
|
2194 |
}
|
|
2195 |
}
|
|
2196 |
}
|
|
2197 |
}
|
|
2198 |
}
|
|
2199 |
|
|
2200 |
// ---------------------------------------------------------------------------
|
|
2201 |
// CMmPacketContextTsy::FillConnectionInfo
|
|
2202 |
// Fills the current connection information to TConnectionInfoXXX structure.
|
|
2203 |
// (other items were commented in a header).
|
|
2204 |
// ---------------------------------------------------------------------------
|
|
2205 |
//
|
|
2206 |
TInt CMmPacketContextTsy::FillConnectionInfo(
|
|
2207 |
TConnectionInfoBase* const aInfo )
|
|
2208 |
{
|
|
2209 |
TFLOGSTRING( "TSY: CMmPacketContextTsy::FillConnectionInfo" );
|
|
2210 |
|
|
2211 |
TInt ret = KErrNone;
|
|
2212 |
|
|
2213 |
if ( NULL != aInfo &&
|
|
2214 |
TConnectionInfoBase::KConnectionInfoV1 == aInfo->ExtensionId() )
|
|
2215 |
{
|
|
2216 |
//Set connection info to ETel side memory
|
|
2217 |
*( static_cast<RPacketContext::TConnectionInfoV1*>( aInfo ) ) = iConnectionInfo;
|
|
2218 |
}
|
|
2219 |
else
|
|
2220 |
{
|
|
2221 |
ret = KErrArgument;
|
|
2222 |
}
|
|
2223 |
|
|
2224 |
return ret;
|
|
2225 |
}
|
|
2226 |
#endif // SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
|
|
2227 |
// End of File
|