// Queue\r
INITIALIZE_LIST_HEAD_VARIABLE (gSdMmcPciHcTemplate.Queue),\r
{ // Slot\r
- {0, UnknownSlot, 0, 0}, {0, UnknownSlot, 0, 0}, {0, UnknownSlot, 0, 0},\r
- {0, UnknownSlot, 0, 0}, {0, UnknownSlot, 0, 0}, {0, UnknownSlot, 0, 0}\r
+ {0, UnknownSlot, 0, 0, 0}, {0, UnknownSlot, 0, 0, 0}, {0, UnknownSlot, 0, 0, 0},\r
+ {0, UnknownSlot, 0, 0, 0}, {0, UnknownSlot, 0, 0, 0}, {0, UnknownSlot, 0, 0, 0}\r
},\r
{ // Capability\r
{0},\r
if ((Status == EFI_MEDIA_CHANGED) && !MediaPresent) {\r
DEBUG ((EFI_D_INFO, "SdMmcPciHcEnumerateDevice: device disconnected at slot %d of pci %p\n", Slot, Private->PciIo));\r
Private->Slot[Slot].MediaPresent = FALSE;\r
+ Private->Slot[Slot].Initialized = FALSE;\r
//\r
// Signal all async task events at the slot with EFI_NO_MEDIA status.\r
//\r
}\r
\r
Private->Slot[Slot].MediaPresent = TRUE;\r
+ Private->Slot[Slot].Initialized = TRUE;\r
RoutineNum = sizeof (mCardTypeDetectRoutineTable) / sizeof (CARD_TYPE_DETECT_ROUTINE);\r
for (Index = 0; Index < RoutineNum; Index++) {\r
Routine = &mCardTypeDetectRoutineTable[Index];\r
}\r
}\r
}\r
+ //\r
+ // This card doesn't get initialized correctly.\r
+ //\r
+ if (Index == RoutineNum) {\r
+ Private->Slot[Slot].Initialized = FALSE;\r
+ }\r
\r
//\r
// Notify the upper layer the connect state change through ReinstallProtocolInterface.\r
}\r
\r
Private->Slot[Slot].MediaPresent = TRUE;\r
+ Private->Slot[Slot].Initialized = TRUE;\r
RoutineNum = sizeof (mCardTypeDetectRoutineTable) / sizeof (CARD_TYPE_DETECT_ROUTINE);\r
for (Index = 0; Index < RoutineNum; Index++) {\r
Routine = &mCardTypeDetectRoutineTable[Index];\r
}\r
}\r
}\r
+ //\r
+ // This card doesn't get initialized correctly.\r
+ //\r
+ if (Index == RoutineNum) {\r
+ Private->Slot[Slot].Initialized = FALSE;\r
+ }\r
}\r
\r
//\r
return EFI_NO_MEDIA;\r
}\r
\r
+ if (!Private->Slot[Slot].Initialized) {\r
+ return EFI_DEVICE_ERROR;\r
+ }\r
+\r
Trb = SdMmcCreateTrb (Private, Slot, Packet, Event);\r
if (Trb == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- if (!Private->Slot[Slot].MediaPresent) {\r
- return EFI_NO_MEDIA;\r
- }\r
+ if (!Private->Slot[Slot].MediaPresent) {\r
+ return EFI_NO_MEDIA;\r
+ }\r
+\r
+ if (!Private->Slot[Slot].Initialized) {\r
+ return EFI_DEVICE_ERROR;\r
+ }\r
//\r
// Free all async I/O requests in the queue\r
//\r