Update contrib.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
18 #include "T_MmcSDStackDriverData.h"
19 #include "MmcTestUtils.h"
21 //MMCSD Commands index
24 _LIT(KCmdStackAdjustPartialRead, "AdjustPartialRead");
25 _LIT(KCmdStackAllocSession, "AllocSession");
26 _LIT(KCmdStackBufferInfo, "BufferInfo");
27 _LIT(KCmdStackDemandPagingInfo, "DemandPagingInfo");
28 _LIT(KCmdStackEffectiveModes, "EffectiveModes");
29 _LIT(KCmdStackAlterEffectiveModes, "AlterEffectiveModes");
30 _LIT(KCmdStackGetBufferInfo, "GetBufferInfo");
31 _LIT(KCmdStackHasCardsPresent, "HasCardsPresent");
32 _LIT(KCmdStackHasSessionsQueued, "HasSessionsQueued");
33 _LIT(KCmdStackInit, "Init");
34 _LIT(KCmdStackInitStackInProgress, "InitStackInProgress");
35 _LIT(KCmdStackMMCSocket, "MMCSocket");
36 _LIT(KCmdStackMachineInfo, "MachineInfo");
37 _LIT(KCmdStackMaxCardsInStack, "MaxCardsInStack");
38 _LIT(KCmdStackReadPasswordStore, "ReadPasswordStore");
39 _LIT(KCmdStackWritePasswordStore, "WritePasswordStore");
40 _LIT(KCmdStackProgramPeriodInMs, "ProgramPeriodMs");
41 _LIT(KCmdStackStop, "Stop");
42 _LIT(KCmdStackReportPowerUp, "ReportPowerUp");
43 _LIT(KCmdStackReportPowerDown, "ReportPowerDown");
44 _LIT(KCmdStackCardP, "CardP");
47 _LIT(KPrdStart, "prdstart");
48 _LIT(KPrdEnd, "prdend");
49 _LIT(KPrdExpectedStart, "expectedprdstart");
50 _LIT(KPrdExpectedEnd, "expectedprdend");
51 _LIT(KExpectedBufLen, "expectedBuflen");
52 _LIT(KExpectedMinorBufLen, "expectedMinorBuflen");
53 _LIT(KExpectedMaxCardsInStack, "maxcards");
54 _LIT(KProgramPeriodMs, "programperiodms");
55 _LIT(KInProgress, "inprogress");
56 _LIT(KSessionsQueued, "sessionsqueued");
57 _LIT(KCardsPresent, "cardspresent");
58 _LIT(KExpectedTotalSockets, "expectedtotalsockets");
59 _LIT(KExpectedTotalMediaChanges, "expectedtotalmediachanges");
60 _LIT(KExpectedTotalPrimarySupplies, "expectedtotalprimarysupplies");
61 _LIT(KExpectedSPIMode, "expectedspimode");
62 _LIT(KExpectedBaseBusNumber, "expectedbasebusnumber");
63 _LIT(KHasFlagSupportsSPIMode, "hasflagsupportsspimode");
64 _LIT(KHasFlagSupportsDoubleBuffering, "hasflagsupportsdoublebuffering");
65 _LIT(KHasFlagSupportsR7, "hasflagsupportsr7");
66 _LIT(KHasFlagDma8BitAddressing, "hasflagdma8bitaddressing");
67 _LIT(KHasFlagDma16BitAddressing, "hasflagdma16bitaddressing");
68 _LIT(KHasFlagDma32BitAddressing, "hasflagdma32bitaddressing");
69 _LIT(KHasFlagDma64BitAddressing, "hasflagdma64bitaddressing");
70 _LIT(KHasFlagSupportsDMA, "hasflagsupportsdma");
71 _LIT(KHasFlagMaxTransferLength_256K, "hasflagmaxtransferlength256k");
72 _LIT(KHasFlagMaxTransferLength_512K, "hasflagmaxtransferlength512k");
73 _LIT(KHasFlagMaxTransferLength_1M, "hasflagmaxtransferlength1m");
74 _LIT(KHasFlagMaxTransferLength_2M, "hasflagmaxtransferlength2m");
75 _LIT(KHasFlagMaxTransferLength_4M, "hasflagmaxtransferlength4m");
76 _LIT(KHasFlagMaxTransferLength_8M, "hasflagmaxtransferlength8m");
77 _LIT(KHasFlagMaxTransferLength_16M, "hasflagmaxtransferlength16m");
78 _LIT(KPassword, "password");
79 _LIT(KIsNull, "isnull");
80 _LIT(KEffectiveModes, "effectivemodes");
81 _LIT(KEffectiveModesFunctionId, "emfunctionid");
82 _LIT(KEffectiveModesData, "emdata");
83 _LIT(KDriveCount, "drivecount");
84 _LIT(KNumPages, "numpages");
85 _LIT(KPagingType, "pagingtype");
86 _LIT(KWriteProtected, "writeprotected");
87 _LIT(KCardNumber, "cardnumber");
88 _LIT(KSocketWrapperName, "socketwrappername");
91 // TEffectiveModesFunctionId enum strings
92 _LIT(KEffectiveModesRemoveMode, "EEffectiveModesRemoveMode");
93 _LIT(KEffectiveModesSetBusClockInKhz, "EEffectiveModesSetBusClockInKhz");
94 _LIT(KEffectiveModesSetBusyTimeOutInMcs, "EEffectiveModesSetBusyTimeOutInMcs");
95 _LIT(KEffectiveModesSetCRCRetries, "EEffectiveModesSetCRCRetries");
96 _LIT(KEffectiveModesSetDataTimeOutInMcs, "EEffectiveModesSetDataTimeOutInMcs");
97 _LIT(KEffectiveModesSetMode, "EEffectiveModesSetMode");
98 _LIT(KEffectiveModesSetOpCondBusyTimeout, "EEffectiveModesSetOpCondBusyTimeout");
99 _LIT(KEffectiveModesSetPollAttempts, "EEffectiveModesSetPollAttempts");
100 _LIT(KEffectiveModesSetResponseTimeOutInTicks, "EEffectiveModesSetResponseTimeOutInTicks");
101 _LIT(KEffectiveModesSetTicksClockIn, "EEffectiveModesSetTicksClockIn");
102 _LIT(KEffectiveModesSetTicksClockOut, "EEffectiveModesSetTicksClockOut");
103 _LIT(KEffectiveModesSetTimeOutRetries, "EEffectiveModesSetTimeOutRetries");
104 _LIT(KInvalidEffectiveModesFunctionId, "EInvalidEffectiveModesFunctionId");
106 /** Enum as a descriptor Enum integar value
107 * In this case these enums represent TEffectiveModesFunctionId
111 const CDataWrapperBase::TEnumEntryTable CT_MMCSDStackDriverData::iEnumEffectiveModesFunctionIdTable [] =
113 // Enum as a descriptor Enum
114 KEffectiveModesRemoveMode, RMMCSDTestControllerInterface::EStackEffectiveModesRemoveMode,
115 KEffectiveModesSetBusClockInKhz, RMMCSDTestControllerInterface::EStackEffectiveModesSetBusClockInKhz,
116 KEffectiveModesSetBusyTimeOutInMcs, RMMCSDTestControllerInterface::EStackEffectiveModesSetBusyTimeOutInMcs,
117 KEffectiveModesSetCRCRetries, RMMCSDTestControllerInterface::EStackEffectiveModesSetCRCRetries,
118 KEffectiveModesSetDataTimeOutInMcs, RMMCSDTestControllerInterface::EStackEffectiveModesSetDataTimeOutInMcs,
119 KEffectiveModesSetMode, RMMCSDTestControllerInterface::EStackEffectiveModesSetMode,
120 KEffectiveModesSetOpCondBusyTimeout, RMMCSDTestControllerInterface::EStackEffectiveModesSetOpCondBusyTimeout,
121 KEffectiveModesSetPollAttempts, RMMCSDTestControllerInterface::EStackEffectiveModesSetPollAttempts,
122 KEffectiveModesSetResponseTimeOutInTicks, RMMCSDTestControllerInterface::EStackEffectiveModesSetResponseTimeOutInTicks,
123 KEffectiveModesSetTicksClockIn, RMMCSDTestControllerInterface::EStackEffectiveModesSetTicksClockIn,
124 KEffectiveModesSetTicksClockOut, RMMCSDTestControllerInterface::EStackEffectiveModesSetTicksClockOut,
125 KEffectiveModesSetTimeOutRetries, RMMCSDTestControllerInterface::EStackEffectiveModesSetTimeOutRetries,
126 KInvalidEffectiveModesFunctionId, -1
131 //////////////////////////////////////////////////////////////////////
132 // Construction/Destruction
133 //////////////////////////////////////////////////////////////////////
136 * static Construction
139 * @return A pointer to T_MMCSDStackDriverData
141 * @leave System wide error
143 CT_MMCSDStackDriverData* CT_MMCSDStackDriverData::NewL()
145 CT_MMCSDStackDriverData* ret = new (ELeave) CT_MMCSDStackDriverData();
146 CleanupStack::PushL(ret);
148 CleanupStack::Pop(ret);
160 CT_MMCSDStackDriverData::CT_MMCSDStackDriverData()
161 : CT_MmcSDDriverData()
166 * 2nd Phase constructor
171 * @leave System wide error
173 void CT_MMCSDStackDriverData::ConstructL()
175 CT_MmcSDDriverData::ConstructL();
185 CT_MMCSDStackDriverData::~CT_MMCSDStackDriverData()
190 * Process a command read from the script file
192 * @param aCommand The command to process
193 * @param aSection The section in the ini containing data for the command
194 * @param aAsyncErrorIndex Command index for async calls to return errors to
196 * @return ETrue if the command is processed
198 * @leave System wide error
200 TBool CT_MMCSDStackDriverData::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
204 if (aCommand == KCmdStackAdjustPartialRead)
206 DoCmdAdjustPartialRead(aSection);
208 else if (aCommand == KCmdStackAllocSession)
212 else if (aCommand == KCmdStackBufferInfo)
214 DoCmdBufferInfo(aSection);
216 else if (aCommand == KCmdStackDemandPagingInfo)
218 DoCmdDemandPagingInfo(aSection);
220 else if (aCommand == KCmdStackEffectiveModes)
222 DoCmdEffectiveModes(aSection);
224 else if (aCommand == KCmdStackGetBufferInfo)
226 DoCmdGetBufferInfo(aSection);
228 else if (aCommand == KCmdStackHasCardsPresent)
230 DoCmdHasCardsPresent(aSection);
232 else if (aCommand == KCmdStackHasSessionsQueued)
234 DoCmdHasSessionsQueued(aSection);
236 else if (aCommand == KCmdStackInit)
240 else if (aCommand == KCmdStackInitStackInProgress)
242 DoCmdInitStackInProgress(aSection);
244 else if (aCommand == KCmdStackMMCSocket)
246 DoCmdMMCSocketL(aSection);
248 else if (aCommand == KCmdStackMachineInfo)
250 DoCmdMachineInfo(aSection);
252 else if (aCommand == KCmdStackMaxCardsInStack)
254 DoCmdMaxCardsInStack(aSection);
256 else if (aCommand == KCmdStackReadPasswordStore)
258 DoCmdPasswordStore(aSection);
260 else if (aCommand == KCmdStackWritePasswordStore)
262 DoCmdWritePasswordStore(aSection);
264 else if (aCommand == KCmdStackProgramPeriodInMs)
266 DoCmdProgramPeriodInMilliSeconds(aSection);
268 else if (aCommand == KCmdStackStop)
272 else if (aCommand == KCmdStackReportPowerUp)
274 DoCmdReportPowerUp(aSection);
276 else if (aCommand == KCmdStackReportPowerDown)
278 DoCmdReportPowerDown(aSection);
280 else if (aCommand == KCmdStackCardP)
282 DoCmdCardP(aSection);
284 else if (aCommand == KCmdStackAlterEffectiveModes)
286 DoCmdAlterEffectiveModes(aSection);
290 ret = CT_MmcSDDriverData::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
297 * Process command that will result in call to DMMCStack::AdjustPartial kernel side
299 * @param aSection The section in the ini containing data for the command
303 * @leave System wide error
305 void CT_MMCSDStackDriverData::DoCmdAdjustPartialRead(const TDesC& aSection)
307 TPartialReadData prd;
311 if(! GetUintFromConfig(aSection, KPrdStart(), prd.iStart) )
313 ERR_PRINTF1(_L("Failed to get prdstart from ini file"));
314 SetBlockResult(EFail);
317 if(!GetUintFromConfig(aSection, KPrdEnd(), prd.iEnd))
319 ERR_PRINTF1(_L("Failed to get prdend from ini file"));
320 SetBlockResult(EFail);
323 INFO_PRINTF3(_L("Calling MMCStack::AdjustPartialRead(start=%d, end=%d)"), prd.iStart, prd.iEnd);
324 TInt err = iMmcSDController->StackAdjustPartialRead(prd);
328 ERR_PRINTF2(_L("MMCStack::AdjustPartialRead() Error %d"), err);
333 INFO_PRINTF3(_L("MMCStack::AdjustPartialRead() = %d, %d"), prd.iPhysStart, prd.iPhysEnd);
336 if( !GetUintFromConfig(aSection, KPrdExpectedStart(), expectedStart) )
338 ERR_PRINTF1(_L("Failed to get KPrdExpectedStart from ini file"));
339 SetBlockResult(EFail);
342 else if(prd.iPhysStart != expectedStart )
344 ERR_PRINTF3(_L("phys start(%d) != expectedStart(%d)"), prd.iPhysStart, expectedStart);
345 SetBlockResult(EFail);
349 if( !GetUintFromConfig(aSection, KPrdExpectedEnd(), expectedEnd) )
351 ERR_PRINTF1(_L("Failed to get KPrdExpectedEnd from ini file"));
352 SetBlockResult(EFail);
354 else if(prd.iPhysEnd != expectedEnd )
356 ERR_PRINTF3(_L("MMCStack::AdjustPartialRead phys end(%d) != expected end(%d)"), prd.iPhysEnd, expectedEnd);
357 SetBlockResult(EFail);
363 * Process command that will result in call to DMMCStack::AllocSession kernel side
365 * @param aSection The section in the ini containing data for the command
369 * @leave System wide error
371 void CT_MMCSDStackDriverData::DoCmdAllocSession()
373 INFO_PRINTF1(_L("Calling MMCStack::AllocSession()"));
374 iMmcSDController->StackAllocSession();
378 * Process command that will result in call to DMMCStack::BufferInfo kernel side
380 * @param aSection The section in the ini containing data for the command
384 * @leave System wide error
386 void CT_MMCSDStackDriverData::DoCmdBufferInfo(const TDesC& aSection)
388 TBufferInfo bufferInfo;
389 INFO_PRINTF1(_L("Calling MMCStack::BufferInfo()"));
390 TInt err = iMmcSDController->StackBufferInfo(bufferInfo);
393 ERR_PRINTF2(_L("MMCStack::BufferInfo() Error %d"), err);
398 INFO_PRINTF4(_L("BufferInfo() iBuf(%x) iBufLen(%d) iMinorBufLen(%d)"),
399 bufferInfo.iBuf, bufferInfo.iBufLen, bufferInfo.iMinorBufLen);
401 // check the expected length
403 if( ! GetIntFromConfig(aSection, KExpectedBufLen(), expectedBufLen ))
405 ERR_PRINTF1(_L("Failed to get KExpectedBufLen from ini file"));
406 SetBlockResult(EFail);
409 else if(bufferInfo.iBufLen != expectedBufLen )
411 ERR_PRINTF3(_L("bufferInfo.iBufLen (%d) != expectedBufLen(%d)"),
412 bufferInfo.iBufLen , expectedBufLen);
413 SetBlockResult(EFail);
416 // check the expected minor length
417 TInt expectedMinorBufLen;
418 if( !GetIntFromConfig(aSection, KExpectedMinorBufLen(), expectedMinorBufLen ))
420 ERR_PRINTF1(_L("Failed to get KExpectedMinorBufLen from ini file"));
421 SetBlockResult(EFail);
423 else if(bufferInfo.iMinorBufLen != expectedMinorBufLen )
425 ERR_PRINTF3(_L("bufferInfo.iMinorBufLen (%d) != expectedMinorBufLen(%d)"),
426 bufferInfo.iMinorBufLen , expectedMinorBufLen);
427 SetBlockResult(EFail);
433 * Process command that will result in call to DMMCStack::GetBufferInfo kernel side
435 * @param aSection The section in the ini containing data for the command
439 * @leave System wide error
441 void CT_MMCSDStackDriverData::DoCmdGetBufferInfo(const TDesC& aSection)
443 TBufferInfo bufferInfo;
444 INFO_PRINTF1(_L("Calling MMCStack::GetBufferInfo()"));
445 TInt err = iMmcSDController->StackGetBufferInfo(bufferInfo);
448 ERR_PRINTF2(_L("MMCStack::GetBufferInfo() Error %d"), err);
453 INFO_PRINTF3(_L("GetBufferInfo() iBuf(%x) iBufLen(%d)"),
454 bufferInfo.iBuf, bufferInfo.iBufLen);
456 // check the expected length
458 if( !GetIntFromConfig(aSection, KExpectedBufLen(), expectedBufLen ))
460 ERR_PRINTF1(_L("Failed to get KExpectedBufLen from ini file"));
461 SetBlockResult(EFail);
463 else if(bufferInfo.iBufLen != expectedBufLen )
465 ERR_PRINTF3(_L("bufferInfo.iBufLen (%d) != expectedBufLen(%d)"),
466 bufferInfo.iBufLen , expectedBufLen);
467 SetBlockResult(EFail);
473 * Process command that will result in call to DMMCStack::DemandPagingInfo kernel side
475 * @param aSection The section in the ini containing data for the command
479 * @leave System wide error
481 void CT_MMCSDStackDriverData::DoCmdDemandPagingInfo(const TDesC& aSection)
483 TTCDemandPagingInfo info;
484 INFO_PRINTF1(_L("Calling MMCStack::DemandPagingInfo()"));
485 TInt err = iMmcSDController->StackDemandPagingInfo(info);
489 ERR_PRINTF2(_L("MMCStack::DemandPagingInfo() Error %d"), err);
494 INFO_PRINTF4(_L("info.iPagingDriveList(%x) info.iDriveCount(%d) info.iPagingType(%d)"),
495 info.iPagingDriveList, info.iDriveCount, info.iPagingType);
496 INFO_PRINTF4(_L("info.iReadShift(%d) info.iNumPages(%d) info.iWriteProtected(%d)"),
497 info.iReadShift, info.iNumPages, info.iWriteProtected);
499 // read expected values here
501 if(!GetIntFromConfig(aSection, KDriveCount(), driveCount))
503 ERR_PRINTF1(_L("Failed to read KDriveCount from ini file"));
504 SetBlockResult(EFail);
508 if(driveCount != info.iDriveCount)
510 ERR_PRINTF3(_L("drive counts do not match actual(%d), expected(%d)"), info.iDriveCount, driveCount);
511 SetBlockResult(EFail);
516 if(!GetUintFromConfig(aSection, KPagingType(), pagingType))
518 ERR_PRINTF1(_L("Failed to read pagingType from ini file"));
519 SetBlockResult(EFail);
523 if(pagingType != info.iPagingType)
525 ERR_PRINTF3(_L("pagingType do not match actual(%d), expected(%d)"), info.iPagingType, pagingType);
526 SetBlockResult(EFail);
532 if(!GetUintFromConfig(aSection, KNumPages(), numPages))
534 ERR_PRINTF1(_L("Failed to read num pages from ini file"));
535 SetBlockResult(EFail);
539 if(numPages != info.iNumPages)
541 ERR_PRINTF3(_L("numPages do not match actual(%d), expected(%d)"), info.iNumPages, numPages);
542 SetBlockResult(EFail);
546 TBool writeProtected;
547 if(!GetBoolFromConfig(aSection, KWriteProtected(), writeProtected))
549 ERR_PRINTF1(_L("Failed to read writeProtected from ini file"));
550 SetBlockResult(EFail);
554 if(writeProtected != info.iWriteProtected)
556 ERR_PRINTF3(_L("writeProtected do not match actual(%d), expected(%d)"), info.iWriteProtected, writeProtected);
557 SetBlockResult(EFail);
565 * Process command that will result in call to DMMCStack::EffectiveModes kernel side
567 * @param aSection The section in the ini containing data for the command
571 * @leave System wide error
573 void CT_MMCSDStackDriverData::DoCmdEffectiveModes(const TDesC& aSection)
575 INFO_PRINTF1(_L("Calling MMCStack::EffectiveModes()"));
578 TInt err = iMmcSDController->StackEffectiveModes(actualModes);
581 ERR_PRINTF2(_L("DMMCStack::EffectiveModes() Error (%d)"), err);
586 INFO_PRINTF3(_L("DMMCStack::EffectiveModes() modes(0x%x / %d)"), actualModes, actualModes);
589 if(GetHexFromConfig(aSection, KEffectiveModes(), expectedModes))
592 if(((TUint32)expectedModes) != actualModes)
594 ERR_PRINTF5(_L("actual (%d)(%x) and expected(%d)(%x) effectiveModes do not match"), actualModes, actualModes, expectedModes, expectedModes);
595 SetBlockResult(EFail);
600 ERR_PRINTF1(_L("DMMCStack::EffectiveModes() Could not read expectedModes from ini file"));
607 * Process command that will result in an update of Effective Modes variable on kernel side
608 * for a call to DMMCStack::EffectiveModes
610 * @param aSection The section in the ini containing data for the command
614 * @leave System wide error
616 void CT_MMCSDStackDriverData::DoCmdAlterEffectiveModes(const TDesC& aSection)
621 // read funtion ID from section
622 if (!GetEnumFromConfig(aSection, KEffectiveModesFunctionId(), iEnumEffectiveModesFunctionIdTable, funcId))
624 ERR_PRINTF1(_L("Failed to read Function ID DoCmdEffectiveModes"));
625 SetBlockResult(EFail);
627 // read data param from section - all params are 32 bit or less
628 else if (!GetUintFromConfig(aSection, KEffectiveModesData(), data))
630 ERR_PRINTF2(_L("Failed to read DATA DoCmdEffectiveModes funcId(%d)"), funcId);
631 SetBlockResult(EFail);
635 INFO_PRINTF3( _L("Calling DoCmdEffectiveModes funcid(%d) data(%u)"), funcId, data);
636 TInt err = iMmcSDController->StackAlterEffectiveModes((RMMCSDTestControllerInterface::TEffectiveModesFunctionId) funcId, (TAny*)data);
639 ERR_PRINTF3(_L("DoCmdEffectiveModes funcid(%d) Error(%d"), funcId, err);
646 * Process command that will result in call to DMMCStack::HasCardsPresent kernel side
648 * @param aSection The section in the ini containing data for the command
652 * @leave System wide error
654 void CT_MMCSDStackDriverData::DoCmdHasCardsPresent(const TDesC& aSection)
656 INFO_PRINTF1( _L("CT_MMCSDStackDriverData:::DoCmdHasCardsPresent called"));
658 TBool actualCardspresent;
659 TInt err = iMmcSDController->StackHasCardsPresent(actualCardspresent);
662 ERR_PRINTF2(_L("DMMCStack::DoCmdHasCardsPresent() Error (%d)"), err);
667 INFO_PRINTF2(_L("DMMCStack::DoCmdHasCardsPresent() actual cards present (%d)"), actualCardspresent);
669 TBool expectedCardsPresent;
670 if(!GetBoolFromConfig(aSection, KCardsPresent(), expectedCardsPresent))
672 ERR_PRINTF1(_L("Failed to get KCardsPresent from ini file"));
673 SetBlockResult(EFail);
675 else if(actualCardspresent != expectedCardsPresent)
677 ERR_PRINTF3(_L("actual (%d) and expected(%d) cards present do not match"), actualCardspresent, expectedCardsPresent);
678 SetBlockResult(EFail);
684 * Process command that will result in call to DMMCStack::HasSessionsQueued kernel side
686 * @param aSection The section in the ini containing data for the command
690 * @leave System wide error
692 void CT_MMCSDStackDriverData::DoCmdHasSessionsQueued(const TDesC& aSection)
694 INFO_PRINTF1( _L(" CT_MMCSDStackDriverData::DoCmdHasSessionsQueued called"));
696 TBool actualSessionsQueued;
697 TInt err = iMmcSDController->StackHasSessionsQueued(actualSessionsQueued);
701 ERR_PRINTF2(_L("DMMCStack::DoCmdHasSessionsQueued() Error (%d)"), err);
706 INFO_PRINTF2(_L("DMMCStack::DoCmdHasSessionsQueued() actual sessions queued (%d)"), actualSessionsQueued);
708 TBool expectedInProgress;
709 if(!GetBoolFromConfig(aSection, KSessionsQueued(), expectedInProgress))
711 ERR_PRINTF1(_L("Failed to get KSessionsQueued from ini file"));
712 SetBlockResult(EFail);
714 else if(actualSessionsQueued != expectedInProgress)
716 ERR_PRINTF3(_L("actual (%d) and expected(%d) sessions queued do not match"), actualSessionsQueued, expectedInProgress);
717 SetBlockResult(EFail);
722 * Process command that will result in call to DMMCStack::InitStackInProgress kernel side
724 * @param aSection The section in the ini containing data for the command
728 * @leave System wide error
730 void CT_MMCSDStackDriverData::DoCmdInitStackInProgress(const TDesC& aSection)
732 INFO_PRINTF1( _L(" CT_MMCSDStackDriverData::DoCmdInitStackInProgress called"));
734 TBool actualInProgress;
735 TInt err = iMmcSDController->StackInitStackInProgress(actualInProgress);
739 ERR_PRINTF2(_L("DMMCStack::InitStackInProgress() Error (%d)"), err);
744 INFO_PRINTF2(_L("DMMCStack::InitStackInProgress() actualInProgress(%d)"), actualInProgress);
746 TBool expectedInProgress;
747 if(!GetBoolFromConfig(aSection, KInProgress(), expectedInProgress))
749 ERR_PRINTF1(_L("Failed to get KInProgress from ini file"));
750 SetBlockResult(EFail);
752 else if(actualInProgress != expectedInProgress)
754 ERR_PRINTF3(_L("actual (%d) and expected(%d) in progress do not match"), actualInProgress, expectedInProgress);
755 SetBlockResult(EFail);
761 * Process command that will result in call to DMMCStack::MMCSocket kernel side
763 * @param aSection The section in the ini containing data for the command
767 * @leave System wide error
769 void CT_MMCSDStackDriverData::DoCmdMMCSocketL(const TDesC& aSection)
771 INFO_PRINTF1( _L(" CT_MMCSDStackDriverData::DoCmdMMCSocket called"));
772 // can't use DMMCSocket type on user side
773 TAny* socketPtr= NULL;
775 TInt err = iMmcSDController->StackMMCSocket(&socketPtr);
779 ERR_PRINTF2(_L("MMCStack::Socket() Error %d"), err);
784 INFO_PRINTF2(_L("MMCStack::Socket(): ptr=%x"), socketPtr);
785 TBool expectedIsNull = EFalse;
786 if(!GetBoolFromConfig(aSection, KIsNull(), expectedIsNull))
788 ERR_PRINTF1(_L("Failed to get isnull from ini file"));
789 SetBlockResult(EFail);
794 if (socketPtr != NULL)
796 ERR_PRINTF1(_L("Socket ptr is not NULL"));
797 SetBlockResult(EFail);
804 ERR_PRINTF1(_L("Socket ptr is NULL"));
805 SetBlockResult(EFail);
809 TPtrC socketWrapperName;
810 if( GetStringFromConfig(aSection, KSocketWrapperName(), socketWrapperName) )
812 TAny* expectedSocketPtr = GetDataObjectL(socketWrapperName);
813 INFO_PRINTF2(_L("expectedSocketPtr = %x"), expectedSocketPtr);
815 if( expectedSocketPtr == NULL )
817 ERR_PRINTF1(_L("MMCStack::Socket(): expectedSocketPtr is NULL"));
818 SetBlockResult(EFail);
820 else if( socketPtr != expectedSocketPtr )
822 ERR_PRINTF3(_L("socketPtr(%x) != expectedSocketPtr(%x)"), socketPtr, expectedSocketPtr);
823 SetBlockResult(EFail);
828 ERR_PRINTF1(_L("MMCStack::Socket(): Error in Socket Wrapper Name from INI file"));
829 SetBlockResult(EFail);
837 * Process command that will result in call to DMMCStack::MachineInfo kernel side
839 * @param aSection The section in the ini containing data for the command
843 * @leave System wide error
845 void CT_MMCSDStackDriverData::DoCmdMachineInfo(const TDesC& aSection)
847 INFO_PRINTF1( _L(" CT_MMCSDStackDriverData::DoCmdMachineInfo called XXX"));
849 TMachineInfo machineInfo;
850 TInt err = iMmcSDController->StackMachineInfo(machineInfo);
854 ERR_PRINTF2(_L("DMMCStack::MachineInfo() Error (%d)"), err);
859 INFO_PRINTF2(_L("DMMCStack::MachineInfo(): iTotalSockets=%d"), machineInfo.iTotalSockets);
860 INFO_PRINTF2(_L("DMMCStack::MachineInfo(): iTotalMediaChanges=%d"), machineInfo.iTotalMediaChanges);
861 INFO_PRINTF2(_L("DMMCStack::MachineInfo(): iTotalPrimarySupplies=%d"), machineInfo.iTotalPrimarySupplies);
862 INFO_PRINTF2(_L("DMMCStack::MachineInfo(): iSPIMode=%d"), machineInfo.iSPIMode);
863 INFO_PRINTF2(_L("DMMCStack::MachineInfo(): iBaseBusNumber=%d"), machineInfo.iBaseBusNumber);
865 if (machineInfo.iSupportsSPIMode)
867 INFO_PRINTF1(_L("DMMCStack::MachineInfo(): Has flag ESupportsSPIMode"));
869 if (machineInfo.iSupportsDoubleBuffering)
871 INFO_PRINTF1(_L("DMMCStack::MachineInfo(): Has flag ESupportsDoubleBuffering"));
873 if (machineInfo.iSupportsR7)
875 INFO_PRINTF1(_L("DMMCStack::MachineInfo(): Has flag ESupportsR7"));
877 if( machineInfo.iDma8BitAddressing )
879 INFO_PRINTF1(_L("DMMCStack::MachineInfo(): Has flag EDma8BitAddressing"));
881 if( machineInfo.iDma16BitAddressing )
883 INFO_PRINTF1(_L("DMMCStack::MachineInfo(): Has flag EDma16BitAddressing"));
885 if( machineInfo.iDma32BitAddressing )
887 INFO_PRINTF1(_L("DMMCStack::MachineInfo(): Has flag EDma32BitAddressing"));
889 if( machineInfo.iDma64BitAddressing )
891 INFO_PRINTF1(_L("DMMCStack::MachineInfo(): Has flag EDma64BitAddressing"));
893 if( machineInfo.iSupportsDMA )
895 INFO_PRINTF1(_L("DMMCStack::MachineInfo(): Has flag ESupportsDMA"));
897 if (machineInfo.iMaxTransferLength_256K)
899 INFO_PRINTF1(_L("DMMCStack::MachineInfo(): Has flag EMaxTransferLength_256K"));
901 if (machineInfo.iMaxTransferLength_512K)
903 INFO_PRINTF1(_L("DMMCStack::MachineInfo(): Has flag EMaxTransferLength_512K"));
905 if (machineInfo.iMaxTransferLength_1M)
907 INFO_PRINTF1(_L("DMMCStack::MachineInfo(): Has flag EMaxTransferLength_1M"));
909 if (machineInfo.iMaxTransferLength_2M)
911 INFO_PRINTF1(_L("DMMCStack::MachineInfo(): Has flag EMaxTransferLength_2M"));
913 if (machineInfo.iMaxTransferLength_4M)
915 INFO_PRINTF1(_L("DMMCStack::MachineInfo(): Has flag EMaxTransferLength_4M"));
917 if (machineInfo.iMaxTransferLength_8M)
919 INFO_PRINTF1(_L("DMMCStack::MachineInfo(): Has flag EMaxTransferLength_8M"));
921 if (machineInfo.iMaxTransferLength_16M)
923 INFO_PRINTF1(_L("DMMCStack::MachineInfo(): Has flag EMaxTransferLength_16M"));
929 if( !GetIntFromConfig(aSection, KExpectedTotalSockets(), expectedInt))
931 ERR_PRINTF1(_L("Failed to get KExpectedTotalSockets from ini file"));
932 SetBlockResult(EFail);
934 else if(machineInfo.iTotalSockets != expectedInt )
936 ERR_PRINTF3(_L("totalSockets(%d) != expectedTotalSockets(%d)"), machineInfo.iTotalSockets, expectedInt);
937 SetBlockResult(EFail);
940 if( !GetIntFromConfig(aSection, KExpectedTotalMediaChanges(), expectedInt))
942 ERR_PRINTF1(_L("Failed to get expected total media changes from ini file"));
943 SetBlockResult(EFail);
945 else if(machineInfo.iTotalMediaChanges != expectedInt )
947 ERR_PRINTF3(_L("totalMediaChanges(%d) != expectedTotalMediaChanges(%d)"), machineInfo.iTotalMediaChanges, expectedInt);
948 SetBlockResult(EFail);
951 if( !GetIntFromConfig(aSection, KExpectedTotalPrimarySupplies(), expectedInt))
953 ERR_PRINTF1(_L("Failed to get KExpectedTotalPrimarySupplies from ini file"));
954 SetBlockResult(EFail);
956 else if(machineInfo.iTotalPrimarySupplies != expectedInt )
958 ERR_PRINTF3(_L("totalPrimarySupplies(%d) != expectedTotalPrimarySupplies(%d)"), machineInfo.iTotalPrimarySupplies, expectedInt);
959 SetBlockResult(EFail);
962 if( !GetBoolFromConfig(aSection, KExpectedSPIMode(), expectedBool))
964 ERR_PRINTF1(_L("Failed to get KExpectedSPIMode from ini file"));
965 SetBlockResult(EFail);
967 else if(machineInfo.iSPIMode != expectedBool )
969 ERR_PRINTF3(_L("SPIMode(%d) != expectedSPIMode(%d)"), machineInfo.iSPIMode, expectedBool);
970 SetBlockResult(EFail);
973 if( !GetIntFromConfig(aSection, KExpectedBaseBusNumber(), expectedInt))
975 ERR_PRINTF1(_L("Failed to get KExpectedBaseBusNumber from ini file"));
976 SetBlockResult(EFail);
978 else if(machineInfo.iBaseBusNumber != expectedInt )
980 ERR_PRINTF3(_L("baseBusNumber(%d) != expectedBaseBusNumber(%d)"), machineInfo.iBaseBusNumber, expectedInt);
981 SetBlockResult(EFail);
984 if( !GetBoolFromConfig(aSection, KHasFlagSupportsSPIMode(), expectedBool))
986 ERR_PRINTF1(_L("Failed to get KHasFlagSupportsSPIMode from ini file"));
987 SetBlockResult(EFail);
989 else if(machineInfo.iSupportsSPIMode != expectedBool )
991 ERR_PRINTF3(_L("supportsSPIMode(%d) != expectedSupportsSPIMode(%d)"), machineInfo.iSupportsSPIMode, expectedBool);
992 SetBlockResult(EFail);
995 if(!GetBoolFromConfig(aSection, KHasFlagSupportsDoubleBuffering(), expectedBool))
997 ERR_PRINTF1(_L("Failed to get KHasFlagSupportsDoubleBuffering from ini file"));
998 SetBlockResult(EFail);
1000 else if(machineInfo.iSupportsDoubleBuffering != expectedBool )
1002 ERR_PRINTF3(_L("supportsDoubleBuffering(%d) != expectedSupportsDoubleBuffering(%d)"), machineInfo.iSupportsDoubleBuffering, expectedBool);
1003 SetBlockResult(EFail);
1006 if( !GetBoolFromConfig(aSection, KHasFlagSupportsR7(), expectedBool))
1008 ERR_PRINTF1(_L("Failed to get KHasFlagSupportsR7 from ini file"));
1009 SetBlockResult(EFail);
1012 else if(machineInfo.iSupportsR7 != expectedBool )
1014 ERR_PRINTF3(_L("supportsR7(%d) != expectedSupportsR7(%d)"), machineInfo.iSupportsR7, expectedBool);
1015 SetBlockResult(EFail);
1018 if( !GetBoolFromConfig(aSection, KHasFlagDma8BitAddressing(), expectedBool))
1020 ERR_PRINTF1(_L("Failed to get KHasFlagDma8BitAddressing from ini file"));
1021 SetBlockResult(EFail);
1023 else if(machineInfo.iDma8BitAddressing != expectedBool )
1025 ERR_PRINTF3(_L("Dma8BitAddressing(%d) != expectedDma8BitAddressing(%d)"), machineInfo.iDma8BitAddressing, expectedBool);
1026 SetBlockResult(EFail);
1029 if( !GetBoolFromConfig(aSection, KHasFlagDma16BitAddressing(), expectedBool))
1031 ERR_PRINTF1(_L("Failed to get KHasFlagDma16BitAddressing from ini file"));
1032 SetBlockResult(EFail);
1034 else if(machineInfo.iDma16BitAddressing != expectedBool )
1036 ERR_PRINTF3(_L("Dma16BitAddressing(%d) != expectedDma16BitAddressing(%d)"), machineInfo.iDma16BitAddressing, expectedBool);
1037 SetBlockResult(EFail);
1040 if( !GetBoolFromConfig(aSection, KHasFlagDma32BitAddressing(), expectedBool))
1042 ERR_PRINTF1(_L("Failed to get KHasFlagDma32BitAddressing from ini file"));
1043 SetBlockResult(EFail);
1045 else if(machineInfo.iDma32BitAddressing != expectedBool )
1047 ERR_PRINTF3(_L("Dma32BitAddressing(%d) != expectedDma32BitAddressing(%d)"), machineInfo.iDma32BitAddressing, expectedBool);
1048 SetBlockResult(EFail);
1051 if( !GetBoolFromConfig(aSection, KHasFlagDma64BitAddressing(), expectedBool))
1053 ERR_PRINTF1(_L("Failed to get KHasFlagDma64BitAddressing from ini file"));
1054 SetBlockResult(EFail);
1056 else if(machineInfo.iDma64BitAddressing != expectedBool )
1058 ERR_PRINTF3(_L("Dma64BitAddressing(%d) != expectedDma64BitAddressing(%d)"), machineInfo.iDma64BitAddressing, expectedBool);
1059 SetBlockResult(EFail);
1062 if( !GetBoolFromConfig(aSection, KHasFlagSupportsDMA(), expectedBool))
1064 ERR_PRINTF1(_L("Failed to get KHasFlagSupportsDMA from ini file"));
1065 SetBlockResult(EFail);
1067 else if(machineInfo.iSupportsDMA != expectedBool )
1069 ERR_PRINTF3(_L("SupportsDMA(%d) != expectedSupportsDMA(%d)"), machineInfo.iSupportsDMA, expectedBool);
1070 SetBlockResult(EFail);
1073 if( !GetBoolFromConfig(aSection, KHasFlagMaxTransferLength_256K(), expectedBool))
1075 ERR_PRINTF1(_L("Failed to get KHasFlagMaxTransferLength_256K( from ini file"));
1076 SetBlockResult(EFail);
1078 else if(machineInfo.iMaxTransferLength_256K != expectedBool )
1080 ERR_PRINTF3(_L("maxTransferLength_256K(%d) != expectedMaxTransferLength_256K(%d)"), machineInfo.iMaxTransferLength_256K, expectedBool);
1081 SetBlockResult(EFail);
1084 if( !GetBoolFromConfig(aSection, KHasFlagMaxTransferLength_512K(), expectedBool))
1086 ERR_PRINTF1(_L("Failed to get KHasFlagMaxTransferLength_512K from ini file"));
1087 SetBlockResult(EFail);
1090 else if(machineInfo.iMaxTransferLength_512K != expectedBool )
1092 ERR_PRINTF3(_L("maxTransferLength_512K(%d) != expectedMaxTransferLength_512K(%d)"), machineInfo.iMaxTransferLength_512K, expectedBool);
1093 SetBlockResult(EFail);
1096 if( !GetBoolFromConfig(aSection, KHasFlagMaxTransferLength_1M(), expectedBool))
1098 ERR_PRINTF1(_L("Failed to get KHasFlagMaxTransferLength_1M from ini file"));
1099 SetBlockResult(EFail);
1102 else if(machineInfo.iMaxTransferLength_1M != expectedBool )
1104 ERR_PRINTF3(_L("maxTransferLength_1M(%d) != expectedMaxTransferLength_1M(%d)"), machineInfo.iMaxTransferLength_1M, expectedBool);
1105 SetBlockResult(EFail);
1108 if( !GetBoolFromConfig(aSection, KHasFlagMaxTransferLength_2M(), expectedBool))
1110 ERR_PRINTF1(_L("Failed to get KHasFlagMaxTransferLength_2M from ini file"));
1111 SetBlockResult(EFail);
1114 else if(machineInfo.iMaxTransferLength_2M != expectedBool )
1116 ERR_PRINTF3(_L("maxTransferLength_2M(%d) != expectedMaxTransferLength_2M(%d)"), machineInfo.iMaxTransferLength_2M, expectedBool);
1117 SetBlockResult(EFail);
1120 if( !GetBoolFromConfig(aSection, KHasFlagMaxTransferLength_4M(), expectedBool))
1122 ERR_PRINTF1(_L("Failed to get KHasFlagMaxTransferLength_4M from ini file"));
1123 SetBlockResult(EFail);
1125 else if(machineInfo.iMaxTransferLength_4M != expectedBool )
1127 ERR_PRINTF3(_L("maxTransferLength_4M(%d) != expectedMaxTransferLength_4M(%d)"), machineInfo.iMaxTransferLength_4M, expectedBool);
1128 SetBlockResult(EFail);
1131 if( !GetBoolFromConfig(aSection, KHasFlagMaxTransferLength_8M(), expectedBool))
1133 ERR_PRINTF1(_L("Failed to get KHasFlagMaxTransferLength_8M from ini file"));
1134 SetBlockResult(EFail);
1136 else if(machineInfo.iMaxTransferLength_8M != expectedBool )
1138 ERR_PRINTF3(_L("maxTransferLength_8M(%d) != expectedMaxTransferLength_8M(%d)"), machineInfo.iMaxTransferLength_8M, expectedBool);
1139 SetBlockResult(EFail);
1142 if( !GetBoolFromConfig(aSection, KHasFlagMaxTransferLength_16M(), expectedBool))
1144 ERR_PRINTF1(_L("Failed to get KHasFlagMaxTransferLength_16M from ini file"));
1145 SetBlockResult(EFail);
1148 else if(machineInfo.iMaxTransferLength_16M != expectedBool )
1150 ERR_PRINTF3(_L("maxTransferLength_16M(%d) != expectedMaxTransferLength_16M(%d)"), machineInfo.iMaxTransferLength_16M, expectedBool);
1151 SetBlockResult(EFail);
1157 * Process command that will result in call to DMMCStack::MaxCardsInStack kernel side
1159 * @param aSection The section in the ini containing data for the command
1163 * @leave System wide error
1166 void CT_MMCSDStackDriverData::DoCmdMaxCardsInStack(const TDesC& aSection)
1168 INFO_PRINTF1( _L(" CT_MMCSDStackDriverData::DoCmdMaxCardsInStack called"));
1170 TUint actualMaxCardsInStack;
1171 iMmcSDController->StackMaxCardsInStack(actualMaxCardsInStack);
1173 TUint expectedMaxCardsInStack;
1174 if(!GetUintFromConfig(aSection, KExpectedMaxCardsInStack(), expectedMaxCardsInStack))
1176 ERR_PRINTF1(_L("Failed to get KExpectedMaxCardsInStack from ini file"));
1177 SetBlockResult(EFail);
1180 else if(actualMaxCardsInStack != expectedMaxCardsInStack)
1182 ERR_PRINTF3(_L("MaxCardsInStack actualMaxCardsInStack (%d) != expectedMaxCardsInStack(%d)")
1183 ,actualMaxCardsInStack, expectedMaxCardsInStack);
1184 SetBlockResult(EFail);
1189 * Process command that will result in call to DMMCStack::PasswordStore kernel side
1190 * and retrieve the password in the store
1192 * @param aSection The section in the ini containing data for the command
1196 * @leave System wide error
1198 void CT_MMCSDStackDriverData::DoCmdPasswordStore(const TDesC& aSection)
1200 INFO_PRINTF1( _L(" CT_MMCSDStackDriverData::DoCmdPasswordStore called"));
1202 TStackPasswordStoreData pwdStoreData;
1203 TInt err = iMmcSDController->StackReadPasswordStore(pwdStoreData);
1205 if (err != KErrNone)
1207 ERR_PRINTF2(_L("MMCStack::DoCmdPasswordStore() Error %d"), err);
1212 if (!pwdStoreData.iPwdStorePtr)
1214 ERR_PRINTF1(_L("MMCStack::DoCmdPasswordStore() retrieved a NULL pointer"));
1219 INFO_PRINTF2( _L("Password Store ptr (%x)"), pwdStoreData.iPwdStorePtr);
1221 TBuf<KMmcPwdLen> pwd;
1222 pwd.Copy(pwdStoreData.iPassword);
1223 INFO_PRINTF2( _L("PwdStore Password (%S)"), &pwd);
1226 if (GetStringFromConfig(aSection, KPassword(), tmp))
1228 INFO_PRINTF2( _L("Expected password (%S)"), &tmp);
1231 ERR_PRINTF1( _L("PASSWORD does not match"));
1232 SetBlockResult(EFail);
1237 ERR_PRINTF1( _L("failed to read password"));
1238 SetBlockResult(EFail);
1245 * Process command that will result in call to DMMCStack::PasswordStore kernel side
1246 * and update the password in the store
1248 * @param aSection The section in the ini containing data for the command
1252 * @leave System wide error
1254 void CT_MMCSDStackDriverData::DoCmdWritePasswordStore(const TDesC& aSection)
1257 INFO_PRINTF1( _L(" CT_MMCSDStackDriverData::DoCmdWritePasswordStore called"));
1259 // read the password to set from ini file
1261 if (GetStringFromConfig(aSection, KPassword(), tmp))
1263 INFO_PRINTF2( _L("Attempting to write password (%S) to password store"), &tmp);
1265 TStackPasswordStoreData pwdStoreData;
1266 pwdStoreData.iPassword.Copy(tmp);
1267 TInt err = iMmcSDController->StackWritePasswordStore(pwdStoreData);
1268 if (err == KErrNone)
1270 INFO_PRINTF1(_L("Wrote password ok"));
1274 ERR_PRINTF2( _L("StackWritePasswordStore failed err(%d)"), err);
1280 ERR_PRINTF1( _L("Failed to read PASSWORD to write from ini file"));
1281 SetBlockResult(EFail);
1286 * Process command that will result in call to DMMCStack::ProgramPeriodMs kernel side
1288 * @param aSection The section in the ini containing data for the command
1292 * @leave System wide error
1294 void CT_MMCSDStackDriverData::DoCmdProgramPeriodInMilliSeconds(const TDesC& aSection)
1297 INFO_PRINTF1(_L("Calling MMCStack::ProgramPeriodInMilliSeconds()"));
1298 TInt err = iMmcSDController->StackProgramPeriodInMilliSeconds(actualPeriod);
1300 if (err != KErrNone)
1302 ERR_PRINTF2(_L("DMMCStack::ProgramPeriodInMilliSeconds() Error %d"), err);
1307 INFO_PRINTF2(_L("DMMCStack::ProgramPeriodInMilliSeconds() actualPeriod(%d)"), actualPeriod);
1309 TInt expectedPeriod;
1310 if (GetIntFromConfig(aSection, KProgramPeriodMs(), expectedPeriod)
1311 && actualPeriod != expectedPeriod)
1313 ERR_PRINTF3(_L("actual (%d) and expected(%d) periods do not match"), actualPeriod, expectedPeriod);
1314 SetBlockResult(EFail);
1320 * Process command that will result in call to DMMCStack::Stop kernel side
1322 * @param aSection The section in the ini containing data for the command
1326 * @leave System wide error
1328 void CT_MMCSDStackDriverData::DoCmdStop(const TDesC& /*aSection*/)
1330 INFO_PRINTF1(_L("Calling MMCStack::Stop()"));
1331 TInt err = iMmcSDController->StackStop();
1332 if (err != KErrNone)
1334 ERR_PRINTF2(_L("MMCStack::Stop() Error %d"), err);
1340 * Process command that will result in call to DMMCStack::Init kernel side
1344 * @leave System wide error
1346 void CT_MMCSDStackDriverData::DoCmdInit()
1348 INFO_PRINTF1(_L("Calling MMCStack::Init()"));
1349 TInt err = iMmcSDController->StackInit();
1353 ERR_PRINTF2(_L("MMCStack::Init() Error %d"), err);
1359 * Process command that will result in call to DMMCStack::ReportPowerUp kernel side
1361 * @param aSection The section in the ini containing data for the command
1365 * @leave System wide error
1367 void CT_MMCSDStackDriverData::DoCmdReportPowerUp(const TDesC& /*aSection*/)
1369 INFO_PRINTF1(_L("Calling MMCStack::ReportPowerUp()"));
1370 TInt err = iMmcSDController->StackReportPowerUp();
1371 if (err != KErrNone)
1373 ERR_PRINTF2(_L("MMCStack::ReportPowerUp() Error %d"), err);
1379 * Process command that will result in call to DMMCStack::ReportPowerDown kernel side
1381 * @param aSection The section in the ini containing data for the command
1385 * @leave System wide error
1387 void CT_MMCSDStackDriverData::DoCmdReportPowerDown(const TDesC& /*aSection*/)
1389 INFO_PRINTF1(_L("Calling MMCStack::ReportPowerDown()"));
1390 TInt err = iMmcSDController->StackReportPowerDown();
1391 if (err != KErrNone)
1393 ERR_PRINTF2(_L("MMCStack::ReportPowerDown() Error %d"), err);
1399 * Process command that will result in call to DMMCStack::CardP kernel side
1401 * @param aSection The section in the ini containing data for the command
1405 * @leave System wide error
1407 void CT_MMCSDStackDriverData::DoCmdCardP(const TDesC& aSection)
1410 if( GetIntFromConfig(aSection, KCardNumber(), cardPtr.iCardNumber) )
1412 INFO_PRINTF2(_L("Calling MMCStack::CardP(%d)"), cardPtr.iCardNumber);
1413 TInt err = iMmcSDController->StackCardP(cardPtr);
1417 ERR_PRINTF2(_L("MMCStack::CardP() Error %d"), err);
1422 INFO_PRINTF2(_L("MMCStack::CardP(): ptr=%x"), cardPtr.iCardPtr);
1423 TBool expectedIsNull;
1424 if( GetBoolFromConfig(aSection, KIsNull(), expectedIsNull) )
1426 if( expectedIsNull )
1428 if( cardPtr.iCardPtr != NULL )
1430 ERR_PRINTF1(_L("Card ptr is not NULL"));
1431 SetBlockResult(EFail);
1436 if( cardPtr.iCardPtr == NULL )
1438 ERR_PRINTF1(_L("Card ptr is NULL"));
1439 SetBlockResult(EFail);
1445 ERR_PRINTF1(_L("Expected Is Null not given in ini file"));
1446 SetBlockResult(EFail);
1452 ERR_PRINTF1(_L("Card Number not given in ini file"));
1453 SetBlockResult(EFail);