|
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 * Implementation of DMC extension. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <kern_priv.h> // DfcQue0()->iThread->iPriority |
|
22 #include <isikernel.h> // TIsiKernelSend |
|
23 #include <isakernelapi.h> // DIsaKernelAPI |
|
24 #include <iscnokiadefinitions.h> // EIscNokiaDMC |
|
25 #include <pn_const.h> // PN constants |
|
26 #include <phonetisi.h> // ISI_HEADER_*** |
|
27 #include "dmc_extension.h" // DDmcExtension |
|
28 #include "dmc_trace.h" |
|
29 #include "dmc_event_handler_ape_cent.h" |
|
30 |
|
31 #include "osttracedefinitions.h" // For Open System Trace |
|
32 #ifdef OST_TRACE_COMPILER_IN_USE |
|
33 #include "dmc_extensionTraces.h" |
|
34 #endif |
|
35 |
|
36 |
|
37 // EXTERNAL DATA STRUCTURES |
|
38 // EXTERNAL FUNCTION PROTOTYPES |
|
39 // CONSTANTS |
|
40 // MACROS |
|
41 // LOCAL CONSTANTS AND MACROS |
|
42 #define DFC_OBJECT_PRIORITY 1 // priority for DFC object, 1 is default |
|
43 |
|
44 _LIT(KDmcName, "DMC"); // Name given to power handler |
|
45 _LIT(KDMCExtDfc, "DMCExtDFC"); // Name given to DfcQCreate() |
|
46 |
|
47 // MODULE DATA STRUCTURES |
|
48 DDmcExtension* DDmcExtension::iDmcExtPtr(NULL); |
|
49 |
|
50 // LOCAL FUNCTION PROTOTYPES |
|
51 // FORWARD DECLARATIONS |
|
52 |
|
53 |
|
54 // ============================ MEMBER FUNCTIONS =============================== |
|
55 // ----------------------------------------------------------------------------- |
|
56 // Extension entry point |
|
57 // ----------------------------------------------------------------------------- |
|
58 // |
|
59 DECLARE_STANDARD_EXTENSION() |
|
60 { |
|
61 OstTrace0(TRACE_ENTRY_EXIT, DECLARE_STANDARD_EXTENSION_ENTRY, |
|
62 "DMC:KERN_EXTEN: DECLARE_STANDARD_EXTENSION() # IN"); |
|
63 DMC_TRACE(("DMC:KERN_EXTEN: DECLARE_STANDARD_EXTENSION() # IN")); |
|
64 |
|
65 DDmcExtension::iDmcExtPtr = new DDmcExtension; |
|
66 |
|
67 DMC_TRACE((("DMC:KERN_EXTEN: DECLARE_STANDARD_EXTENSION() - iDmcExtPtr 0x%x:"), |
|
68 DDmcExtension::iDmcExtPtr)); |
|
69 |
|
70 DMC_TRACE_ASSERT_RESET(DDmcExtension::iDmcExtPtr, "DMC:KERN_EXTEN: create failed", |
|
71 KErrNoMemory); |
|
72 |
|
73 DDmcExtension::iDmcExtPtr->Init(); |
|
74 |
|
75 DMC_TRACE(("DMC:KERN_EXTEN: DECLARE_STANDARD_EXTENSION() - call Init()")); |
|
76 |
|
77 OstTrace0(TRACE_ENTRY_EXIT, DECLARE_STANDARD_EXTENSION_RETURN, |
|
78 "DMC:KERN_EXTEN:DECLARE_STANDARD_EXTENSION()# OUT - KErrNone"); |
|
79 DMC_TRACE(("DMC:KERN_EXTEN: DECLARE_STANDARD_EXTENSION() # OUT - KErrNone")); |
|
80 |
|
81 return KErrNone; |
|
82 } |
|
83 |
|
84 |
|
85 // ----------------------------------------------------------------------------- |
|
86 // DDmcExtension::DDmcExtension |
|
87 // Constructor |
|
88 // ----------------------------------------------------------------------------- |
|
89 // |
|
90 DDmcExtension::DDmcExtension() |
|
91 : DPowerHandler(KDmcName) |
|
92 , iDmcDfcQueuePtr(NULL) |
|
93 , iReceiveMsgPtr(NULL) |
|
94 , iIsaKernelAPIOpenStatus(KErrUnknown) |
|
95 , iIsaKernelAPIReceiveStatus(KErrUnknown) |
|
96 , iIsaKernelModemStatus(EIscConnectionNotOk) |
|
97 , iChannelOpenedDfcPtr(NULL) |
|
98 , iMsgReceivedDfcPtr(NULL) |
|
99 , iStateChangedDfcPtr(NULL) |
|
100 , iPowerDownDfcPtr(NULL) |
|
101 { |
|
102 OstTrace0(TRACE_ENTRY_EXIT, DDMC_DDMC_ENTRY, "DMC:KERN_EXTEN: DDmcExtension() # IN"); |
|
103 DMC_TRACE(("DMC:KERN_EXTEN: DDmcExtension() # IN")); |
|
104 |
|
105 TInt dfcQueueDmcPriority = (Kern::DfcQue0()->iThread->iPriority) + 1; |
|
106 |
|
107 DMC_TRACE((("DMC:KERN_EXTEN: DDmcExtension() - dfcQueueDmcPriority: %d"), |
|
108 dfcQueueDmcPriority)); |
|
109 |
|
110 // DFC queue must be created in the critical section |
|
111 NKern::ThreadEnterCS(); |
|
112 TInt dfcStatus = Kern::DfcQCreate(iDmcDfcQueuePtr, dfcQueueDmcPriority, &KDMCExtDfc); |
|
113 |
|
114 NKern::ThreadLeaveCS(); |
|
115 |
|
116 DMC_TRACE((("DMC:KERN_EXTEN: DDmcExtension() - dfcStatus: 0x%x "), dfcStatus)); |
|
117 DMC_TRACE_ASSERT_RESET(dfcStatus == KErrNone , "Kern::DfcQCreate failed", dfcStatus); |
|
118 |
|
119 OstTrace1(TRACE_FLOW, DDMC_DMC_1,"DMC:KERN_EXTEN: DDmcExtension() - return; KErrNone=%d", KErrNone); |
|
120 DMC_TRACE((("DMC:KERN_EXTEN: DDmcExtension() - InitiDmcDfcQueuePtr: 0x%x "), iDmcDfcQueuePtr)); |
|
121 |
|
122 // We never delete this objects because DMC is running as long as a device is running. |
|
123 iChannelOpenedDfcPtr = new TDfc(ChannelOpenedDfc, this, iDmcDfcQueuePtr, DFC_OBJECT_PRIORITY); |
|
124 iMsgReceivedDfcPtr = new TDfc(MsgReceivedDfc, this, iDmcDfcQueuePtr, DFC_OBJECT_PRIORITY); |
|
125 iStateChangedDfcPtr = new TDfc(StateChangedDfc, this, iDmcDfcQueuePtr, DFC_OBJECT_PRIORITY); |
|
126 iPowerDownDfcPtr = new TDfc(PowerDownDfc, this, iDmcDfcQueuePtr, DFC_OBJECT_PRIORITY); |
|
127 |
|
128 DMC_TRACE_ASSERT_RESET(iChannelOpenedDfcPtr, |
|
129 "DMC:KERN_EXTEN: DDmcExtension() - iChannelOpenedDfcPtr", |
|
130 KErrNoMemory); |
|
131 DMC_TRACE_ASSERT_RESET(iMsgReceivedDfcPtr, |
|
132 "DMC:KERN_EXTEN: DDmcExtension() - iMsgReceivedDfcPtr", |
|
133 KErrNoMemory); |
|
134 DMC_TRACE_ASSERT_RESET(iStateChangedDfcPtr, |
|
135 "DMC:KERN_EXTEN: DDmcExtension() - iStateChangedDfcPtr", |
|
136 KErrNoMemory); |
|
137 |
|
138 DMC_TRACE_ASSERT_RESET(iPowerDownDfcPtr, |
|
139 "DMC:KERN_EXTEN: DDmcExtension() - iPowerDownDfcPtr", |
|
140 KErrNoMemory); |
|
141 |
|
142 OstTrace0(TRACE_ENTRY_EXIT, DDMC_DDMC_RETURN, "DMC:KERN_EXTEN: DDmcExtension() # OUT"); |
|
143 DMC_TRACE(("DMC:KERN_EXTEN: DDmcExtension() # OUT")); |
|
144 } |
|
145 |
|
146 |
|
147 // ----------------------------------------------------------------------------- |
|
148 // DDmcExtension::Init |
|
149 // Handles the initialization of DMC |
|
150 // ----------------------------------------------------------------------------- |
|
151 // |
|
152 void DDmcExtension::Init() |
|
153 { |
|
154 OstTrace0(TRACE_ENTRY_EXIT, DDMC_INIT_ENTRY, "DMC:KERN_EXTEN: Init() # IN"); |
|
155 DMC_TRACE(("DMC:KERN_EXTEN: Init() # IN")); |
|
156 |
|
157 OstTrace0(TRACE_FLOW, DDMC_INIT_1, "DMC:KERN_EXTEN: Init() - DPowerHandler -> Add"); |
|
158 DMC_TRACE(("DMC:KERN_EXTEN: Init() - DPowerHandler -> Add")); |
|
159 |
|
160 // Register to Power Handler |
|
161 Add(); |
|
162 |
|
163 OstTrace0(TRACE_FLOW, DDMC_INIT_2, "DMC:KERN_EXTEN: Init() - DIsaKernelAPI::NewF"); |
|
164 DMC_TRACE(("DMC:KERN_EXTEN: Init() - DIsaKernelAPI::NewF")); |
|
165 |
|
166 // Create new IsaKernelAPI object. Throws Kern::Fault if the allocation fails |
|
167 iIsaKernelApiPtr = DIsaKernelAPI::NewF(); |
|
168 |
|
169 iIsaKernelApiPtr->Open(EIscNokiaDMC, iIsaKernelAPIOpenStatus, *iChannelOpenedDfcPtr); |
|
170 |
|
171 OstTrace1(TRACE_FLOW, DDMC_INIT_3,"DMC:KERN_EXTEN: Init() - iIsaKernelAPIOpenStatus: %d ", |
|
172 iIsaKernelAPIOpenStatus); |
|
173 DMC_TRACE((("DMC:KERN_EXTEN: Init() - iIsaKernelAPIOpenStatus %d: "), iIsaKernelAPIOpenStatus)); |
|
174 |
|
175 OstTrace0(TRACE_ENTRY_EXIT, DDMC_INIT_RETURN, "DMC:KERN_EXTEN: Init() # OUT"); |
|
176 DMC_TRACE(("DMC:KERN_EXTEN: Init() # OUT")); |
|
177 } |
|
178 |
|
179 |
|
180 // ----------------------------------------------------------------------------- |
|
181 // DDmcExtension::PowerUp |
|
182 // Handles the powering up of the device |
|
183 // ----------------------------------------------------------------------------- |
|
184 // |
|
185 void DDmcExtension::PowerUp() |
|
186 { |
|
187 OstTrace0(TRACE_ENTRY_EXIT, DDMC_POWER_UP_ENTRY, "DMC:KERN_EXTEN: PowerUp() # IN"); |
|
188 DMC_TRACE(("DMC:KERN_EXTEN: PowerUp() # IN")); |
|
189 |
|
190 OstTrace0(TRACE_FLOW, DDMC_POWERUP, "DMC:KERN_EXTEN: PowerUp() - PM asks PowerUp"); |
|
191 DMC_TRACE(("DMC:KERN_EXTEN: PowerUp() - PM asks PowerUp")); |
|
192 |
|
193 // We have nothing to do in this phase, so acknowledge to powerhandler. |
|
194 PowerUpDone(); |
|
195 |
|
196 OstTrace0(TRACE_ENTRY_EXIT, DDMC_POWER_UP_RETURN, "DMC:KERN_EXTEN: PowerUp() # OUT"); |
|
197 DMC_TRACE(("DMC:KERN_EXTEN: PowerUp() # OUT")); |
|
198 } |
|
199 |
|
200 |
|
201 // ----------------------------------------------------------------------------- |
|
202 // DDmcExtension::PowerDown |
|
203 // Handles the powering down of the extension. |
|
204 // ----------------------------------------------------------------------------- |
|
205 // |
|
206 void DDmcExtension::PowerDown(TPowerState aTargetState) |
|
207 { |
|
208 OstTrace1(TRACE_ENTRY_EXIT, DDMC_POWERDOWN_ENTRY, |
|
209 "DMC:KERN_EXTEN: PowerDown() # IN - aTargetState: 0x%x", (TUint)(aTargetState)); |
|
210 // TPowerState is printed only for debugging purpose. See the values in e32power.h. |
|
211 DMC_TRACE((("DMC:KERN_EXTEN: PowerDown() # IN - aTargetState: 0x%x "), aTargetState)); |
|
212 |
|
213 if (NKern::CurrentContext() == NKern::EInterrupt) |
|
214 { |
|
215 iPowerDownDfcPtr->Add(); |
|
216 } |
|
217 else |
|
218 { |
|
219 iPowerDownDfcPtr->Enque(); |
|
220 } |
|
221 |
|
222 OstTrace0(TRACE_ENTRY_EXIT, DDMC_POWERDOWN_RETURN, "DMC:KERN_EXTEN: PowerDown() # OUT"); |
|
223 DMC_TRACE(("DMC:KERN_EXTEN: PowerDown() # OUT")); |
|
224 } |
|
225 |
|
226 |
|
227 // ----------------------------------------------------------------------------- |
|
228 // DDmcExtension::ChannelOpenedDfc |
|
229 // Dfc function, called by IsaKernelIF when channel is opened |
|
230 // ----------------------------------------------------------------------------- |
|
231 // |
|
232 void DDmcExtension::ChannelOpenedDfc(TAny *aPtr) |
|
233 { |
|
234 OstTrace1(TRACE_ENTRY_EXIT, DDMC_CHANNEL_OPEN_DFC_ENTRY, |
|
235 "DMC:KERN_EXTEN: ChannelOpenedDfc() # IN - aPtr: 0x%x", (TUint)(aPtr)); |
|
236 DMC_TRACE((("DMC:KERN_EXTEN: ChannelOpenedDfc() # IN - aPtr: 0x%x"), aPtr)); |
|
237 DMC_TRACE_ASSERT_RESET(aPtr, "DMC:EH_APE_CEN: ChannelOpenedDfc() - Kernel NULL pointer", |
|
238 KErrNoMemory); |
|
239 |
|
240 DDmcExtension* dmcExtPtr = static_cast<DDmcExtension*>(aPtr); |
|
241 |
|
242 dmcExtPtr->CompleteIadInit(); |
|
243 |
|
244 OstTrace0(TRACE_ENTRY_EXIT, DDMC_CHANNEL_OPEN_DFC_RETURN, |
|
245 "DMC:KERN_EXTEN: ChannelOpenedDfc() # OUT"); |
|
246 DMC_TRACE(("DMC:KERN_EXTEN: ChannelOpenedDfc() # OUT")); |
|
247 } |
|
248 |
|
249 |
|
250 // ----------------------------------------------------------------------------- |
|
251 // DDmcExtension::MsgReceivedDfc |
|
252 // Dfc function, called by IsaKernelIF when a message is received |
|
253 // ----------------------------------------------------------------------------- |
|
254 // |
|
255 void DDmcExtension::MsgReceivedDfc(TAny *aPtr) |
|
256 { |
|
257 OstTrace1(TRACE_ENTRY_EXIT, DDMC_MSG_RECEIVED_DFC_ENTRY, |
|
258 "DMC:KERN_EXTEN: MsgReceivedDfc() # IN - aPtr: 0x%x", (TUint)(aPtr)); |
|
259 DMC_TRACE((("DMC:KERN_EXTEN: MsgReceivedDfc() # IN - aPtr: 0x%x"), aPtr)); |
|
260 DMC_TRACE_ASSERT_RESET(aPtr, "DMC:EH_APE_CEN: MsgReceivedDfc() - Kernel NULL pointer", |
|
261 KErrNoMemory); |
|
262 |
|
263 DDmcExtension* dmcExtPtr = static_cast<DDmcExtension*>(aPtr); |
|
264 |
|
265 DMC_TRACE_ASSERT_RESET((dmcExtPtr->iIsaKernelAPIReceiveStatus == KErrNone), |
|
266 "DMC:KERN_EXTEN: MsgReceivedDfc() - IsaKernelAPI Msg receive error", |
|
267 dmcExtPtr->iIsaKernelAPIReceiveStatus); |
|
268 |
|
269 TUint8* msgPtr = const_cast<TUint8*>(dmcExtPtr->iReceiveMsgPtr->Ptr()); |
|
270 |
|
271 OstTrace1(TRACE_FLOW, DDMC_MSG_RECEIVED_DFC_1, |
|
272 "DMC:KERN_EXTEN: MsgReceivedDfc() - msgPtr: 0x%x", (TUint)(msgPtr)); |
|
273 DMC_TRACE((("DMC:KERN_EXTEN: MsgReceivedDfc() - msgPtr: 0x%x"), msgPtr)); |
|
274 |
|
275 DmcEvHandApeCent::HandleEvent(KERNEL_EVENT_ISI, msgPtr, NULL /* User */); |
|
276 |
|
277 // Free the message buffer |
|
278 dmcExtPtr->iIsaKernelApiPtr->DeAllocateMsgBlock(*dmcExtPtr->iReceiveMsgPtr); |
|
279 dmcExtPtr->iReceiveMsgPtr = NULL; |
|
280 |
|
281 // Continue receiving messages |
|
282 dmcExtPtr->ReceiveMessage(); |
|
283 |
|
284 OstTrace0(TRACE_ENTRY_EXIT, DDMC_MSG_RECEIVED_DFC_RETURN, |
|
285 "DMC:KERN_EXTEN: MsgReceivedDfc() # OUT"); |
|
286 DMC_TRACE(("DMC:KERN_EXTEN: MsgReceivedDfc() # OUT")); |
|
287 } |
|
288 |
|
289 |
|
290 // ----------------------------------------------------------------------------- |
|
291 // DDmcExtension::StateChangedDfc |
|
292 // Dfc function, called by IsaKernelIF when a channel state has been changed |
|
293 // ----------------------------------------------------------------------------- |
|
294 // |
|
295 void DDmcExtension::StateChangedDfc(TAny *aPtr) |
|
296 { |
|
297 OstTrace1(TRACE_ENTRY_EXIT, DDMC_STATE_CHANGED_DFC_ENTRY, |
|
298 "DMC:KERN_EXTEN: StateChangedDfc() # IN - aPtr: 0x%x", (TUint)(aPtr)); |
|
299 DMC_TRACE((("DMC:KERN_EXTEN: StateChangedDfc() # IN - aPtr: 0x%x"), aPtr)); |
|
300 DMC_TRACE_ASSERT_RESET(aPtr, "DMC:EH_APE_CEN: StateChangedDfc() - Kernel NULL pointer", |
|
301 KErrNoMemory); |
|
302 |
|
303 DDmcExtension* dmcExtPtr = static_cast<DDmcExtension*>(aPtr); |
|
304 |
|
305 OstTraceExt2(TRACE_FLOW, DDMC_STATE_CHANGED_DFC_1, |
|
306 "DMC:KERN_EXTEN: StateChangedDfc() - iIsaKernelAPIOpenStatus: %d, EIscConnectionOk: %d", |
|
307 dmcExtPtr->iIsaKernelModemStatus, EIscConnectionOk); |
|
308 DMC_TRACE((("DMC:KERN_EXTEN: StateChangedDfc() - iIsaKernelAPIOpenStatus: %d, EIscConnectionOk: %d"), |
|
309 dmcExtPtr->iIsaKernelModemStatus, EIscConnectionOk)); |
|
310 |
|
311 // A Modem connenction lost. |
|
312 if (dmcExtPtr->iIsaKernelModemStatus != EIscConnectionOk) |
|
313 { |
|
314 DmcEvHandApeCent::HandleEvent(KERNEL_EVENT_MODEM_CONNECTION_NOT_OK, |
|
315 NULL /* Kernel*/, NULL /* User */); |
|
316 } |
|
317 |
|
318 OstTrace0(TRACE_ENTRY_EXIT, DDMC_STATE_CHANGED_DFC_RETURN, |
|
319 "DMC:KERN_EXTEN: StateChangedDfc() # OUT"); |
|
320 DMC_TRACE(("DMC:KERN_EXTEN: StateChangedDfc() # OUT")); |
|
321 } |
|
322 |
|
323 |
|
324 // ----------------------------------------------------------------------------- |
|
325 // DDmcExtension::PowerDownDfc |
|
326 // Dfc function, called by the Power Handler in a shutdown |
|
327 // ----------------------------------------------------------------------------- |
|
328 // |
|
329 void DDmcExtension::PowerDownDfc(TAny* aPtr) |
|
330 { |
|
331 OstTrace1(TRACE_ENTRY_EXIT, DDMC_POWER_DOWN_DFC_ENTRY, |
|
332 "DMC:KERN_EXTEN: PowerDownDfc() # IN - aPtr: 0x%x ", (TUint)(aPtr)); |
|
333 DMC_TRACE((("DMC:KERN_EXTEN: PowerDownDfc() # IN - aPtr: 0x%x"), aPtr)); |
|
334 |
|
335 (void)DmcEvHandApeCent::HandleEvent(KERNEL_EVENT_PWR_HANDLER, NULL/*Kernel*/, NULL /* User */); |
|
336 |
|
337 OstTrace0(TRACE_ENTRY_EXIT, DDMC_POWER_DOWN_DFC_RETURN, |
|
338 "DMC:KERN_EXTEN: PowerDownDfc() # OUT"); |
|
339 DMC_TRACE(("DMC:KERN_EXTEN: PowerDownDfc() # OUT")); |
|
340 } |
|
341 |
|
342 |
|
343 // ----------------------------------------------------------------------------- |
|
344 // DDmcExtension::CompleteIadInit |
|
345 // Completes the IAD initialization for ISI message handling |
|
346 // ----------------------------------------------------------------------------- |
|
347 // |
|
348 void DDmcExtension::CompleteIadInit() |
|
349 { |
|
350 OstTrace0(TRACE_ENTRY_EXIT, DDMC_COMPLETE_ENTRY, |
|
351 "DMC:KERN_EXTEN: CompleteIadInit() # IN"); |
|
352 DMC_TRACE(("DMC:KERN_EXTEN: CompleteIadInit() # IN")); |
|
353 |
|
354 // Initialize an event handler |
|
355 DmcEvHandApeCent::Init(DDmcExtension::iDmcExtPtr); |
|
356 |
|
357 OstTrace0(TRACE_FLOW, DDMC_COMPLETE_1, |
|
358 "DMC:KERN_EXTEN: CompleteIadInit() - Start listen IAD state change"); |
|
359 DMC_TRACE(("DMC:KERN_EXTEN: CompleteIadInit() - Start listen IAD state change")); |
|
360 |
|
361 iIsaKernelApiPtr->NotifyStateChange(*iStateChangedDfcPtr, iIsaKernelModemStatus); |
|
362 |
|
363 // Starts listening ISI messages |
|
364 ReceiveMessage(); |
|
365 |
|
366 OstTrace0(TRACE_ENTRY_EXIT, DDMC_COMPLETE_RETURN, "DMC:KERN_EXTEN: CompleteIadInit() # OUT"); |
|
367 DMC_TRACE(("DMC:KERN_EXTEN: CompleteIadInit() # OUT")); |
|
368 } |
|
369 |
|
370 |
|
371 // ----------------------------------------------------------------------------- |
|
372 // DDmcExtension::ReceiveMessage |
|
373 // Allocates a message and starts receiving ISI messages from IsaKernelIF |
|
374 // ----------------------------------------------------------------------------- |
|
375 // |
|
376 void DDmcExtension::ReceiveMessage() |
|
377 { |
|
378 OstTrace0(TRACE_ENTRY_EXIT, DDMC_RECEIVEM_ESSAGE_ENTRY, |
|
379 "DMC:KERN_EXTEN: ReceiveMessage() # IN"); |
|
380 DMC_TRACE(("DMC:KERN_EXTEN: ReceiveMessage() # IN")); |
|
381 |
|
382 iReceiveMsgPtr = NULL; |
|
383 iIsaKernelApiPtr->Receive(*&iReceiveMsgPtr, iIsaKernelAPIReceiveStatus, *iMsgReceivedDfcPtr); |
|
384 |
|
385 OstTrace0(TRACE_ENTRY_EXIT, DDMC_RECEIVE_MESSAGE_RETURN, |
|
386 "DMC:KERN_EXTEN: ReceiveMessage # OUT"); |
|
387 DMC_TRACE(("DMC:KERN_EXTEN: ReceiveMessage() # OUT")); |
|
388 } |
|
389 |
|
390 |
|
391 // ----------------------------------------------------------------------------- |
|
392 // DDmcExtension::AllocateMsgBlock |
|
393 // Returns a reference to a message block |
|
394 // ----------------------------------------------------------------------------- |
|
395 // |
|
396 TDes8& DDmcExtension::AllocateMsgBlock(const TUint32 aSize) const |
|
397 { |
|
398 OstTrace1(TRACE_ENTRY_EXIT, DDMC_ALLOC_MSG_BLOCK_ENTRY, |
|
399 "DMC:KERN_EXTEN: AllocateMsgBlock() # IN - aSize: %d", aSize); |
|
400 DMC_TRACE((("DMC:KERN_EXTEN: AllocateMsgBlock() # IN - aSize: %d"), aSize)); |
|
401 |
|
402 OstTrace0(TRACE_ENTRY_EXIT, DDMC_ALLOC_MSG_BLOCK_RETURN, |
|
403 "DMC:KERN_EXTEN: AllocateMsgBlock() # OUT"); |
|
404 DMC_TRACE(("DMC:KERN_EXTEN: AllocateMsgBlock() # OUT")); |
|
405 |
|
406 return (iIsaKernelApiPtr->AllocateMsgBlock(aSize)); |
|
407 } |
|
408 |
|
409 |
|
410 // ----------------------------------------------------------------------------- |
|
411 // DDmcExtension::Send |
|
412 // Sends a message through Isa Access Driver |
|
413 // ----------------------------------------------------------------------------- |
|
414 // |
|
415 TInt DDmcExtension::Send(TDes8& aSendMsg) |
|
416 { |
|
417 OstTrace0(TRACE_ENTRY_EXIT, DDMC_SEND_ENTRY, |
|
418 "DMC:KERN_EXTEN: Send() # IN"); |
|
419 DMC_TRACE(("DMC:KERN_EXTEN: Send() # IN")); |
|
420 |
|
421 OstTrace0(TRACE_ENTRY_EXIT, DDMC_SEND_RETURN, |
|
422 "DMC:KERN_EXTEN: Send() # OUT"); |
|
423 DMC_TRACE(("DMC:KERN_EXTEN: Send() # OUT")); |
|
424 |
|
425 return (iIsaKernelApiPtr->Send(aSendMsg)); |
|
426 } |
|
427 |
|
428 |
|
429 // ----------------------------------------------------------------------------- |
|
430 // DDmcExtension::SubscribeIndications |
|
431 // Sends a message through Isa Access Driver |
|
432 // ----------------------------------------------------------------------------- |
|
433 // |
|
434 TInt DDmcExtension::SubscribeIndications(TDes8& aIndications) |
|
435 { |
|
436 OstTrace0(TRACE_ENTRY_EXIT, DDMC_SUBSCRIBE_IND_ENTRY, |
|
437 "DMC:KERN_EXTEN: SubscribeIndications() # IN"); |
|
438 DMC_TRACE(("DMC:KERN_EXTEN: SubscribeIndications() # IN")); |
|
439 |
|
440 OstTrace0(TRACE_ENTRY_EXIT, DDMC_SUBSCRIBE_IND_RETURN, |
|
441 "DMC:KERN_EXTEN: SubscribeIndications() # OUT"); |
|
442 DMC_TRACE(("DMC:KERN_EXTEN: SubscribeIndications() # OUT")); |
|
443 |
|
444 return (iIsaKernelApiPtr->SubscribeIndications(aIndications)); |
|
445 } |
|
446 |
|
447 |
|
448 // ----------------------------------------------------------------------------- |
|
449 // DDmcExtension::CompletePowerDown |
|
450 // Completes the power down |
|
451 // ----------------------------------------------------------------------------- |
|
452 // |
|
453 void DDmcExtension::CompletePowerDown() |
|
454 { |
|
455 OstTrace0(TRACE_ENTRY_EXIT, DDMC_COMPLETE_POWER_DOWN_ENTRY, |
|
456 "DMC:KERN_EXTEN: CompletePowerDown() # IN"); |
|
457 DMC_TRACE(("DMC:KERN_EXTEN: CompletePowerDown() # IN")); |
|
458 |
|
459 // Tell to Power Handler that we are ready for power off / reset |
|
460 PowerDownDone(); |
|
461 |
|
462 OstTrace0(TRACE_ENTRY_EXIT, DDMC_COMPLETE_POWER_DOWN_RETURN, |
|
463 "DMC:KERN_EXTEN: CompletePowerDown() # OUT"); |
|
464 DMC_TRACE(("DMC:KERN_EXTEN: CompletePowerDown() # OUT")); |
|
465 } |
|
466 |
|
467 // End of File |
|
468 |