kernel/eka/drivers/pbus/mmc/stack.cpp
changeset 152 657f875b013e
parent 139 95f71bcdcdb7
child 221 39b39e1a406e
child 244 a77889bee936
--- a/kernel/eka/drivers/pbus/mmc/stack.cpp	Thu May 27 14:17:14 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/stack.cpp	Fri Jun 11 15:02:23 2010 +0300
@@ -6408,6 +6408,9 @@
 			{
 			EStBegin=0,
 			EStNextIndex,
+			EStSendStatus,
+			EStGetStatus,
+			EStUnlock,
 			EStInitStackAfterUnlock,
 			EStIssuedLockUnlock,
 			EStDone,
@@ -6470,6 +6473,25 @@
 		//
 		// Upon completion, test the next card before performing further initialisation.
 		//
+		
+		SMF_STATE(EStSendStatus)
+		        
+		s.FillCommandDesc(ECmdSendStatus, 0);
+		                        
+		SMF_INVOKES(ExecCommandSMST,EStGetStatus)
+		                        
+		SMF_STATE(EStGetStatus)
+		                        
+		const TMMCStatus st = s.LastStatus();
+		if((st & KMMCStatCardIsLocked) == 0)
+			{
+		    SMF_RETURN(err)
+		    }
+		                        
+		SMF_STATE(EStUnlock)
+		                        
+		const TMapping *mp = NULL;
+		mp = iSocket->iPasswordStore->FindMappingInStore(iCardArray->CardP(iAutoUnlockIndex)->CID());
 
 		TMMCard &cd = *(iCardArray->CardP(iAutoUnlockIndex++));
 		OstTrace1( TRACE_INTERNALS, DMMCSTACK_CIMAUTOUNLOCKSM4, "Attempting to unlock card %d", cd.Number() );