|
1 /* |
|
2 * Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Maps QoS parameters |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "TSatQoSParser.h" |
|
20 #include "SatLog.h" |
|
21 |
|
22 // Lenght of array of QoS from / to (U)SIM |
|
23 const TUint8 KSimQoSSize = 6; |
|
24 |
|
25 // Precedence class values |
|
26 const TUint8 KPrecMaxSize = 4; |
|
27 const TUint8 KPrecPos = 0; |
|
28 |
|
29 const RPacketQoS::TQoSPrecedence TPrecedenceClass[KPrecMaxSize] = |
|
30 { |
|
31 RPacketQoS::EUnspecifiedPrecedence, |
|
32 RPacketQoS::EPriorityHighPrecedence, |
|
33 RPacketQoS::EPriorityMediumPrecedence, |
|
34 RPacketQoS::EPriorityLowPrecedence |
|
35 }; |
|
36 |
|
37 // Delay class values |
|
38 const TUint8 KDelayMaxSize = 8; |
|
39 const TUint8 KDelayPos = 1; |
|
40 const RPacketQoS::TQoSDelay TDelayClass[KDelayMaxSize] = |
|
41 { |
|
42 RPacketQoS::EUnspecifiedDelayClass, |
|
43 RPacketQoS::EDelayClass1, |
|
44 RPacketQoS::EDelayClass2, |
|
45 RPacketQoS::EDelayClass3, |
|
46 RPacketQoS::EDelayClass4, |
|
47 // CDMA2000 specific values |
|
48 RPacketQoS::EDelay40ms, |
|
49 RPacketQoS::EDelay120ms, |
|
50 RPacketQoS::EDelay360ms |
|
51 }; |
|
52 |
|
53 // Reliability class values |
|
54 const TUint8 KRelMaxSize = 6; |
|
55 const TUint8 KRelPos = 2; |
|
56 const RPacketQoS::TQoSReliability TReliablitityClass[KRelMaxSize] = |
|
57 { |
|
58 RPacketQoS::EUnspecifiedReliabilityClass, |
|
59 RPacketQoS::EReliabilityClass1, |
|
60 RPacketQoS::EReliabilityClass2, |
|
61 RPacketQoS::EReliabilityClass3, |
|
62 RPacketQoS::EReliabilityClass4, |
|
63 RPacketQoS::EReliabilityClass5 |
|
64 }; |
|
65 |
|
66 // Peak throughput values |
|
67 const TUint8 KPeakMaxSize = 10; |
|
68 const TUint8 KPeakPos = 3; |
|
69 const RPacketQoS::TQoSPeakThroughput TPeak[KPeakMaxSize] = |
|
70 { |
|
71 RPacketQoS::EUnspecifiedPeakThroughput, |
|
72 RPacketQoS::EPeakThroughput1000, |
|
73 RPacketQoS::EPeakThroughput2000, |
|
74 RPacketQoS::EPeakThroughput4000, |
|
75 RPacketQoS::EPeakThroughput8000, |
|
76 RPacketQoS::EPeakThroughput16000, |
|
77 RPacketQoS::EPeakThroughput32000, |
|
78 RPacketQoS::EPeakThroughput64000, |
|
79 RPacketQoS::EPeakThroughput128000, |
|
80 RPacketQoS::EPeakThroughput256000 |
|
81 }; |
|
82 |
|
83 // Mean throughput values |
|
84 const TUint8 KMeanMaxSize = 20; |
|
85 const TUint8 KMeanPos = 4; |
|
86 const TUint8 KMeanBestEffort = 0x1F; |
|
87 const RPacketQoS::TQoSMeanThroughput TMean[KMeanMaxSize] = |
|
88 { |
|
89 RPacketQoS::EUnspecifiedMeanThroughput, |
|
90 RPacketQoS::EMeanThroughput100, |
|
91 RPacketQoS::EMeanThroughput200, |
|
92 RPacketQoS::EMeanThroughput500, |
|
93 RPacketQoS::EMeanThroughput1000, |
|
94 RPacketQoS::EMeanThroughput2000, |
|
95 RPacketQoS::EMeanThroughput5000, |
|
96 RPacketQoS::EMeanThroughput10000, |
|
97 RPacketQoS::EMeanThroughput20000, |
|
98 RPacketQoS::EMeanThroughput50000, |
|
99 RPacketQoS::EMeanThroughput100000, |
|
100 RPacketQoS::EMeanThroughput200000, |
|
101 RPacketQoS::EMeanThroughput500000, |
|
102 RPacketQoS::EMeanThroughput1000000, |
|
103 RPacketQoS::EMeanThroughput2000000, |
|
104 RPacketQoS::EMeanThroughput5000000, |
|
105 RPacketQoS::EMeanThroughput10000000, |
|
106 RPacketQoS::EMeanThroughput20000000, |
|
107 RPacketQoS::EMeanThroughput50000000, |
|
108 RPacketQoS::EMeanThroughputBestEffort |
|
109 }; |
|
110 |
|
111 // Maximum SDU size value |
|
112 const TInt KMaximumSDUSize = 1500; |
|
113 |
|
114 // ======== MEMBER FUNCTIONS ======== |
|
115 |
|
116 // --------------------------------------------------------------------------- |
|
117 // GetRequestedQoSValues |
|
118 // --------------------------------------------------------------------------- |
|
119 // |
|
120 void TSatQoSParser::GetRequestedQoSValues( |
|
121 RSat::TBearerParams& aParams, |
|
122 RPacketQoS::TQoSGPRSRequested& aResult) |
|
123 { |
|
124 LOG( SIMPLE, "SATENGINE: TSatQoSParser::GetRequestedQoSValues calling" ) |
|
125 |
|
126 // Get Precedence class value |
|
127 aResult.iReqPrecedence = TPrecedenceClass[ |
|
128 CheckIndex( aParams[KPrecPos], KPrecMaxSize ) ]; |
|
129 LOG2( SIMPLE, " Precedence class: %i", aParams[KPrecPos] ) |
|
130 LOG2( SIMPLE, " Precedence value: 0x%x", aResult.iReqPrecedence ) |
|
131 |
|
132 // Get Delay class value |
|
133 aResult.iReqDelay = TDelayClass[ |
|
134 CheckIndex( aParams[KDelayPos], KDelayMaxSize ) ]; |
|
135 LOG2( SIMPLE, " Delay class: %i", aParams[KDelayPos] ) |
|
136 LOG2( SIMPLE, " Delay value: 0x%x", aResult.iReqDelay ) |
|
137 |
|
138 // Get Reliablility value |
|
139 aResult.iReqReliability = TReliablitityClass[ |
|
140 CheckIndex( aParams[KRelPos], KRelMaxSize ) ]; |
|
141 LOG2( SIMPLE, " Reliablility class: %i", aParams[KRelPos] ) |
|
142 LOG2( SIMPLE, " Reliablility value: 0x%x", aResult.iReqReliability ) |
|
143 |
|
144 // Get Peak value |
|
145 aResult.iReqPeakThroughput = TPeak[ |
|
146 CheckIndex( aParams[KPeakPos], KPeakMaxSize ) ]; |
|
147 LOG2( SIMPLE, " Peak througput: %i", aParams[KPeakPos] ) |
|
148 LOG2( SIMPLE, " Peak througput: 0x%x", aResult.iReqPeakThroughput ) |
|
149 |
|
150 // Get Mean value |
|
151 if ( KMeanBestEffort != aParams[KMeanPos] ) |
|
152 { |
|
153 LOG( SIMPLE, "SATENGINE: TSatQoSParser::GetRequestedQoSValues \ |
|
154 KMeanBestEffort != aParams[KMeanPos]" ) |
|
155 aResult.iReqMeanThroughput = TMean[ |
|
156 CheckIndex( aParams[KMeanPos], KMeanMaxSize ) ]; |
|
157 } |
|
158 else |
|
159 { |
|
160 aResult.iReqMeanThroughput = RPacketQoS::EMeanThroughputBestEffort; |
|
161 } |
|
162 LOG2( SIMPLE, " Mean througput: %i", aParams[KMeanPos] ) |
|
163 LOG2( SIMPLE, " Mean througput(int):%i", aResult.iReqMeanThroughput ) |
|
164 |
|
165 LOG( SIMPLE, "SATENGINE: TSatQoSParser::GetRequestedQoSValues exiting" ) |
|
166 } |
|
167 |
|
168 // --------------------------------------------------------------------------- |
|
169 // GetRequestedQoSValues |
|
170 // --------------------------------------------------------------------------- |
|
171 // |
|
172 void TSatQoSParser::GetNegotiatedQoSValues( |
|
173 const RPacketQoS::TQoSGPRSNegotiated& aNegParams, |
|
174 RSat::TBearerParams& aResult ) |
|
175 { |
|
176 LOG( SIMPLE, "SATENGINE: TSatQoSParser::GetNegotiatedQoSValues calling" ) |
|
177 |
|
178 aResult.SetLength( KSimQoSSize ); |
|
179 TInt index( 0 ); |
|
180 |
|
181 // Get Precedence class by value |
|
182 for ( index = 0; index < KPrecMaxSize; index++ ) |
|
183 { |
|
184 if ( TPrecedenceClass[index] == aNegParams.iPrecedence ) |
|
185 { |
|
186 // Found, store index |
|
187 aResult[KPrecPos] = static_cast<TUint8>( index ); |
|
188 index = KPrecMaxSize; // Stop loop |
|
189 LOG2( SIMPLE, " Prececence class: %i", aResult[KPrecPos] ) |
|
190 LOG2( SIMPLE, " Prececence value: 0x%x", aNegParams.iPrecedence ) |
|
191 } |
|
192 } |
|
193 LOG2( SIMPLE, "SATENGINE: TSatQoSParser::GetNegotiatedQoSValues index:%i", |
|
194 index ) |
|
195 // Get Delay class by value |
|
196 for ( index = 0; index < KDelayMaxSize; index++ ) |
|
197 { |
|
198 if ( TDelayClass[index] == aNegParams.iDelay ) |
|
199 { |
|
200 // Found, store index |
|
201 aResult[KDelayPos] = static_cast<TUint8>( index ); |
|
202 index = KDelayMaxSize; // Stop loop |
|
203 LOG2( SIMPLE, " Delay class: %i", aResult[KDelayPos] ) |
|
204 LOG2( SIMPLE, " Delay value: 0x%x", aNegParams.iDelay ) |
|
205 } |
|
206 } |
|
207 LOG2( SIMPLE, "SATENGINE: TSatQoSParser::GetNegotiatedQoSValues index:%i", |
|
208 index ) |
|
209 // Get Reliability class by value |
|
210 for ( index = 0; index < KRelMaxSize; index++ ) |
|
211 { |
|
212 if ( TReliablitityClass[index] == aNegParams.iReliability ) |
|
213 { |
|
214 // Found, store index |
|
215 aResult[KRelPos] = static_cast<TUint8>( index ); |
|
216 index = KRelMaxSize; // Stop loop |
|
217 LOG2( SIMPLE, " Reliability class: %i", aResult[KRelPos] ) |
|
218 LOG2( SIMPLE, " Reliability value: 0x%x", aNegParams.iReliability ) |
|
219 } |
|
220 } |
|
221 LOG2( SIMPLE, "SATENGINE: TSatQoSParser::GetNegotiatedQoSValues index:%i", |
|
222 index ) |
|
223 // Get Peak by value |
|
224 for ( index = 0; index < KPeakMaxSize; index++ ) |
|
225 { |
|
226 if ( TPeak[index] == aNegParams.iPeakThroughput ) |
|
227 { |
|
228 // Found, store index |
|
229 aResult[KPeakPos] = static_cast<TUint8>( index ); |
|
230 index = KPeakMaxSize; // Stop loop |
|
231 LOG2( SIMPLE, " Peak class: %i", aResult[KPeakPos] ) |
|
232 LOG2( SIMPLE, " Peak value: 0x%x", |
|
233 aNegParams.iPeakThroughput ) |
|
234 } |
|
235 } |
|
236 LOG2( SIMPLE, "SATENGINE: TSatQoSParser::GetNegotiatedQoSValues index:%i", |
|
237 index ) |
|
238 // Get Mean by value |
|
239 for ( index = 0; index < KMeanMaxSize; index++ ) |
|
240 { |
|
241 if ( TMean[index] == aNegParams.iMeanThroughput ) |
|
242 { |
|
243 if ( RPacketQoS::EMeanThroughputBestEffort == |
|
244 aNegParams.iMeanThroughput ) |
|
245 { |
|
246 LOG( SIMPLE, "SATENGINE: TSatQoSParser::GetNegotiatedQoSValues \ |
|
247 EMeanThroughputBestEffort" ) |
|
248 // Best effort is not value '19', handle this case differently |
|
249 aResult[4] = KMeanBestEffort; |
|
250 } |
|
251 else |
|
252 { |
|
253 // All other values are linear from '0' to '18' |
|
254 // store index |
|
255 aResult[KMeanPos] = static_cast<TUint8>( index ); |
|
256 } |
|
257 |
|
258 index = KMeanMaxSize; // Stop loop |
|
259 LOG2( SIMPLE, " Mean class: %i", aResult[KMeanPos] ) |
|
260 LOG2( SIMPLE, " Mean value: 0x%x", |
|
261 aNegParams.iMeanThroughput ) |
|
262 } |
|
263 } |
|
264 LOG2( SIMPLE, "SATENGINE: TSatQoSParser::GetNegotiatedQoSValues index:%i", |
|
265 index ) |
|
266 LOG( SIMPLE, "SATENGINE: TSatQoSParser::GetNegotiatedQoSValues exiting" ) |
|
267 } |
|
268 |
|
269 // --------------------------------------------------------------------------- |
|
270 // CheckIndex |
|
271 // --------------------------------------------------------------------------- |
|
272 // |
|
273 TInt TSatQoSParser::CheckIndex( TInt aReqIndex, TInt aMaxIndex ) |
|
274 { |
|
275 LOG( SIMPLE, "SATENGINE: TSatQoSParser::CheckIndex calling" ) |
|
276 TInt retVal( aReqIndex ); |
|
277 |
|
278 if ( aMaxIndex < aReqIndex ) |
|
279 { |
|
280 LOG( SIMPLE, "SATENGINE: TSatQoSParser::CheckIndex \ |
|
281 aMaxIndex < aReqIndex" ) |
|
282 retVal = 0; |
|
283 } |
|
284 LOG( SIMPLE, "SATENGINE: TSatQoSParser::CheckIndex exiting" ) |
|
285 return retVal; |
|
286 } |
|
287 |
|
288 // --------------------------------------------------------------------------- |
|
289 // Convert QoS parameters from Rel97/98 format to Rel5 format |
|
290 // --------------------------------------------------------------------------- |
|
291 // |
|
292 TSatQoSParser::TQoSRel5 TSatQoSParser::ConvertQoS( |
|
293 const RPacketQoS::TQoSGPRSRequested& aReqParams ) |
|
294 { |
|
295 LOG( SIMPLE, "SATENGINE: TSatQoSParser::ConvertQoS calling" ) |
|
296 |
|
297 TQoSRel5 qos; |
|
298 LOG2( SIMPLE, "SATENGINE: TSatQoSParser::ConvertQoS \ |
|
299 aReqParams.iReqDelay: %i", aReqParams.iReqDelay ) |
|
300 // Map Delay class value to Traffic class/Traffic handling priority |
|
301 // Delay Class ----------- Traffic Class |
|
302 // 1,2,3 Interactive |
|
303 // 4 Background |
|
304 // Delay Class ----------- Traffic Handling priority |
|
305 // 1 1 |
|
306 // 2 2 |
|
307 // 3 3 |
|
308 // 4 unspecified |
|
309 switch ( aReqParams.iReqDelay ) |
|
310 { |
|
311 case RPacketQoS::EDelayClass1: |
|
312 { |
|
313 qos.iTrafficClass = RPacketQoS::ETrafficClassInteractive; |
|
314 qos.iTrafficHandlingPriority = RPacketQoS::ETrafficPriority1; |
|
315 break; |
|
316 } |
|
317 case RPacketQoS::EDelayClass2: |
|
318 { |
|
319 qos.iTrafficClass = RPacketQoS::ETrafficClassInteractive; |
|
320 qos.iTrafficHandlingPriority = RPacketQoS::ETrafficPriority2; |
|
321 break; |
|
322 } |
|
323 case RPacketQoS::EDelayClass3: |
|
324 { |
|
325 qos.iTrafficClass = RPacketQoS::ETrafficClassInteractive; |
|
326 qos.iTrafficHandlingPriority = RPacketQoS::ETrafficPriority3; |
|
327 break; |
|
328 } |
|
329 case RPacketQoS::EDelayClass4: |
|
330 { |
|
331 qos.iTrafficClass = RPacketQoS::ETrafficClassBackground; |
|
332 qos.iTrafficHandlingPriority = RPacketQoS::ETrafficPriorityUnspecified; |
|
333 break; |
|
334 } |
|
335 default: |
|
336 { |
|
337 qos.iTrafficClass = RPacketQoS::ETrafficClassUnspecified; |
|
338 qos.iTrafficHandlingPriority = RPacketQoS::ETrafficPriorityUnspecified; |
|
339 break; |
|
340 } |
|
341 } |
|
342 LOG2( SIMPLE, "SATENGINE: TSatQoSParser::ConvertQoS \ |
|
343 aReqParams.iReqReliability: %i", aReqParams.iReqReliability ) |
|
344 // Map Reliability class value to SDU error ratio/ |
|
345 // Residual bit error ratio/Delivery of erroneous SDUs |
|
346 // Reliability Class ----------- SDU error ratio |
|
347 // 1,2 0.000001 |
|
348 // 3 0.0001 |
|
349 // 4,5 0.001 |
|
350 // Reliability Class ----------- Residual bit error ratio |
|
351 // 1,2,3,4 0.00001 |
|
352 // 5 0.004 |
|
353 // Reliability Class ----------- Delivery of erroneous SDUs |
|
354 // 1,2,3,4 No |
|
355 // 5 Yes |
|
356 switch ( aReqParams.iReqReliability ) |
|
357 { |
|
358 case RPacketQoS::EReliabilityClass1: |
|
359 { |
|
360 qos.iSduErrorRatio = |
|
361 RPacketQoS::ESDUErrorRatioOnePerMillion; |
|
362 qos.iResidualBer = RPacketQoS::EBEROnePerHundredThousand; |
|
363 qos.iDeliveryErroneousSdu = |
|
364 RPacketQoS::EErroneousSDUDeliveryNotRequired; |
|
365 break; |
|
366 } |
|
367 case RPacketQoS::EReliabilityClass2: |
|
368 { |
|
369 qos.iSduErrorRatio = RPacketQoS::ESDUErrorRatioOnePerMillion; |
|
370 qos.iResidualBer = RPacketQoS::EBEROnePerHundredThousand; |
|
371 qos.iDeliveryErroneousSdu = |
|
372 RPacketQoS::EErroneousSDUDeliveryNotRequired; |
|
373 break; |
|
374 } |
|
375 case RPacketQoS::EReliabilityClass3: |
|
376 { |
|
377 qos.iSduErrorRatio = |
|
378 RPacketQoS::ESDUErrorRatioOnePerTenThousand; |
|
379 qos.iResidualBer = RPacketQoS::EBEROnePerHundredThousand; |
|
380 qos.iDeliveryErroneousSdu = |
|
381 RPacketQoS::EErroneousSDUDeliveryNotRequired; |
|
382 break; |
|
383 } |
|
384 case RPacketQoS::EReliabilityClass4: |
|
385 { |
|
386 qos.iSduErrorRatio = RPacketQoS::ESDUErrorRatioOnePerThousand; |
|
387 qos.iResidualBer = RPacketQoS::EBEROnePerHundredThousand; |
|
388 qos.iDeliveryErroneousSdu = |
|
389 RPacketQoS::EErroneousSDUDeliveryNotRequired; |
|
390 break; |
|
391 } |
|
392 case RPacketQoS::EReliabilityClass5: |
|
393 { |
|
394 qos.iSduErrorRatio = RPacketQoS::ESDUErrorRatioOnePerThousand; |
|
395 qos.iResidualBer = RPacketQoS::EBERFourPerThousand; |
|
396 qos.iDeliveryErroneousSdu = |
|
397 RPacketQoS::EErroneousSDUDeliveryRequired; |
|
398 break; |
|
399 } |
|
400 default: |
|
401 { |
|
402 qos.iSduErrorRatio = RPacketQoS::ESDUErrorRatioUnspecified; |
|
403 qos.iResidualBer = RPacketQoS::EBERUnspecified; |
|
404 qos.iDeliveryErroneousSdu = |
|
405 RPacketQoS::EErroneousSDUDeliveryNotRequired; |
|
406 break; |
|
407 } |
|
408 } |
|
409 LOG2( SIMPLE, "SATENGINE: TSatQoSParser::ConvertQoS \ |
|
410 aReqParams.iReqPeakThroughput: %i", aReqParams.iReqPeakThroughput ) |
|
411 // Map Peak throughout class value to Maximum bitrate[kbps] |
|
412 // Peak throughout Class ---- Maximum bitrate[kbps] |
|
413 // 1 8 |
|
414 // 2 16 |
|
415 // 3 32 |
|
416 // 4 64 |
|
417 // 5 128 |
|
418 // 6 256 |
|
419 // 7 512 |
|
420 // 8 1024 |
|
421 // 9 2048 |
|
422 switch ( aReqParams.iReqPeakThroughput ) |
|
423 { |
|
424 case RPacketQoS::EPeakThroughput1000: |
|
425 { |
|
426 qos.iMaxBitRate = ESatMaxBitRate1; |
|
427 break; |
|
428 } |
|
429 |
|
430 case RPacketQoS::EPeakThroughput2000: |
|
431 { |
|
432 qos.iMaxBitRate = ESatMaxBitRate2; |
|
433 break; |
|
434 } |
|
435 case RPacketQoS::EPeakThroughput4000: |
|
436 { |
|
437 qos.iMaxBitRate = ESatMaxBitRate3; |
|
438 break; |
|
439 } |
|
440 case RPacketQoS::EPeakThroughput8000: |
|
441 { |
|
442 qos.iMaxBitRate = ESatMaxBitRate4; |
|
443 break; |
|
444 } |
|
445 case RPacketQoS::EPeakThroughput16000: |
|
446 { |
|
447 qos.iMaxBitRate = ESatMaxBitRate5; |
|
448 break; |
|
449 } |
|
450 case RPacketQoS::EPeakThroughput32000: |
|
451 { |
|
452 qos.iMaxBitRate = ESatMaxBitRate6; |
|
453 break; |
|
454 } |
|
455 case RPacketQoS::EPeakThroughput64000: |
|
456 { |
|
457 qos.iMaxBitRate = ESatMaxBitRate7; |
|
458 break; |
|
459 } |
|
460 case RPacketQoS::EPeakThroughput128000: |
|
461 { |
|
462 qos.iMaxBitRate = ESatMaxBitRate8; |
|
463 break; |
|
464 } |
|
465 case RPacketQoS::EPeakThroughput256000: |
|
466 { |
|
467 qos.iMaxBitRate = ESatMaxBitRate9; |
|
468 break; |
|
469 } |
|
470 default: |
|
471 { |
|
472 qos.iMaxBitRate = ESatMaxBitRateUnspecified; |
|
473 break; |
|
474 } |
|
475 } |
|
476 |
|
477 // Fixed value |
|
478 qos.iMaximumSDUSize = KMaximumSDUSize; |
|
479 qos.iDeliveryOrder = RPacketQoS::EDeliveryOrderNotRequired; |
|
480 |
|
481 LOG( SIMPLE, "SATENGINE: TSatQoSParser::ConvertQoS exiting" ) |
|
482 |
|
483 return qos; |
|
484 } |
|
485 |
|
486 // --------------------------------------------------------------------------- |
|
487 // Convert QoS parameters from Rel5 format to Rel97/98 format |
|
488 // --------------------------------------------------------------------------- |
|
489 // |
|
490 RPacketQoS::TQoSGPRSNegotiated TSatQoSParser::ConvertNegotiatedQoS( |
|
491 const TQoSRel5& aNegQoSRel5 ) |
|
492 { |
|
493 LOG( SIMPLE, "SATENGINE: CSatBIPGPRSDataChannel::ConvertNegotiatedQoS \ |
|
494 calling" ) |
|
495 |
|
496 RPacketQoS::TQoSGPRSNegotiated negQos; |
|
497 LOG2( SIMPLE, "SATENGINE: TSatQoSParser::ConvertNegotiatedQoS \ |
|
498 aNegQoSRel5.iTrafficClass: %i", aNegQoSRel5.iTrafficClass ) |
|
499 // Map Traffic class/Traffic handling priority to Delay class value |
|
500 // Traffic Class/Traffic Handling priority----------- Delay Class |
|
501 // conversational 1 |
|
502 // streaming 1 |
|
503 // Interactive/1 1 |
|
504 // Interactive/2 2 |
|
505 // Interactive/3 3 |
|
506 // Background 4 |
|
507 |
|
508 switch ( aNegQoSRel5.iTrafficClass ) |
|
509 { |
|
510 case RPacketQoS::ETrafficClassConversational: |
|
511 { |
|
512 negQos.iDelay = RPacketQoS::EDelayClass1; |
|
513 break; |
|
514 } |
|
515 case RPacketQoS::ETrafficClassStreaming: |
|
516 { |
|
517 negQos.iDelay = RPacketQoS::EDelayClass1; |
|
518 break; |
|
519 } |
|
520 case RPacketQoS::ETrafficClassInteractive: |
|
521 { |
|
522 LOG2( SIMPLE, "SATENGINE: TSatQoSParser::ConvertNegotiatedQoS \ |
|
523 priority: %i", aNegQoSRel5.iTrafficHandlingPriority ) |
|
524 switch ( aNegQoSRel5.iTrafficHandlingPriority ) |
|
525 { |
|
526 case RPacketQoS::ETrafficPriority1: |
|
527 { |
|
528 negQos.iDelay = RPacketQoS::EDelayClass1; |
|
529 break; |
|
530 } |
|
531 case RPacketQoS::ETrafficPriority2: |
|
532 { |
|
533 negQos.iDelay = RPacketQoS::EDelayClass2; |
|
534 break; |
|
535 } |
|
536 case RPacketQoS::ETrafficPriority3: |
|
537 { |
|
538 negQos.iDelay = RPacketQoS::EDelayClass3; |
|
539 break; |
|
540 } |
|
541 default: |
|
542 { |
|
543 negQos.iDelay = RPacketQoS::EUnspecifiedDelayClass; |
|
544 break; |
|
545 } |
|
546 } |
|
547 break; |
|
548 } |
|
549 case RPacketQoS::ETrafficClassBackground: |
|
550 { |
|
551 negQos.iDelay = RPacketQoS::EDelayClass4; |
|
552 break; |
|
553 } |
|
554 default: |
|
555 { |
|
556 negQos.iDelay = RPacketQoS::EUnspecifiedDelayClass; |
|
557 break; |
|
558 } |
|
559 } |
|
560 LOG2( SIMPLE, "SATENGINE: TSatQoSParser::ConvertNegotiatedQoS \ |
|
561 aNegQoSRel5.iSduErrorRatio: %i", aNegQoSRel5.iSduErrorRatio ) |
|
562 // Map SDU error ratio/Residual bit error ratio to Reliability value |
|
563 // SDU error ratio/Residual bit error ratio -------- Reliability Class |
|
564 // 0.000001 2 |
|
565 // 0.00001 2 |
|
566 // 0.0001 3 |
|
567 // 0.001,0.007,0.01,0.1/0.0001,0.00001, 0.000001,0.00000006 4 |
|
568 // 0.001,0.007,0.01,0.1/0.001,0.004,0.005,0.01,0.05 5 |
|
569 switch ( aNegQoSRel5.iSduErrorRatio ) |
|
570 { |
|
571 case RPacketQoS::ESDUErrorRatioOnePerHundredThousand: |
|
572 case RPacketQoS::ESDUErrorRatioOnePerMillion: |
|
573 { |
|
574 negQos.iReliability = RPacketQoS::EReliabilityClass2; |
|
575 break; |
|
576 } |
|
577 case RPacketQoS::ESDUErrorRatioOnePerTenThousand: |
|
578 { |
|
579 negQos.iReliability = RPacketQoS::EReliabilityClass3; |
|
580 break; |
|
581 } |
|
582 case RPacketQoS::ESDUErrorRatioOnePerThousand: |
|
583 case RPacketQoS::ESDUErrorRatioSevenPerThousand: |
|
584 case RPacketQoS::ESDUErrorRatioOnePerHundred: |
|
585 case RPacketQoS::ESDUErrorRatioOnePerTen: |
|
586 { |
|
587 LOG2( SIMPLE, "SATENGINE: TSatQoSParser::ConvertNegotiatedQoS \ |
|
588 aNegQoSRel5.iResidualBer: %i", aNegQoSRel5.iResidualBer ) |
|
589 switch( aNegQoSRel5.iResidualBer ) |
|
590 { |
|
591 case RPacketQoS::EBEROnePerTenThousand: |
|
592 case RPacketQoS::EBEROnePerHundredThousand: |
|
593 case RPacketQoS::EBEROnePerMillion: |
|
594 case RPacketQoS::EBERSixPerHundredMillion: |
|
595 { |
|
596 negQos.iReliability = RPacketQoS::EReliabilityClass4; |
|
597 break; |
|
598 } |
|
599 case RPacketQoS::EBERFivePerHundred: |
|
600 case RPacketQoS::EBEROnePerHundred: |
|
601 case RPacketQoS::EBERFivePerThousand: |
|
602 case RPacketQoS::EBERFourPerThousand: |
|
603 case RPacketQoS::EBEROnePerThousand: |
|
604 { |
|
605 negQos.iReliability = RPacketQoS::EReliabilityClass5; |
|
606 break; |
|
607 } |
|
608 default: |
|
609 { |
|
610 negQos.iReliability = RPacketQoS::EUnspecifiedReliabilityClass; |
|
611 break; |
|
612 } |
|
613 } |
|
614 break; |
|
615 } |
|
616 default: |
|
617 { |
|
618 negQos.iReliability = RPacketQoS::EUnspecifiedReliabilityClass; |
|
619 break; |
|
620 } |
|
621 } |
|
622 |
|
623 // Map Maximum bitrate [kbps] to Peak throughout class |
|
624 // Maximum bitrate[kbps] ---- Peak throughout Class |
|
625 // |
|
626 // < 16 1 |
|
627 // 16 <= x < 32 2 |
|
628 // 32 <= x < 64 3 |
|
629 // 64 <= x < 128 4 |
|
630 // 128 <= x < 256 5 |
|
631 // 256 <= x < 512 6 |
|
632 // 512 <= x < 1024 7 |
|
633 // 1024 <= x < 2048 8 |
|
634 // >= 2048 9 |
|
635 if ( aNegQoSRel5.iMaxBitRate < ESatMaxBitRate2 ) |
|
636 { |
|
637 LOG( SIMPLE, "SATENGINE: CSatBIPGPRSDataChannel::\ |
|
638 ConvertNegotiatedQoS rate: rate< 16" ) |
|
639 negQos.iPeakThroughput = RPacketQoS::EPeakThroughput1000; |
|
640 } |
|
641 else if ( ( aNegQoSRel5.iMaxBitRate < ESatMaxBitRate3 ) && |
|
642 ( aNegQoSRel5.iMaxBitRate >= ESatMaxBitRate2 ) ) |
|
643 { |
|
644 LOG( SIMPLE, "SATENGINE: CSatBIPGPRSDataChannel::\ |
|
645 ConvertNegotiatedQoS rate: 16 <= rate < 32" ) |
|
646 negQos.iPeakThroughput = RPacketQoS::EPeakThroughput2000; |
|
647 } |
|
648 else if ( ( aNegQoSRel5.iMaxBitRate < ESatMaxBitRate4 ) && |
|
649 ( aNegQoSRel5.iMaxBitRate >= ESatMaxBitRate3 ) ) |
|
650 { |
|
651 LOG( SIMPLE, "SATENGINE: CSatBIPGPRSDataChannel::\ |
|
652 ConvertNegotiatedQoS rate: 32 <= rate < 64" ) |
|
653 negQos.iPeakThroughput = RPacketQoS::EPeakThroughput4000; |
|
654 } |
|
655 else if ( ( aNegQoSRel5.iMaxBitRate < ESatMaxBitRate5 ) && |
|
656 ( aNegQoSRel5.iMaxBitRate >= ESatMaxBitRate4 ) ) |
|
657 { |
|
658 LOG( SIMPLE, "SATENGINE: CSatBIPGPRSDataChannel::\ |
|
659 ConvertNegotiatedQoS rate: 64 <= rate < 128" ) |
|
660 negQos.iPeakThroughput = RPacketQoS::EPeakThroughput8000; |
|
661 } |
|
662 else if ( ( aNegQoSRel5.iMaxBitRate < ESatMaxBitRate6 ) && |
|
663 ( aNegQoSRel5.iMaxBitRate >= ESatMaxBitRate5 ) ) |
|
664 { |
|
665 LOG( SIMPLE, "SATENGINE: CSatBIPGPRSDataChannel::\ |
|
666 ConvertNegotiatedQoS rate: 128 <= rate < 256" ) |
|
667 negQos.iPeakThroughput = RPacketQoS::EPeakThroughput16000; |
|
668 } |
|
669 else if ( ( aNegQoSRel5.iMaxBitRate < ESatMaxBitRate7 ) && |
|
670 ( aNegQoSRel5.iMaxBitRate >= ESatMaxBitRate6 ) ) |
|
671 { |
|
672 LOG( SIMPLE, "SATENGINE: CSatBIPGPRSDataChannel::\ |
|
673 ConvertNegotiatedQoS rate: 256 <= rate < 512" ) |
|
674 negQos.iPeakThroughput = RPacketQoS::EPeakThroughput32000; |
|
675 } |
|
676 else if ( ( aNegQoSRel5.iMaxBitRate < ESatMaxBitRate8 ) && |
|
677 ( aNegQoSRel5.iMaxBitRate >= ESatMaxBitRate7 ) ) |
|
678 { |
|
679 LOG( SIMPLE, "SATENGINE: CSatBIPGPRSDataChannel::\ |
|
680 ConvertNegotiatedQoS rate: 512 <= rate < 1024" ) |
|
681 negQos.iPeakThroughput = RPacketQoS::EPeakThroughput64000; |
|
682 } |
|
683 else if ( ( aNegQoSRel5.iMaxBitRate < ESatMaxBitRate9 ) && |
|
684 ( aNegQoSRel5.iMaxBitRate >= ESatMaxBitRate8 ) ) |
|
685 { |
|
686 LOG( SIMPLE, "SATENGINE: CSatBIPGPRSDataChannel::\ |
|
687 ConvertNegotiatedQoS rate: 1024 <= rate < 2048" ) |
|
688 negQos.iPeakThroughput = RPacketQoS::EPeakThroughput128000; |
|
689 } |
|
690 else if ( aNegQoSRel5.iMaxBitRate >= ESatMaxBitRate9 ) |
|
691 { |
|
692 LOG( SIMPLE, "SATENGINE: CSatBIPGPRSDataChannel::\ |
|
693 ConvertNegotiatedQoS rate: rate >= 2048" ) |
|
694 negQos.iPeakThroughput = RPacketQoS::EPeakThroughput256000; |
|
695 } |
|
696 else |
|
697 { |
|
698 LOG( SIMPLE, "SATENGINE: CSatBIPGPRSDataChannel::\ |
|
699 ConvertNegotiatedQoS others" ) |
|
700 negQos.iPeakThroughput = RPacketQoS::EUnspecifiedPeakThroughput; |
|
701 } |
|
702 |
|
703 // Fixed value |
|
704 // UE shall set the R97/98 precedence class to value "subscribed" |
|
705 negQos.iPrecedence = RPacketQoS::EUnspecifiedPrecedence; |
|
706 // Always set to 31, best effort |
|
707 negQos.iMeanThroughput = RPacketQoS::EMeanThroughputBestEffort; |
|
708 |
|
709 LOG( SIMPLE, "SATENGINE: CSatBIPGPRSDataChannel::ConvertNegotiatedQoS \ |
|
710 exiting" ) |
|
711 |
|
712 return negQos; |
|
713 } |
|
714 |