kernel/eka/drivers/medmmc/medmmc.cpp
branchRCL_3
changeset 43 c1f20ce4abcf
parent 42 a179b74831c9
child 44 3e88ff8f41d5
equal deleted inserted replaced
42:a179b74831c9 43:c1f20ce4abcf
  1130 	if ((r = CheckDevice(EMReqTypeNormalWr)) == KErrNone)
  1130 	if ((r = CheckDevice(EMReqTypeNormalWr)) == KErrNone)
  1131 		{
  1131 		{
  1132 		iPhysStart = aStart & ~iBlkMsk;
  1132 		iPhysStart = aStart & ~iBlkMsk;
  1133 
  1133 
  1134 		// formats are always block-aligned, and the buffer is initialized to 0xff
  1134 		// formats are always block-aligned, and the buffer is initialized to 0xff
  1135 		//  Check whether erase commands are supported by this card
  1135 		//  Check whether erase commands are supported by this card		
  1136 		if (iCard->CSD().CCC() & KMMCCmdClassErase)
  1136 		if ( (iCard->CSD().CCC() & KMMCCmdClassErase) && iEraseInfo.iEraseFlags) 		       
  1137 			{
  1137 			{
  1138 			// Determine the erase end point for the next command. We don't erase past the preferred erase unit
  1138 			// Determine the erase end point for the next command. We don't erase past the preferred erase unit
  1139 			// size. Therefore, check which is lower, the preferred erase unit size or the end of the requested range.
  1139 			// size. Therefore, check which is lower, the preferred erase unit size or the end of the requested range.
  1140 			TInt64 prefEraseUnitEnd = (iPhysStart + iEraseInfo.iPreferredEraseUnitSize) & ~iEraseUnitMsk;
  1140 			TInt64 prefEraseUnitEnd = (iPhysStart + iEraseInfo.iPreferredEraseUnitSize) & ~iEraseUnitMsk;
  1141 			iPhysEnd = UMin(prefEraseUnitEnd, aStart + aLength);
  1141 			iPhysEnd = UMin(prefEraseUnitEnd, aStart + aLength);
  2723 	OstTraceExt3(TRACE_FLOW, DMMCMEDIADRIVERFLASH_ENGAGEANDSETREQUEST_ENTRY, "DMmcMediaDriverFlash::EngageAndSetRequest;aRequest=%d;aCurrent=%d;this=%x", (TInt) aRequest, aCurrent, (TUint) this);
  2723 	OstTraceExt3(TRACE_FLOW, DMMCMEDIADRIVERFLASH_ENGAGEANDSETREQUEST_ENTRY, "DMmcMediaDriverFlash::EngageAndSetRequest;aRequest=%d;aCurrent=%d;this=%x", (TInt) aRequest, aCurrent, (TUint) this);
  2724 	__ASSERT_DEBUG(iSession != NULL, Panic(ECFSessPtrNull));
  2724 	__ASSERT_DEBUG(iSession != NULL, Panic(ECFSessPtrNull));
  2725 
  2725 
  2726 	iMedReq = aRequest;
  2726 	iMedReq = aRequest;
  2727 	SetCurrentConsumption(aCurrent);
  2727 	SetCurrentConsumption(aCurrent);
       
  2728 
       
  2729 	// Reset the card pointer just in case the stack has changed it.
       
  2730 	iSession->SetCard(iCard);
  2728 
  2731 
  2729 	TInt r = InCritical();
  2732 	TInt r = InCritical();
  2730 	if (r == KErrNone)
  2733 	if (r == KErrNone)
  2731 		{
  2734 		{
  2732 		r = iSession->Engage();
  2735 		r = iSession->Engage();