author | mikaruus <mika.a.ruuskanen@nokia.com> |
Wed, 17 Feb 2010 13:58:55 +0200 | |
changeset 7 | fa67e03b87df |
parent 5 | 8ccc39f9d787 |
child 8 | 6295dc2169f3 |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
* Copyright (c) 2009 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 the License "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: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#include <phonetisi.h> // For ISI_HEADER_SIZE |
|
20 |
#include <pn_const.h> // For PN_HEADER_SIZE |
|
21 |
#include <pipeisi.h> // For PNS_PIPE_DATA_OFFSET_DATA |
|
22 |
#include <commisi.h> // For SIZE_COMMON_MESSAGE_COMM_ISA_ENTITY_NOT_REACHABLE_RESP |
|
23 |
#include "router.h" |
|
24 |
#include "iadtrace.h" // For C_TRACE.. |
|
25 |
#include "isaaccessextension.h" // For DIsaAccessExtension |
|
26 |
#include "queue.h" // For DQueue |
|
27 |
#include "iadinternaldefinitions.h" // For EIADAsync... |
|
28 |
#include "iadhelpers.h" // For GET_RECEIVER |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
29 |
#include <nsisi.h> // For PN_NAMESERVICE... |
0 | 30 |
|
31 |
#include "pipehandler.h" // For PipeHandler |
|
32 |
#include "OstTraceDefinitions.h" |
|
33 |
#ifdef OST_TRACE_COMPILER_IN_USE |
|
34 |
#include "routerTraces.h" |
|
35 |
#endif |
|
36 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
37 |
|
0 | 38 |
//#define MODEM_MCE_DOES_NOT_WORK_AS_IT_SHOULD // TODO: to be removed when Bridge Modem SW is ok |
39 |
||
40 |
// ISCE |
|
41 |
#include "memapi.h" // For MemApi |
|
42 |
#include "trxdefs.h" // For ETrx... |
|
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
43 |
#include "ape_commgrisi.h" // For APE_COMMGR... |
0 | 44 |
// ISCE |
45 |
||
46 |
// CONSTS |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
47 |
DRouter* DRouter::iThisPtr = NULL; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
48 |
const TUint32 KCommunicationManagerUID( 0x2002B3D0 ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
49 |
const TUint32 KNameServiceUID( 0x2002A5A1 ); |
0 | 50 |
|
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
51 |
const TUint8 K8BitResourceId( 2 ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
52 |
const TUint8 K32BitResourceId( 5 ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
53 |
const TUint8 K32BitResourceOffsetByte1( 0 ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
54 |
const TUint8 K32BitResourceOffsetByte2( 1 ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
55 |
const TUint8 K32BitResourceOffsetByte3( 2 ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
56 |
const TUint8 K32BitResourceOffsetByte4( 3 ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
57 |
const TUint8 K8BitResourceOffset( 0 ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
58 |
const TUint8 KEventOffset32Bit( 4 ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
59 |
const TUint8 KEventOffset8Bit( 1 ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
60 |
const TUint8 KFiller( 0 ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
61 |
const TUint8 KNoResource( 0 ); |
0 | 62 |
// TODO: change this to use UnuqueID instead and to extension.. |
63 |
void DRouter::CheckDfc() |
|
64 |
{ |
|
65 |
OstTrace0( TRACE_NORMAL, DROUTER_CHECKDFC_ENTRY, ">DRouter::CheckDfc" ); |
|
66 |
||
67 |
DObject* tempObj = reinterpret_cast<DObject*>( &Kern::CurrentThread() ); |
|
68 |
TUint8* buffer = ( TUint8* )Kern::Alloc( 100 ); |
|
69 |
TPtr8* bufferPtr = new ( TPtr8 )( buffer, 100 ); |
|
70 |
tempObj->Name( *bufferPtr ); |
|
71 |
C_TRACE( ( _T( "DRouter::CheckDfc" ) ) ); |
|
72 |
if ( bufferPtr->Compare( KIADExtensionDfc ) != KErrNone ) |
|
73 |
{ |
|
74 |
for( TInt i( 0 );i < bufferPtr->Length(); ++i ) |
|
75 |
{ |
|
76 |
Kern::Printf( "%c", i, bufferPtr->Ptr()[ i ]); |
|
77 |
} |
|
78 |
ASSERT_RESET_ALWAYS( 0, EIADWrongDFCQueueUsed | EIADFaultIdentifier2 << KFaultIdentifierShift ); |
|
79 |
} |
|
80 |
Kern::Free( buffer ); |
|
81 |
delete bufferPtr; |
|
82 |
bufferPtr = NULL; |
|
83 |
||
84 |
OstTrace0( TRACE_NORMAL, DROUTER_CHECKDFC_EXIT, "<DRouter::CheckDfc" ); |
|
85 |
} |
|
86 |
||
87 |
#ifdef _DEBUG |
|
88 |
#define ASSERT_DFCTHREAD_INEXT() CheckDfc() |
|
89 |
#else |
|
90 |
#define ASSERT_DFCTHREAD_INEXT() |
|
91 |
#endif |
|
92 |
||
93 |
DRouter::DRouter(): |
|
94 |
iConnectionStatus( EIADConnectionNotOk ) |
|
95 |
, iBootDone( EFalse ) |
|
96 |
{ |
|
97 |
OstTrace0( TRACE_NORMAL, DROUTER_DROUTER_ENTRY, "<DRouter::DRouter" ); |
|
98 |
||
99 |
C_TRACE( ( _T( "DRouter::DRouter ->" ) ) ); |
|
100 |
// owned |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
101 |
#ifdef NCP_COMMON_BRIDGE_FAMILY_PIPE_SUPPORT |
0 | 102 |
iPipeHandler = new DPipeHandler( *this ); |
103 |
#endif |
|
104 |
iCommonRxQueue = new DQueue( KIADExtensionRxQueueSize ); |
|
105 |
// Initialize channels to NULL when channel is opened !NULL. |
|
106 |
for( TInt i( 0 ); i < EIADSizeOfChannels; ++i ) |
|
107 |
{ |
|
108 |
iChannelTable[ i ].iChannel = NULL; |
|
109 |
iChannelTable[ i ].iWaitingChannel = NULL; |
|
110 |
iChannelTable[ i ].iType = ENormalOpen; |
|
111 |
} |
|
112 |
||
113 |
iCommonRxDfc = new TDfc( CommonRxDfc, this, DIsaAccessExtension::GetDFCThread( EIADExtensionDfcQueue ), KIADExtCommonRxPriori ); |
|
114 |
// not owned, just using. |
|
115 |
// Set null when not registered. |
|
116 |
iInitCmtDfc = new TDfc( InitCmtDfc, this, DIsaAccessExtension::GetDFCThread( EIADExtensionDfcQueue ), KIADExtInitCmtPriori ); |
|
117 |
iConnStatDfc = new TDfc( NotifyObjLayerConnStatDfc, this, DIsaAccessExtension::GetDFCThread( EIADExtensionDfcQueue ), KIADExtConnStatPriori ); |
|
118 |
ASSERT_RESET_ALWAYS( iCommonRxDfc && iInitCmtDfc && iConnStatDfc, EIADMemoryAllocationFailure | EIADFaultIdentifier18 << KFaultIdentifierShift ); |
|
119 |
iMaxFrameSize = 0x0000; |
|
120 |
// ISCE |
|
121 |
iLinksArray = new MISIRouterLinkIf*[ DRouter::EISIAmountOfMedias ]; |
|
122 |
// TODO: fault codes and ids |
|
123 |
ASSERT_RESET_ALWAYS( iLinksArray, ( EIADMemoryAllocationFailure | EIADFaultIdentifier17 << KFaultIdentifierShift ) ); |
|
124 |
// Initialize links |
|
125 |
for( TInt i( 0 ); i < DRouter::EISIAmountOfMedias; i++ ) |
|
126 |
{ |
|
127 |
iLinksArray[ i ] = NULL; |
|
128 |
C_TRACE( ( _T( "DRouter::DRouter %d" ), i ) ); |
|
129 |
} |
|
130 |
// Configuration of ISI links. TODO: devices and link configurations for coming platforms are unknown and to be done later. |
|
131 |
iLinksArray[ DRouter::EISIMediaHostSSI ] = MISIRouterLinkIf::CreateLinkF( this, PN_MEDIA_MODEM_HOST_IF, ETrxSharedMemory ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
132 |
DRouter::iThisPtr = this; |
0 | 133 |
C_TRACE( ( _T( "DRouter::DRouter 0x%x <-" ), this ) ); |
134 |
OstTrace1( TRACE_NORMAL, DROUTER_DROUTER_EXIT, "<DRouter::DRouter;this=%x", this ); |
|
135 |
} |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
136 |
|
0 | 137 |
DRouter::~DRouter( |
138 |
// None |
|
139 |
) |
|
140 |
{ |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
141 |
|
0 | 142 |
OstTrace0( TRACE_NORMAL, DUP1_DROUTER_DROUTER_ENTRY, "<DRouter::~DRouter" ); |
143 |
//ISCE |
|
144 |
// owning so deleting |
|
145 |
for( TInt i( 0 ); i < EISIAmountOfMedias; i++ ) |
|
146 |
{ |
|
147 |
MISIRouterLinkIf* temp = iLinksArray[ i ]; |
|
148 |
temp->Release(); |
|
149 |
temp = NULL; |
|
150 |
iLinksArray[ i ] = NULL; |
|
151 |
} |
|
152 |
//ISCE |
|
153 |
C_TRACE( ( _T( "DRouter::~DRouter 0x%x ->" ), this ) ); |
|
154 |
// Initialize channels to NULL when channel is opened !NULL. |
|
155 |
for( TInt i( 0 ); i < EIADSizeOfChannels; ++i ) |
|
156 |
{ |
|
157 |
iChannelTable[ i ].iChannel = NULL; |
|
158 |
iChannelTable[ i ].iWaitingChannel = NULL; |
|
159 |
iChannelTable[ i ].iType = ENormalOpen; |
|
160 |
} |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
161 |
#ifdef NCP_COMMON_BRIDGE_FAMILY_PIPE_SUPPORT |
0 | 162 |
if( iPipeHandler ) |
163 |
{ |
|
164 |
delete iPipeHandler; |
|
165 |
iPipeHandler = NULL; |
|
166 |
} |
|
167 |
#endif |
|
168 |
if( iCommonRxQueue ) |
|
169 |
{ |
|
170 |
delete iCommonRxQueue; |
|
171 |
iCommonRxQueue = NULL; |
|
172 |
} |
|
173 |
if( iCommonRxDfc ) |
|
174 |
{ |
|
175 |
iCommonRxDfc->Cancel(); |
|
176 |
delete iCommonRxDfc; |
|
177 |
iCommonRxDfc = NULL; |
|
178 |
} |
|
179 |
if( iInitCmtDfc ) |
|
180 |
{ |
|
181 |
delete iInitCmtDfc; |
|
182 |
iInitCmtDfc = NULL; |
|
183 |
} |
|
184 |
if( iConnStatDfc ) |
|
185 |
{ |
|
186 |
delete iConnStatDfc; |
|
187 |
iConnStatDfc = NULL; |
|
188 |
} |
|
189 |
C_TRACE( ( _T( "DRouter::~DRouter 0x%x <-" ), this ) ); |
|
190 |
||
191 |
OstTrace1( TRACE_NORMAL, DUP1_DROUTER_DROUTER_EXIT, "<DRouter::~DRouter;this=%x", this ); |
|
192 |
} |
|
193 |
||
194 |
// From start |
|
195 |
// Do not call from ISR context!! Can only be called from Extension DFCThread context. |
|
196 |
EXPORT_C TDes8& DRouter::AllocateBlock( |
|
197 |
const TUint16 aSize |
|
198 |
) |
|
199 |
{ |
|
200 |
OstTraceExt1( TRACE_NORMAL, DROUTER_ALLOCATEBLOCK_ENTRY, "<>DRouter::AllocateBlock;aSize=%hu", aSize ); |
|
201 |
||
202 |
C_TRACE( ( _T( "DRouter::AllocateBlock %d <->" ), aSize ) ); |
|
203 |
ASSERT_CONTEXT_ALWAYS( NKern::EThread, 0 ); |
|
204 |
ASSERT_DFCTHREAD_INEXT(); |
|
205 |
ASSERT_RESET_ALWAYS( aSize, EIADWrongParameter | EIADFaultIdentifier9 << KFaultIdentifierShift ); |
|
206 |
// ISCE |
|
207 |
// ASSERT_RESET_ALWAYS( iIST, EIADNullParameter | EIADFaultIdentifier17 << KFaultIdentifierShift ); |
|
208 |
// return iIST->AllocateBlock( aSize );// TODO: Print ptr!!! |
|
209 |
return MemApi::AllocBlock( aSize ); |
|
210 |
// ISCE |
|
211 |
} |
|
212 |
||
213 |
EXPORT_C TDes8& DRouter::AllocateDataBlock( |
|
214 |
const TUint16 aSize |
|
215 |
) |
|
216 |
{ |
|
217 |
OstTraceExt1( TRACE_NORMAL, DROUTER_ALLOCATEDATABLOCK_ENTRY, ">DRouter::AllocateDataBlock;aSize=%hu", aSize ); |
|
218 |
||
219 |
C_TRACE( ( _T( "DRouter::AllocateDataBlock %d <->" ), aSize ) ); |
|
220 |
TUint32 neededLength( aSize + ISI_HEADER_SIZE + PNS_PIPE_DATA_OFFSET_DATA ); |
|
221 |
TDes8& tmp = this->AllocateBlock( neededLength ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
222 |
#ifdef NCP_COMMON_BRIDGE_FAMILY_PIPE_SUPPORT |
0 | 223 |
tmp.SetLength( neededLength ); |
224 |
TUint8* msgPtr = const_cast<TUint8*>( tmp.Ptr() ); |
|
225 |
SET_RECEIVER_DEV( msgPtr, PN_DEV_DONT_CARE ); |
|
226 |
ASSERT_RESET_ALWAYS( neededLength > ISI_HEADER_OFFSET_MESSAGEID, EIADOverTheLimits | EIADFaultIdentifier1 << KFaultIdentifierShift ); |
|
227 |
msgPtr[ ISI_HEADER_OFFSET_RESOURCEID ] = PN_PIPE; |
|
228 |
msgPtr[ ISI_HEADER_OFFSET_MESSAGEID ] = PNS_PIPE_DATA; |
|
229 |
SET_RECEIVER_OBJ( msgPtr, PN_OBJ_ROUTER ); |
|
230 |
SET_LENGTH( tmp, ( tmp.Length() - PN_HEADER_SIZE ) ); |
|
231 |
#endif |
|
232 |
OstTrace1( TRACE_NORMAL, DROUTER_ALLOCATEDATABLOCK_EXIT, "<DRouter::AllocateDataBlock;tmp=%x",( TUint )&( tmp ) ); |
|
233 |
return tmp; |
|
234 |
} |
|
235 |
||
236 |
||
237 |
EXPORT_C void DRouter::Close( |
|
238 |
const TUint16 aChannelId |
|
239 |
) |
|
240 |
{ |
|
241 |
||
242 |
OstTraceExt1( TRACE_NORMAL, DROUTER_CLOSE_ENTRY, ">DRouter::Close;aChannelId=%hx", aChannelId ); |
|
243 |
C_TRACE( ( _T( "DRouter::Close 0x%x ->" ), aChannelId ) ); |
|
244 |
// Channel must be from appropiate length and although it is sixteenbit value it must contain only 8-bit values. If over 8-bit changes needed. |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
245 |
ASSERT_RESET_ALWAYS( aChannelId < EIADSizeOfChannels || aChannelId < 0xff, EIADWrongParameter | EIADFaultIdentifier10 << KFaultIdentifierShift | aChannelId << KChannelNumberShift ); |
0 | 246 |
ASSERT_DFCTHREAD_INEXT(); |
247 |
// If channel open (!NULL) set as closed (NULL) or if channel open is pending. |
|
248 |
ASSERT_RESET_ALWAYS( aChannelId < EIADSizeOfChannels, EIADWrongParameter | (TUint8)aChannelId << KChannelNumberShift | EIADFaultIdentifier21 << KFaultIdentifierShift ); |
|
249 |
if( iChannelTable[ aChannelId ].iChannel || iChannelTable[ aChannelId ].iWaitingChannel ) |
|
250 |
{ |
|
251 |
C_TRACE( ( _T( "DRouter::Close open->close 0x%x" ), aChannelId ) ); |
|
252 |
#if (NCP_COMMON_SOS_VERSION_SUPPORT >= SOS_VERSION_95) |
|
253 |
if( iChannelTable[ aChannelId ].iType != ELoan ) |
|
254 |
{ |
|
255 |
#endif |
|
256 |
iChannelTable[ aChannelId ].iChannel = NULL; |
|
257 |
iChannelTable[ aChannelId ].iWaitingChannel = NULL; |
|
258 |
iChannelTable[ aChannelId ].iType = ENormalOpen; |
|
259 |
const TInt indicationCancelOrderSize( 2 ); |
|
260 |
TDes8& cancelOrder = AllocateBlock( indicationCancelOrderSize ); |
|
261 |
cancelOrder.Append( 0x00 ); |
|
262 |
cancelOrder.Append( 0x00 ); |
|
263 |
// Order internally, so no return values above ::Close { 0x00, 0x00 } 8-bit cancel indication. |
|
264 |
TInt error( OrderIndication( cancelOrder, aChannelId, EFalse ) ); |
|
265 |
C_TRACE( ( _T( "DRouter::Close open->close indication order returned %d 0x%x" ), error, aChannelId ) ); |
|
266 |
OstTraceExt2( TRACE_NORMAL, DROUTER_CLOSE, "DRouter::Close open->close indication order returned;error=%d;aChannelId=%x", error, aChannelId ); |
|
267 |
ASSERT_RESET_ALWAYS( KErrNone == error, EIADIndicationOrderFailed | static_cast<TUint8>( ( aChannelId << KChannelNumberShift ) ) ); |
|
268 |
DeAllocateBlock( cancelOrder ); |
|
269 |
#if (NCP_COMMON_SOS_VERSION_SUPPORT >= SOS_VERSION_95) |
|
270 |
} |
|
271 |
else |
|
272 |
{ |
|
273 |
C_TRACE( ( _T( "DRouter::Close open->close loaned channel 0x%x" ), aChannelId ) ); |
|
274 |
OstTrace1( TRACE_NORMAL, DROUTER_CLOSE_2, "DRouter::Close open->close loaned channel;aChannelId=%x", aChannelId ); |
|
275 |
iChannelTable[ aChannelId ].iType = ENormalOpen; |
|
276 |
iChannelTable[ aChannelId ].iChannel = iChannelTable[ aChannelId ].iWaitingChannel; |
|
277 |
iChannelTable[ aChannelId ].iWaitingChannel = NULL; |
|
278 |
} |
|
279 |
#endif |
|
280 |
} |
|
281 |
C_TRACE( ( _T( "DRouter::Close 0x%x <-" ), aChannelId ) ); |
|
282 |
OstTrace0( TRACE_NORMAL, DROUTER_CLOSE_EXIT, "<DRouter::Close" ); |
|
283 |
||
284 |
} |
|
285 |
||
286 |
// Do not call from ISR context!! Can only be called from Extension DFCThread context. |
|
287 |
EXPORT_C void DRouter::DeAllocateBlock( |
|
288 |
TDes8& aBlock |
|
289 |
) |
|
290 |
{ |
|
291 |
OstTrace1( TRACE_NORMAL, DROUTER_DEALLOCATEBLOCK_ENTRY, ">DRouter::DeAllocateBlock;aBlock=%x", ( TUint )&( aBlock ) ); |
|
292 |
||
293 |
C_TRACE( ( _T( "DRouter::DeAllocateBlock 0x%x ->" ), &aBlock ) ); |
|
294 |
ASSERT_CONTEXT_ALWAYS( NKern::EThread, 0 ); |
|
295 |
ASSERT_DFCTHREAD_INEXT(); |
|
296 |
// ISCE |
|
297 |
// ASSERT_RESET_ALWAYS( iIST, EIADNullParameter | EIADFaultIdentifier18 << KFaultIdentifierShift ); |
|
298 |
// iIST->DeallocateBlock( aBlock ); |
|
299 |
MemApi::DeallocBlock( aBlock ); |
|
300 |
// ISCE |
|
301 |
C_TRACE( ( _T( "DRouter::DeAllocateBlock 0x%x <-" ), &aBlock ) ); |
|
302 |
||
303 |
OstTrace0( TRACE_NORMAL, DROUTER_DEALLOCATEBLOCK_EXIT, "<DRouter::DeAllocateBlock" ); |
|
304 |
} |
|
305 |
||
306 |
EXPORT_C TInt DRouter::GetConnectionStatus( |
|
307 |
// None |
|
308 |
) |
|
309 |
{ |
|
310 |
OstTrace0( TRACE_NORMAL, DROUTER_GETCONNECTIONSTATUS_ENTRY, "<DRouter::GetConnectionStatus" ); |
|
311 |
||
312 |
C_TRACE( ( _T( "DRouter::GetConnectionStatus %d <->" ), iConnectionStatus ) ); |
|
313 |
ASSERT_DFCTHREAD_INEXT(); |
|
314 |
||
315 |
OstTrace1( TRACE_NORMAL, DROUTER_GETCONNECTIONSTATUS, "<DRouter::GetConnectionStatus;iConnectionStatus=%x", iConnectionStatus ); |
|
316 |
return iConnectionStatus; |
|
317 |
} |
|
318 |
||
319 |
EXPORT_C TInt DRouter::GetFlowControlStatus() |
|
320 |
{ |
|
321 |
OstTrace0( TRACE_NORMAL, DROUTER_GETFLOWCONTROLSTATUS_ENTRY, "<>DRouter::GetFlowControlStatus" ); |
|
322 |
ASSERT_DFCTHREAD_INEXT(); |
|
323 |
return KErrNotSupported; // TODO |
|
324 |
} |
|
325 |
||
326 |
EXPORT_C TInt DRouter::GetMaxDataSize( |
|
327 |
// None |
|
328 |
) |
|
329 |
{ |
|
330 |
OstTrace0( TRACE_NORMAL, DROUTER_GETMAXDATASIZE_ENTRY, ">DRouter::GetMaxDataSize" ); |
|
331 |
||
332 |
C_TRACE( ( _T( "DRouter::GetMaxDataSize ->" ) ) ); |
|
333 |
ASSERT_DFCTHREAD_INEXT(); |
|
334 |
TInt excludeSize( iMaxFrameSize - ( ISI_HEADER_SIZE + PNS_PIPE_DATA_OFFSET_DATA ) ); |
|
335 |
// Set the data to be divisible by four. |
|
336 |
TInt allowedCount( excludeSize - ( excludeSize % 4 ) ); |
|
337 |
C_TRACE( ( _T( "DRouter::GetMaxDataSize %d <-" ), allowedCount ) ); |
|
338 |
||
339 |
OstTrace1( TRACE_NORMAL, DROUTER_GETMAXDATASIZE_EXIT, "<DRouter::GetMaxDataSize;allowedCount=%d", allowedCount ); |
|
340 |
return allowedCount; |
|
341 |
} |
|
342 |
||
343 |
// KErrNone, channelid with channel object open ok |
|
344 |
// KErrNotSupported, resource not supported or in use causes name_add_req to fail |
|
345 |
// KErrInUse, channelid opened by same channel object earlier |
|
346 |
// KErrAlreadyExists, channel opened by some other channel object earlier |
|
347 |
// In completechannelreq, set ~channel number as ~~channelnumber only if KErrNone or KErrInUse |
|
348 |
EXPORT_C void DRouter::Open( |
|
349 |
const TUint16 aChannel, |
|
350 |
const TUint16 aRequest, |
|
351 |
MIAD2ChannelApi* aCallback |
|
352 |
) |
|
353 |
{ |
|
354 |
OstTraceExt3( TRACE_NORMAL, DROUTER_OPEN_ENTRY, ">DRouter::Open;aChannel=%hx;aRequest=%hu;aCallback=%x", aChannel, aRequest, ( TUint )( aCallback ) ); |
|
355 |
||
356 |
||
357 |
C_TRACE( ( _T( "DRouter::Open 0x%x %d 0x%x ->" ), aChannel, aRequest, aCallback ) ); |
|
358 |
ASSERT_RESET_ALWAYS( aCallback, EIADNullParameter | EIADFaultIdentifier19 << KFaultIdentifierShift ); |
|
359 |
ASSERT_DFCTHREAD_INEXT(); |
|
360 |
ASSERT_RESET_ALWAYS( aChannel < EIADSizeOfChannels, EIADWrongParameter | (TUint8)aChannel << KChannelNumberShift | EIADFaultIdentifier26 << KFaultIdentifierShift ); |
|
361 |
if( iConnectionStatus == EIADConnectionOk ) |
|
362 |
{ |
|
363 |
// If not null channel is allready open. |
|
364 |
if( iChannelTable[ aChannel ].iChannel || |
|
365 |
iChannelTable[ aChannel ].iWaitingChannel ) |
|
366 |
{ |
|
367 |
// If another channel tries to open already open channel. |
|
368 |
TRACE_WARNING( iChannelTable[ aChannel ].iChannel == aCallback, (TUint8)aChannel << KChannelNumberShift ); |
|
369 |
// If same object calling KErrInUser if other but same channel KErrAlreadyExists |
|
370 |
aCallback->CompleteChannelRequest( aRequest, ( iChannelTable[ aChannel ].iChannel == aCallback ? KErrInUse : KErrAlreadyExists ) ); |
|
371 |
} |
|
372 |
// Null so channel is not open, set !null to mark opened channel. |
|
373 |
else |
|
374 |
{ |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
375 |
C_TRACE( ( _T( "DRouter::Open channel 0x%x normal 0x%x" ), aChannel, aCallback ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
376 |
OstTraceExt1( TRACE_NORMAL, DUP1_DROUTER_OPEN, "DRouter::Open normal;aChannel=%hx", aChannel ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
377 |
iChannelTable[ aChannel ].iChannel = aCallback; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
378 |
aCallback->CompleteChannelRequest( aRequest, KErrNone ); |
0 | 379 |
} |
380 |
} |
|
381 |
else |
|
382 |
{ |
|
383 |
C_TRACE( ( _T( "DRouter::Open not ready" ) ) ); |
|
384 |
OstTrace0( TRACE_NORMAL, DUP2_DROUTER_OPEN, "DRouter::Open Not ready" ); |
|
385 |
ASSERT_RESET_ALWAYS( !iChannelTable[ aChannel ].iWaitingChannel, EIADWrongRequest | EIADFaultIdentifier15 << KFaultIdentifierShift ); |
|
386 |
iChannelTable[ aChannel ].iWaitingChannel = aCallback; |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
387 |
iChannelTable[ aChannel ].iType = ( ( aChannel == EIADNokiaDRM || aChannel == EIADNokiaSecurityDriver ) ? ENormalOpen : ENormalOpen );//??? TODO FIX THIS |
0 | 388 |
} |
389 |
C_TRACE( ( _T( "DRouter::Open 0x%x <-" ), aChannel ) ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
390 |
OstTraceExt1( TRACE_NORMAL, DROUTER_OPEN_EXIT, "<DRouter::Open;aChannel=%hx", aChannel ); |
0 | 391 |
|
392 |
} |
|
393 |
||
394 |
// With resource and media |
|
395 |
EXPORT_C void DRouter::Open( |
|
396 |
const TUint16 aChannel, |
|
397 |
const TUint16 aRequest, |
|
398 |
const TDesC8& aOpenInfo, |
|
399 |
MIAD2ChannelApi* aCallback |
|
400 |
) |
|
401 |
{ |
|
402 |
OstTraceExt4( TRACE_NORMAL, DUP1_DROUTER_OPEN_ENTRY, ">DRouter::Open;aChannel=%hx;aRequest=%hu;aOpenInfo=%x;aCallback=%x", aChannel, aRequest, ( TUint )&( aOpenInfo ), ( TUint )( aCallback ) ); |
|
403 |
C_TRACE( ( _T( "DRouter::Open 0x%x %d 0x%x 0x%x ->" ), aChannel, aRequest, &aOpenInfo, aCallback ) ); |
|
404 |
// Some maniac from modem sw decided to remove name service in the last meters, hip-hip hurray inform which clients use resource from open to help debug! |
|
405 |
TRACE_ASSERT_INFO( 0, (TUint8)aChannel<<KChannelNumberShift ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
406 |
// Treat as normal open to enable the sending. |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
407 |
// NOTE! SUPPORT FOR RESOURCE OPEN DOES NOT EXISTS: CLIENT SHOULD NAME SERVICE BY ISI IF. SUPPORT FOR NAME SERVICE DOES NOT EXIST IN APE SW YET: NCP_COMMON_BRIDGE_FAMILY_NAME_SERVICE_SUPPORT |
0 | 408 |
Open( aChannel, aRequest, aCallback ); |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
409 |
C_TRACE( ( _T( "DRouter::Open 0x%x <-" ), aChannel ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
410 |
OstTraceExt1( TRACE_NORMAL, DUP1_DROUTER_OPEN_EXIT, "<DRouter::Open;aChannel=%hx", aChannel ); |
0 | 411 |
|
412 |
} |
|
413 |
||
414 |
#if (NCP_COMMON_SOS_VERSION_SUPPORT >= SOS_VERSION_95) |
|
415 |
EXPORT_C TInt DRouter::Loan( |
|
416 |
const TUint16 aChannel, |
|
417 |
const TUint16 aRequest, |
|
418 |
MIAD2ChannelApi* aCallback |
|
419 |
) |
|
420 |
{ |
|
421 |
||
422 |
C_TRACE( ( _T( "DRouter::Loan 0x%x %d 0x%x ->" ), aChannel, aRequest, aCallback ) ); |
|
423 |
OstTraceExt3( TRACE_NORMAL, DUP1_DROUTER_LOAN_ENTRY, ">DRouter::Loan;aChannel=%hx;aRequest=%hu;aCallback=%x", aChannel, aRequest, ( TUint )( aCallback ) ); |
|
424 |
ASSERT_RESET_ALWAYS( aCallback, EIADNullParameter | EIADFaultIdentifier19 << KFaultIdentifierShift );// TODO |
|
425 |
ASSERT_RESET_ALWAYS( aChannel < EIADSizeOfChannels, EIADWrongParameter | EIADFaultIdentifier11 << KFaultIdentifierShift );// TODO |
|
426 |
ASSERT_DFCTHREAD_INEXT(); |
|
427 |
ASSERT_RESET_ALWAYS( aChannel < EIADSizeOfChannels, aChannel ); |
|
428 |
TInt error( KErrNone ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
429 |
#ifdef NCP_COMMON_BRIDGE_FAMILY_PIPE_SUPPORT |
0 | 430 |
// Is connection lost. |
431 |
error = ( iConnectionStatus == EIADConnectionNotOk ) ? KErrNotSupported : error; |
|
432 |
TRACE_ASSERT_INFO( KErrNone == error, error ); |
|
433 |
// Is loaning a resticted channel. |
|
434 |
error = ( KErrNone == error && ( aChannel == EIADNokiaDRM || aChannel == EIADNokiaSecurityDriver ) ) ? KErrNotSupported : error; |
|
435 |
TRACE_ASSERT_INFO( KErrNone == error, error ); |
|
436 |
// Is loaning it self? |
|
437 |
error = ( KErrNone == error && ( iChannelTable[ aChannel ].iChannel == aCallback ) ) ? KErrNotSupported : error; |
|
438 |
TRACE_ASSERT_INFO( KErrNone == error, error ); |
|
439 |
// Is loaning currently not open channel. |
|
440 |
error = ( KErrNone == error && ( !iChannelTable[ aChannel ].iChannel ) ) ? KErrNotSupported : error; |
|
441 |
TRACE_ASSERT_INFO( KErrNone == error, error ); |
|
442 |
// Is loaning already loaned channel. |
|
443 |
error = ( KErrNone == error && ( iChannelTable[ aChannel ].iType == ELoan ) ) ? KErrAlreadyExists : error; |
|
444 |
TRACE_ASSERT_INFO( KErrNone == error, error ); |
|
445 |
if( KErrNone == error ) |
|
446 |
{ |
|
447 |
// Who is loaning whose channel. |
|
448 |
C_TRACE( ( _T( "DRouter::Loan loaning ch 0x%x from chObj 0x%x to chObj 0x%x setting previous as waiting" ), aChannel, iChannelTable[ aChannel ].iChannel, aCallback ) ); |
|
449 |
OstTraceExt3( TRACE_NORMAL, DUP1_DROUTER_LOAN, "DRouter::Loan loaning;aChannel=%hx;channelPtr=%hx;callbackPtr=%hx", aChannel, (TUint)iChannelTable[ aChannel ].iChannel, (TUint)aCallback ); |
|
450 |
iChannelTable[ aChannel ].iWaitingChannel = iChannelTable[ aChannel ].iChannel;// TEST WITH WAITING CHANNEL FIRST |
|
451 |
iChannelTable[ aChannel ].iType = ELoan; |
|
452 |
iChannelTable[ aChannel ].iChannel = aCallback; |
|
453 |
iPipeHandler->PipeLoaned( aChannel, aCallback ); |
|
454 |
} |
|
455 |
#endif |
|
456 |
C_TRACE( ( _T( "DRouter::Loan 0x%x %d<-" ), aChannel, error ) ); |
|
457 |
OstTraceExt2( TRACE_NORMAL, DUP1_DROUTER_LOAN_EXIT, "<DRouter::Loan;aChannel=%hx;error=%d", aChannel, error ); |
|
458 |
return error; |
|
459 |
||
460 |
} |
|
461 |
||
462 |
EXPORT_C TInt DRouter::ReturnLoan( |
|
463 |
const TUint16 aChannel, |
|
464 |
const TUint16 aRequest, |
|
465 |
MIAD2ChannelApi* aCallback |
|
466 |
) |
|
467 |
{ |
|
468 |
||
469 |
C_TRACE( ( _T( "DRouter::ReturnLoan 0x%x %d 0x%x ->" ), aChannel, aRequest, aCallback ) ); |
|
470 |
OstTraceExt3( TRACE_NORMAL, DUP1_DROUTER_RETURNLOAN_ENTRY, ">DRouter::ReturnLoan;aChannel=%hx;aRequest=%hu;aCallback=%x", aChannel, aRequest, ( TUint )( aCallback ) ); |
|
471 |
ASSERT_RESET_ALWAYS( aCallback, EIADNullParameter | EIADFaultIdentifier19 << KFaultIdentifierShift );// TODO |
|
472 |
ASSERT_RESET_ALWAYS( aChannel < EIADSizeOfChannels, EIADWrongParameter | EIADFaultIdentifier11 << KFaultIdentifierShift );// TODO |
|
473 |
ASSERT_DFCTHREAD_INEXT(); |
|
474 |
ASSERT_RESET_ALWAYS( aChannel < EIADSizeOfChannels, aChannel ); |
|
475 |
TInt error( KErrNone ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
476 |
#ifdef NCP_COMMON_BRIDGE_FAMILY_PIPE_SUPPORT |
0 | 477 |
// Is connection lost. |
478 |
error = ( iConnectionStatus == EIADConnectionNotOk ) ? KErrNotSupported : error; |
|
479 |
TRACE_ASSERT_INFO( KErrNone == error, error ); |
|
480 |
// Is loaning a resticted channel. |
|
481 |
error = ( KErrNone == error && ( aChannel == EIADNokiaDRM || aChannel == EIADNokiaSecurityDriver ) ) ? KErrNotSupported : error; |
|
482 |
TRACE_ASSERT_INFO( KErrNone == error, error ); |
|
483 |
// Is retuning someone elses loan? |
|
484 |
error = ( KErrNone == error && ( iChannelTable[ aChannel ].iChannel != aCallback ) ) ? KErrNotSupported : error; |
|
485 |
TRACE_ASSERT_INFO( KErrNone == error, error ); |
|
486 |
// Is returning currently not open channel. |
|
487 |
error = ( KErrNone == error && ( !iChannelTable[ aChannel ].iChannel ) ) ? KErrNotSupported : error; |
|
488 |
TRACE_ASSERT_INFO( KErrNone == error, error ); |
|
489 |
// Is returning a not loaned channel. |
|
490 |
error = ( KErrNone == error && ( iChannelTable[ aChannel ].iType != ELoan ) ) ? KErrAlreadyExists : error; |
|
491 |
TRACE_ASSERT_INFO( KErrNone == error, error ); |
|
492 |
if( KErrNone == error ) |
|
493 |
{ |
|
494 |
// Who is loaning whose channel. |
|
495 |
C_TRACE( ( _T( "DRouter::ReturnLoan returning loan ch 0x%x to chObj 0x%x from chObj 0x%x setting previous as waiting" ), aChannel, iChannelTable[ aChannel ].iWaitingChannel, aCallback ) ); |
|
496 |
OstTraceExt3( TRACE_NORMAL, DUP1_DROUTER_RETURNLOAN, "DRouter::Loan loaning;aChannel=%hx;waitingchannelPtr=%hx;callbackPtr=%hx", aChannel, (TUint)iChannelTable[ aChannel ].iWaitingChannel, (TUint)aCallback ); |
|
497 |
iPipeHandler->PipeLoanReturned( aChannel, iChannelTable[ aChannel ].iWaitingChannel ); |
|
498 |
} |
|
499 |
#endif |
|
500 |
C_TRACE( ( _T( "DRouter::ReturnLoan 0x%x %d<-" ), aChannel, error ) ); |
|
501 |
OstTraceExt2( TRACE_NORMAL, DUP1_DROUTER_RETURNLOAN_EXIT, "<DRouter::ReturnLoan;aChannel=%hx;error=%d", aChannel, error ); |
|
502 |
return error; |
|
503 |
||
504 |
} |
|
505 |
#endif |
|
506 |
||
507 |
EXPORT_C TInt DRouter::OrderIndication( |
|
508 |
TDes8& anOrder, |
|
509 |
const TUint16 aCh, |
|
510 |
const TBool a32Bit |
|
511 |
) |
|
512 |
{ |
|
513 |
OstTraceExt3( TRACE_NORMAL, DROUTER_ORDERINDICATION_ENTRY, ">DRouter::OrderIndication;anOrder=%x;aCh=%hx;a32Bit=%d", ( TUint )&( anOrder ), aCh, a32Bit ); |
|
514 |
||
515 |
C_TRACE( ( _T( "DRouter::OrderIndication 0x%x 0x%x %d ->" ), &anOrder, aCh, a32Bit ) ); |
|
516 |
ASSERT_DFCTHREAD_INEXT(); |
|
517 |
TInt orderLength( anOrder.Length() ); |
|
518 |
TInt msgOk = ( 0 == orderLength ) ? KErrBadDescriptor : KErrNone; |
|
519 |
TRACE_ASSERT_INFO( msgOk == KErrNone, (TUint8)aCh<<KChannelNumberShift ); |
|
520 |
// Should be divisible by two if not 32 bit. |
|
521 |
msgOk = ( ( msgOk == KErrNone && ( !a32Bit && 0 != orderLength % 2 ) ) ? KErrBadDescriptor : msgOk ); |
|
522 |
TRACE_ASSERT_INFO( msgOk == KErrNone, (TUint8)aCh<<KChannelNumberShift ); |
|
523 |
// Should be divisible by five if 32 bit. |
|
524 |
msgOk = ( ( msgOk == KErrNone && ( a32Bit && 0 != orderLength % 5 ) ) ? KErrBadDescriptor : msgOk ); |
|
525 |
TRACE_ASSERT_INFO( msgOk == KErrNone, (TUint8)aCh<<KChannelNumberShift ); |
|
526 |
msgOk = ( ( msgOk == KErrNone && ( orderLength > GetMaxDataSize() ) ) ? KErrUnderflow : msgOk ); |
|
527 |
TRACE_ASSERT_INFO( msgOk == KErrNone, (TUint8)aCh<<KChannelNumberShift ); |
|
528 |
if( KErrNone == msgOk ) |
|
529 |
{ |
|
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
530 |
TInt numOfOrders( 0 ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
531 |
if( a32Bit == EFalse ) |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
532 |
{ |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
533 |
if( anOrder.Ptr()[ K8BitResourceOffset ] == KNoResource ) //Subscription remove |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
534 |
{ |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
535 |
numOfOrders = 0x00; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
536 |
} |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
537 |
else{ |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
538 |
numOfOrders = ( anOrder.Length() / K8BitResourceId ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
539 |
} |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
540 |
} |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
541 |
else |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
542 |
{ |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
543 |
if( anOrder.Ptr()[ K32BitResourceOffsetByte4 ] == KNoResource ) //Subscription remove |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
544 |
{ |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
545 |
numOfOrders = 0x00; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
546 |
} |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
547 |
else{ |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
548 |
numOfOrders = ( anOrder.Length() / K32BitResourceId ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
549 |
} |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
550 |
} |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
551 |
TUint16 msgLength = ( ISI_HEADER_SIZE + SIZE_APE_COMMGR_SUBSCRIBE_REQ + ( SIZE_APE_COMMGR_SUBSCRIBE_SB * numOfOrders ) ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
552 |
TDes8& desPtr = MemApi::AllocBlock( msgLength ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
553 |
desPtr.SetLength( msgLength ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
554 |
TUint8* ptr( const_cast<TUint8*>( desPtr.Ptr() ) ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
555 |
ptr[ ISI_HEADER_OFFSET_MEDIA ] = PN_MEDIA_ROUTING_REQ; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
556 |
SET_RECEIVER_DEV( ptr, PN_DEV_OWN ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
557 |
SET_SENDER_DEV( ptr, PN_DEV_OWN ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
558 |
ptr[ ISI_HEADER_OFFSET_RESOURCEID ] = PN_APE_COMMGR; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
559 |
SET_LENGTH( ptr, ( desPtr.Length() - PN_HEADER_SIZE ) ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
560 |
SET_RECEIVER_OBJ( ptr, PN_OBJ_ROUTER ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
561 |
SET_SENDER_OBJ( ptr, aCh ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
562 |
ptr[ ISI_HEADER_SIZE + APE_COMMGR_SUBSCRIBE_REQ_OFFSET_TRANSID ] = 0x00; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
563 |
ptr[ ISI_HEADER_SIZE + APE_COMMGR_SUBSCRIBE_REQ_OFFSET_MESSAGEID ] = APE_COMMGR_SUBSCRIBE_REQ; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
564 |
ptr[ ISI_HEADER_SIZE + APE_COMMGR_SUBSCRIBE_REQ_OFFSET_FILLERBYTE1 ] = numOfOrders; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
565 |
ptr[ ISI_HEADER_SIZE + APE_COMMGR_SUBSCRIBE_REQ_OFFSET_SUBBLOCKCOUNT ] = 0x00; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
566 |
TInt orderIndex( 0 ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
567 |
//TODO automatically generated ape_commgrisi.h is totally wrong and not according to the specification |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
568 |
for( TInt subBlockOffset( ISI_HEADER_SIZE + SIZE_APE_COMMGR_SUBSCRIBE_REQ + APE_COMMGR_SUBSCRIBE_SB_OFFSET_SUBBLOCKID ); subBlockOffset < msgLength; subBlockOffset += SIZE_APE_COMMGR_SUBSCRIBE_SB ) |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
569 |
{ |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
570 |
ptr[ subBlockOffset + APE_COMMGR_SUBSCRIBE_SB_OFFSET_SUBBLOCKID ] = APE_COMMGR_SUBSCRIBE_SB; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
571 |
ptr[ subBlockOffset + APE_COMMGR_SUBSCRIBE_SB_OFFSET_SUBBLOCKLENGTH ] = SIZE_APE_COMMGR_SUBSCRIBE_SB; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
572 |
ptr[ subBlockOffset + APE_COMMGR_SUBSCRIBE_SB_OFFSET_DEVICEID ] = PN_DEV_HOST; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
573 |
if( a32Bit == EFalse ) |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
574 |
{ |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
575 |
ptr[ subBlockOffset + APE_COMMGR_SUBSCRIBE_SB_OFFSET_RESOURCEID ] = ( anOrder.Ptr()[ orderIndex + KEventOffset8Bit ] ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
576 |
ptr[ subBlockOffset + APE_COMMGR_SUBSCRIBE_SB_OFFSET_FILLERBYTE1 ] = KFiller; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
577 |
ptr[ subBlockOffset + APE_COMMGR_SUBSCRIBE_SB_OFFSET_FILLERBYTE2 ] = KFiller; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
578 |
ptr[ subBlockOffset + APE_COMMGR_SUBSCRIBE_SB_OFFSET_FILLERBYTE3 ] = KFiller; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
579 |
ptr[ subBlockOffset + APE_COMMGR_SUBSCRIBE_SB_OFFSET_MESSAGEID ] = ( anOrder.Ptr()[ orderIndex + K8BitResourceOffset ] ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
580 |
} |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
581 |
else |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
582 |
{ |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
583 |
ptr[ subBlockOffset + APE_COMMGR_SUBSCRIBE_SB_OFFSET_RESOURCEID ] = ( anOrder.Ptr()[ orderIndex + KEventOffset32Bit ] ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
584 |
ptr[ subBlockOffset + APE_COMMGR_SUBSCRIBE_SB_OFFSET_FILLERBYTE1 ] = ( anOrder.Ptr()[ orderIndex + K32BitResourceOffsetByte1 ] ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
585 |
ptr[ subBlockOffset + APE_COMMGR_SUBSCRIBE_SB_OFFSET_FILLERBYTE2 ] = ( anOrder.Ptr()[ orderIndex + K32BitResourceOffsetByte2 ] ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
586 |
ptr[ subBlockOffset + APE_COMMGR_SUBSCRIBE_SB_OFFSET_FILLERBYTE3 ] = ( anOrder.Ptr()[ orderIndex + K32BitResourceOffsetByte3 ]) ; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
587 |
ptr[ subBlockOffset + APE_COMMGR_SUBSCRIBE_SB_OFFSET_MESSAGEID ] = ( anOrder.Ptr()[ orderIndex + K32BitResourceOffsetByte4 ] ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
588 |
} |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
589 |
orderIndex = ( a32Bit == EFalse ) ? orderIndex + K8BitResourceId : orderIndex + K32BitResourceId; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
590 |
} |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
591 |
iCommunicationManager->Receive( desPtr ); |
0 | 592 |
} |
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
593 |
TRACE_ASSERT_INFO( msgOk == KErrNone, (TUint8)aCh<<KChannelNumberShift ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
594 |
C_TRACE( ( _T( "DRouter::OrderIndication order:0x%x channel:0x%x 32bit:%d msgok:%d <-" ), &anOrder, aCh, a32Bit, msgOk ) ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
595 |
OstTrace1( TRACE_NORMAL, DROUTER_ORDERINDICATION, "<DRouter::OrderIndication;msgOk=%x", msgOk ); |
0 | 596 |
return msgOk; |
597 |
} |
|
598 |
||
599 |
EXPORT_C TInt DRouter::SendMessage( |
|
600 |
TDes8& aMessage, |
|
601 |
const TUint16 aCh |
|
602 |
) |
|
603 |
{ |
|
604 |
||
605 |
OstTraceExt2( TRACE_NORMAL, DROUTER_SENDMESSAGE_ENTRY, "<DRouter::SendMessage;aMessage=%x;aCh=%hx", ( TUint )&( aMessage ), aCh ); |
|
606 |
OstTraceExt1( TRACE_NORMAL, DUP4_DROUTER_SENDMESSAGE, "DRouter::SendMessage;aCh=%hx", aCh ); |
|
607 |
C_TRACE( ( _T( "DRouter::SendMessage 0x%x 0x%x ->" ), &aMessage, aCh ) ); |
|
608 |
ASSERT_RESET_ALWAYS( iMaxFrameSize != 0x0000, EIADCmtConnectionNotInit ); |
|
609 |
TInt error( ValiDateIsiMessage( aMessage ) ); |
|
610 |
error = ( KErrNone == error && iConnectionStatus != EIADConnectionOk ) ? KErrNotReady : error; |
|
611 |
if( KErrNone == error ) |
|
612 |
{ |
|
613 |
ASSERT_RESET_ALWAYS( aCh != KNotInitializedChannel, EIADWrongParameter | EIADFaultIdentifier12 << KFaultIdentifierShift ); |
|
614 |
C_TRACE( ( _T( "DRouter::SendMessage sending 0x%x" ), &aMessage ) ); |
|
615 |
OstTraceExt2( TRACE_NORMAL, DROUTER_SENDMESSAGE, "DRouter::SendMessage;error=%d;aCh=%hx", error, aCh ); |
|
616 |
||
617 |
SetSenderInfo( aMessage, aCh ); |
|
618 |
const TUint8* msgBlockPtr( aMessage.Ptr() ); |
|
619 |
// TODO: Simplify this |
|
620 |
ASSERT_RESET_ALWAYS( aMessage.Length() > ISI_HEADER_OFFSET_RESOURCEID, EIADOverTheLimits | EIADFaultIdentifier2 << KFaultIdentifierShift ); |
|
621 |
if( msgBlockPtr[ ISI_HEADER_OFFSET_RESOURCEID ] == PN_PIPE && msgBlockPtr[ ISI_HEADER_OFFSET_SENDERDEVICE ] == THIS_DEVICE ) |
|
622 |
{ |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
623 |
#ifdef NCP_COMMON_BRIDGE_FAMILY_PIPE_SUPPORT |
0 | 624 |
// This shall send the message and deallocate it too. |
625 |
error = iPipeHandler->SendPipeMessage( aMessage, aCh ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
626 |
#else |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
627 |
error = KErrNotSupported; |
0 | 628 |
#endif |
629 |
if( error != KErrNone ) |
|
630 |
{ |
|
631 |
// Deallocate the block. |
|
632 |
this->DeAllocateBlock( aMessage ); |
|
633 |
} |
|
634 |
} |
|
635 |
else |
|
636 |
{ |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
637 |
// To communicationmanager |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
638 |
if( ( msgBlockPtr[ ISI_HEADER_OFFSET_RECEIVEROBJECT ] == PN_OBJ_EVENT_MULTICAST ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
639 |
&& ( msgBlockPtr[ ISI_HEADER_OFFSET_RECEIVERDEVICE ] == PN_DEV_OWN ) ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
640 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
641 |
C_TRACE( ( _T( "DRouter::SendMessage sending to COMMUNICATIONMANAGER>" ) ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
642 |
iCommunicationManager->Receive( aMessage ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
643 |
C_TRACE( ( _T( "DRouter::SendMessage sending to COMMUNICATIONMANAGER<" ) ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
644 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
645 |
else if( ( msgBlockPtr[ ISI_HEADER_OFFSET_RECEIVEROBJECT ] == PN_OBJ_ROUTING_REQ ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
646 |
&& ( msgBlockPtr[ ISI_HEADER_OFFSET_RECEIVERDEVICE ] == PN_DEV_OWN ) ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
647 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
648 |
C_TRACE( ( _T( "DRouter::SendMessage sending to NAMESERVICE>" ) ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
649 |
iNameService->Receive( aMessage ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
650 |
C_TRACE( ( _T( "DRouter::SendMessage sending to NAMESERVICE<" ) ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
651 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
652 |
else // Normal way |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
653 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
654 |
// The IST shall deallocate the block when it's approriate to do. |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
655 |
C_TRACE( ( _T( "DRouter::SendMessage sending 0x%x" ), &aMessage ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
656 |
OstTrace1( TRACE_NORMAL, DUP3_DROUTER_SENDMESSAGE, "DRouter::SendMessage;aMessage=%x", (TUint)&(aMessage )); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
657 |
error = SendMsg( aMessage ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
658 |
} |
0 | 659 |
}//PIPE |
660 |
} |
|
661 |
else |
|
662 |
{ |
|
663 |
C_TRACE( ( _T( "DRouter::SendMessage not sending due error 0x%x %d %d" ), &aMessage, aCh, error ) ); |
|
664 |
OstTraceExt2( TRACE_NORMAL, DUP1_DROUTER_SENDMESSAGE, "DRouter::SendMessage;aCh=%hx;error=%d", aCh, error ); |
|
665 |
// Deallocate the block. |
|
666 |
TRACE_ASSERT_INFO( 0, (TUint8)aCh<<KChannelNumberShift | (TUint8)error ); |
|
667 |
this->DeAllocateBlock( aMessage ); |
|
668 |
// TODO: who should NULL the block? IST or IAD |
|
669 |
} |
|
670 |
C_TRACE( ( _T( "DRouter::SendMessage 0x%x %d %d <-" ), &aMessage, aCh, error ) ); |
|
671 |
OstTraceExt2( TRACE_NORMAL, DROUTER_SENDMESSAGE_EXIT, "<DRouter::SendMessage;aCh=%hx;error=%d", aCh, error ); |
|
672 |
return error; |
|
673 |
||
674 |
} |
|
675 |
||
676 |
EXPORT_C TInt DRouter::SendIndication( |
|
677 |
TDes8& aMessage, |
|
678 |
const TUint16 aCh |
|
679 |
) |
|
680 |
{ |
|
681 |
||
682 |
OstTraceExt2( TRACE_NORMAL, DROUTER_SENDINDICATION_ENTRY, ">DRouter::SendIndication;aMessage=%x;aCh=%hx", ( TUint )&( aMessage ), aCh ); |
|
683 |
C_TRACE( ( _T( "DRouter::SendIndication 0x%x 0x%x ->" ), &aMessage, aCh ) ); |
|
684 |
TUint8* msgPtr = const_cast<TUint8*>( aMessage.Ptr() ); |
|
685 |
SET_RECEIVER_OBJ( msgPtr,PN_OBJ_EVENT_MULTICAST ); |
|
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
686 |
if( GET_RECEIVER_DEV( aMessage ) != PN_DEV_OWN ) |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
687 |
{ |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
688 |
SET_RECEIVER_DEV( msgPtr, OTHER_DEVICE_1 ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
689 |
// Copy for receivers in this device -> fake event from modem |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
690 |
TDes8& tmpIndication = MemApi::AllocBlock( aMessage.Length() ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
691 |
tmpIndication.SetLength( aMessage.Length() ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
692 |
tmpIndication.Copy( aMessage ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
693 |
TUint8* indicationPtr = const_cast<TUint8*>( tmpIndication.Ptr() ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
694 |
SET_SENDER_DEV( indicationPtr, PN_DEV_HOST ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
695 |
SET_RECEIVER_DEV( indicationPtr, PN_DEV_OWN ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
696 |
indicationPtr[ ISI_HEADER_OFFSET_MEDIA ] = PN_MEDIA_SOS; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
697 |
this->MessageReceived( tmpIndication ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
698 |
} |
0 | 699 |
TInt error( SendMessage( aMessage, aCh ) ); |
700 |
C_TRACE( ( _T( "DRouter::SendIndication 0x%x 0x%x %d <-" ), &aMessage, aCh, error ) ); |
|
701 |
OstTrace1( TRACE_NORMAL, DROUTER_SENDINDICATION_EXIT, "<DRouter::SendIndication;error=%d", error ); |
|
702 |
return error; |
|
703 |
||
704 |
} |
|
705 |
||
706 |
// From end |
|
707 |
||
708 |
void DRouter::NotifyObjLayerConnStatDfc( |
|
709 |
TAny* aPtr |
|
710 |
) |
|
711 |
{ |
|
712 |
OstTrace1( TRACE_NORMAL, DROUTER_NOTIFYOBJLAYERCONNSTATDFC_ENTRY, ">DRouter::NotifyObjLayerConnStatDfc;aPtr=%x", ( TUint )( aPtr ) ); |
|
713 |
||
714 |
C_TRACE( ( _T( "DRouter::NotifyObjLayerConnStatDfc ->" ) ) ); |
|
715 |
DRouter* self = reinterpret_cast<DRouter*>( aPtr ); |
|
716 |
self->NotifyObjLayerConnStat( self->iConnectionStatus ); |
|
717 |
C_TRACE( ( _T( "DRouter::NotifyObjLayerConnStatDfc to %d <-" ), self->iConnectionStatus ) ); |
|
718 |
||
719 |
OstTrace1( TRACE_NORMAL, DROUTER_NOTIFYOBJLAYERCONNSTATDFC_EXIT, "<DRouter::NotifyObjLayerConnStatDfc;self->iConnectionStatus=%x", self->iConnectionStatus ); |
|
720 |
} |
|
721 |
||
722 |
void DRouter::NotifyObjLayerConnStat( |
|
723 |
const TIADConnectionStatus aStatus |
|
724 |
) |
|
725 |
{ |
|
726 |
OstTrace1( TRACE_NORMAL, DROUTER_NOTIFYOBJLAYERCONNSTAT_ENTRY, ">DRouter::NotifyObjLayerConnStat;aStatus=%x", ( TUint )&( aStatus ) ); |
|
727 |
||
728 |
C_TRACE( ( _T( "DRouter::NotifyObjLayerConnStat %d ->" ), aStatus ) ); |
|
729 |
ASSERT_DFCTHREAD_INEXT(); |
|
730 |
for( TUint16 i( 0 ); i < EIADSizeOfChannels; ++i ) |
|
731 |
{ |
|
732 |
if( iChannelTable[ i ].iChannel ) |
|
733 |
{ |
|
734 |
C_TRACE( ( _T( "DRouter::NotifyObjLayerConnStat ch %d ptr 0x%x" ), i, iChannelTable[ i ].iChannel ) ); |
|
735 |
OstTraceExt2( TRACE_NORMAL, DUP1_DROUTER_NOTIFYOBJLAYERCONNSTAT, "DRouter::NotifyObjLayerConnStat;i=%hx;iChannelTable[ i ].iChannel=%x", i,( TUint ) ( iChannelTable[ i ].iChannel ) ); |
|
736 |
iChannelTable[ i ].iChannel->NotifyConnectionStatus( aStatus ); |
|
737 |
} |
|
738 |
// TODO: If we need open to be waiting until connection status is ok, set waiting here. |
|
739 |
} |
|
740 |
C_TRACE( ( _T( "DRouter::NotifyObjLayerConnStat %d <-" ), aStatus ) ); |
|
741 |
OstTrace0( TRACE_NORMAL, DROUTER_NOTIFYOBJLAYERCONNSTAT_EXIT, "<DRouter::NotifyObjLayerConnStat" ); |
|
742 |
} |
|
743 |
||
744 |
// Used internally in IAD. |
|
745 |
// Can be called in 1..N thread contextes and returns immediately. |
|
746 |
void DRouter::MessageReceived( |
|
747 |
TDes8& aMsg |
|
748 |
) |
|
749 |
{ |
|
750 |
||
751 |
OstTrace1( TRACE_NORMAL, DROUTER_MESSAGERECEIVED_ENTRY, ">DRouter::MessageReceived;aMsg=%x", ( TUint )&( aMsg ) ); |
|
752 |
C_TRACE( ( _T( "DRouter::MessageReceived 0x%x ->" ), &aMsg ) ); |
|
753 |
// Let MaxLength to be the length of the allocated block. (IST (SSI&SISA) can work differently. |
|
754 |
// SISA set length and maxlength according to ISI msg length, but SSI set length according to block length |
|
755 |
// Block length in SSI at the moment always %4. |
|
756 |
// Set the length of the descriptor to ISI message length + PN_HEADER_SIZE |
|
757 |
// TODO : harmonize these IST differencies. |
|
758 |
TInt len( GET_LENGTH( aMsg ) ); |
|
759 |
len += PN_HEADER_SIZE; |
|
760 |
aMsg.SetLength( len ); |
|
761 |
iCommonRxQueue->Add( aMsg ); |
|
762 |
iCommonRxDfc->Enque(); |
|
763 |
C_TRACE( ( _T( "DRouter::MessageReceived 0x%x <-" ), &aMsg ) ); |
|
764 |
OstTrace0( TRACE_NORMAL, DROUTER_MESSAGERECEIVED_EXIT, "<DRouter::MessageReceived" ); |
|
765 |
||
766 |
} |
|
767 |
||
768 |
//PRIVATES |
|
769 |
||
770 |
void DRouter::HandleIsiMessage( |
|
771 |
TDes8& aMsg |
|
772 |
) |
|
773 |
{ |
|
774 |
OstTrace1( TRACE_NORMAL, DROUTER_HANDLEISIMESSAGE_ENTRY, ">DRouter::HandleIsiMessage;aMsg=%x", ( TUint )&( aMsg ) ); |
|
775 |
||
776 |
C_TRACE( ( _T( "DRouter::HandleIsiMessage 0x%x ->" ), &aMsg ) ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
777 |
TUint8* msg = const_cast<TUint8*>( aMsg.Ptr() ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
778 |
// Message from MODEM to APE, or from APE to APE. If Media SOS -> come through link. If dev OWN -> from APE nameservice |
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
779 |
if( ( msg[ ISI_HEADER_OFFSET_MEDIA ] == PN_MEDIA_SOS ) || ( msg[ ISI_HEADER_OFFSET_RECEIVERDEVICE ] == PN_DEV_OWN ) ) |
0 | 780 |
{ |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
781 |
const TUint16 rcvObjId( GET_RECEIVER_OBJ( aMsg ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
782 |
C_TRACE( ( _T( "DRouter::HandleIsiMessage rcvObjId 0x%x" ), rcvObjId ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
783 |
ASSERT_RESET_ALWAYS( rcvObjId < EIADSizeOfChannels, EIADWrongParameter | (TUint8)rcvObjId << KChannelNumberShift | EIADFaultIdentifier22 << KFaultIdentifierShift ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
784 |
if( rcvObjId == PN_OBJ_ROUTER ) //TODO to channel table |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
785 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
786 |
C_TRACE( ( _T( "DRouter::HandleIsiMessage to NAMESERVICE>" ) ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
787 |
iNameService->Receive( aMsg ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
788 |
C_TRACE( ( _T( "DRouter::HandleIsiMessage to NAMESERVICE<" ) ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
789 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
790 |
else if( rcvObjId == PN_OBJ_EVENT_MULTICAST ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
791 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
792 |
C_TRACE( ( _T( "DRouter::HandleIsiMessage to COMMUNICATIONMANAGER>" ) ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
793 |
iCommunicationManager->Receive( aMsg ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
794 |
C_TRACE( ( _T( "DRouter::HandleIsiMessage to COMMUNICATIONMANAGER<" ) ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
795 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
796 |
else |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
797 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
798 |
if( iChannelTable[ rcvObjId ].iChannel ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
799 |
{ |
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
800 |
if( msg[ ISI_HEADER_OFFSET_RESOURCEID ] == PN_APE_COMMGR ) |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
801 |
{ |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
802 |
C_TRACE( ( _T( "DRouter::HandleIsiMessage to channel from COMMUNICATIONMANAGER deallocate" ) ) ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
803 |
DeAllocateBlock( aMsg ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
804 |
} |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
805 |
else |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
806 |
{ |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
807 |
iChannelTable[ rcvObjId ].iChannel->ReceiveMsg( aMsg ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
808 |
// DeAllocation done by the channel after writing to client's address space. |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
809 |
} |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
810 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
811 |
else |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
812 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
813 |
SendCommIsaEntityNotReachableResp( aMsg ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
814 |
// Not going to anywhere deallocate. |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
815 |
DeAllocateBlock( aMsg ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
816 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
817 |
} |
0 | 818 |
} |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
819 |
else // PN_MEDIA_ROUTING_REQ, receivedevice != own, from nameservice, send to modem |
0 | 820 |
{ |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
821 |
C_TRACE( ( _T( "DRouter::CheckRouting going to MODEM" ) ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
822 |
msg[ ISI_HEADER_OFFSET_MEDIA ] = PN_MEDIA_SOS; // link should set this |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
823 |
TInt sendError = SendMsg( aMsg ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
824 |
C_TRACE( ( _T( "DRouter::CheckRouting sendError %d" ), sendError ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
825 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
826 |
|
0 | 827 |
C_TRACE( ( _T( "DRouter::HandleIsiMessage 0x%x <-" ), &aMsg ) ); |
828 |
||
829 |
OstTrace0( TRACE_NORMAL, DROUTER_HANDLEISIMESSAGE_EXIT, "<DRouter::HandleIsiMessage" ); |
|
830 |
} |
|
831 |
||
832 |
||
833 |
void DRouter::HandlePipeMessage( |
|
834 |
TDes8& aMsg |
|
835 |
) |
|
836 |
{ |
|
837 |
OstTrace1( TRACE_NORMAL, DROUTER_HANDLEPIPEMESSAGE_ENTRY, ">DRouter::HandlePipeMessage;aMsg=%x", ( TUint )&( aMsg ) ); |
|
838 |
||
839 |
C_TRACE( ( _T( "DRouter::HandlePipeMessage 0x%x ->" ), &aMsg ) ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
840 |
#ifdef NCP_COMMON_BRIDGE_FAMILY_PIPE_SUPPORT |
0 | 841 |
const TUint16 rcvObjId( GET_RECEIVER_OBJ( aMsg ) ); |
842 |
C_TRACE( ( _T( "DRouter::HandlePipeMessage rcvObjId 0x%x" ), rcvObjId ) ); |
|
843 |
ASSERT_RESET_ALWAYS( rcvObjId < EIADSizeOfChannels, EIADWrongParameter | (TUint8)rcvObjId << KChannelNumberShift| EIADFaultIdentifier25 << KFaultIdentifierShift ); |
|
844 |
MIAD2ChannelApi* openChannel = iChannelTable[ rcvObjId ].iChannel; |
|
845 |
if( openChannel ) |
|
846 |
{ |
|
847 |
// TODO: is it ok to give channel from here? |
|
848 |
iPipeHandler->ReceivePipeMessage( aMsg, openChannel ); |
|
849 |
// DeAllocation done by the pipehandler or someone who it frwd's the message. |
|
850 |
} |
|
851 |
else |
|
852 |
{ |
|
853 |
// COMM_ISA_ENTITY_NOT_REACHABLE_RESP NOT SEND TO PIPE MESSAGES |
|
854 |
TRACE_ASSERT_INFO( 0, (TUint8)rcvObjId<<KChannelNumberShift ); |
|
855 |
// Not going to anywhere deallocate. |
|
856 |
for( TInt i( 0 ); i < aMsg.Length(); i++ ) |
|
857 |
{ |
|
858 |
Kern::Printf( "%d 0x%x", i, aMsg.Ptr()[ i ] ); |
|
859 |
} |
|
860 |
DeAllocateBlock( aMsg ); |
|
861 |
} |
|
862 |
#endif |
|
863 |
C_TRACE( ( _T( "DRouter::HandlePipeMessage 0x%x <-" ), &aMsg ) ); |
|
864 |
||
865 |
OstTrace0( TRACE_NORMAL, DROUTER_HANDLEPIPEMESSAGE_EXIT, "<DRouter::HandlePipeMessage" ); |
|
866 |
} |
|
867 |
||
868 |
void DRouter::HandleMediaMessage( |
|
869 |
TDes8& aMsg |
|
870 |
) |
|
871 |
{ |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
872 |
|
0 | 873 |
OstTrace1( TRACE_NORMAL, DROUTER_HANDLEMEDIAMESSAGE_ENTRY, ">DRouter::HandleMediaMessage;aMsg=%x", ( TUint )&( aMsg ) ); |
874 |
C_TRACE( ( _T( "DRouter::HandleMediaMessage 0x%x ->" ), &aMsg ) ); |
|
875 |
TUint8 rcvObjId( 0x00); |
|
876 |
ASSERT_RESET_ALWAYS( aMsg.Length() > ISI_HEADER_OFFSET_MEDIA, EIADOverTheLimits | EIADFaultIdentifier3 << KFaultIdentifierShift ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
877 |
rcvObjId = GET_RECEIVER_OBJ( aMsg ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
878 |
ASSERT_RESET_ALWAYS( 0, EIADUnkownMedia | ( rcvObjId << KChannelNumberShift ) ); |
0 | 879 |
// TODO: UNIQUE |
880 |
ASSERT_RESET_ALWAYS( rcvObjId < EIADSizeOfChannels, EIADWrongParameter | (TUint8)rcvObjId << KChannelNumberShift | EIADFaultIdentifier3 << KFaultIdentifierShift ); |
|
881 |
if( iChannelTable[ rcvObjId ].iChannel ) |
|
882 |
{ |
|
883 |
iChannelTable[ rcvObjId ].iChannel->ReceiveMsg( aMsg ); |
|
884 |
// DeAllocation done by the channel after writing to client's address space. |
|
885 |
} |
|
886 |
else |
|
887 |
{ |
|
888 |
SendCommIsaEntityNotReachableResp( aMsg ); |
|
889 |
// Not going to anywhere deallocate. |
|
890 |
DeAllocateBlock( aMsg ); |
|
891 |
} |
|
892 |
C_TRACE( ( _T( "DRouter::HandleMediaMessage 0x%x <-" ), &aMsg ) ); |
|
893 |
OstTrace0( TRACE_NORMAL, DROUTER_HANDLEMEDIAMESSAGE_EXIT, "<DRouter::HandleMediaMessage" ); |
|
894 |
||
895 |
} |
|
896 |
||
897 |
// KErrBadDescriptor, if message length too small |
|
898 |
// KErrUnderFlow, if message length too big. |
|
899 |
// KErrCouldNotConnect, if receiver object is out of scope. |
|
900 |
TInt DRouter::ValiDateIsiMessage( |
|
901 |
TDes8& aMsg |
|
902 |
) |
|
903 |
{ |
|
904 |
OstTrace1( TRACE_NORMAL, DROUTER_VALIDATEISIMESSAGE_ENTRY, ">DRouter::ValiDateIsiMessage;aMsg=%x", ( TUint )&( aMsg ) ); |
|
905 |
||
906 |
C_TRACE( ( _T( "DRouter::ValiDateIsiMessage ->" ) ) ); |
|
907 |
const TUint16 descLength( aMsg.Length() ); |
|
908 |
TInt msgOk( KErrNone ); |
|
909 |
msgOk = ( ISI_HEADER_OFFSET_MESSAGEID >= descLength ) ? KErrBadDescriptor : msgOk; |
|
910 |
TRACE_ASSERT_INFO( msgOk == KErrNone, msgOk ); |
|
911 |
// Get ISI message length after known that the descriptor is big enough. |
|
912 |
const TUint8* msgPtr( aMsg.Ptr() ); |
|
913 |
const TUint16 isiMsgLength( GET_LENGTH( msgPtr ) + PN_HEADER_SIZE ); |
|
914 |
// TODO: Do we need the underflow information or is it BadDescriptor as good? If so remove msgok == KErrNone... |
|
915 |
// If the descriptor length is less than ISI message length. |
|
916 |
msgOk = ( ( msgOk == KErrNone && isiMsgLength > descLength ) ? KErrUnderflow : msgOk ); |
|
917 |
TRACE_ASSERT_INFO( msgOk == KErrNone, msgOk ); |
|
918 |
// If the ISI message length is bigger that the largest supported. |
|
919 |
msgOk = ( ( msgOk == KErrNone && isiMsgLength > KIADMaxIsiMsgSize ) ? KErrUnderflow : msgOk ); |
|
920 |
TRACE_ASSERT_INFO( msgOk == KErrNone, msgOk ); |
|
921 |
// If the ISI message length with PN_HEADER_SIZE is less or equal than ISI_HEADER_OFFSET_MESSAGEID. |
|
922 |
msgOk = ( ( msgOk == KErrNone && isiMsgLength <= ISI_HEADER_OFFSET_MESSAGEID ) ? KErrUnderflow : msgOk ); |
|
923 |
TRACE_ASSERT_INFO( msgOk == KErrNone, msgOk ); |
|
924 |
TRACE_ASSERT_INFO( msgOk == KErrNone, msgOk ); |
|
925 |
TRACE_ASSERT_INFO( msgOk == KErrNone, isiMsgLength ); |
|
926 |
TRACE_ASSERT_INFO( msgOk == KErrNone, descLength ); |
|
927 |
||
928 |
// Check is receiver object valid if going from SOS<->SOS. |
|
929 |
msgOk = ( ( msgOk == KErrNone && ( GET_RECEIVER_DEV( msgPtr ) == THIS_DEVICE && GET_RECEIVER_OBJ( msgPtr ) > EIADSizeOfChannels ) ) ? KErrCouldNotConnect : msgOk ); |
|
930 |
TRACE_ASSERT_INFO( msgOk == KErrNone, msgOk ); |
|
931 |
// TODO: checking that receiver object is ok in SOS<->ISA cases. |
|
932 |
C_TRACE( ( _T( "DRouter::ValiDateIsiMessage <- %d" ), msgOk ) ); |
|
933 |
||
934 |
||
935 |
OstTrace1( TRACE_NORMAL, DROUTER_VALIDATEISIMESSAGE_EXIT, "<DRouter::ValiDateIsiMessage;msgOk=%x", msgOk ); |
|
936 |
return msgOk; |
|
937 |
} |
|
938 |
||
939 |
void DRouter::CheckRouting( |
|
940 |
DRouter& aTmp, |
|
941 |
TDes8& aMsg |
|
942 |
) |
|
943 |
{ |
|
944 |
||
945 |
ASSERT_DFCTHREAD_INEXT(); |
|
946 |
const TUint8* msg( aMsg.Ptr() ); |
|
947 |
OstTrace1( TRACE_NORMAL, DROUTER_CHECKROUTING_ENTRY, ">DRouter::CheckRouting;aMsg=%x", ( TUint )( msg ) ); |
|
948 |
C_TRACE( ( _T( "DRouter::CheckRouting 0x%x 0x%x ->" ), msg, msg[ ISI_HEADER_OFFSET_RESOURCEID ] ) ); |
|
949 |
TRoutingRule route( ENotKnownMsg ); |
|
950 |
// Message to symbian side (media sos). |
|
951 |
if( msg[ ISI_HEADER_OFFSET_MEDIA ] == PN_MEDIA_SOS ) |
|
952 |
{ |
|
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
953 |
if( ( msg[ ISI_HEADER_OFFSET_RECEIVERDEVICE ] == THIS_DEVICE ) || ( msg[ ISI_HEADER_OFFSET_RECEIVERDEVICE ] == PN_DEV_OWN ) ) |
0 | 954 |
{ |
955 |
switch( msg[ ISI_HEADER_OFFSET_RECEIVEROBJECT ] ) |
|
956 |
{ |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
957 |
// Indication NOTE! INDICATION HANDLING IS STILL LEGACY |
0 | 958 |
case KIADEventSubscriptionObjId: |
959 |
{ |
|
960 |
ASSERT_RESET_ALWAYS( msg[ ISI_HEADER_OFFSET_RESOURCEID ] != PN_PIPE, EIADWrongParameter | msg[ ISI_HEADER_OFFSET_RESOURCEID ] ); |
|
961 |
route = EIndicationMsg; |
|
962 |
break; |
|
963 |
} |
|
964 |
// Any other message. |
|
965 |
default: |
|
966 |
{ |
|
967 |
// Indication message. Receiver object equals to event subscription obj id (0xfc). |
|
968 |
route = ( msg[ ISI_HEADER_OFFSET_RESOURCEID ] == PN_PIPE ) ? EPipeMsg : EIsiMsg; |
|
969 |
break; |
|
970 |
} |
|
971 |
} |
|
972 |
} |
|
973 |
else if ( msg[ ISI_HEADER_OFFSET_RECEIVERDEVICE ] == PN_DEV_GLOBAL )// TODO: This (PN_DEV_GLOBAL) should be removed from Bridge when modem SW MCE Server is ok |
|
974 |
{ |
|
975 |
#ifdef MODEM_MCE_DOES_NOT_WORK_AS_IT_SHOULD // TODO: To be removed depends on modem sw version MCE server |
|
976 |
if ( aTmp.iBootDone ) |
|
977 |
{ |
|
978 |
#endif // MODEM_MCE_DOES_NOT_WORK_AS_IT_SHOULD |
|
979 |
C_TRACE( ( _T( "DRouter::CheckRouting message to PN_DEV_GLOBAL -> EIndicationMsg" ) ) ); |
|
980 |
OstTrace0( TRACE_NORMAL, DROUTER_CHECKROUTING_PN_DEV_GLOBAL, "DRouter::CheckRouting PN_DEV_GLOBAL -> EIndicationMsg"); |
|
981 |
TUint8* ptr = const_cast<TUint8*>( msg ); |
|
982 |
SET_RECEIVER_DEV( ptr, THIS_DEVICE ); |
|
983 |
route = EIndicationMsg; |
|
984 |
} |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
985 |
else if ( msg[ ISI_HEADER_OFFSET_RECEIVERDEVICE ] == PN_DEV_PC )// TODO: This (PN_DEV_GLOBAL) should be removed from Bridge when modem SW MCE Server is ok |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
986 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
987 |
C_TRACE( ( _T( "DRouter::CheckRouting message to PN_DEV_PC ") ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
988 |
route=EUsbPhonetMsg; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
989 |
} |
0 | 990 |
#ifdef MODEM_MCE_DOES_NOT_WORK_AS_IT_SHOULD |
991 |
#include <mceisi.h> |
|
992 |
else |
|
993 |
{ |
|
994 |
Kern::Printf("0x%x 0x%x", msg[ ISI_HEADER_SIZE + MCE_MODEM_STATE_IND_OFFSET_MESSAGEID ], msg[ ISI_HEADER_SIZE + MCE_MODEM_STATE_IND_OFFSET_ACTION ] ); |
|
995 |
if ( ( msg[ ISI_HEADER_SIZE + MCE_MODEM_STATE_IND_OFFSET_MESSAGEID ] == MCE_MODEM_STATE_IND ) && |
|
996 |
( msg[ ISI_HEADER_SIZE + MCE_MODEM_STATE_IND_OFFSET_ACTION ] == MCE_READY ) ) |
|
997 |
{ |
|
998 |
//15:08:55.563 xti: MASTER_ASCII_PRINTF; string:M_HSI: TX common: 26ff60c2 06000014 00000004 ffffffff |
|
999 |
Kern::Printf("Connection OK"); |
|
1000 |
aTmp.InitConnectionOk(); |
|
1001 |
} |
|
1002 |
else |
|
1003 |
{ |
|
1004 |
// just ignore and wait for MCE_READY_IND DEALLOC???? |
|
1005 |
Kern::Printf("Connection NOK"); |
|
1006 |
} |
|
1007 |
} |
|
1008 |
} |
|
1009 |
#endif // MODEM_MCE_DOES_NOT_WORK_AS_IT_SHOULD |
|
1010 |
else |
|
1011 |
{ |
|
1012 |
C_TRACE( ( _T( "DRouter::CheckRouting Unknown message" ) ) ); |
|
1013 |
TRACE_ASSERT_ALWAYS; |
|
1014 |
Kern::Printf("Unknown message 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x", msg[ 0 ], msg[ 1 ], msg[ 2 ], msg[ 3 ], msg[ 4 ], msg[ 5 ], msg[ 6 ], msg[ 7 ], msg[ 8 ], msg[ 9 ] ); |
|
1015 |
} |
|
1016 |
} |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1017 |
// APE to APE routing |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1018 |
else if( ( msg[ ISI_HEADER_OFFSET_RECEIVERDEVICE ] == PN_DEV_OWN ) && ( msg[ ISI_HEADER_OFFSET_SENDERDEVICE ] == PN_DEV_OWN ) ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1019 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1020 |
C_TRACE( ( _T( "DRouter::CheckRouting APE to APE routing" ) ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1021 |
route = EIsiMsg; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1022 |
} |
0 | 1023 |
// Message to other media than sos in symbian side. |
1024 |
else |
|
1025 |
{ |
|
1026 |
route = EMediaMsg; |
|
1027 |
} |
|
1028 |
C_TRACE( ( _T( "DRouter::CheckRouting msg 0x%x route %d" ), msg, route ) ); |
|
1029 |
OstTraceExt2( TRACE_NORMAL, DROUTER_CHECKROUTING_ROUTE, "DRouter::CheckRouting;aMsg=0x%x;route=%d", ( TUint )msg, route ); |
|
1030 |
switch( route ) |
|
1031 |
{ |
|
1032 |
case EIsiMsg: |
|
1033 |
{ |
|
1034 |
aTmp.HandleIsiMessage( aMsg ); |
|
1035 |
break; |
|
1036 |
} |
|
1037 |
case EPipeMsg: |
|
1038 |
{ |
|
1039 |
aTmp.HandlePipeMessage( aMsg ); |
|
1040 |
break; |
|
1041 |
} |
|
1042 |
case EMediaMsg: |
|
1043 |
{ |
|
1044 |
aTmp.HandleMediaMessage( aMsg ); |
|
1045 |
break; |
|
1046 |
} |
|
1047 |
case EIndicationMsg: |
|
1048 |
{ |
|
1049 |
// De-allocate, message is multicasted to subsribers as new |
|
1050 |
// message and the original is ready to be deallocated. |
|
1051 |
aTmp.DeAllocateBlock( aMsg ); |
|
1052 |
break; |
|
1053 |
} |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1054 |
case EUsbPhonetMsg: |
0 | 1055 |
{ |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1056 |
aTmp.iChannelTable[ EIscNokiaUsbPhonetLink ].iChannel->ReceiveMsg( aMsg ); |
0 | 1057 |
break; |
1058 |
} |
|
1059 |
case ENotKnownMsg: |
|
1060 |
{ |
|
1061 |
// Not going to anywhere deallocate. |
|
1062 |
aTmp.DeAllocateBlock( aMsg ); |
|
1063 |
break; |
|
1064 |
} |
|
1065 |
default: |
|
1066 |
{ |
|
1067 |
ASSERT_RESET_ALWAYS( 0, EIADWrongParameter | EIADFaultIdentifier16 << KFaultIdentifierShift ); |
|
1068 |
break; |
|
1069 |
} |
|
1070 |
} |
|
1071 |
C_TRACE( ( _T( "DRouter::CheckRouting 0x%x<-" ), msg ) ); |
|
1072 |
OstTrace1( TRACE_NORMAL, DROUTER_CHECKROUTING_EXIT, "<DRouter::CheckRouting;msg=0x%x", (TUint)msg ); |
|
1073 |
||
1074 |
} |
|
1075 |
||
1076 |
void DRouter::CommonRxDfc( |
|
1077 |
TAny* aPtr // Pointer to this object. |
|
1078 |
) |
|
1079 |
{ |
|
1080 |
||
1081 |
OstTrace1( TRACE_NORMAL, DROUTER_COMMONRXDFC_ENTRY, ">DRouter::CommonRxDfc;aPtr=%x", ( TUint )( aPtr ) ); |
|
1082 |
C_TRACE( ( _T( "DRouter::CommonRxDfc ->" ) ) ); |
|
1083 |
DRouter& tmp = *reinterpret_cast<DRouter*>( aPtr ); |
|
1084 |
ASSERT_DFCTHREAD_INEXT(); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1085 |
|
0 | 1086 |
if( tmp.iCommonRxQueue->Count() > KErrNone ) |
1087 |
{ |
|
1088 |
TDes8& msg( tmp.iCommonRxQueue->Get() ); |
|
1089 |
DATA_DUMP_TRACE( msg, EFalse );// TODO: this causes problems in legacy flowcontrol causing main rx to overflow!! |
|
1090 |
OstTraceData( TRACE_ISIMSG, DROUTER_COMMONRXDFC_DATA, "DRouter::CommonRxDfc RX: 0x%hx", msg.Ptr(), msg.Length() ); |
|
1091 |
CheckRouting( tmp, msg ); |
|
1092 |
// Check here too to avoid unnecessary dfc queuing. |
|
1093 |
if( tmp.iCommonRxQueue->Count() > KErrNone ) |
|
1094 |
{ |
|
1095 |
C_TRACE( ( _T( "DRouter::CommonRxDfc enque commonrxdfc" ) ) ); |
|
1096 |
tmp.iCommonRxDfc->Enque(); |
|
1097 |
} |
|
1098 |
} |
|
1099 |
C_TRACE( ( _T( "DRouter::CommonRxDfc <-" ) ) ); |
|
1100 |
OstTrace0( TRACE_NORMAL, DROUTER_COMMONRXDFC_EXIT, "<DRouter::CommonRxDfc" ); |
|
1101 |
||
1102 |
} |
|
1103 |
||
1104 |
void DRouter::SendCommIsaEntityNotReachableResp( |
|
1105 |
const TDesC8& aMsg |
|
1106 |
) |
|
1107 |
{ |
|
1108 |
OstTrace1( TRACE_NORMAL, DROUTER_SENDCOMMISAENTITYNOTREACHABLERESP_ENTRY, ">DRouter::SendCommIsaEntityNotReachableResp;aMsg=%x", ( TUint )&( aMsg ) ); |
|
1109 |
||
1110 |
C_TRACE( ( _T( "DRouter::SendCommIsaEntityNotReachableResp 0x%x ->" ), &aMsg ) ); |
|
1111 |
// Make channel opening request followinfg COMM specification: 000.026 |
|
1112 |
// Length is sixteen bytes. |
|
1113 |
TUint8 length( 16 ); |
|
1114 |
TDes8& tempPtr = AllocateBlock( ISI_HEADER_SIZE + SIZE_COMMON_MESSAGE_COMM_ISA_ENTITY_NOT_REACHABLE_RESP ); |
|
1115 |
ASSERT_RESET_ALWAYS( &tempPtr, EIADMemoryAllocationFailure | EIADFaultIdentifier19 << KFaultIdentifierShift ); |
|
1116 |
ASSERT_RESET_ALWAYS( ISI_HEADER_SIZE + SIZE_COMMON_MESSAGE_COMM_ISA_ENTITY_NOT_REACHABLE_RESP > ISI_HEADER_OFFSET_MESSAGEID, EIADOverTheLimits | EIADFaultIdentifier5 << KFaultIdentifierShift ); |
|
1117 |
TUint8* ptr = const_cast<TUint8*>( tempPtr.Ptr() ); |
|
1118 |
// We start to append from transaction id. |
|
1119 |
tempPtr.SetLength( ISI_HEADER_OFFSET_TRANSID ); |
|
1120 |
// Get the header until messageid from prev. message. |
|
1121 |
// Just turn receiver and sender device and object vice versa. |
|
1122 |
const TUint8* msgTmpPtr( aMsg.Ptr() ); |
|
1123 |
ptr[ ISI_HEADER_OFFSET_MEDIA ] = msgTmpPtr[ ISI_HEADER_OFFSET_MEDIA ]; |
|
1124 |
SET_RECEIVER_DEV( ptr, GET_SENDER_DEV( aMsg ) ); |
|
1125 |
SET_SENDER_DEV ( ptr, GET_RECEIVER_DEV( aMsg ) ); |
|
1126 |
ptr[ ISI_HEADER_OFFSET_RESOURCEID ] = msgTmpPtr[ ISI_HEADER_OFFSET_RESOURCEID ]; |
|
1127 |
SET_LENGTH( ptr, length - PN_HEADER_SIZE ); |
|
1128 |
SET_RECEIVER_OBJ( ptr, GET_SENDER_OBJ( aMsg ) ); |
|
1129 |
SET_SENDER_OBJ( ptr, GET_RECEIVER_OBJ( aMsg ) ); |
|
1130 |
// Transactionid. Set to 0x01 since this is the first. |
|
1131 |
tempPtr.Append( msgTmpPtr[ ISI_HEADER_OFFSET_TRANSID ] ); |
|
1132 |
// Message ID |
|
1133 |
tempPtr.Append( 0xF0 ); |
|
1134 |
// Sub message ID. |
|
1135 |
tempPtr.Append( 0x14 ); |
|
1136 |
// Not Delivered Message from original req. |
|
1137 |
tempPtr.Append( msgTmpPtr[ ISI_HEADER_OFFSET_MESSAGEID ] ); |
|
1138 |
// Status - COMM_ISA_ENTITY_NOT_AVAILABLE |
|
1139 |
tempPtr.Append( 0x00 ); |
|
1140 |
// Filler |
|
1141 |
tempPtr.Append( 0x00 ); |
|
1142 |
// Filler |
|
1143 |
tempPtr.Append( 0x00 ); |
|
1144 |
// Filler |
|
1145 |
tempPtr.Append( 0x00 ); |
|
1146 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1147 |
if( msgTmpPtr[ ISI_HEADER_OFFSET_RECEIVERDEVICE ] == PN_DEV_OWN ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1148 |
{ |
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1149 |
MessageReceived( tempPtr ); |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1150 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1151 |
else |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1152 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1153 |
SendMsg( tempPtr ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1154 |
} |
0 | 1155 |
C_TRACE( ( _T( "DRouter::SendCommIsaEntityNotReachableResp 0x%x <-" ), &aMsg ) ); |
1156 |
OstTrace0( TRACE_NORMAL, DROUTER_SENDCOMMISAENTITYNOTREACHABLERESP_EXIT, "<DRouter::SendCommIsaEntityNotReachableResp" ); |
|
1157 |
} |
|
1158 |
||
1159 |
void DRouter::InitCmtDfc( |
|
1160 |
TAny* aPtr |
|
1161 |
) |
|
1162 |
{ |
|
1163 |
OstTrace1( TRACE_NORMAL, DROUTER_INITCMTDFC_ENTRY, ">DRouter::InitCmtDfc;aPtr=%x", ( TUint )( aPtr ) ); |
|
1164 |
||
1165 |
C_TRACE( ( _T( "DRouter::InitCmtDfc ->" ) ) ); |
|
1166 |
DRouter& tmp = *reinterpret_cast<DRouter*>( aPtr ); |
|
1167 |
if( !tmp.iBootDone ) |
|
1168 |
{ |
|
1169 |
#ifndef MODEM_MCE_DOES_NOT_WORK_AS_IT_SHOULD |
|
1170 |
tmp.InitConnectionOk(); |
|
1171 |
#endif // MODEM_MCE_DOES_NOT_WORK_AS_IT_SHOULD |
|
1172 |
} |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1173 |
C_TRACE( ( _T( "DRouter::InitCmtDfc <-" ) ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1174 |
OstTrace0( TRACE_NORMAL, DROUTER_INITCMTDFC_EXIT, "<DRouter::InitCmtDfc" ); |
0 | 1175 |
|
1176 |
} |
|
1177 |
||
1178 |
void DRouter::InitConnectionOk() |
|
1179 |
{ |
|
1180 |
||
1181 |
C_TRACE( ( _T( "DRouter::InitConnectionOk ->" ) ) ); |
|
1182 |
iMaxFrameSize = KIADMaxIsiMsgSize; |
|
1183 |
iConnectionStatus = EIADConnectionOk; |
|
1184 |
iBootDone = ETrue; |
|
1185 |
NotifyObjLayerConnStat( EIADConnectionOk ); |
|
1186 |
// Initialize channels to NULL when channel is opened !NULL. |
|
1187 |
for( TInt i( 0 ); i < EIADSizeOfChannels; ++i ) |
|
1188 |
{ |
|
1189 |
ASSERT_RESET_ALWAYS( !iChannelTable[ i ].iChannel, EIADChannelOpenedBeforePhysicalLayerInit ); |
|
1190 |
C_TRACE( ( _T( "DRouter::InitConnectionOk %d" ), i ) ); |
|
1191 |
if( iChannelTable[ i ].iWaitingChannel ) |
|
1192 |
{ |
|
1193 |
switch( iChannelTable[ i ].iType ) |
|
1194 |
{ |
|
1195 |
case ENormalOpen: |
|
1196 |
{ |
|
1197 |
C_TRACE( ( _T( "DRouter::InitConnectionOk booting ENormalOpen 0x%x" ), i ) ); |
|
1198 |
MIAD2ChannelApi* tmpChannel = iChannelTable[ i ].iWaitingChannel; |
|
1199 |
iChannelTable[ i ].iChannel = tmpChannel; |
|
1200 |
iChannelTable[ i ].iWaitingChannel = NULL; |
|
1201 |
iChannelTable[ i ].iChannel->CompleteChannelRequest( EIADAsyncOpen, KErrNone ); |
|
1202 |
break; |
|
1203 |
} |
|
1204 |
default: |
|
1205 |
{ |
|
1206 |
ASSERT_RESET_ALWAYS( 0, -1111 ); |
|
1207 |
break; |
|
1208 |
} |
|
1209 |
} |
|
1210 |
} |
|
1211 |
} |
|
1212 |
C_TRACE( ( _T( "DRouter::InitConnectionOk <-" ) ) ); |
|
1213 |
} |
|
1214 |
||
1215 |
// router and handler (pipe and indication) |
|
1216 |
TInt DRouter::SendMsg( |
|
1217 |
TDes8& aMsg |
|
1218 |
) |
|
1219 |
{ |
|
1220 |
OstTrace1( TRACE_NORMAL, DROUTER_SENDMSG_ENTRY, ">DRouter::SendMsg;aMsg=%x", ( TUint )&( aMsg ) ); |
|
1221 |
||
1222 |
C_TRACE( ( _T( " DRouter::SendMsg 0x%x ->" ), &aMsg ) ); |
|
1223 |
// The IST shall deallocate the block when it's approriate to do. |
|
1224 |
DATA_DUMP_TRACE( aMsg, ETrue ); |
|
1225 |
OstTraceData( TRACE_ISIMSG, DROUTER_SENDMSG_DATA, "DRouter::SendMsg TX: %{hex8[]}", aMsg.Ptr(), aMsg.Length() ); |
|
1226 |
||
1227 |
//ISCE |
|
1228 |
//TInt error = iIST->SendMessage( aMsg, MIAD2ISTApi::EISTPriorityDefault );// priority 0 |
|
1229 |
// TODO error codes and ids |
|
1230 |
TUint8 linkId = MapMediaToLinkId( aMsg.Ptr()[ ISI_HEADER_OFFSET_MEDIA ] ); |
|
1231 |
ASSERT_RESET_ALWAYS( linkId < DRouter::EISIAmountOfMedias, -1000 ); |
|
1232 |
MISIRouterLinkIf* link = iLinksArray[ linkId ]; |
|
1233 |
ASSERT_RESET_ALWAYS( link, -999 ); |
|
1234 |
TInt error( KErrNone ); |
|
1235 |
if( link->TrxPresent() ) |
|
1236 |
{ |
|
1237 |
link->Send( aMsg ); |
|
1238 |
} |
|
1239 |
else |
|
1240 |
{ |
|
1241 |
TRACE_ASSERT_ALWAYS; |
|
1242 |
// Discard send block if connection lost |
|
1243 |
MemApi::DeallocBlock( aMsg ); |
|
1244 |
error = KErrNotReady; |
|
1245 |
} |
|
1246 |
//ISCE |
|
1247 |
OstTraceExt2( TRACE_NORMAL, DROUTER_SENDMSG_EXIT, "<DRouter::SendMsg;aMsg=%x;error=%d", ( TUint )&( aMsg ), error ); |
|
1248 |
return error; |
|
1249 |
} |
|
1250 |
||
1251 |
//pipehandler |
|
1252 |
MIAD2ChannelApi* DRouter::GetChannel( |
|
1253 |
const TUint16 aChannel |
|
1254 |
) |
|
1255 |
{ |
|
1256 |
OstTraceExt1( TRACE_NORMAL, DROUTER_GETCHANNEL_ENTRY, ">DRouter::GetChannel;aChannel=%hx", aChannel ); |
|
1257 |
||
1258 |
ASSERT_RESET_ALWAYS( aChannel < EIADSizeOfChannels, EIADWrongParameter | (TUint8)aChannel << KChannelNumberShift | EIADFaultIdentifier24 << KFaultIdentifierShift ); |
|
1259 |
||
1260 |
MIAD2ChannelApi* channelApi = iChannelTable[ aChannel ].iChannel; |
|
1261 |
||
1262 |
OstTrace1( TRACE_NORMAL, DROUTER_GETCHANNEL_EXIT, "<DRouter::GetChannel;channelApi=%x", ( TUint )( channelApi ) ); |
|
1263 |
return channelApi; |
|
1264 |
} |
|
1265 |
//pipehandler |
|
1266 |
||
1267 |
void DRouter::SetSenderInfo( |
|
1268 |
TDes8& aMessage, |
|
1269 |
const TUint16 aCh |
|
1270 |
) |
|
1271 |
{ |
|
1272 |
OstTraceExt2( TRACE_NORMAL, DROUTER_SETSENDERINFO_ENTRY, ">DRouter::SetSenderInfo;aMessage=%x;aCh=%hx", ( TUint )&( aMessage ), aCh ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1273 |
C_TRACE( ( _T( "DRouter::SetSenderInfo 0x%x ->" ), &aMessage ) ); |
0 | 1274 |
TUint8* msgBlockPtr = const_cast<TUint8*>( aMessage.Ptr() ); |
1275 |
ASSERT_RESET_ALWAYS( aMessage.Length() > ISI_HEADER_OFFSET_MEDIA, EIADOverTheLimits | EIADFaultIdentifier10 << KFaultIdentifierShift ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1276 |
if ( aCh == EIADNokiaUsbPhonetLink ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1277 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1278 |
msgBlockPtr[ ISI_HEADER_OFFSET_MEDIA ] = PN_MEDIA_SOS; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1279 |
SET_RECEIVER_DEV( msgBlockPtr, OTHER_DEVICE_1 ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1280 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1281 |
else{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1282 |
SET_SENDER_OBJ( msgBlockPtr, aCh ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1283 |
C_TRACE( ( _T( "DRouter::SetSenderInfo receiver device %d" ), msgBlockPtr[ ISI_HEADER_OFFSET_RECEIVERDEVICE ] ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1284 |
if( msgBlockPtr[ ISI_HEADER_OFFSET_RECEIVERDEVICE ] == PN_DEV_OWN ) |
0 | 1285 |
{ |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1286 |
C_TRACE( ( _T( "DRouter::SetSenderInfo message to APE from APE" ) ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1287 |
SET_SENDER_DEV( msgBlockPtr, PN_DEV_OWN ); |
0 | 1288 |
} |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1289 |
else |
0 | 1290 |
{ |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1291 |
C_TRACE( ( _T( "DRouter::SetSenderInfo message to MODEM from APE" ) ) ); |
0 | 1292 |
msgBlockPtr[ ISI_HEADER_OFFSET_MEDIA ] = PN_MEDIA_SOS; |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1293 |
SET_RECEIVER_DEV( msgBlockPtr, OTHER_DEVICE_1 ); |
0 | 1294 |
SET_SENDER_DEV( msgBlockPtr, THIS_DEVICE ); |
1295 |
} |
|
1296 |
} |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1297 |
C_TRACE( ( _T( "DRouter::SetSenderInfo 0x%x <-" ), &aMessage ) ); |
0 | 1298 |
OstTrace0( TRACE_NORMAL, DROUTER_SETSENDERINFO_EXIT, "<DRouter::SetSenderInfo" ); |
1299 |
} |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1300 |
|
0 | 1301 |
void DRouter::CheckSameThreadContext() |
1302 |
{ |
|
1303 |
OstTrace0( TRACE_NORMAL, DROUTER_CHECKSAMETHREADCONTEXT_ENTRY, ">DRouter::CheckSameThreadContext" ); |
|
1304 |
||
1305 |
DObject* tempObj = reinterpret_cast<DObject*>( &Kern::CurrentThread() ); |
|
1306 |
// If Null set current thread otherwise ignore |
|
1307 |
iThreadPtr = !iThreadPtr ? tempObj : iThreadPtr; |
|
1308 |
||
1309 |
IAD_ASSERT_RESET_ALWAYS( ( iThreadPtr == tempObj ? ETrue : EFalse ) , -1112, "NOTSAMETHREAD" ); |
|
1310 |
||
1311 |
OstTrace0( TRACE_NORMAL, DROUTER_CHECKSAMETHREADCONTEXT_EXIT, "<DRouter::CheckSameThreadContext" ); |
|
1312 |
} |
|
1313 |
||
1314 |
// FM held, must not block and nor acquire locks. |
|
1315 |
void DRouter::NotifyTrxPresenceEnqueDfc( |
|
1316 |
TBool aPresent |
|
1317 |
) |
|
1318 |
{ |
|
1319 |
||
1320 |
C_TRACE( ( _T( "DRouter::NotifyTrxPresenceEnqueDfc %d ->" ), aPresent ) ); |
|
1321 |
if( !iBootDone ) |
|
1322 |
{ |
|
1323 |
iInitCmtDfc->Enque(); |
|
1324 |
} |
|
1325 |
else |
|
1326 |
{ |
|
1327 |
iConnectionStatus = ( aPresent ) ? EIADConnectionOk : EIADConnectionNotOk;// TODO: atomicity check |
|
1328 |
iConnStatDfc->Enque(); |
|
1329 |
} |
|
1330 |
C_TRACE( ( _T( "DRouter::NotifyTrxPresenceEnqueDfc %d <-" ), aPresent ) ); |
|
1331 |
||
1332 |
} |
|
1333 |
||
1334 |
void DRouter::Receive( |
|
1335 |
TDes8& aMsg |
|
1336 |
) |
|
1337 |
{ |
|
1338 |
||
1339 |
C_TRACE( ( _T( "DRouter::Receive 0x%x ->" ), &aMsg ) ); |
|
1340 |
MessageReceived( aMsg ); |
|
1341 |
C_TRACE( ( _T( "DRouter::Receive 0x%x <-" ), &aMsg ) ); |
|
1342 |
||
1343 |
} |
|
1344 |
||
1345 |
EXPORT_C void DRouter::DummyDoNothing() |
|
1346 |
{ |
|
1347 |
||
1348 |
ASSERT_RESET_ALWAYS( 0, -1001 ); |
|
1349 |
||
1350 |
} |
|
1351 |
||
1352 |
EXPORT_C void DRouter::DummyDoNothing2() |
|
1353 |
{ |
|
1354 |
||
1355 |
ASSERT_RESET_ALWAYS( 0, -1000 ); |
|
1356 |
||
1357 |
} |
|
1358 |
||
1359 |
||
1360 |
TUint8 DRouter::MapMediaToLinkId( |
|
1361 |
const TUint8 aMedia |
|
1362 |
) |
|
1363 |
{ |
|
1364 |
||
1365 |
TUint8 linkdId( DRouter::EISIAmountOfMedias ); |
|
1366 |
switch( aMedia ) |
|
1367 |
{ |
|
1368 |
case PN_MEDIA_SOS: |
|
1369 |
{ |
|
1370 |
linkdId = EISIMediaHostSSI; |
|
1371 |
break; |
|
1372 |
} |
|
1373 |
// Not supported media |
|
1374 |
default: |
|
1375 |
{ |
|
1376 |
ASSERT_RESET_ALWAYS( 0, -998 ); |
|
1377 |
break; |
|
1378 |
} |
|
1379 |
} |
|
1380 |
return linkdId; |
|
1381 |
||
1382 |
} |
|
1383 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1384 |
//From objectapi |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1385 |
EXPORT_C MISIObjectRouterIf* MISIObjectRouterIf::Connect( const TInt32 aUID, TUint8& aObjId, MISIRouterObjectIf* aCallback ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1386 |
{ |
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1387 |
C_TRACE( ( _T( "MISIObjectRouterIf::Connect %d 0x%x 0x%x>" ), aUID, aObjId, aCallback ) ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1388 |
Kern::Printf( "IADRouter::Connect" ); |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1389 |
//Connect( aUID, aObjId, aCallback ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1390 |
if( aUID == KNameServiceUID ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1391 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1392 |
C_TRACE( ( _T( "MISIObjectRouterIf was nameservice" ) ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1393 |
DRouter::iThisPtr->iNameService = aCallback; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1394 |
aObjId = PN_OBJ_ROUTING_REQ; // 0x00 |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1395 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1396 |
else if( aUID == KCommunicationManagerUID ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1397 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1398 |
C_TRACE( ( _T( "MISIObjectRouterIf was communicationmanager" ) ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1399 |
DRouter::iThisPtr->iCommunicationManager = aCallback; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1400 |
aObjId = PN_OBJ_EVENT_MULTICAST; // 0x20 |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1401 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1402 |
else |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1403 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1404 |
C_TRACE( ( _T( "MISIObjectRouterIf unknown object api client" ) ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1405 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1406 |
MISIObjectRouterIf* tmp = DRouter::iThisPtr; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1407 |
C_TRACE( ( _T( "MISIObjectRouterIf::Connect %d 0x%x 0x%x<" ), aUID, aObjId, aCallback ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1408 |
return tmp; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1409 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1410 |
|
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1411 |
TInt DRouter::Send( TDes8& aMessage, const TUint8 aObjId ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1412 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1413 |
C_TRACE( ( _T( "DRouter::Send objectapi 0x%x 0x%x>" ), &aMessage, aObjId ) ); |
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1414 |
Kern::Printf( "IADRouter::Send" ); |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1415 |
if( aObjId == PN_OBJ_EVENT_MULTICAST ) //from communicationmanager |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1416 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1417 |
// Don't put to mainrxqueue |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1418 |
HandleIsiMessage( aMessage ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1419 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1420 |
else |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1421 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1422 |
Receive( aMessage ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1423 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1424 |
C_TRACE( ( _T( "DRouter::Send objectapi 0x%x 0x%x<" ), &aMessage, aObjId ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1425 |
return KErrNone; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1426 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1427 |
|
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1428 |
TDfcQue* DRouter::GetDfcThread( |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1429 |
const TISIDfcQThreadType // aType |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1430 |
) |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1431 |
{ |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1432 |
C_TRACE( ( _T( "DRouter::GetDfcThread<>" ) ) ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1433 |
Kern::Printf( "IADRouter::GetDfcThread" ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1434 |
return DIsaAccessExtension::GetDFCThread( EIADExtensionDfcQueue ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1435 |
//ASSERT_RESET_ALWAYS( 0, -1003 ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1436 |
//return NULL; |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1437 |
} |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1438 |
|
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1439 |
void DRouter::FreeDfcThread( TDfcQue* aThread ) |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1440 |
{ |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1441 |
C_TRACE( ( _T( "DRouter::FreeDfcThread 0x%x>" ), aThread ) ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1442 |
Kern::Printf( "IADRouter::FreeDfcThread" ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1443 |
ASSERT_RESET_ALWAYS( 0, -1002 ); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1444 |
} |
0 | 1445 |
// End of file. |
1446 |