Lines Matching refs:slot
52 s32 slot; member
190 static s32 DoMount(s32 slot, void* workArea) in DoMount() argument
203 result = CARDMount(slot, workArea, 0); in DoMount()
208 resultSectorSize = CARDGetSectorSize(slot, &CardControl.sectorSize); in DoMount()
213 result = CARDCheck(slot); in DoMount()
216 resultSectorSize = CARDGetSectorSize(slot, &CardControl.sectorSize); in DoMount()
230 result = CARDFreeBlocks(slot, &CardControl.byteNotUsed, &CardControl.filesNotUsed); in DoMount()
240 static s32 DoUnmount(s32 slot) in DoUnmount() argument
246 return CARDUnmount(slot); in DoUnmount()
254 static s32 DoFormat(s32 slot) in DoFormat() argument
264 result = CARDFormat(slot); in DoFormat()
269 result = CARDFreeBlocks(slot, &CardControl.byteNotUsed, &CardControl.filesNotUsed); in DoFormat()
279 static s32 DoErase(s32 slot, s32 fileNo) in DoErase() argument
285 result = CARDFastDelete(slot, fileNo); in DoErase()
312 return CARDFreeBlocks(slot, &CardControl.byteNotUsed, &CardControl.filesNotUsed); in DoErase()
340 static s32 DoList(s32 slot, CardUtilDirent* directory) in DoList() argument
373 if (CARDGetStatus(slot, fileNo, &ent->stat) < 0 || in DoList()
392 CARDRename(slot, tempName, fileName) == CARD_RESULT_READY) in DoList()
398 (result = CARDFastDelete(slot, fileNo)) < 0 || in DoList()
400 … (result = CARDFreeBlocks(slot, &CardControl.byteNotUsed, &CardControl.filesNotUsed)) < 0) in DoList()
412 result = CARDFastOpen(slot, fileNo, &fileInfo); in DoList()
437 result = CARDFastOpen(slot, fileNo, &fileInfo); in DoList()
513 static s32 DoOpen(s32 slot, s32 fileNo, void* buffer) in DoOpen() argument
519 result = CARDGetStatus(slot, fileNo, &stat); in DoOpen()
525 result = CARDFastOpen(slot, fileNo, &fileInfo); in DoOpen()
549 static s32 DoSave(s32 slot, CARDStat* stat, void* buffer) in DoSave() argument
578 result = CARDOpen(slot, fileName, &fileInfo); in DoSave()
593 result = CARDCreate(slot, tempName, stat->length, &fileInfo); in DoSave()
607 if (result < 0 || (result = CARDSetStatus(slot, fileNo, stat)) < 0) in DoSave()
616 result = CARDFastDelete(slot, oldNo); in DoSave()
629 result = CARDRename(slot, tempName, fileName); in DoSave()
638 return CARDFreeBlocks(slot, &CardControl.byteNotUsed, &CardControl.filesNotUsed); in DoSave()
725 return CARDFreeBlocks(slot, &CardControl.byteNotUsed, &CardControl.filesNotUsed); in DoSave()
736 static s32 CardUtilCommand(s32 slot, s32 command, s32 fileNo, void* param) in CardUtilCommand() argument
743 ASSERT(CardControl.slot == -1); in CardUtilCommand()
745 if (CardControl.slot != -1) in CardUtilCommand()
754 CardControl.slot = slot; in CardUtilCommand()
761 CardControl.xferred = CARDGetXferredBytes(slot); in CardUtilCommand()
795 s32 CardUtilMount(s32 slot, void* workArea) in CardUtilMount() argument
797 return CardUtilCommand(slot, CARDUTIL_CMD_MOUNT, 0, workArea); in CardUtilMount()
810 s32 CardUtilUnmount(s32 slot) in CardUtilUnmount() argument
812 return CardUtilCommand(slot, CARDUTIL_CMD_UNMOUNT, 0, 0); in CardUtilUnmount()
826 s32 CardUtilList(s32 slot, CardUtilDirent* directory) in CardUtilList() argument
828 return CardUtilCommand(slot, CARDUTIL_CMD_LIST, 0, directory); in CardUtilList()
841 s32 CardUtilFormat(s32 slot) in CardUtilFormat() argument
843 return CardUtilCommand(slot, CARDUTIL_CMD_FORMAT, 0, 0); in CardUtilFormat()
856 s32 CardUtilErase(s32 slot, s32 fileNo) in CardUtilErase() argument
858 return CardUtilCommand(slot, CARDUTIL_CMD_ERASE, fileNo, 0); in CardUtilErase()
873 s32 CardUtilOpen(s32 slot, s32 fileNo, void* buffer) in CardUtilOpen() argument
875 return CardUtilCommand(slot, CARDUTIL_CMD_OPEN, fileNo, buffer); in CardUtilOpen()
894 s32 CardUtilSave(s32 slot, CARDStat* stat, void* buffer) in CardUtilSave() argument
896 return CardUtilCommand(slot, CARDUTIL_CMD_SAVE, (s32) stat, buffer); in CardUtilSave()
908 s32 slot; in CardUtilMain() local
916 while (CardControl.slot == -1) in CardUtilMain()
922 slot = CardControl.slot; in CardUtilMain()
931 result = DoMount(slot, param); in CardUtilMain()
934 result = DoUnmount(slot); in CardUtilMain()
937 result = DoFormat(slot); in CardUtilMain()
940 result = DoList(slot, param); in CardUtilMain()
943 result = DoErase(slot, fileNo); in CardUtilMain()
946 result = DoOpen(slot, fileNo, param); in CardUtilMain()
949 result = DoSave(slot, (CARDStat*) fileNo, param); in CardUtilMain()
955 CardControl.slot = -1; in CardUtilMain()
1138 s32 CardUtilGetProgress(s32 slot) in CardUtilGetProgress() argument
1142 percent = CARDGetXferredBytes(slot) - CardControl.xferred; in CardUtilGetProgress()