void MCPHookClose() { if (mcp_hook_fd < 0) return; //close down wupserver, return control to mcp IOSUHAX_Close(); //wait for mcp to return retro_sleep(1000); IOS_Close(mcp_hook_fd); mcp_hook_fd = -1; }
static void fsdev_exit(void) { if (iosuhaxMount) { fatUnmount("sd:"); fatUnmount("usb:"); if (mcp_hook_fd >= 0) MCPHookClose(); else IOSUHAX_Close(); } else unmount_sd_fat("sd"); }
void DeInit_SD_USB() { DEBUG_FUNCTION_LINE("Called this function.\n"); if(gSDInitDone & WUPS_SDUSB_MOUNTED_FAKE) { DEBUG_FUNCTION_LINE("Unmounting fake\n"); unmount_fake(); gSDInitDone &= ~WUPS_SDUSB_MOUNTED_FAKE; } if(gSDInitDone & WUPS_SDUSB_MOUNTED_OS_SD) { DEBUG_FUNCTION_LINE("Unmounting OS SD\n"); unmount_sd_fat("sd"); gSDInitDone &= ~WUPS_SDUSB_MOUNTED_OS_SD; } if(gSDInitDone & WUPS_SD_MOUNTED_LIBFAT) { DEBUG_FUNCTION_LINE("Unmounting LIBFAT SD\n"); unmount_libfat("sd"); gSDInitDone &= ~WUPS_SD_MOUNTED_LIBFAT; } if(gSDInitDone & WUPS_USB_MOUNTED_LIBFAT) { DEBUG_FUNCTION_LINE("Unmounting LIBFAT USB\n"); unmount_libfat("usb"); gSDInitDone &= ~WUPS_USB_MOUNTED_LIBFAT; } if(gSDInitDone & WUPS_USB_MOUNTED_LIBNTFS) { DEBUG_FUNCTION_LINE("Unmounting LIBNTFS USB\n"); unmountAllNTFS(); gSDInitDone &= ~WUPS_USB_MOUNTED_LIBNTFS; } if(gSDInitDone & WUPS_SDUSB_LIBIOSU_LOADED) { DEBUG_FUNCTION_LINE("Calling IOSUHAX_Close\n"); IOSUHAX_Close(); gSDInitDone &= ~WUPS_SDUSB_LIBIOSU_LOADED; } deleteDevTabsNames(); if(gSDInitDone != WUPS_SDUSB_MOUNTED_NONE) { DEBUG_FUNCTION_LINE("WARNING. Some devices are still mounted.\n"); } DEBUG_FUNCTION_LINE("Function end.\n"); }